From 61d8d3c661e7a2aa0e65539ba83b3f322c68700e Mon Sep 17 00:00:00 2001 From: Eyck Jentzsch Date: Sat, 17 Aug 2024 16:19:10 +0200 Subject: [PATCH] applies clang-format (incl. submodules), adds launch configs --- .launch/FW-Debug (Firmware).launch | 13 +++++ .launch/FW-Debug prebuild FW.launch | 13 +++++ .launch/FW-VP HW Debug GDB loading.launch | 13 +++++ ...launch => FW-VP HW Debug preloaded.launch} | 4 +- .launch/TGC-VP interp hello (Firmware).launch | 35 ++++++++++++ ...ello cycle-estimate slow (Firmware).launch | 35 ++++++++++++ ...ch => TGC-VP-FW-Debug prebuild FW.launch} | 2 +- .launch/TGC-VP-FW-Debug (Firmware).launch | 52 +++++++++++++++++ .launch/TGC-VP-GDBServer (Firmware).launch | 35 ++++++++++++ ...ch => TGC-VP-GDBServer prebuilt FW.launch} | 0 .launch/TGC-VP-GDBServer wo FW.launch | 35 ++++++++++++ CMakeLists.txt | 4 +- scc | 2 +- src/CLIParser.cpp | 19 ++++--- src/CLIParser.h | 10 ++-- src/sc_main.cpp | 57 +++++++++++-------- .../gen/PipelinedMemoryBusToApbBridge.h | 34 +++++------ src/tgc_vp/rst_gen.h | 8 +-- src/tgc_vp/system.cpp | 11 ++-- src/tgc_vp/system.h | 46 ++++++++------- src/tgc_vp/tb.cpp | 5 +- src/tgc_vp/tb.h | 12 ++-- tgc-iss/dbt-rise-core | 2 +- tgc-iss/dbt-rise-tgc | 2 +- vpvper | 2 +- 25 files changed, 347 insertions(+), 104 deletions(-) create mode 100644 .launch/FW-Debug (Firmware).launch create mode 100644 .launch/FW-Debug prebuild FW.launch create mode 100644 .launch/FW-VP HW Debug GDB loading.launch rename .launch/{FW-Debug.launch => FW-VP HW Debug preloaded.launch} (92%) create mode 100644 .launch/TGC-VP interp hello (Firmware).launch create mode 100644 .launch/TGC-VP interp hello cycle-estimate slow (Firmware).launch rename .launch/{TGC-VP-FW-Debug.launch => TGC-VP-FW-Debug prebuild FW.launch} (98%) create mode 100644 .launch/TGC-VP-FW-Debug (Firmware).launch create mode 100644 .launch/TGC-VP-GDBServer (Firmware).launch rename .launch/{TGC-VP-GDBServer.launch => TGC-VP-GDBServer prebuilt FW.launch} (100%) create mode 100644 .launch/TGC-VP-GDBServer wo FW.launch diff --git a/.launch/FW-Debug (Firmware).launch b/.launch/FW-Debug (Firmware).launch new file mode 100644 index 0000000..97ce4aa --- /dev/null +++ b/.launch/FW-Debug (Firmware).launch @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/.launch/FW-Debug prebuild FW.launch b/.launch/FW-Debug prebuild FW.launch new file mode 100644 index 0000000..e8709d7 --- /dev/null +++ b/.launch/FW-Debug prebuild FW.launch @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/.launch/FW-VP HW Debug GDB loading.launch b/.launch/FW-VP HW Debug GDB loading.launch new file mode 100644 index 0000000..4f61eab --- /dev/null +++ b/.launch/FW-VP HW Debug GDB loading.launch @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/.launch/FW-Debug.launch b/.launch/FW-VP HW Debug preloaded.launch similarity index 92% rename from .launch/FW-Debug.launch rename to .launch/FW-VP HW Debug preloaded.launch index e9e2a41..26cf7ff 100644 --- a/.launch/FW-Debug.launch +++ b/.launch/FW-VP HW Debug preloaded.launch @@ -4,10 +4,10 @@ - + - + diff --git a/.launch/TGC-VP interp hello (Firmware).launch b/.launch/TGC-VP interp hello (Firmware).launch new file mode 100644 index 0000000..5b24109 --- /dev/null +++ b/.launch/TGC-VP interp hello (Firmware).launch @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.launch/TGC-VP interp hello cycle-estimate slow (Firmware).launch b/.launch/TGC-VP interp hello cycle-estimate slow (Firmware).launch new file mode 100644 index 0000000..70acb63 --- /dev/null +++ b/.launch/TGC-VP interp hello cycle-estimate slow (Firmware).launch @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.launch/TGC-VP-FW-Debug.launch b/.launch/TGC-VP-FW-Debug prebuild FW.launch similarity index 98% rename from .launch/TGC-VP-FW-Debug.launch rename to .launch/TGC-VP-FW-Debug prebuild FW.launch index 3a50df7..e268ecc 100644 --- a/.launch/TGC-VP-FW-Debug.launch +++ b/.launch/TGC-VP-FW-Debug prebuild FW.launch @@ -36,7 +36,7 @@ - + diff --git a/.launch/TGC-VP-FW-Debug (Firmware).launch b/.launch/TGC-VP-FW-Debug (Firmware).launch new file mode 100644 index 0000000..0491413 --- /dev/null +++ b/.launch/TGC-VP-FW-Debug (Firmware).launch @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.launch/TGC-VP-GDBServer (Firmware).launch b/.launch/TGC-VP-GDBServer (Firmware).launch new file mode 100644 index 0000000..a2f6b1e --- /dev/null +++ b/.launch/TGC-VP-GDBServer (Firmware).launch @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.launch/TGC-VP-GDBServer.launch b/.launch/TGC-VP-GDBServer prebuilt FW.launch similarity index 100% rename from .launch/TGC-VP-GDBServer.launch rename to .launch/TGC-VP-GDBServer prebuilt FW.launch diff --git a/.launch/TGC-VP-GDBServer wo FW.launch b/.launch/TGC-VP-GDBServer wo FW.launch new file mode 100644 index 0000000..238caa3 --- /dev/null +++ b/.launch/TGC-VP-GDBServer wo FW.launch @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CMakeLists.txt b/CMakeLists.txt index a0bfce7..b53f6a6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -104,7 +104,7 @@ if(NOT USE_CWR_SYSTEMC AND NOT USE_NCSC_SYSTEMC AND NOT DEFINED ENV{SYSTEMC_HOME endif() conan_check() -conan_add_remote(NAME minres URL https://git.minres.com/api/packages/Tooling/conan) +#conan_add_remote(NAME minres URL https://git.minres.com/api/packages/Tooling/conan) # Boost on CentOS 7 quirks: the b2 of conan-center is build against a newer libstdc++ and therefore does not run # with the oooooold libs on CentOS 7. Therefore we build our own version of b2 if it is not there execute_process(COMMAND bash -c "conan search -r all b2 | tail -1" OUTPUT_VARIABLE B2_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE) @@ -136,7 +136,7 @@ set(Boost_NO_BOOST_CMAKE ON) # Don't do a find_package in config mode before se find_package(Boost REQUIRED COMPONENTS program_options QUIET) include(SystemCPackage) -set(CLANG_FORMAT_EXCLUDE_PATTERNS "scc") +set(CLANG_FORMAT_EXCLUDE_PATTERNS scc build) find_package(ClangFormat) if(ENABLE_COVERAGE) diff --git a/scc b/scc index bc96b96..44bca92 160000 --- a/scc +++ b/scc @@ -1 +1 @@ -Subproject commit bc96b96ef2b155fe217b7574bf8f091843d7ae3d +Subproject commit 44bca92871512982c7ea389954f78ce8292182a8 diff --git a/src/CLIParser.cpp b/src/CLIParser.cpp index b686d11..367d33c 100644 --- a/src/CLIParser.cpp +++ b/src/CLIParser.cpp @@ -5,7 +5,6 @@ */ #include "CLIParser.h" -#include #include #include #include @@ -20,31 +19,34 @@ using namespace sc_core; namespace { std::unordered_set backend_opts = {"interp", "tcc", "llvm", "asmjit"}; } -CLIParser::CLIParser(int argc, char *argv[]) +CLIParser::CLIParser(int argc, char* argv[]) : desc("Options") , valid(false) { build(); try { po::store(po::parse_command_line(argc, argv, desc), vm_); // can throw // --help option - if (vm_.count("help")) { + if(vm_.count("help")) { std::cout << "DBT-RISE-TGC based virtual platform of TGC cores" << std::endl << desc << std::endl; } po::notify(vm_); // throws on error, so do after help in case there are any problems valid = true; - if(backend_opts.find(vm_["backend"].as())== std::end(backend_opts)) + if(backend_opts.find(vm_["backend"].as()) == std::end(backend_opts)) throw po::error("Illegal value for switch backend"); - } catch (po::error &e) { + } catch(po::error& e) { std::cerr << "ERROR: " << e.what() << std::endl << std::endl; std::cerr << desc << std::endl; exit(-1); } auto log_level = vm_["verbose"].as(); auto log_level_num = static_cast(log_level); - LOGGER(DEFAULT)::reporting_level() = logging::as_log_level(log_level_num > 6 ? 6 : log_level_num);; + LOGGER(DEFAULT)::reporting_level() = logging::as_log_level(log_level_num > 6 ? 6 : log_level_num); + ; LOGGER(DEFAULT)::print_time() = false; LOG_OUTPUT(DEFAULT)::ostream() = &std::cout; - LOGGER(connection)::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(connection)::print_time() = false; LOG_OUTPUT(connection)::ostream() = &std::cout; /////////////////////////////////////////////////////////////////////////// @@ -57,7 +59,8 @@ CLIParser::CLIParser(int argc, char *argv[]) .logAsync(!vm_["log-sync"].as())); 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() { diff --git a/src/CLIParser.h b/src/CLIParser.h index 858d75f..d94e2fb 100644 --- a/src/CLIParser.h +++ b/src/CLIParser.h @@ -8,22 +8,22 @@ #define PLATFORM_SRC_CLIPARSER_H_ #include -#include #include +#include class CLIParser { public: - CLIParser(int argc, char *argv[]); + CLIParser(int argc, char* argv[]); virtual ~CLIParser(); bool is_valid() { return valid; } - const boost::program_options::variables_map &vm() { return vm_; } + const boost::program_options::variables_map& vm() { return vm_; } - bool is_set(const char *option) { return vm_.count(option) != 0; } + bool is_set(const char* option) { return vm_.count(option) != 0; } - template const T &get(const char *option) { return vm_[option].as(); } + template const T& get(const char* option) { return vm_[option].as(); } private: void build(); diff --git a/src/sc_main.cpp b/src/sc_main.cpp index 78d9fbd..cd17b19 100644 --- a/src/sc_main.cpp +++ b/src/sc_main.cpp @@ -10,19 +10,19 @@ #include #include #include +#include #include #include #include -#include #ifdef WITH_LLVM #include #endif #include -#include -#include #include +#include #include +#include #ifdef ERROR #undef ERROR #endif @@ -38,7 +38,7 @@ const size_t ERRORR_IN_COMMAND_LINE = 1; const size_t SUCCESS = 0; } // namespace -int sc_main(int argc, char *argv[]) { +int sc_main(int argc, char* argv[]) { /////////////////////////////////////////////////////////////////////////// // SystemC >=2.2 got picky about multiple drivers so disable check /////////////////////////////////////////////////////////////////////////// @@ -47,7 +47,8 @@ int sc_main(int argc, char *argv[]) { // CLI argument parsing & logging setup /////////////////////////////////////////////////////////////////////////// CLIParser parser(argc, argv); - if (!parser.is_valid()) return ERRORR_IN_COMMAND_LINE; + if(!parser.is_valid()) + return ERRORR_IN_COMMAND_LINE; scc::stream_redirection cout_redir(std::cout, scc::log::INFO); scc::stream_redirection cerr_redir(std::cerr, scc::log::ERROR); /////////////////////////////////////////////////////////////////////////// @@ -69,14 +70,16 @@ int sc_main(int argc, char *argv[]) { /////////////////////////////////////////////////////////////////////////// std::unique_ptr tracer; - if( auto trace_level = parser.get("trace-level")) { + if(auto trace_level = parser.get("trace-level")) { auto file_name = parser.get("trace-file"); - auto enable_sig_trace = (trace_level&0x1) != 0;// bit0 enables sig trace - auto tx_trace_type = static_cast(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(trace_level >> 1); // bit3-bit1 define the kind of transaction trace auto trace_default_on = parser.is_set("trace-default-on"); 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, tx_trace_type, enable_sig_trace, trace_default_on); + tracer = + scc::make_unique(file_name, tx_trace_type, enable_sig_trace, trace_default_on); } /////////////////////////////////////////////////////////////////////////// // instantiate top level @@ -85,18 +88,21 @@ int sc_main(int argc, char *argv[]) { /////////////////////////////////////////////////////////////////////////// // add non-implemented 'enableTracing' properties /////////////////////////////////////////////////////////////////////////// - if(tracer) tracer->add_control(); + if(tracer) + tracer->add_control(); /////////////////////////////////////////////////////////////////////////// // dump configuration if requested /////////////////////////////////////////////////////////////////////////// - if (parser.get("dump-config").size() > 0) { + if(parser.get("dump-config").size() > 0) { std::ofstream of{parser.get("dump-config")}; - if (of.is_open()) cfg.dump_configuration(of, true); + if(of.is_open()) + cfg.dump_configuration(of, true); } cfg.configure(); std::unique_ptr dumper; if(parser.is_set("dump-structure")) - dumper.reset(new scc::hierarchy_dumper(parser.get("dump-structure"), scc::hierarchy_dumper::D3JSON)); + dumper.reset( + new scc::hierarchy_dumper(parser.get("dump-structure"), scc::hierarchy_dumper::D3JSON)); /////////////////////////////////////////////////////////////////////////// // overwrite config with command line settings /////////////////////////////////////////////////////////////////////////// @@ -104,23 +110,25 @@ int sc_main(int argc, char *argv[]) { cfg.set_value(core_path + ".dump_ir", parser.is_set("dump-ir")); cfg.set_value(core_path + ".backend", parser.get("backend")); cfg.set_value(core_path + ".core_type", parser.get("isa")); - if(parser.is_set("plugin")){ - auto plugins = util::join(parser.get>("plugin"),","); + if(parser.is_set("plugin")) { + auto plugins = util::join(parser.get>("plugin"), ","); cfg.set_value(core_path + ".plugins", plugins); } - if (parser.is_set("elf")) cfg.set_value(core_path + ".elf_file", parser.get("elf")); - if (parser.is_set("quantum")) + if(parser.is_set("elf")) + cfg.set_value(core_path + ".elf_file", parser.get("elf")); + if(parser.is_set("quantum")) tlm::tlm_global_quantum::instance().set(sc_core::sc_time(parser.get("quantum"), sc_core::SC_NS)); - if (parser.is_set("reset")) { + if(parser.is_set("reset")) { auto str = parser.get("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")) { + if(parser.is_set("disass")) { cfg.set_value(core_path + ".enable_disass", true); LOGGER(disass)::reporting_level() = logging::INFO; auto file_name = parser.get("disass"); - if (file_name.length() > 0) { + if(file_name.length() > 0) { LOG_OUTPUT(disass)::stream() = fopen(file_name.c_str(), "w"); LOGGER(disass)::print_time() = false; LOGGER(disass)::print_severity() = false; @@ -130,12 +138,13 @@ int sc_main(int argc, char *argv[]) { // run simulation /////////////////////////////////////////////////////////////////////////// try { - if (parser.is_set("max_time")) { + if(parser.is_set("max_time")) { 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()) sc_core::sc_stop(); - } catch (sc_core::sc_report &rep) { + if(!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); } return 0; diff --git a/src/tgc_vp/gen/PipelinedMemoryBusToApbBridge.h b/src/tgc_vp/gen/PipelinedMemoryBusToApbBridge.h index b0765a5..7b8407b 100644 --- a/src/tgc_vp/gen/PipelinedMemoryBusToApbBridge.h +++ b/src/tgc_vp/gen/PipelinedMemoryBusToApbBridge.h @@ -1,21 +1,21 @@ /* -* Copyright (c) 2023 - 2024 MINRES Technologies GmbH -* -* SPDX-License-Identifier: Apache-2.0 -* -* Generated at 2024-02-08 14:41:56 UTC -* by peakrdl_mnrs version 1.2.2 -*/ + * Copyright (c) 2023 - 2024 MINRES Technologies GmbH + * + * SPDX-License-Identifier: Apache-2.0 + * + * Generated at 2024-02-08 14:41:56 UTC + * by peakrdl_mnrs version 1.2.2 + */ #pragma once -// need double braces, see https://stackoverflow.com/questions/6893700/how-to-construct-stdarray-object-with-initializer-list#6894191 -const std::array, 7> PipelinedMemoryBusToApbBridge_map = {{ - { gpio0.socket, 0x0, 0xc }, - { uart0.socket, 0x1000, 0x14 }, - { timer0.socket, 0x20000, 0x1c }, - { aclint.socket, 0x30000, 0xc000 }, - { irq_ctrl.socket, 0x40000, 0x8 }, - { qspi.socket, 0x50000, 0x5c }, - { boot_rom.target, 0x80000, 0x5c } - }} ; +// need double braces, see +// https://stackoverflow.com/questions/6893700/how-to-construct-stdarray-object-with-initializer-list#6894191 +const std::array, 7> PipelinedMemoryBusToApbBridge_map = { + {{gpio0.socket, 0x0, 0xc}, + {uart0.socket, 0x1000, 0x14}, + {timer0.socket, 0x20000, 0x1c}, + {aclint.socket, 0x30000, 0xc000}, + {irq_ctrl.socket, 0x40000, 0x8}, + {qspi.socket, 0x50000, 0x5c}, + {boot_rom.target, 0x80000, 0x5c}}}; diff --git a/src/tgc_vp/rst_gen.h b/src/tgc_vp/rst_gen.h index 63b9bed..020c69a 100644 --- a/src/tgc_vp/rst_gen.h +++ b/src/tgc_vp/rst_gen.h @@ -11,13 +11,13 @@ namespace tgc_vp { class rst_gen : public sc_core::sc_module { SC_HAS_PROCESS(rst_gen); + public: - rst_gen(sc_core::sc_module_name const& nm) { - SC_THREAD(run); - } + rst_gen(sc_core::sc_module_name const& nm) { SC_THREAD(run); } sc_core::sc_out rst_n{"rst_n"}; + private: - void run(){ + void run() { rst_n.write(false); wait(100_ns); rst_n.write(true); diff --git a/src/tgc_vp/system.cpp b/src/tgc_vp/system.cpp index 280362d..126261b 100644 --- a/src/tgc_vp/system.cpp +++ b/src/tgc_vp/system.cpp @@ -17,7 +17,7 @@ using namespace sysc::tgfs; system::system(sc_core::sc_module_name nm) : sc_core::sc_module(nm) , NAMED(ahb_router, 3, 2) -, NAMED(apbBridge, PipelinedMemoryBusToApbBridge_map.size(), 1){ +, NAMED(apbBridge, PipelinedMemoryBusToApbBridge_map.size(), 1) { core_complex.ibus(ahb_router.target[0]); core_complex.dbus(ahb_router.target[1]); @@ -29,7 +29,7 @@ system::system(sc_core::sc_module_name nm) ahb_router.set_target_range(2, 0xF0000000, 256_MB); size_t i = 0; - for (const auto &e : PipelinedMemoryBusToApbBridge_map) { + for(const auto& e : PipelinedMemoryBusToApbBridge_map) { apbBridge.initiator.at(i)(e.target); apbBridge.set_target_range(i, e.start, e.size); i++; @@ -86,9 +86,6 @@ system::system(sc_core::sc_module_name nm) SC_METHOD(gen_reset); sensitive << erst_n; } -void system::gen_reset(){ - rst_s = !erst_n.read(); -} +void system::gen_reset() { rst_s = !erst_n.read(); } - -} /* namespace sysc */ +} // namespace tgc_vp diff --git a/src/tgc_vp/system.h b/src/tgc_vp/system.h index 1a21f0b..e4ff3d2 100644 --- a/src/tgc_vp/system.h +++ b/src/tgc_vp/system.h @@ -9,42 +9,42 @@ #include "minres/irq.h" #include "minres/timer.h" +#include +#include +#include #include #include #include -#include -#include -#include #include -#include #include #include #include +#include +#include +#include +#include #include #include #include -#include -#include -#include namespace tgc_vp { class system : public sc_core::sc_module { public: - SC_HAS_PROCESS(system);// NOLINT + SC_HAS_PROCESS(system); // NOLINT - sc_core::sc_vector> pins_o{"pins_o",32}; + sc_core::sc_vector> pins_o{"pins_o", 32}; sc_core::sc_vector> pins_oe_o{"pins_oe_o", 32}; - sc_core::sc_vector> pins_i{"pins_i", 32}; - sc_core::sc_out uart0_tx_o {"uart0_tx_o"}; - sc_core::sc_in uart0_rx_i {"uart0_rx_i"}; - sc_core::sc_vector> t0_clear_i {"t0_clear_i", vpvper::minres::timer::CLEAR_CNT}; - sc_core::sc_vector> t0_tick_i {"t0_tick_i", vpvper::minres::timer::TICK_CNT-1}; + sc_core::sc_vector> pins_i{"pins_i", 32}; + sc_core::sc_out uart0_tx_o{"uart0_tx_o"}; + sc_core::sc_in uart0_rx_i{"uart0_rx_i"}; + sc_core::sc_vector> t0_clear_i{"t0_clear_i", vpvper::minres::timer::CLEAR_CNT}; + sc_core::sc_vector> t0_tick_i{"t0_tick_i", vpvper::minres::timer::TICK_CNT - 1}; sc_core::sc_out ssclk_o{"ssclk_o"}; sc_core::sc_vector> dq_o{"dq_o", 4}; sc_core::sc_vector> dq_oe_o{"dq_oe_o", 4}; sc_core::sc_vector> dq_i{"dq_i", 4}; - + sc_core::sc_in clk_i{"clk_i"}; sc_core::sc_in erst_n{"erst_n"}; @@ -62,17 +62,19 @@ private: vpvper::minres::qspi_tl qspi{"qspi"}; scc::memory<1_kB, scc::LT> boot_rom{"boot_rom"}; - scc::memory<32_kB, scc::LT> main_ram {"main_ram"}; - - sc_core::sc_signal rst_s{"rst_s"}, mtime_int_s{"mtime_int_s"}, msip_int_s{"msip_int_s"}; - - sc_core::sc_vector> irq_int_s{"irq_int_s", 32}, local_int_s{"local_int_s", 16}; + scc::memory<32_kB, scc::LT> main_ram{"main_ram"}; + + sc_core::sc_signal rst_s{"rst_s"}, mtime_int_s{"mtime_int_s"}, + msip_int_s{"msip_int_s"}; + + sc_core::sc_vector> irq_int_s{"irq_int_s", 32}, + local_int_s{"local_int_s", 16}; sc_core::sc_signal core_int_s{"core_int_s"}; - + void gen_reset(); #include "tgc_vp/gen/PipelinedMemoryBusToApbBridge.h" }; -} /* namespace sysc */ +} // namespace tgc_vp #endif /* _PLATFORM_H_ */ diff --git a/src/tgc_vp/tb.cpp b/src/tgc_vp/tb.cpp index 408c147..2fa2747 100644 --- a/src/tgc_vp/tb.cpp +++ b/src/tgc_vp/tb.cpp @@ -9,7 +9,8 @@ namespace tgc_vp { SC_HAS_PROCESS(tb); -tb::tb(const sc_core::sc_module_name &nm): sc_core::sc_module(nm) { +tb::tb(const sc_core::sc_module_name& nm) +: sc_core::sc_module(nm) { top.erst_n(rst_n); rst_gen.rst_n(rst_n); top.pins_o(pins_o); @@ -26,4 +27,4 @@ tb::tb(const sc_core::sc_module_name &nm): sc_core::sc_module(nm) { top.clk_i(clk_i); clk_i = 10_ns; } -} +} // namespace tgc_vp diff --git a/src/tgc_vp/tb.h b/src/tgc_vp/tb.h index 7bb2335..66664ea 100644 --- a/src/tgc_vp/tb.h +++ b/src/tgc_vp/tb.h @@ -20,13 +20,13 @@ public: tgc_vp::system top{"top"}; tgc_vp::rst_gen rst_gen{"rst_gen"}; sc_core::sc_signal rst_n{"rst_n"}; - sc_core::sc_vector> pins_o{"pins_o",32}; + sc_core::sc_vector> pins_o{"pins_o", 32}; sc_core::sc_vector> pins_oe_o{"pins_oe_o", 32}; - sc_core::sc_vector> pins_i{"pins_i", 32}; - sc_core::sc_signal uart0_tx_o {"uart0_tx_o"}; - sc_core::sc_signal uart0_rx_i {"uart0_rx_i"}; - sc_core::sc_vector> t0_clear_i {"t0_clear_i", vpvper::minres::timer::CLEAR_CNT}; - sc_core::sc_vector> t0_tick_i {"t0_tick_i", vpvper::minres::timer::TICK_CNT-1}; + sc_core::sc_vector> pins_i{"pins_i", 32}; + sc_core::sc_signal uart0_tx_o{"uart0_tx_o"}; + sc_core::sc_signal uart0_rx_i{"uart0_rx_i"}; + sc_core::sc_vector> t0_clear_i{"t0_clear_i", vpvper::minres::timer::CLEAR_CNT}; + sc_core::sc_vector> t0_tick_i{"t0_tick_i", vpvper::minres::timer::TICK_CNT - 1}; sc_core::sc_signal ssclk_o{"ssclk_o"}; sc_core::sc_vector> dq_o{"dq_o", 4}; sc_core::sc_vector> dq_oe_o{"dq_oe_o", 4}; diff --git a/tgc-iss/dbt-rise-core b/tgc-iss/dbt-rise-core index f1beb88..7c446a3 160000 --- a/tgc-iss/dbt-rise-core +++ b/tgc-iss/dbt-rise-core @@ -1 +1 @@ -Subproject commit f1beb88a6158a7ab20b8cc539d042103200b2f42 +Subproject commit 7c446a3dc656482f2e91eb990c47df2ab666ea4b diff --git a/tgc-iss/dbt-rise-tgc b/tgc-iss/dbt-rise-tgc index 0996d15..9de0aed 160000 --- a/tgc-iss/dbt-rise-tgc +++ b/tgc-iss/dbt-rise-tgc @@ -1 +1 @@ -Subproject commit 0996d15bd406d3a73f4860d57b9d468444043843 +Subproject commit 9de0aed84da0c96077ad363327209ed284985ae9 diff --git a/vpvper b/vpvper index 021f845..99f8c5d 160000 --- a/vpvper +++ b/vpvper @@ -1 +1 @@ -Subproject commit 021f845cfe32fdd0cbb44d9d2c68d2bb334cccf9 +Subproject commit 99f8c5dd4a9e523998f3247cfb6c756ee660e3d1