updates submodules and refactors sc_main to work with changed initialization of core_complex

This commit is contained in:
2026-02-01 15:18:54 +01:00
parent c64827d436
commit d47fdc885f
4 changed files with 47 additions and 36 deletions

2
scc

Submodule scc updated: 726a43247c...2d5b268615

View File

@@ -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)) {
SCCERR() << "Simulation aborted with signal " << res << "!"; 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 << "!";
}
} else { } else {
try { try {
if(parser.is_set("max_time")) { if(parser.is_set("max_time")) {