diff --git a/.gitignore b/.gitignore index 8c518be..14352b6 100644 --- a/.gitignore +++ b/.gitignore @@ -25,3 +25,4 @@ CMakeSettings.json .clangd /install .gdb_history +/dbt-rise-custom diff --git a/.vscode/launch.json b/.vscode/launch.json index b383420..e30f69b 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -88,6 +88,24 @@ "program": "${workspaceFolder}/build/Debug/src/riscv-vp", "arguments": "-v DEBUG --isa 'tgc5c|mu_p' --backend asmjit -f fw/hello-world/hello.elf", "openGdbConsole": true + }, + { + "type": "gdb", + "request": "launch", + "name": "RISCV-VP report ISA", + "cwd": "${workspaceRoot}", + "program": "${workspaceFolder}/build/Debug/src/riscv-vp", + "arguments": "--isa ?", + "openGdbConsole": true + }, + { + "type": "gdb", + "request": "launch", + "name": "RISCV-SIM report ISA", + "cwd": "${workspaceRoot}", + "program": "${workspaceFolder}/build/Debug/dbt-rise-riscv/riscv-sim", + "arguments": "--isa ?", + "openGdbConsole": true } ], "compounds": [ diff --git a/CMakeLists.txt b/CMakeLists.txt index 7418014..77bd66b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,6 +6,7 @@ project(riscv-vp LANGUAGES C CXX VERSION 1.0.0) option(LIBS_ONLY "Just build the shared libraries needed to build the VP" OFF) option(ENABLE_COVERAGE "Enable code coverage" OFF) option(ENABLE_SANITIZER "Enable address sanitizer" OFF) +option(ENABLE_CLANGFORMAT "Enable code formatting using clang-format." OFF) option(ENABLE_CLANGTIDY "Enable static analysis with clang-tidy." OFF) option(ENABLE_FW_BUILD "Enable build of firmware of MIRES Firmware repo." OFF) option(ENABLE_GPROF "Enable gprof profiling" OFF) @@ -77,7 +78,10 @@ if(NOT LIBS_ONLY) add_subdirectory(src) endif() -find_package(ClangFormat) +if(ENABLE_CLANGFORMAT) + set(CLANG_FORMAT_EXCLUDE_PATTERNS "/scc/" "/build/" "/.direnv/") + find_package(ClangFormat) +endif() if(FW_BUILD) include(FetchContent) diff --git a/src/sc_main.cpp b/src/sc_main.cpp index 21c2276..e5094bb 100644 --- a/src/sc_main.cpp +++ b/src/sc_main.cpp @@ -143,7 +143,7 @@ int sc_main(int argc, char* argv[]) { sc_core::sc_start(scc::parse_from_string(parser.get("max_time"))); } else sc_core::sc_start(); - if(!sc_core::sc_end_of_simulation_invoked()) + if(sc_core::sc_start_of_simulation_invoked() && !sc_core::sc_end_of_simulation_invoked()) sc_core::sc_stop(); } catch(sc_core::sc_report& rep) { sc_core::sc_report_handler::get_handler()(rep, sc_core::SC_DISPLAY | sc_core::SC_STOP);