From 6e751ac2b4de961fdaef8d5f39c8f1582710c592 Mon Sep 17 00:00:00 2001 From: Eyck Jentzsch Date: Sat, 11 Jan 2020 09:07:02 +0000 Subject: [PATCH 1/3] =?UTF-8?q?=E2=80=9EREADME.md=E2=80=9C=20=C3=A4ndern?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index f8ce066..fb93915 100644 --- a/README.md +++ b/README.md @@ -39,9 +39,9 @@ compiler.libcxx=libstdc++11 ``` in $HOME/.conan/profiles/default -** Detailed Setup steps** +**Detailed Setup steps** -*** prepare Ubuntu 18.04 *** +***prepare Ubuntu 18.04*** ``` sudo apt-get install -y git python-pip build-essential cmake libloki-dev zlib1g-dev libncurses5-dev \ @@ -49,7 +49,7 @@ in $HOME/.conan/profiles/default pip install --user conan ``` -*** prepare Fedora 28 *** +***prepare Fedora 28*** ``` #prepare system @@ -59,7 +59,7 @@ in $HOME/.conan/profiles/default export PATH=${PATH}:$HOME/.local/bin ``` -*** Build the ISS *** +***Build the ISS*** ``` # configure conan @@ -67,9 +67,10 @@ in $HOME/.conan/profiles/default conan remote add bincrafters https://api.bintray.com/conan/bincrafters/public-conan conan profile new default --detect # clone and build DBT-RISE-RISCV - git clone --recursive https://github.com/Minres/DBT-RISE-RISCV.git - cd DBT-RISE-RISCV/ + git clone --recursive https://git.minres.com/VP/RISCV-VP.git + cd RISCV-VP/ git checkout develop + git submodule update --recursive mkdir build;cd build MAKE_FLAGS="-j4" cmake .. make -j4 From f928ad5814258479ab32157f5fc2e27f568d968f Mon Sep 17 00:00:00 2001 From: Eyck Jentzsch Date: Mon, 30 Mar 2020 19:41:35 +0000 Subject: [PATCH 2/3] =?UTF-8?q?=E2=80=9EREADME.md=E2=80=9C=20=C3=A4ndern?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index fb93915..b3e9614 100644 --- a/README.md +++ b/README.md @@ -16,16 +16,21 @@ RISCV-VP uses libGIS (https://github.com/vsergeev/libGIS) as well as ELFIO (http * you need to have a C++11 capable compiler (e.g. gcc >= 4.8), make, python, and cmake installed * install LLVM >= 4.0 according to http://apt.llvm.org/ (if it is not already provided by your distribution e.g by Ubuntu 18.04) * install conan.io (see also http://docs.conan.io/en/latest/installation.html): + ``` pip install conan ``` + * setup conan to use the minres repo: + ``` conan remote add minres https://api.bintray.com/conan/minres/conan-repo conan remote add bincrafters https://api.bintray.com/conan/bincrafters/public-conan ``` + * checkout source from git * start an out-of-source build: + ``` cd RISCV-VP mkdir build @@ -33,10 +38,13 @@ RISCV-VP uses libGIS (https://github.com/vsergeev/libGIS) as well as ELFIO (http cmake .. cmake --build . ``` + * if you encounter issues when linking wrt. c++11 symbols you might have run into GCC ABI incompatibility introduced from GCC 5.0 onwards. You can fix this by adding '-s compiler.libcxx=libstdc++11' to the conan call or changing compiler.libcxx to + ``` compiler.libcxx=libstdc++11 ``` + in $HOME/.conan/profiles/default **Detailed Setup steps** From 6ee0cd1b291117fae3d293507e9cb0ae6888f11b Mon Sep 17 00:00:00 2001 From: eyck Date: Thu, 18 Jun 2020 06:20:04 +0200 Subject: [PATCH 3/3] update submodule pointers --- dbt-core | 2 +- platform/src/CLIParser.cpp | 44 ++++++++++++++++++---------------- platform/src/sc_main.cpp | 4 ---- platform/src/sysc/clint.cpp | 4 ++-- platform/src/sysc/gpio.cpp | 2 +- platform/src/sysc/mcp_adc.cpp | 4 ++-- platform/src/sysc/plic.cpp | 8 +++---- platform/src/sysc/terminal.cpp | 4 ++-- riscv | 2 +- scc | 2 +- 10 files changed, 37 insertions(+), 39 deletions(-) diff --git a/dbt-core b/dbt-core index 3caaa87..715ffe5 160000 --- a/dbt-core +++ b/dbt-core @@ -1 +1 @@ -Subproject commit 3caaa873be50218c1669b359cc672e685d09183c +Subproject commit 715ffe5e74ee3e5ddfa214fba866d650d440f524 diff --git a/platform/src/CLIParser.cpp b/platform/src/CLIParser.cpp index 0d90798..4508c0f 100644 --- a/platform/src/CLIParser.cpp +++ b/platform/src/CLIParser.cpp @@ -75,25 +75,26 @@ CLIParser::CLIParser(int argc, char *argv[]) std::cerr << "ERROR: " << e.what() << std::endl << std::endl; std::cerr << desc << std::endl; } - auto log_level = vm_["verbose"].as(); - auto verbosity = !vm_["Verbose"].defaulted()?vm_["Verbose"].as():vm_["verbose"].as(); - auto colored_output = vm_["Verbose"].defaulted(); - auto dbg_level = std::min(logging::DBGTRACE, verbosity); - auto l = logging::as_log_level(log_level > 6 ? 6 : log_level); + auto verbosity = !vm_["Verbose"].defaulted() ? vm_["Verbose"].as() : vm_["verbose"].as(); + auto colored_output = vm_["Verbose"].defaulted(); + auto dbg_level = vm_.count("debug-level") + ? vm_["debug-level"].as() + : static_cast(std::min(static_cast(scc::log::DBGTRACE), verbosity)); + auto log_regex = vm_["log-filter"].as(); if (vm_.count("log-file")) { auto log_file_name = vm_["log-file"].as(); scc::init_logging(scc::LogConfig() .logFileName(log_file_name) - .logLevel(static_cast(dbg_level)) + .logLevel(static_cast(dbg_level)) .logFilterRegex(log_regex) .coloredOutput(colored_output) ); } else { scc::init_logging(scc::LogConfig() - .logLevel(static_cast(dbg_level)) + .logLevel(static_cast(dbg_level)) .logFilterRegex(log_regex) .coloredOutput(colored_output) ); @@ -104,21 +105,22 @@ void CLIParser::build() { // clang-format off desc.add_options() ("help,h", "Print help message") - ("verbose,v", po::value()->implicit_value(3), "Sets logging verbosity") - ("Verbose,V", po::value()->default_value(logging::INFO), "Debug output level as with --verbose but print non-colored") - ("log-file", po::value(), "Sets default log file.") - ("log-filter", po::value()->default_value(""), "log filter regular expression name") - ("disass,d", po::value()->implicit_value(""), "Enables disassembly") - ("elf,l", po::value(), "ELF file to load") - ("gdb-port,g", po::value()->default_value(0), "enable gdb server and specify port to use") - ("dump-ir", "dump the intermediate representation") - ("quantum", po::value(), "SystemC quantum time in ns") - ("reset,r", po::value(), "reset address") - ("trace-level,t", po::value()->default_value(0), "enable tracing, or combination of 1=signals and 2=TX text, 4=TX compressed text, 6=TX in SQLite") + ("verbose,v", po::value()->implicit_value(3), "Sets logging verbosity") + ("Verbose,V", po::value()->default_value(logging::INFO), "Debug output level as with --verbose but print non-colored") + ("debug-level,D", po::value(), "Debug output level (textual) as with --verbose") + ("log-file", po::value(), "Sets default log file.") + ("log-filter", po::value()->default_value(""), "log filter regular expression name") + ("disass,d", po::value()->implicit_value(""), "Enables disassembly") + ("elf,l", po::value(), "ELF file to load") + ("gdb-port,g", po::value()->default_value(0), "enable gdb server and specify port to use") + ("ir-dump", "dump the intermediate representation") + ("quantum", po::value(), "SystemC quantum time in ns") + ("reset,r", po::value(), "reset address") + ("trace-level,t", po::value()->default_value(0), "enable tracing, or combination of 1=signals and 2=TX text, 4=TX compressed text, 6=TX in SQLite") ("trace-default-on", "enables tracing for all unspecified modules") - ("trace-file", po::value()->default_value("system"), "set th ename of the trace file") - ("max_time,m", po::value(), "maximum time to run") - ("config-file,c", po::value()->default_value(""), "read configuration from file") + ("trace-file", po::value()->default_value("system"), "set th ename of the trace file") + ("max_time,m", po::value(), "maximum time to run") + ("config-file,c", po::value()->default_value(""), "read configuration from file") ("dump-config,dc", po::value()->default_value(""), "dump configuration to file file"); // clang-format on } diff --git a/platform/src/sc_main.cpp b/platform/src/sc_main.cpp index f278883..600be7f 100644 --- a/platform/src/sc_main.cpp +++ b/platform/src/sc_main.cpp @@ -65,10 +65,6 @@ int sc_main(int argc, char *argv[]) { /////////////////////////////////////////////////////////////////////////// sc_report_handler::set_actions(SC_ID_MORE_THAN_ONE_SIGNAL_DRIVER_, SC_DO_NOTHING); /////////////////////////////////////////////////////////////////////////// - // create global CCI broker - /////////////////////////////////////////////////////////////////////////// - cci::cci_register_broker(new cci_utils::broker("Global Broker")); - /////////////////////////////////////////////////////////////////////////// // CLI argument parsing & logging setup /////////////////////////////////////////////////////////////////////////// CLIParser parser(argc, argv); diff --git a/platform/src/sysc/clint.cpp b/platform/src/sysc/clint.cpp index 51f34c3..2b92a10 100644 --- a/platform/src/sysc/clint.cpp +++ b/platform/src/sysc/clint.cpp @@ -117,11 +117,11 @@ void clint::update_mtime(bool force) { if (regs->r_mtimecmp > regs->r_mtime && clk > sc_core::SC_ZERO_TIME) { sc_core::sc_time next_trigger = (clk * lfclk_mutiplier) * (regs->r_mtimecmp - regs->r_mtime) - cnt_fraction * clk; - SCTRACE() << "Timer fires at " << sc_time_stamp() + next_trigger; + SCCTRACE() << "Timer fires at " << sc_time_stamp() + next_trigger; mtime_evt.notify(next_trigger); mtime_int_o.write(false); } else { - SCTRACE() << "Timer fired at " << sc_time_stamp(); + SCCTRACE() << "Timer fired at " << sc_time_stamp(); mtime_int_o.write(true); } } diff --git a/platform/src/sysc/gpio.cpp b/platform/src/sysc/gpio.cpp index 8c4f315..c75223b 100644 --- a/platform/src/sysc/gpio.cpp +++ b/platform/src/sysc/gpio.cpp @@ -111,7 +111,7 @@ gpio::~gpio() = default; void gpio::before_end_of_elaboration() { if (write_to_ws.get_value()) { - SCTRACE() << "Adding WS handler for " << (std::string{"/ws/"} + name()); + SCCTRACE() << "Adding WS handler for " << (std::string{"/ws/"} + name()); handler = std::make_shared(); sc_comm_singleton::inst().registerWebSocketHandler((std::string{"/ws/"} + name()).c_str(), handler); } diff --git a/platform/src/sysc/mcp_adc.cpp b/platform/src/sysc/mcp_adc.cpp index f21dad2..2b05fa8 100644 --- a/platform/src/sysc/mcp_adc.cpp +++ b/platform/src/sysc/mcp_adc.cpp @@ -86,7 +86,7 @@ void mcp_3008::do_conversion() { auto inp = ch_i[channel].read(); auto norm = 1024.0 * inp / vref; auto res = static_cast(norm); - SCDEBUG(this->name()) << "Converting " << inp << " to " << norm << " as int " << res; + SCCDEBUG(this->name()) << "Converting " << inp << " to " << norm << " as int " << res; tx_bytes[1] = bit_sub<8, 2>(res); tx_bytes[2] = bit_sub<0, 8>(res); } else { @@ -176,7 +176,7 @@ void mcp_3208::do_conversion() { auto inp = ch_i[channel].read(); auto norm = 4096.0 * inp / vref; auto res = static_cast(norm); - SCDEBUG(this->name()) << "Converting channel " << channel << " " << inp << "V to " << norm << " as int " + SCCDEBUG(this->name()) << "Converting channel " << channel << " " << inp << "V to " << norm << " as int " << res; tx_bytes[1] = bit_sub<8, 4>(res); tx_bytes[2] = bit_sub<0, 8>(res); diff --git a/platform/src/sysc/plic.cpp b/platform/src/sysc/plic.cpp index f912e1e..d96ab4c 100644 --- a/platform/src/sysc/plic.cpp +++ b/platform/src/sysc/plic.cpp @@ -111,7 +111,7 @@ void plic::global_int_port_cb() { if (enable && global_interrupts_i[i].read() == 1) { regs->r_pending[reg_idx] = regs->r_pending[reg_idx] | (0x1 << bit_ofs); handle_pending = true; - SCDEBUG(this->name()) << "pending interrupt identified: " << i; + SCCDEBUG(this->name()) << "pending interrupt identified: " << i; } } @@ -138,7 +138,7 @@ void plic::handle_pending_int() { claim_prio = prio; claim_int = i; raise_int = true; - SCDEBUG(this->name()) << "pending interrupt activated: " << i; + SCCDEBUG(this->name()) << "pending interrupt activated: " << i; } } } @@ -149,14 +149,14 @@ void plic::handle_pending_int() { // todo: evluate clock period } else { regs->r_claim_complete = 0; - SCDEBUG(this->name()) << "no further pending interrupt."; + SCCDEBUG(this->name()) << "no further pending interrupt."; } } void plic::reset_pending_int(uint32_t irq) { // todo: evaluate enable register (see spec) // todo: make sure that pending is set, otherwise don't reset irq ... read spec. - SCTRACE(this->name()) << "reset pending interrupt: " << irq; + SCCTRACE(this->name()) << "reset pending interrupt: " << irq; // reset related pending bit auto reg_idx = irq >> 5; auto bit_ofs = irq & 0x1F; diff --git a/platform/src/sysc/terminal.cpp b/platform/src/sysc/terminal.cpp index 4003684..c46e9b6 100644 --- a/platform/src/sysc/terminal.cpp +++ b/platform/src/sysc/terminal.cpp @@ -57,7 +57,7 @@ terminal::~terminal() = default; void terminal::before_end_of_elaboration() { if (write_to_ws.get_value()) { - SCTRACE() << "Adding WS handler for " << (std::string{"/ws/"} + name()); + SCCTRACE() << "Adding WS handler for " << (std::string{"/ws/"} + name()); handler = std::make_shared(); sc_comm_singleton::inst().registerWebSocketHandler((std::string{"/ws/"} + name()).c_str(), handler); } @@ -80,7 +80,7 @@ void terminal::receive(tlm::tlm_signal_gp &gp, sc_core::sc_time this->handler->send(os.str()); }); else - SCINFO(this->name()) << " receive: '" << msg << "'"; + SCCINFO(this->name()) << " receive: '" << msg << "'"; queue.clear(); } } diff --git a/riscv b/riscv index abcfb75..edeff7a 160000 --- a/riscv +++ b/riscv @@ -1 +1 @@ -Subproject commit abcfb7501148c6b9892c18ba651e7293342208f7 +Subproject commit edeff7add807ab0e524b5d05b16defe58be2a867 diff --git a/scc b/scc index d3d7c9f..0145853 160000 --- a/scc +++ b/scc @@ -1 +1 @@ -Subproject commit d3d7c9f590ea422ad8d47486fb1efcaeef208cce +Subproject commit 01458535fa10e3bd5794d50df82ce94f214bfbe1