summaryrefslogtreecommitdiff
path: root/src/sim
diff options
context:
space:
mode:
authorAndreas Hansson <andreas.hansson@arm.com>2013-02-19 05:56:06 -0500
committerAndreas Hansson <andreas.hansson@arm.com>2013-02-19 05:56:06 -0500
commit7cd49b24d2523eaf21179946e291c46c6acf5bfc (patch)
tree91c066608dfb6e4ca52dd25e91a61719848d64a7 /src/sim
parent5c7ebee434a0328802c01b38c19845c50ae75cab (diff)
downloadgem5-7cd49b24d2523eaf21179946e291c46c6acf5bfc.tar.xz
sim: Make clock private and access using clockPeriod()
This patch makes the clock member private to the ClockedObject and forces all children to access it using clockPeriod(). This makes it impossible to inadvertently change the clock, and also makes it easier to transition to a situation where the clock is derived from e.g. a clock domain, or through a multiplier.
Diffstat (limited to 'src/sim')
-rw-r--r--src/sim/clocked_object.hh4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/sim/clocked_object.hh b/src/sim/clocked_object.hh
index b0aaa1721..e04e9338d 100644
--- a/src/sim/clocked_object.hh
+++ b/src/sim/clocked_object.hh
@@ -103,11 +103,11 @@ class ClockedObject : public SimObject
tick += elapsedCycles * clock;
}
- protected:
-
// Clock period in ticks
Tick clock;
+ protected:
+
/**
* Create a clocked object and set the clock based on the
* parameters.