diff --git a/.cproject b/.cproject index effef55..a773b5e 100644 --- a/.cproject +++ b/.cproject @@ -5,10 +5,7 @@ - - - @@ -20,52 +17,44 @@ - - - - - - @@ -94,7 +83,6 @@ - @@ -156,8 +144,40 @@ + + + + + make + + all VERBOSE=1 + true + true + true + + + make + + clean + true + true + true + + + make + + all + true + true + true + + + + + + @@ -167,29 +187,11 @@ + + + - - - - - make - - all - true - true - true - - - make - - all VERBOSE=1 - true - true - true - - - diff --git a/.gitignore b/.gitignore index a4409d8..b7eb8e8 100644 --- a/.gitignore +++ b/.gitignore @@ -32,3 +32,4 @@ *.app /build/ +/simple_system.txlog diff --git a/.settings/language.settings.xml b/.settings/language.settings.xml index 343b471..aab43e1 100644 --- a/.settings/language.settings.xml +++ b/.settings/language.settings.xml @@ -5,7 +5,7 @@ - + @@ -16,7 +16,7 @@ - + diff --git a/.settings/org.eclipse.cdt.core.prefs b/.settings/org.eclipse.cdt.core.prefs index 82d0b6a..eb4d582 100644 --- a/.settings/org.eclipse.cdt.core.prefs +++ b/.settings/org.eclipse.cdt.core.prefs @@ -1,3 +1,11 @@ eclipse.preferences.version=1 +environment/project/cdt.managedbuild.config.gnu.macosx.exe.debug.133691581/SC_DEFAULT_WRITER_POLICY/delimiter=\: +environment/project/cdt.managedbuild.config.gnu.macosx.exe.debug.133691581/SC_DEFAULT_WRITER_POLICY/operation=append +environment/project/cdt.managedbuild.config.gnu.macosx.exe.debug.133691581/SC_DEFAULT_WRITER_POLICY/value=SC_MANY_WRITERS environment/project/cdt.managedbuild.config.gnu.macosx.exe.debug.133691581/append=true environment/project/cdt.managedbuild.config.gnu.macosx.exe.debug.133691581/appendContributed=true +environment/project/cdt.managedbuild.config.macosx.exe.release.222902119/SC_DEFAULT_WRITER_POLICY/delimiter=\: +environment/project/cdt.managedbuild.config.macosx.exe.release.222902119/SC_DEFAULT_WRITER_POLICY/operation=append +environment/project/cdt.managedbuild.config.macosx.exe.release.222902119/SC_DEFAULT_WRITER_POLICY/value=SC_MANY_WRITERS +environment/project/cdt.managedbuild.config.macosx.exe.release.222902119/append=true +environment/project/cdt.managedbuild.config.macosx.exe.release.222902119/appendContributed=true diff --git a/etc/simple_system.launch b/etc/simple_system.launch new file mode 100644 index 0000000..a3c9e5d --- /dev/null +++ b/etc/simple_system.launch @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/examples/simple_system/sc_main.cpp b/examples/simple_system/sc_main.cpp index 90ef207..33141d4 100644 --- a/examples/simple_system/sc_main.cpp +++ b/examples/simple_system/sc_main.cpp @@ -38,20 +38,20 @@ const size_t ERROR_UNHANDLED_EXCEPTION = 2; } // namespace int sc_main(int argc, char *argv[]) { - - // Environment adaptations - putenv(const_cast("SC_SIGNAL_WRITE_CHECK=DISABLE")); - - // sc_report_handler::set_handler(my_report_handler); - scc::Logger<>::reporting_level() = log::DEBUG; - // todo: add module-name to log-file - + /////////////////////////////////////////////////////////////////////////// + // setup initial logging + /////////////////////////////////////////////////////////////////////////// + scc::Logger<>::reporting_level() = logging::INFO; /////////////////////////////////////////////////////////////////////////// // CLI argument parsing /////////////////////////////////////////////////////////////////////////// po::options_description desc("Options"); - desc.add_options()("help,h", "Print help message")("debug,d", po::value(), - "set debug level")("trace,t", "trace SystemC signals"); + // clang-format off + desc.add_options() + ("help,h", "Print help message") + ("debug,d", "set debug level") + ("trace,t", "trace SystemC signals"); + // clang-format on po::variables_map vm; try { po::store(po::parse_command_line(argc, argv, desc), vm); // can throw @@ -67,6 +67,12 @@ int sc_main(int argc, char *argv[]) { std::cerr << desc << std::endl; return ERROR_IN_COMMAND_LINE; } + if (vm.count("debug")) { + LOGGER(DEFAULT)::reporting_level() = log::DEBUG; + LOGGER(SystemC)::reporting_level() = log::DEBUG; + scc::Logger<>::reporting_level() = log::DEBUG; + } + /////////////////////////////////////////////////////////////////////////// // set up tracing & transaction recording /////////////////////////////////////////////////////////////////////////// @@ -89,5 +95,5 @@ int sc_main(int argc, char *argv[]) { LOG(ERROR) << "simulation timed out"; sc_core::sc_stop(); } - return 0; + return SUCCESS; }