+2008-06-17 Dave Brolley <brolley@redhat.com>
+
+ * mainDynamic.cxx (usage): Document --reversible.
+ (try_add_memory): Call sess->add_memory.
+ (option_num): add opt_reversible.
+ (long_options): Add "reversible".
+ (main): Handle opt_reversible.
+ * commonCfg.h (set_reversible): New method of SessionCfg.
+ (add_memory): Likewise.
+ (reversible_p): New member of SessionCfg.
+ (memory): Likewise.
+ * commonCfg.cxx (CpuCfg): Establish sim-sched relation.
+ (SessionCfg): Initialize reversible_p.
+ (SessionCfg::write_load): Set up all memory regions as reversible,
+ if requested.
+ (BoardCfg::write_config): Set up the cpu to be reversible, if
+ requested.
+
2007-11-06 Dave Brolley <brolley@redhat.com>
* mepCfg.cxx (MepBoardCfg): Set the gloss component's
sess->sim_sched->add_subscription
(this, "step!", "step-cycles",
"time-query", "time-high", "time-low");
+ relate (this, "sim-sched", sess->sim_sched);
}
tcl_bridge (NULL),
loader (NULL),
verbose (false),
+ reversible_p (false),
use_stdio (true),
need_gprof (false),
need_core_probe (false),
host_sched->set_time (n, 150);
use_stdio = false;
}
+
+ // Setup all memory regions to be reversible, if specified.
+ if (reversible_p)
+ for (vector<MemCfg *>::iterator it = memory.begin ();
+ it != memory.end ();
+ ++it)
+ {
+ set (*it, "reversible?", "true");
+ relate (*it, "sim-sched", sim_sched);
+ conn_pin (sim_sched, "time-set", *it, "restore-to-time!");
+ }
+
AggregateCfg::write_load (w);
}
PinConnection (cpu, "trap-code", gdb, "trap-code").write_to(w);
}
}
+
+ // Set up the cpu to be reversible, if requested.
+ if (sess->reversible_p)
+ {
+ Setting (cpu, "reversible?", "true").write_to (w);
+ PinConnection (sess->sim_sched, "time-set", cpu, "restore-to-time!").write_to(w);
+ }
}
void BoardCfg::set_gprof (const string filename, gprof_type type, int interval)
void use_tksm();
void use_tcl_bridge();
void use_no_stdio ();
+ void set_reversible () { reversible_p = true; }
virtual void set_loader (LoaderCfg *l);
LoaderCfg *get_loader () const { return loader; }
AtomicCfg *audio;
AtomicCfg *tcl_bridge;
bool verbose;
bool use_stdio;
+ bool reversible_p;
bool need_gprof;
bool need_core_probe;
bool maybe_model_busses;
map<const string, AtomicCfg *> ulog_map;
void add_gdb () { ++gdb_count; }
void add_board (ComponentCfg *b) { ++board_count; add_child (b); }
+ void add_memory (MemCfg *mem) { memory.push_back (mem); }
+ vector<MemCfg *> memory;
virtual void write_config (Writer &w);
// Support for dynamic configuration profiles
vector<AtomicCfg *> wrapped_components;
cout << "--profile-config=NAME,OPTIONS" << endl;
cout << " Specify options for a named profiling configuration" << endl;
cout << "--rc Pass stop code as simulator exit rc" << endl;
+ cout << "--reversible Configure for reversible simulation" << endl;
cout << "--save-temps=FILE Write config to FILE, '-' for stdout." << endl;
cout << "--wrap=COMPONENT Turn on SID API tracing for COMPONENT" << endl;
cout << "--verbose Turn on run-time verbosity settings" << endl;
if (! (mmap_p || read_only_p))
sess->shutdown_seq->add_output (6, mem, "image-store");
}
+
+ sess->add_memory (mem);
}
enum option_num { opt_help, opt_version, opt_save_temps, opt_wrap,
opt_verbose, opt_tksched, opt_enable_warnings,
opt_persistent, opt_profile_config,
- opt_rc, opt_no_run, opt_sidrtc, opt_sidcodec,
+ opt_rc, opt_reversible, opt_no_run, opt_sidrtc, opt_sidcodec,
opt_tksm, opt_board, opt_cpu, opt_gdb, opt_gloss, opt_engine,
opt_insn_count, opt_load, opt_icache, opt_dcache,
opt_memory_region, opt_profile_func,
{"persistent", no_argument, & curr_opt, opt_persistent },
{"profile-config", required_argument, &curr_opt, opt_profile_config },
{"rc", no_argument, & curr_opt, opt_rc },
+ {"reversible", no_argument, & curr_opt, opt_reversible },
{"tksm", no_argument, & curr_opt, opt_tksm },
rc_p = true;
break;
+ case opt_reversible:
+ if (sess)
+ {
+ sess->set_reversible ();
+ // --insn-count must be 1 for this to work correctly
+ if (curr_board)
+ {
+ curr_board->set_step_insn_count("1");
+ board_start_config += " --insn-count=1";
+ }
+ else
+ {
+ defaults.step_insn_count = "1";
+ defaults.start_config += " --insn-count=1";
+ }
+ }
+ break;
+
case opt_sidrtc:
option_requires_board (curr_board, "sidrtc");
curr_board->add_sidrtc (optaddr("sidrtc"));