diff options
author | Andreas Hansson <andreas.hansson@arm.com> | 2012-08-21 05:49:01 -0400 |
---|---|---|
committer | Andreas Hansson <andreas.hansson@arm.com> | 2012-08-21 05:49:01 -0400 |
commit | 452217817f421a64bc022a5977e795229af45b30 (patch) | |
tree | 8f66c1802e5e22cfd4eee963d3cda37b77c5ca08 /src/cpu/base.hh | |
parent | 4ebefc145adf818f8695c36a36daacca99f59eb8 (diff) | |
download | gem5-452217817f421a64bc022a5977e795229af45b30.tar.xz |
Clock: Move the clock and related functions to ClockedObject
This patch moves the clock of the CPU, bus, and numerous devices to
the new class ClockedObject, that sits in between the SimObject and
MemObject in the class hierarchy. Although there are currently a fair
amount of MemObjects that do not make use of the clock, they
potentially should do so, e.g. the caches should at some point have
the same clock as the CPU, potentially with a 1:n ratio. This patch
does not introduce any new clock objects or object hierarchies
(clusters, clock domains etc), but is still a step in the direction of
having a more structured approach clock domains.
The most contentious part of this patch is the serialisation of clocks
that some of the modules (but not all) did previously. This
serialisation should not be needed as the clock is set through the
parameters even when restoring from the checkpoint. In other words,
the state is "stored" in the Python code that creates the modules.
The nextCycle methods are also simplified and the clock phase
parameter of the CPU is removed (this could be part of a clock object
once they are introduced).
Diffstat (limited to 'src/cpu/base.hh')
-rw-r--r-- | src/cpu/base.hh | 24 |
1 files changed, 1 insertions, 23 deletions
diff --git a/src/cpu/base.hh b/src/cpu/base.hh index b99b25d17..aab6ac4ca 100644 --- a/src/cpu/base.hh +++ b/src/cpu/base.hh @@ -88,8 +88,7 @@ class CPUProgressEvent : public Event class BaseCPU : public MemObject { protected: - // CPU's clock period in terms of the number of ticks of curTime. - Tick clock; + // @todo remove me after debugging with legion done Tick instCnt; // every cpu has an id, put it in the base cpu @@ -174,30 +173,11 @@ class BaseCPU : public MemObject */ MasterPort &getMasterPort(const std::string &if_name, int idx = -1); -// Tick currentTick; - inline Tick frequency() const { return SimClock::Frequency / clock; } - inline Tick ticks(int numCycles) const { return clock * numCycles; } - inline Tick curCycle() const { return curTick() / clock; } - inline Tick tickToCycles(Tick val) const { return val / clock; } inline void workItemBegin() { numWorkItemsStarted++; } inline void workItemEnd() { numWorkItemsCompleted++; } // @todo remove me after debugging with legion done Tick instCount() { return instCnt; } - /** The next cycle the CPU should be scheduled, given a cache - * access or quiesce event returning on this cycle. This function - * may return curTick() if the CPU should run on the current cycle. - */ - Tick nextCycle(); - - /** The next cycle the CPU should be scheduled, given a cache - * access or quiesce event returning on the given Tick. This - * function may return curTick() if the CPU should run on the - * current cycle. - * @param begin_tick The tick that the event is completing on. - */ - Tick nextCycle(Tick begin_tick); - TheISA::MicrocodeRom microcodeRom; protected: @@ -328,8 +308,6 @@ class BaseCPU : public MemObject System *system; - Tick phase; - /** * Serialize this object to the given output stream. * @param os The stream to serialize to. |