diff --git a/dbt-rise-riscv b/dbt-rise-riscv index 8a528fc..dab4c69 160000 --- a/dbt-rise-riscv +++ b/dbt-rise-riscv @@ -1 +1 @@ -Subproject commit 8a528fceadae055c02197e194d188bbd0f78a03d +Subproject commit dab4c69f59e0f33b979ac43b40a29d6ec5c67d68 diff --git a/scc b/scc index 82602d0..3f5d963 160000 --- a/scc +++ b/scc @@ -1 +1 @@ -Subproject commit 82602d000fa1ed177ad0872dd3f82298f411efbc +Subproject commit 3f5d963ae0f7e83a340674d44c3a8e5125d221ef diff --git a/src/CLIParser.cpp b/src/CLIParser.cpp index f0ee526..0d3bbab 100644 --- a/src/CLIParser.cpp +++ b/src/CLIParser.cpp @@ -85,8 +85,8 @@ void CLIParser::build() { "core or isa name to use for simulation, use '?' to get list") ("dump-ir", "dump the intermediate representation") - ("dump-structure", po::value(), - "dump model structure to ELK file") + ("dump-structure", po::value(), + "dump model structure to ELK file") ("quantum", po::value()->default_value(100), "SystemC quantum time in ns") ("reset,r", po::value(), @@ -99,6 +99,8 @@ void CLIParser::build() { "set th ename of the trace file") ("max_time,m", po::value(), "maximum time to run") + ("parameter,p", po::value>(), + "parameter to set, value has the form of =") ("config-file,c", po::value()->default_value(""), "read configuration from file") ("plugin,p", po::value>(), diff --git a/src/sc_main.cpp b/src/sc_main.cpp index 4830914..f432a30 100644 --- a/src/sc_main.cpp +++ b/src/sc_main.cpp @@ -73,18 +73,30 @@ int sc_main(int argc, char* argv[]) { /////////////////////////////////////////////////////////////////////////// scc::configurer cfg(parser.get("config-file")); /////////////////////////////////////////////////////////////////////////// + // process CLI paramter settings + /////////////////////////////////////////////////////////////////////////// + if(parser.is_set("parameter")) + for(auto& p : parser.get>("parameter")) { + auto token = util::split(p, '='); + if(token.size() == 2) + cfg.set_value_from_str(token[0], token[1]); + else + SCCERR() << "Invalid parameter specification '" << p << "', should be '='"; + } + /////////////////////////////////////////////////////////////////////////// // set up tracing & transaction recording /////////////////////////////////////////////////////////////////////////// - std::unique_ptr tracer; if(auto trace_level = parser.get("trace-level")) { auto file_name = parser.get("trace-file"); auto trace_default_on = parser.is_set("trace-default-on"); + auto enable_tx_trace = static_cast(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(scc::tracer::file_type::FTR)); cfg.set_value("scc_tracer.sig_trace_type", static_cast(scc::tracer::file_type::FST)); - tracer = scc::make_unique(file_name, static_cast(trace_level & 0x2), - static_cast(trace_level & 0x1)); + tracer = scc::make_unique(file_name, enable_tx_trace, static_cast(trace_level & 0x1)); + if(enable_tx_trace) + cfg.set_value(core_path + ".enable_instr_trace", true); } /////////////////////////////////////////////////////////////////////////// // instantiate top level