This patch adds a check to the clocked object constructor to ensure it
is not configured to have a clock period of 0.
addrRanges(p->addr_ranges.begin(), p->addr_ranges.end()),
system(p->system)
{
- // ensure the clock is not running at an unreasonable clock speed
- if (clock == 1)
- panic("Cache %s has a cycle time of 1 tick. Specify a clock.\n",
- name());
}
void
#define __SIM_CLOCKED_OBJECT_HH__
#include "base/intmath.hh"
+#include "base/misc.hh"
#include "params/ClockedObject.hh"
#include "sim/core.hh"
#include "sim/sim_object.hh"
*/
ClockedObject(const ClockedObjectParams* p) :
SimObject(p), tick(0), cycle(0), clock(p->clock)
- { }
+ {
+ if (clock == 0) {
+ fatal("%s has a clock period of zero\n", name());
+ }
+ }
/**
* Virtual destructor due to inheritance.