From b6ff600bcae2d1e816d0e409c1638a15e207695b Mon Sep 17 00:00:00 2001 From: Steve Reinhardt Date: Wed, 4 Feb 2004 21:42:00 -0800 Subject: 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 --- sim/eventq.hh | 4 ++-- sim/serialize.cc | 4 ++-- sim/serialize.hh | 2 +- sim/sim_object.hh | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) (limited to 'sim') diff --git a/sim/eventq.hh b/sim/eventq.hh index 36cb402a8..31bf9d652 100644 --- a/sim/eventq.hh +++ b/sim/eventq.hh @@ -153,7 +153,7 @@ class Event : public Serializable, public FastAlloc ~Event() {} - virtual std::string name() const { + virtual const std::string name() const { return csprintf("Event_%x", (uintptr_t)this); } @@ -257,7 +257,7 @@ class EventQueue : public Serializable : objName(n), head(NULL) {} - virtual std::string name() const { return objName; } + virtual const std::string name() const { return objName; } // schedule the given event on this queue void schedule(Event *ev); diff --git a/sim/serialize.cc b/sim/serialize.cc index 180cc38a0..d836e7c20 100644 --- a/sim/serialize.cc +++ b/sim/serialize.cc @@ -186,7 +186,7 @@ INSTANTIATE_PARAM_TEMPLATES(string) class Globals : public Serializable { public: - string name() const; + const string name() const; void serialize(ostream& os); void unserialize(Checkpoint *cp); }; @@ -194,7 +194,7 @@ class Globals : public Serializable /// The one and only instance of the Globals class. Globals globals; -string +const string Globals::name() const { return "Globals"; diff --git a/sim/serialize.hh b/sim/serialize.hh index 9ab2fa833..43dbd2c85 100644 --- a/sim/serialize.hh +++ b/sim/serialize.hh @@ -111,7 +111,7 @@ class Serializable virtual ~Serializable() {} // manditory virtual function, so objects must provide names - virtual std::string name() const = 0; + virtual const std::string name() const = 0; virtual void serialize(std::ostream& os) {} virtual void unserialize(Checkpoint *cp, const std::string §ion) {} diff --git a/sim/sim_object.hh b/sim/sim_object.hh index 165931b2b..aaaafc04b 100644 --- a/sim/sim_object.hh +++ b/sim/sim_object.hh @@ -63,7 +63,7 @@ class SimObject : public Serializable virtual ~SimObject() {} - virtual std::string name() const { return objName; } + virtual const std::string name() const { return objName; } // initialization pass of all objects. Gets invoked by SimInit() virtual void init(); -- cgit v1.2.3