summaryrefslogtreecommitdiff
path: root/src/sim/clocked_object.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/sim/clocked_object.hh')
-rw-r--r--src/sim/clocked_object.hh7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/sim/clocked_object.hh b/src/sim/clocked_object.hh
index d9630139a..b0aaa1721 100644
--- a/src/sim/clocked_object.hh
+++ b/src/sim/clocked_object.hh
@@ -46,6 +46,7 @@
#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"
@@ -113,7 +114,11 @@ class ClockedObject : public SimObject
*/
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.