Add a startup function that will fast forward to the right clock edge
using a divide in order to not loop forever after resuming from a checkpoint --HG-- extra : convert_revision : 4bbc70b1be4e5c4ed99d4f88418ab620d5ce475a
This commit is contained in:
parent
11f1c8dd3e
commit
fc4ab050b4
|
@ -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)
|
BEGIN_DECLARE_SIM_OBJECT_PARAMS(Bus)
|
||||||
|
|
||||||
Param<int> bus_id;
|
Param<int> bus_id;
|
||||||
|
|
|
@ -267,6 +267,7 @@ class Bus : public MemObject
|
||||||
virtual void deletePortRefs(Port *p);
|
virtual void deletePortRefs(Port *p);
|
||||||
|
|
||||||
virtual void init();
|
virtual void init();
|
||||||
|
virtual void startup();
|
||||||
|
|
||||||
unsigned int drain(Event *de);
|
unsigned int drain(Event *de);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue