class Root(SimObject):
type = 'Root'
clock = Param.RootClock('200MHz', "tick frequency")
- max_time = Param.Latency('0ns', "maximum simulation time (0 = infinite)")
- progress_interval = Param.Latency('0ns',
- "print a progress message at a regular interval (0 = never)")
+ max_tick = Param.Tick('0', "maximum simulation ticks (0 = infinite)")
+ progress_interval = Param.Tick('0',
+ "print a progress message every n ticks (0 = never)")
output_file = Param.String('cout', "file to dump simulator output to")
checkpoint = Param.String('', "checkpoint file to load")
# hier = Param.HierParams(HierParams(do_data = False, do_events = True),
class Root : public SimObject
{
private:
- Tick max_time;
+ Tick max_tick;
Tick progress_interval;
public:
- Root(const std::string &name, Tick maxtime, Tick pi)
- : SimObject(name), max_time(maxtime), progress_interval(pi)
+ Root(const std::string &name, Tick maxtick, Tick pi)
+ : SimObject(name), max_tick(maxtick), progress_interval(pi)
{}
virtual void startup();
void
Root::startup()
{
- if (max_time != 0)
- new SimExitEvent(curTick + max_time, "reached maximum cycle count");
+ if (max_tick != 0)
+ new SimExitEvent(curTick + max_tick, "reached maximum cycle count");
if (progress_interval != 0)
new ProgressEvent(&mainEventQueue, progress_interval);
BEGIN_DECLARE_SIM_OBJECT_PARAMS(Root)
Param<Tick> clock;
- Param<Tick> max_time;
+ Param<Tick> max_tick;
Param<Tick> progress_interval;
Param<string> output_file;
BEGIN_INIT_SIM_OBJECT_PARAMS(Root)
INIT_PARAM(clock, "tick frequency"),
- INIT_PARAM(max_time, "maximum simulation time"),
+ INIT_PARAM(max_tick, "maximum simulation time"),
INIT_PARAM(progress_interval, "print a progress message"),
INIT_PARAM(output_file, "file to dump simulator output to")
created = true;
outputStream = simout.find(output_file);
- Root *root = new Root(getInstanceName(), max_time, progress_interval);
+ Root *root = new Root(getInstanceName(), max_tick, progress_interval);
using namespace Clock;
Frequency = clock;