From 930db9257dbac7e678888a65a17c39bcc87aa7fa Mon Sep 17 00:00:00 2001 From: Andreas Hansson Date: Mon, 15 Oct 2012 08:07:07 -0400 Subject: Clock: Inherit the clock from parent by default This patch changes the default 1 Tick clock period to a proxy that resolves the parents clock. As a result of this, the caches and L1-to-L2 bus, for example, will automatically use the clock period of the CPU unless explicitly overridden. To ensure backwards compatibility, the System class overrides the proxy and specifies a 1 Tick clock. We could change this to something more reasonable in a follow-on patch, perhaps 1 GHz or something similar. With this patch applied, all clocked objects should have a reasonable clock period set, and could start specifying delays in Cycles instead of absolute time. --- src/sim/ClockedObject.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/sim/ClockedObject.py') diff --git a/src/sim/ClockedObject.py b/src/sim/ClockedObject.py index 9bb243df8..26b0e2348 100644 --- a/src/sim/ClockedObject.py +++ b/src/sim/ClockedObject.py @@ -37,9 +37,13 @@ from m5.SimObject import SimObject from m5.params import * +from m5.proxy import * class ClockedObject(SimObject): type = 'ClockedObject' abstract = True - clock = Param.Clock('1t', "Clock speed") + # Clock period of this object, with the default value being the + # clock period of the parent object, unproxied at instantiation + # time + clock = Param.Clock(Parent.clock, "Clock speed") -- cgit v1.2.3