From 04b5b6b2024e6410fe2c428b43c58ee4cebcf76d Mon Sep 17 00:00:00 2001 From: Eyck Jentzsch Date: Fri, 24 Nov 2017 10:05:59 +0100 Subject: [PATCH] Added JSON dump --- .gitignore | 1 + riscv.sc/src/sc_main.cpp | 11 ++++++++--- sc-components | 2 +- simple-system.json | 7 +++++-- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 4d498bb..2865d22 100644 --- a/.gitignore +++ b/.gitignore @@ -29,3 +29,4 @@ language.settings.xml /*.log /.gdbinit /*.out +/dump.json diff --git a/riscv.sc/src/sc_main.cpp b/riscv.sc/src/sc_main.cpp index c99aeee..e82263b 100644 --- a/riscv.sc/src/sc_main.cpp +++ b/riscv.sc/src/sc_main.cpp @@ -61,7 +61,8 @@ int sc_main(int argc, char *argv[]) { ("reset,r", po::value(), "reset address") ("trace,t", po::value()->default_value(0), "enable tracing, or combintation of 1=signals and 2=TX text, 4=TX compressed text, 6=TX in SQLite") ("max_time,m", po::value(), "maximum time to run") - ("config-file,c", po::value()->default_value(""), "configuration file"); + ("config-file,c", po::value()->default_value(""), "read configuration from file") + ("dump-config", po::value()->default_value(""), "dump configuration to file file"); // clang-format on po::variables_map vm; try { @@ -111,8 +112,12 @@ int sc_main(int argc, char *argv[]) { platform i_simple_system("i_simple_system"); // sr_report_handler::add_sc_object_to_filter(&i_simple_system.i_master, // sc_core::SC_WARNING, sc_core::SC_MEDIUM); - // cfg.dump_hierarchy(); - cfg.configure(); + if (vm.count("dump-config")){ + std::ofstream of{vm["dump-config"].as()}; + if(of.is_open()) + cfg.dump_configuration(of); + } + cfg.configure(); // overwrite with command line settings if (vm.count("gdb-port")) cfg.set_value("i_simple_system.i_core_complex.gdb_server_port", vm["gdb-port"].as()); diff --git a/sc-components b/sc-components index 251a735..02cb175 160000 --- a/sc-components +++ b/sc-components @@ -1 +1 @@ -Subproject commit 251a735cea414b4a79da99ca438da4335bb0fbc5 +Subproject commit 02cb1756166adb7074f6e5dfa106ca5ab04176c6 diff --git a/simple-system.json b/simple-system.json index 0eebd11..a2bd7ac 100644 --- a/simple-system.json +++ b/simple-system.json @@ -1,10 +1,13 @@ { "i_simple_system":{ "i_uart0":{ - "write_to_ws": true + "write_to_ws": false + }, + "i_uart1":{ + "write_to_ws": false }, "i_gpio0":{ - "write_to_ws": true + "write_to_ws": false } } }