mirror of
https://github.com/Minres/RISCV-VP.git
synced 2026-02-06 10:02:35 +00:00
updates submodules and refactors sc_main to work with changed initialization of core_complex
This commit is contained in:
Submodule dbt-rise-core updated: c3c48b095d...9b1791a9b7
Submodule dbt-rise-riscv updated: 76456a4fca...4be6176695
2
scc
2
scc
Submodule scc updated: 726a43247c...2d5b268615
@@ -84,38 +84,7 @@ int sc_main(int argc, char* argv[]) {
|
|||||||
SCCERR() << "Invalid parameter specification '" << p << "', should be '<param name>=<param_value>'";
|
SCCERR() << "Invalid parameter specification '" << p << "', should be '<param name>=<param_value>'";
|
||||||
}
|
}
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
// set up tracing & transaction recording
|
// rocess CLI switche and set/overwrite config from command line settings
|
||||||
///////////////////////////////////////////////////////////////////////////
|
|
||||||
std::unique_ptr<scc::configurable_tracer> tracer;
|
|
||||||
if(auto trace_level = parser.get<unsigned>("trace-level")) {
|
|
||||||
auto file_name = parser.get<std::string>("trace-file");
|
|
||||||
auto trace_default_on = parser.is_set("trace-default-on");
|
|
||||||
auto enable_tx_trace = static_cast<bool>(trace_level & 0x2);
|
|
||||||
cfg.set_value("scc_tracer.default_trace_enable", !parser.is_set("trace-default-off"));
|
|
||||||
cfg.set_value("scc_tracer.tx_trace_type", static_cast<unsigned>(scc::tracer::file_type::FTR));
|
|
||||||
cfg.set_value("scc_tracer.sig_trace_type", static_cast<unsigned>(scc::tracer::file_type::FST));
|
|
||||||
tracer = scc::make_unique<scc::configurable_tracer>(file_name, enable_tx_trace, static_cast<bool>(trace_level & 0x1));
|
|
||||||
if(enable_tx_trace)
|
|
||||||
cfg.set_value(core_path + ".enable_instr_trace", true);
|
|
||||||
}
|
|
||||||
///////////////////////////////////////////////////////////////////////////
|
|
||||||
// instantiate top level
|
|
||||||
///////////////////////////////////////////////////////////////////////////
|
|
||||||
auto i_system = scc::make_unique<vp::tb>("tb");
|
|
||||||
///////////////////////////////////////////////////////////////////////////
|
|
||||||
// dump configuration if requested and/or structure
|
|
||||||
///////////////////////////////////////////////////////////////////////////
|
|
||||||
if(parser.get<std::string>("dump-config").size() > 0) {
|
|
||||||
std::ofstream of{parser.get<std::string>("dump-config")};
|
|
||||||
if(of.is_open())
|
|
||||||
cfg.dump_configuration(of, true);
|
|
||||||
}
|
|
||||||
cfg.configure();
|
|
||||||
std::unique_ptr<scc::hierarchy_dumper> dumper;
|
|
||||||
if(parser.is_set("dump-structure"))
|
|
||||||
dumper.reset(new scc::hierarchy_dumper(parser.get<std::string>("dump-structure"), scc::hierarchy_dumper::D3JSON));
|
|
||||||
///////////////////////////////////////////////////////////////////////////
|
|
||||||
// overwrite config with command line settings
|
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
cfg.set_value(core_path + ".gdb_server_port", parser.get<unsigned short>("gdb-port"));
|
cfg.set_value(core_path + ".gdb_server_port", parser.get<unsigned short>("gdb-port"));
|
||||||
cfg.set_value(core_path + ".dump_ir", parser.is_set("dump-ir"));
|
cfg.set_value(core_path + ".dump_ir", parser.is_set("dump-ir"));
|
||||||
@@ -144,10 +113,52 @@ int sc_main(int argc, char* argv[]) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
// set up tracing & transaction recording
|
||||||
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
std::unique_ptr<scc::configurable_tracer> tracer;
|
||||||
|
if(auto trace_level = parser.get<unsigned>("trace-level")) {
|
||||||
|
auto file_name = parser.get<std::string>("trace-file");
|
||||||
|
auto trace_default_on = parser.is_set("trace-default-on");
|
||||||
|
auto enable_tx_trace = static_cast<bool>(trace_level & 0x2);
|
||||||
|
cfg.set_value("scc_tracer.default_trace_enable", !parser.is_set("trace-default-off"));
|
||||||
|
cfg.set_value("scc_tracer.tx_trace_type", static_cast<unsigned>(scc::tracer::file_type::FTR));
|
||||||
|
cfg.set_value("scc_tracer.sig_trace_type", static_cast<unsigned>(scc::tracer::file_type::FST));
|
||||||
|
tracer = scc::make_unique<scc::configurable_tracer>(file_name, enable_tx_trace, static_cast<bool>(trace_level & 0x1));
|
||||||
|
if(enable_tx_trace)
|
||||||
|
cfg.set_value(core_path + ".enable_instr_trace", true);
|
||||||
|
}
|
||||||
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
// instantiate top level
|
||||||
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
auto i_system = scc::make_unique<vp::tb>("tb");
|
||||||
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
// dump configuration and/or hierarchical structure if requested
|
||||||
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
if(parser.get<std::string>("dump-config").size() > 0) {
|
||||||
|
std::ofstream of{parser.get<std::string>("dump-config")};
|
||||||
|
if(of.is_open())
|
||||||
|
cfg.dump_configuration(of, true);
|
||||||
|
}
|
||||||
|
cfg.configure();
|
||||||
|
std::unique_ptr<scc::hierarchy_dumper> dumper;
|
||||||
|
if(parser.is_set("dump-structure"))
|
||||||
|
dumper.reset(new scc::hierarchy_dumper(parser.get<std::string>("dump-structure"), scc::hierarchy_dumper::D3JSON));
|
||||||
|
///////////////////////////////////////////////////////////////////////////
|
||||||
// run simulation
|
// run simulation
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
if(auto res = setjmp(abrt)) {
|
if(auto res = setjmp(abrt)) {
|
||||||
|
switch(res) {
|
||||||
|
case SIGHUP:
|
||||||
|
case SIGINT:
|
||||||
|
case SIGQUIT:
|
||||||
|
case SIGTERM:
|
||||||
|
case SIGUSR1:
|
||||||
|
case SIGUSR2:
|
||||||
|
SCCINFO() << "Simulation stopped with signal " << res << ".";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
SCCERR() << "Simulation aborted with signal " << res << "!";
|
SCCERR() << "Simulation aborted with signal " << res << "!";
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
if(parser.is_set("max_time")) {
|
if(parser.is_set("max_time")) {
|
||||||
|
|||||||
Reference in New Issue
Block a user