diff options
Diffstat (limited to 'src/sim/clocked_object.hh')
-rw-r--r-- | src/sim/clocked_object.hh | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/sim/clocked_object.hh b/src/sim/clocked_object.hh index 78539c9c9..9a4c1034a 100644 --- a/src/sim/clocked_object.hh +++ b/src/sim/clocked_object.hh @@ -119,6 +119,18 @@ class ClockedObject : public SimObject */ virtual ~ClockedObject() { } + /** + * Reset the object's clock using the current global tick value. Likely + * to be used only when the global clock is reset. Currently, this done + * only when Ruby is done warming up the memory system. + */ + void resetClock() const + { + Cycles elapsedCycles(divCeil(curTick(), clock)); + cycle = elapsedCycles; + tick = elapsedCycles * clock; + } + public: /** |