mirror of
https://github.com/Minres/RISCV-VP.git
synced 2025-12-17 00:41:35 +00:00
cleanup VSCode settings and linux setup
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -24,3 +24,6 @@ CMakeSettings.json
|
||||
/.envrc.*
|
||||
.clangd
|
||||
/install
|
||||
.gdb_history
|
||||
.launch/TGC-VP interp.launch
|
||||
.launch/TGC-VP-FW-Debug dhrystone.launch
|
||||
|
||||
11
.vscode/extensions.json
vendored
11
.vscode/extensions.json
vendored
@@ -1,10 +1,15 @@
|
||||
{
|
||||
"recommendations": [
|
||||
"ms-vscode.cpptools-extension-pack",
|
||||
"mkhl.direnv",
|
||||
"sanaajani.taskrunnercode",
|
||||
"ms-vscode.cpptools-themes",
|
||||
"cnshenj.vscode-task-manager",
|
||||
"twxs.cmake",
|
||||
"kylinideteam.cmake-intellisence",
|
||||
"kylinideteam.kylin-cmake-tools",
|
||||
"llvm-vs-code-extensions.vscode-clangd",
|
||||
"eclipse-cdt.cdt-gdb-vscode",
|
||||
"eclipse-cdt.memory-inspector",
|
||||
"eclipse-cdt.peripheral-inspector",
|
||||
|
||||
"eclipse-cdt.peripheral-inspector"
|
||||
]
|
||||
}
|
||||
22
.vscode/launch.json
vendored
22
.vscode/launch.json
vendored
@@ -56,16 +56,34 @@
|
||||
"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": "64bit VP with Linux",
|
||||
"cwd": "${workspaceRoot}",
|
||||
"program": "${workspaceFolder}/build/Debug/src/riscv-vp",
|
||||
"arguments": "--isa 'rv64gc|msu_vp' -v DEBUG --disass -l run.log -f build/Linux4TGC/opensbi/build/platform/riscv_vp/firmware/fw_payload.elf -m 40ms",
|
||||
"openGdbConsole": true
|
||||
},
|
||||
{
|
||||
"type": "gdb",
|
||||
"request": "launch",
|
||||
"name": "64bit VP with Linux with gdbserver",
|
||||
"cwd": "${workspaceRoot}",
|
||||
"program": "${workspaceFolder}/build/Debug/src/riscv-vp",
|
||||
"arguments": "--isa 'rv64gc|msu_vp' -f build/Linux4TGC/opensbi/build/platform/riscv_vp/firmware/fw_payload.elf -m 40ms -g 10000",
|
||||
"openGdbConsole": true
|
||||
}
|
||||
],
|
||||
"compounds": [
|
||||
{
|
||||
"name": "FW-Debug 32bit",
|
||||
"configurations": ["32bit VP with gdbserver", "Attach to VP"]
|
||||
"configurations": ["32bit VP with gdbserver", "Attach GDB to VP"]
|
||||
},
|
||||
{
|
||||
"name": "FW-Debug 64bit",
|
||||
"configurations": ["64bit VP with gdbserver", "Attach to VP"]
|
||||
"configurations": ["64bit VP with gdbserver", "Attach GDB to VP"]
|
||||
}
|
||||
]
|
||||
}
|
||||
7
.vscode/settings.json
vendored
7
.vscode/settings.json
vendored
@@ -2,7 +2,7 @@
|
||||
"files.associations": {
|
||||
"platform.h": "c"
|
||||
},
|
||||
"debug.allowBreakpointsEverywhere": true,
|
||||
"debug.disassemblyView.showSourceCode": true,
|
||||
"editor.rulers": [
|
||||
{
|
||||
"column": 140,
|
||||
@@ -14,10 +14,15 @@
|
||||
"--background-index",
|
||||
"--compile-commands-dir=${workspaceFolder}/build"
|
||||
],
|
||||
"cmake.buildDirectory": "${workspaceFolder}/build",
|
||||
"cmake.copyCompileCommands": "${workspaceFolder}/build/compile_commands.json",
|
||||
"cmake.options.statusBarVisibility": "hidden",
|
||||
"cmake.options.advanced": {
|
||||
"configure": {"projectStatusVisibility": "visible"},
|
||||
"build": {"statusBarVisibility": "visible"}
|
||||
},
|
||||
"todo-tree.ripgrep.ripgrep": "/bin/rg",
|
||||
"files.watcherExclude": {
|
||||
"**/target": true
|
||||
}
|
||||
}
|
||||
@@ -77,8 +77,6 @@ if(NOT LIBS_ONLY)
|
||||
add_subdirectory(src)
|
||||
endif()
|
||||
|
||||
find_package(ClangFormat)
|
||||
|
||||
if(FW_BUILD)
|
||||
include(FetchContent)
|
||||
set(FETCHCONTENT_BASE_DIR ${CMAKE_CURRENT_BINARY_DIR}/..)
|
||||
|
||||
Submodule dbt-rise-core updated: b0fd6762be...e60892d2f9
Submodule dbt-rise-riscv updated: c99d195faa...1260c9db5e
2
scc
2
scc
Submodule scc updated: badc373aae...214d4fc7b0
@@ -41,10 +41,8 @@ CLIParser::CLIParser(int argc, char* argv[])
|
||||
auto log_level = vm_["verbose"].as<scc::log>();
|
||||
auto log_level_num = static_cast<unsigned>(log_level);
|
||||
LOGGER(DEFAULT)::reporting_level() = logging::as_log_level(log_level_num > 6 ? 6 : log_level_num);
|
||||
LOGGER(connection)::reporting_level() =
|
||||
logging::as_log_level(log_level_num > 4 ? log_level_num - 1 : log_level_num);
|
||||
LOGGER(dbt_rise_iss)::reporting_level() =
|
||||
logging::as_log_level(log_level_num > 4 ? log_level_num - 1 : log_level_num);
|
||||
LOGGER(connection)::reporting_level() = logging::as_log_level(log_level_num > 4 ? log_level_num - 1 : log_level_num);
|
||||
LOGGER(dbt_rise_iss)::reporting_level() = logging::as_log_level(log_level_num > 4 ? log_level_num - 1 : log_level_num);
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// configure logging
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
@@ -57,8 +55,8 @@ CLIParser::CLIParser(int argc, char* argv[])
|
||||
scc::stream_redirection cerr_redir(std::cerr, scc::log::ERROR);
|
||||
sc_core::sc_report_handler::set_actions("/IEEE_Std_1666/deprecated", sc_core::SC_DO_NOTHING);
|
||||
sc_core::sc_report_handler::set_actions(sc_core::SC_ID_MORE_THAN_ONE_SIGNAL_DRIVER_, sc_core::SC_DO_NOTHING);
|
||||
sc_core::sc_report_handler::set_actions(sc_core::SC_ERROR, sc_core::SC_LOG | sc_core::SC_CACHE_REPORT |
|
||||
sc_core::SC_DISPLAY | sc_core::SC_STOP);
|
||||
sc_core::sc_report_handler::set_actions(sc_core::SC_ERROR,
|
||||
sc_core::SC_LOG | sc_core::SC_CACHE_REPORT | sc_core::SC_DISPLAY | sc_core::SC_STOP);
|
||||
}
|
||||
|
||||
void CLIParser::build() {
|
||||
@@ -100,6 +98,8 @@ void CLIParser::build() {
|
||||
"set th ename of the trace file")
|
||||
("max_time,m", po::value<std::string>(),
|
||||
"maximum time to run")
|
||||
("heartbeat", po::value<std::string>()->default_value("0"),
|
||||
"print a heartbeat message at specifeid time intervals")
|
||||
("config-file,c", po::value<std::string>()->default_value(""),
|
||||
"read configuration from file")
|
||||
("plugin,p", po::value<std::vector<std::string>>(),
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2019 -2021 MINRES Technolgies GmbH
|
||||
* Copyright (c) 2019 -2025 MINRES Technolgies GmbH
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -22,7 +22,6 @@
|
||||
#include <boost/program_options.hpp>
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
#ifdef ERROR
|
||||
#undef ERROR
|
||||
#endif
|
||||
@@ -31,7 +30,6 @@ const std::string core_path{"tb.top.core_complex"};
|
||||
|
||||
using namespace sysc;
|
||||
using namespace sc_core;
|
||||
namespace po = boost::program_options;
|
||||
|
||||
namespace {
|
||||
const size_t ERRORR_IN_COMMAND_LINE = 1;
|
||||
@@ -60,7 +58,7 @@ int sc_main(int argc, char* argv[]) {
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// create the performance estimation module
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
scc::perf_estimator estimator;
|
||||
scc::perf_estimator estimator(scc::parse_from_string(parser.get<std::string>("heartbeat")));
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// set up configuration
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
@@ -72,9 +70,8 @@ int sc_main(int argc, char* argv[]) {
|
||||
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 enable_sig_trace = (trace_level & 0x1) != 0; // bit0 enables sig trace
|
||||
auto tx_trace_type =
|
||||
static_cast<scc::tracer::file_type>(trace_level >> 1); // bit3-bit1 define the kind of transaction trace
|
||||
auto enable_sig_trace = (trace_level & 0x1) != 0; // bit0 enables sig trace
|
||||
auto tx_trace_type = static_cast<scc::tracer::file_type>(trace_level >> 1); // bit3-bit1 define the kind of transaction trace
|
||||
auto trace_default_on = parser.is_set("trace-default-on");
|
||||
if(parser.is_set("trace-default-off"))
|
||||
cfg.set_value("scc_tracer.default_trace_enable", false);
|
||||
@@ -102,8 +99,7 @@ int sc_main(int argc, char* argv[]) {
|
||||
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));
|
||||
dumper.reset(new scc::hierarchy_dumper(parser.get<std::string>("dump-structure"), scc::hierarchy_dumper::D3JSON));
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// overwrite config with command line settings
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
@@ -121,8 +117,7 @@ int sc_main(int argc, char* argv[]) {
|
||||
tlm::tlm_global_quantum::instance().set(sc_core::sc_time(parser.get<unsigned>("quantum"), sc_core::SC_NS));
|
||||
if(parser.is_set("reset")) {
|
||||
auto str = parser.get<std::string>("reset");
|
||||
uint64_t start_address =
|
||||
str.find("0x") == 0 ? std::stoull(str.substr(2), nullptr, 16) : std::stoull(str, nullptr, 10);
|
||||
uint64_t start_address = str.find("0x") == 0 ? std::stoull(str.substr(2), nullptr, 16) : std::stoull(str, nullptr, 10);
|
||||
cfg.set_value(core_path + ".reset_address", start_address);
|
||||
}
|
||||
if(parser.is_set("disass")) {
|
||||
|
||||
@@ -18,5 +18,5 @@ const std::array<scc::target_memory_map_entry<scc::LT>, 7> PipelinedMemoryBusToA
|
||||
{aclint.socket, 0x30000, 0xc000},
|
||||
{irq_ctrl.socket, 0x40000, 0x8},
|
||||
{qspi.socket, 0x50000, 0x5c},
|
||||
{boot_rom.target, 0x80000, 0x2000},
|
||||
{boot_rom.target, 0x80000, 0x100000},
|
||||
}};
|
||||
|
||||
@@ -15,6 +15,7 @@ namespace vp {
|
||||
using namespace sc_core;
|
||||
using namespace vpvper::minres;
|
||||
|
||||
SC_HAS_PROCESS(system); // NOLINT
|
||||
system::system(sc_core::sc_module_name nm)
|
||||
: sc_core::sc_module(nm)
|
||||
, NAMED(ahb_router, 3, 2)
|
||||
@@ -24,17 +25,13 @@ system::system(sc_core::sc_module_name nm)
|
||||
core_complex.ibus(ahb_router.target[0]);
|
||||
core_complex.dbus(ahb_router.target[1]);
|
||||
|
||||
ahb_router.initiator.at(0)(qspi.xip_sck);
|
||||
ahb_router.set_target_range(0, 0x20000000, 16_MB);
|
||||
ahb_router.initiator.at(1)(mem_ram.target);
|
||||
ahb_router.set_target_range(1, 0x00000000, 128_kB);
|
||||
ahb_router.initiator.at(2)(apbBridge.target[0]);
|
||||
ahb_router.set_target_range(2, 0x10000000, 256_MB);
|
||||
ahb_router.bind_target(qspi.xip_sck, 0, 0x20000000, 16_MB);
|
||||
ahb_router.bind_target(mem_ram.target, 1, 0x00000000, 32_MB);
|
||||
ahb_router.bind_target(apbBridge.target[0], 2, 0x10000000, 256_MB);
|
||||
|
||||
size_t i = 0;
|
||||
for(const auto& e : PipelinedMemoryBusToApbBridge_map) {
|
||||
apbBridge.initiator.at(i)(e.target);
|
||||
apbBridge.set_target_range(i, e.start, e.size);
|
||||
apbBridge.bind_target(e.target, i, e.start, e.size);
|
||||
i++;
|
||||
}
|
||||
|
||||
|
||||
@@ -30,8 +30,6 @@ namespace vp {
|
||||
|
||||
class system : public sc_core::sc_module {
|
||||
public:
|
||||
SC_HAS_PROCESS(system); // NOLINT
|
||||
|
||||
sc_core::sc_vector<sc_core::sc_out<bool>> pins_o{"pins_o", 32};
|
||||
sc_core::sc_vector<sc_core::sc_out<bool>> pins_oe_o{"pins_oe_o", 32};
|
||||
sc_core::sc_vector<sc_core::sc_in<bool>> pins_i{"pins_i", 32};
|
||||
@@ -57,8 +55,8 @@ private:
|
||||
vpvper::minres::irq_tl irq_ctrl{"irq_ctrl"};
|
||||
vpvper::minres::qspi_tl qspi{"qspi"};
|
||||
|
||||
scc::memory<128_kB, scc::LT> mem_ram{"mem_ram"};
|
||||
scc::memory<8_kB, scc::LT> boot_rom{"boot_rom"};
|
||||
scc::memory<32_MB, scc::LT> mem_ram{"mem_ram"};
|
||||
scc::memory<1_MB, scc::LT> boot_rom{"boot_rom"};
|
||||
|
||||
sc_core::sc_signal<sc_core::sc_time> mtime_clk{"mtime_clk"};
|
||||
sc_core::sc_signal<bool, sc_core::SC_MANY_WRITERS> rst_s{"rst_s"}, mtime_int_s{"mtime_int_s"}, msip_int_s{"msip_int_s"};
|
||||
|
||||
@@ -20,6 +20,7 @@ public:
|
||||
tb(sc_core::sc_module_name const& nm);
|
||||
vp::system top{"top"};
|
||||
vpvper::generic::rst_gen rst_gen{"rst_gen"};
|
||||
vpvper::generic::terminal term;
|
||||
sc_core::sc_signal<bool> rst_n{"rst_n"};
|
||||
sc_core::sc_vector<sc_core::sc_signal<bool>> pins_o{"pins_o", 32};
|
||||
sc_core::sc_vector<sc_core::sc_signal<bool>> pins_oe_o{"pins_oe_o", 32};
|
||||
|
||||
Reference in New Issue
Block a user