diff options
Diffstat (limited to 'src/sim/clock_domain.cc')
-rw-r--r-- | src/sim/clock_domain.cc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/sim/clock_domain.cc b/src/sim/clock_domain.cc index 8b563d598..ff96f2808 100644 --- a/src/sim/clock_domain.cc +++ b/src/sim/clock_domain.cc @@ -1,5 +1,6 @@ /* * Copyright (c) 2013 ARM Limited + * Copyright (c) 2013 Cornell University * All rights reserved * * The license below extends only to copyright in the software and shall @@ -37,6 +38,7 @@ * Authors: Vasileios Spiliopoulos * Akash Bagdia * Andreas Hansson + * Christopher Torng */ #include "debug/ClockDomain.hh" @@ -45,6 +47,7 @@ #include "params/SrcClockDomain.hh" #include "sim/clock_domain.hh" #include "sim/voltage_domain.hh" +#include "sim/clocked_object.hh" double ClockDomain::voltage() const @@ -65,6 +68,11 @@ SrcClockDomain::clockPeriod(Tick clock_period) fatal("%s has a clock period of zero\n", name()); } + // Align all members to the current tick + for (auto m = members.begin(); m != members.end(); ++m) { + (*m)->updateClockPeriod(); + } + _clockPeriod = clock_period; DPRINTF(ClockDomain, @@ -105,6 +113,11 @@ DerivedClockDomain::DerivedClockDomain(const Params *p) : void DerivedClockDomain::updateClockPeriod() { + // Align all members to the current tick + for (auto m = members.begin(); m != members.end(); ++m) { + (*m)->updateClockPeriod(); + } + // recalculate the clock period, relying on the fact that changes // propagate downwards in the tree _clockPeriod = parent.clockPeriod() * clockDivider; |