Add a startup function that will fast forward to the right clock edge
authorNathan Binkert <binkertn@umich.edu>
Sun, 10 Jun 2007 06:01:47 +0000 (23:01 -0700)
committerNathan Binkert <binkertn@umich.edu>
Sun, 10 Jun 2007 06:01:47 +0000 (23:01 -0700)
using a divide in order to not loop forever after resuming from a checkpoint

--HG--
extra : convert_revision : 4bbc70b1be4e5c4ed99d4f88418ab620d5ce475a

src/mem/bus.cc
src/mem/bus.hh

index 1f96115b8a3e2d2100df6b4447d4485bbd80452c..13e5450646dcab193b513b5f40a0cebce9fbee54 100644 (file)
@@ -605,6 +605,13 @@ Bus::drain(Event * de)
     }
 }
 
+void
+Bus::startup()
+{
+    if (tickNextIdle < curTick)
+        tickNextIdle = (curTick / clock) * clock + clock;
+}
+
 BEGIN_DECLARE_SIM_OBJECT_PARAMS(Bus)
 
     Param<int> bus_id;
index 5dd98c07edffffcd268517b55df226bc0fc29480..ee647e20a7af4224803df38381cfae8dc10cd3bc 100644 (file)
@@ -267,6 +267,7 @@ class Bus : public MemObject
     virtual void deletePortRefs(Port *p);
 
     virtual void init();
+    virtual void startup();
 
     unsigned int drain(Event *de);