summaryrefslogtreecommitdiff
path: root/cpu
diff options
context:
space:
mode:
authorSteve Reinhardt <stever@eecs.umich.edu>2004-02-04 21:42:00 -0800
committerSteve Reinhardt <stever@eecs.umich.edu>2004-02-04 21:42:00 -0800
commitb6ff600bcae2d1e816d0e409c1638a15e207695b (patch)
treed9884aae2a629f3d4298c1990036912fd0115f60 /cpu
parent3e5070a3f121d84846de16718575567725129db9 (diff)
downloadgem5-b6ff600bcae2d1e816d0e409c1638a15e207695b.tar.xz
Add support for "serializing" instructions that flush
execution pipeline (Alpha trapb & excb). Add support for write memory barriers (mostly impacts store buffer). Add StaticInst flag to indicate memory barriers, though this is not modeled in the pipeline yet. arch/alpha/isa_desc: Implement trapb, excb, mb, and wmb as insts with no execution effect (empty execute() function) but with flags that indicate their side effects. Also make sure every instruction that needs to go to the execute stage has a real opClass value, since we are now using No_OpClass to signal insts that can get dropped at dispatch. StaticInst::branchTarget() is now a const method. cpu/static_inst.hh: Add flags to indicate serializing insts (trapb, excb) and memory and write barriers. Also declare some StaticInst methods as const methods. dev/etherlink.hh: sim/eventq.hh: sim/serialize.cc: sim/serialize.hh: sim/sim_object.hh: Make name() return value const. --HG-- extra : convert_revision : 39520e71469fa20e0a7446b2e06b494eec17a02c
Diffstat (limited to 'cpu')
-rw-r--r--cpu/static_inst.hh24
1 files changed, 19 insertions, 5 deletions
diff --git a/cpu/static_inst.hh b/cpu/static_inst.hh
index f3fd6fa24..5f4bcae3d 100644
--- a/cpu/static_inst.hh
+++ b/cpu/static_inst.hh
@@ -78,6 +78,12 @@ class StaticInstBase : public RefCounted
/// - If IsControl is set, then exactly one of IsDirectControl or
/// IsIndirect Control will be set, and exactly one of
/// IsCondControl or IsUncondControl will be set.
+ /// - IsSerializing, IsMemBarrier, and IsWriteBarrier are
+ /// implemented as flags since in the current model there's no
+ /// other way for instructions to inject behavior into the
+ /// pipeline outside of fetch. Once we go to an exec-in-exec CPU
+ /// model we should be able to get rid of these flags and
+ /// implement this behavior via the execute() methods.
///
enum Flags {
IsNop, ///< Is a no-op (no effect at all).
@@ -99,7 +105,12 @@ class StaticInstBase : public RefCounted
IsCall, ///< Subroutine call.
IsReturn, ///< Subroutine return.
- IsThreadSync, ///< Thread synchronization operation.
+ IsThreadSync, ///< Thread synchronization operation.
+
+ IsSerializing, ///< Serializes pipeline: won't until all
+ /// older instructions have committed.
+ IsMemBarrier, ///< Is a memory barrier
+ IsWriteBarrier, ///< Is a write barrier
NumFlags
};
@@ -178,6 +189,9 @@ class StaticInstBase : public RefCounted
bool isUncondCtrl() const { return flags[IsUncondControl]; }
bool isThreadSync() const { return flags[IsThreadSync]; }
+ bool isSerializing() const { return flags[IsSerializing]; }
+ bool isMemBarrier() const { return flags[IsMemBarrier]; }
+ bool isWriteBarrier() const { return flags[IsWriteBarrier]; }
//@}
/// Operation class. Used to select appropriate function unit in issue.
@@ -216,11 +230,11 @@ class StaticInst : public StaticInstBase
/// Return logical index (architectural reg num) of i'th destination reg.
/// Only the entries from 0 through numDestRegs()-1 are valid.
- RegIndex destRegIdx(int i) { return _destRegIdx[i]; }
+ RegIndex destRegIdx(int i) const { return _destRegIdx[i]; }
/// Return logical index (architectural reg num) of i'th source reg.
/// Only the entries from 0 through numSrcRegs()-1 are valid.
- RegIndex srcRegIdx(int i) { return _srcRegIdx[i]; }
+ RegIndex srcRegIdx(int i) const { return _srcRegIdx[i]; }
/// Pointer to a statically allocated "null" instruction object.
/// Used to give eaCompInst() and memAccInst() something to return
@@ -305,7 +319,7 @@ class StaticInst : public StaticInstBase
* Invalid if not a PC-relative branch (i.e. isDirectCtrl()
* should be true).
*/
- virtual Addr branchTarget(Addr branchPC)
+ virtual Addr branchTarget(Addr branchPC) const
{
panic("StaticInst::branchTarget() called on instruction "
"that is not a PC-relative branch.");
@@ -318,7 +332,7 @@ class StaticInst : public StaticInstBase
* execute the branch in question. Invalid if not an indirect
* branch (i.e. isIndirectCtrl() should be true).
*/
- virtual Addr branchTarget(ExecContext *xc)
+ virtual Addr branchTarget(ExecContext *xc) const
{
panic("StaticInst::branchTarget() called on instruction "
"that is not an indirect branch.");