Clock: Move the clock and related functions to ClockedObject
authorAndreas Hansson <andreas.hansson@arm.com>
Tue, 21 Aug 2012 09:49:01 +0000 (05:49 -0400)
committerAndreas Hansson <andreas.hansson@arm.com>
Tue, 21 Aug 2012 09:49:01 +0000 (05:49 -0400)
commit452217817f421a64bc022a5977e795229af45b30
tree8f66c1802e5e22cfd4eee963d3cda37b77c5ca08
parent4ebefc145adf818f8695c36a36daacca99f59eb8
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).
29 files changed:
src/arch/x86/interrupts.cc
src/arch/x86/interrupts.hh
src/arch/x86/utility.cc
src/cpu/BaseCPU.py
src/cpu/base.cc
src/cpu/base.hh
src/cpu/testers/memtest/memtest.hh
src/cpu/testers/networktest/networktest.hh
src/dev/CopyEngine.py
src/dev/Ethernet.py
src/dev/arm/RealView.py
src/dev/arm/pl111.cc
src/dev/arm/pl111.hh
src/dev/arm/timer_cpulocal.cc
src/dev/i8254xGBe.cc
src/dev/i8254xGBe.hh
src/dev/ns_gige.cc
src/dev/ns_gige.hh
src/dev/sinic.cc
src/dev/sinic.hh
src/mem/Bus.py
src/mem/MemObject.py
src/mem/bus.cc
src/mem/bus.hh
src/mem/mem_object.cc
src/mem/mem_object.hh
src/sim/ClockedObject.py [new file with mode: 0644]
src/sim/SConscript
src/sim/clocked_object.hh [new file with mode: 0644]