diff --git a/examples/simple_system/gen/e300_plat_t.h b/examples/simple_system/gen/e300_plat_t.h index 29e0548..6531c21 100644 --- a/examples/simple_system/gen/e300_plat_t.h +++ b/examples/simple_system/gen/e300_plat_t.h @@ -17,7 +17,7 @@ #define _E300_PLAT_MAP_H_ // need double braces, see // https://stackoverflow.com/questions/6893700/how-to-construct-stdarray-object-with-initializer-list#6894191 -const std::array, 4> e300_plat_map = {{ +const std::array, 4> e300_plat_map = {{ {&i_plic, 0x0c000000, 0x200008}, {&i_gpio, 0x10012000, 0x1000}, {&i_uart, 0x10013000, 0x1000}, diff --git a/examples/simple_system/gen/gpio_regs.h b/examples/simple_system/gen/gpio_regs.h index f91a056..2c5c079 100644 --- a/examples/simple_system/gen/gpio_regs.h +++ b/examples/simple_system/gen/gpio_regs.h @@ -36,14 +36,14 @@ #ifndef _GPIO_REGS_H_ #define _GPIO_REGS_H_ -#include -#include -#include #include +#include "scc/register.h" +#include "scc/tlm_target.h" +#include "scc/utilities.h" namespace sysc { -class gpio_regs : public sc_core::sc_module, public sysc::resetable { +class gpio_regs : public sc_core::sc_module, public scc::resetable { protected: // storage declarations uint32_t r_value; @@ -81,28 +81,28 @@ protected: uint32_t r_out_xor; // register declarations - sysc::sc_register value; - sysc::sc_register input_en; - sysc::sc_register output_en; - sysc::sc_register port; - sysc::sc_register pue; - sysc::sc_register ds; - sysc::sc_register rise_ie; - sysc::sc_register rise_ip; - sysc::sc_register fall_ie; - sysc::sc_register fall_ip; - sysc::sc_register high_ie; - sysc::sc_register high_ip; - sysc::sc_register low_ie; - sysc::sc_register low_ip; - sysc::sc_register iof_en; - sysc::sc_register iof_sel; - sysc::sc_register out_xor; + scc::sc_register value; + scc::sc_register input_en; + scc::sc_register output_en; + scc::sc_register port; + scc::sc_register pue; + scc::sc_register ds; + scc::sc_register rise_ie; + scc::sc_register rise_ip; + scc::sc_register fall_ie; + scc::sc_register fall_ip; + scc::sc_register high_ie; + scc::sc_register high_ip; + scc::sc_register low_ie; + scc::sc_register low_ip; + scc::sc_register iof_en; + scc::sc_register iof_sel; + scc::sc_register out_xor; public: gpio_regs(sc_core::sc_module_name nm); - template void registerResources(sysc::tlm_target &target); + template void registerResources(scc::tlm_target &target); }; } ////////////////////////////////////////////////////////////////////////////// @@ -129,7 +129,7 @@ inline sysc::gpio_regs::gpio_regs(sc_core::sc_module_name nm) , NAMED(iof_sel, r_iof_sel, 0, *this) , NAMED(out_xor, r_out_xor, 0, *this) {} -template inline void sysc::gpio_regs::registerResources(sysc::tlm_target &target) { +template inline void sysc::gpio_regs::registerResources(scc::tlm_target &target) { target.addResource(value, 0x0UL); target.addResource(input_en, 0x4UL); target.addResource(output_en, 0x8UL); diff --git a/examples/simple_system/gen/plic_regs.h b/examples/simple_system/gen/plic_regs.h index d5c21a8..6864328 100644 --- a/examples/simple_system/gen/plic_regs.h +++ b/examples/simple_system/gen/plic_regs.h @@ -36,14 +36,14 @@ #ifndef _PLIC_REGS_H_ #define _PLIC_REGS_H_ -#include -#include -#include #include +#include "scc/register.h" +#include "scc/tlm_target.h" +#include "scc/utilities.h" namespace sysc { -class plic_regs : public sc_core::sc_module, public sysc::resetable { +class plic_regs : public sc_core::sc_module, public scc::resetable { public: // storage declarations BEGIN_BF_DECL(priority_t, uint32_t); @@ -62,15 +62,15 @@ public: uint32_t r_claim_complete; // register declarations - sysc::sc_register_indexed priority; - sysc::sc_register pending; - sysc::sc_register enabled; - sysc::sc_register threshold; - sysc::sc_register claim_complete; + scc::sc_register_indexed priority; + scc::sc_register pending; + scc::sc_register enabled; + scc::sc_register threshold; + scc::sc_register claim_complete; plic_regs(sc_core::sc_module_name nm); - template void registerResources(sysc::tlm_target &target); + template void registerResources(scc::tlm_target &target); }; } ////////////////////////////////////////////////////////////////////////////// @@ -85,7 +85,7 @@ inline sysc::plic_regs::plic_regs(sc_core::sc_module_name nm) , NAMED(threshold, r_threshold, 0, *this) , NAMED(claim_complete, r_claim_complete, 0, *this) {} -template inline void sysc::plic_regs::registerResources(sysc::tlm_target &target) { +template inline void sysc::plic_regs::registerResources(scc::tlm_target &target) { target.addResource(priority, 0x4UL); target.addResource(pending, 0x1000UL); target.addResource(enabled, 0x2000UL); diff --git a/examples/simple_system/gen/spi_regs.h b/examples/simple_system/gen/spi_regs.h index 03e5b13..871a87a 100644 --- a/examples/simple_system/gen/spi_regs.h +++ b/examples/simple_system/gen/spi_regs.h @@ -36,14 +36,14 @@ #ifndef _SPI_REGS_H_ #define _SPI_REGS_H_ -#include -#include -#include #include +#include "scc/register.h" +#include "scc/tlm_target.h" +#include "scc/utilities.h" namespace sysc { -class spi_regs : public sc_core::sc_module, public sysc::resetable { +class spi_regs : public sc_core::sc_module, public scc::resetable { protected: // storage declarations BEGIN_BF_DECL(sckdiv_t, uint32_t); @@ -124,27 +124,27 @@ protected: END_BF_DECL() r_ip; // register declarations - sysc::sc_register sckdiv; - sysc::sc_register sckmode; - sysc::sc_register csid; - sysc::sc_register csdef; - sysc::sc_register csmode; - sysc::sc_register delay0; - sysc::sc_register delay1; - sysc::sc_register fmt; - sysc::sc_register txdata; - sysc::sc_register rxdata; - sysc::sc_register txmark; - sysc::sc_register rxmark; - sysc::sc_register fctrl; - sysc::sc_register ffmt; - sysc::sc_register ie; - sysc::sc_register ip; + scc::sc_register sckdiv; + scc::sc_register sckmode; + scc::sc_register csid; + scc::sc_register csdef; + scc::sc_register csmode; + scc::sc_register delay0; + scc::sc_register delay1; + scc::sc_register fmt; + scc::sc_register txdata; + scc::sc_register rxdata; + scc::sc_register txmark; + scc::sc_register rxmark; + scc::sc_register fctrl; + scc::sc_register ffmt; + scc::sc_register ie; + scc::sc_register ip; public: spi_regs(sc_core::sc_module_name nm); - template void registerResources(sysc::tlm_target &target); + template void registerResources(scc::tlm_target &target); }; } ////////////////////////////////////////////////////////////////////////////// @@ -170,7 +170,7 @@ inline sysc::spi_regs::spi_regs(sc_core::sc_module_name nm) , NAMED(ie, r_ie, 0, *this) , NAMED(ip, r_ip, 0, *this) {} -template inline void sysc::spi_regs::registerResources(sysc::tlm_target &target) { +template inline void sysc::spi_regs::registerResources(scc::tlm_target &target) { target.addResource(sckdiv, 0x0UL); target.addResource(sckmode, 0x4UL); target.addResource(csid, 0x10UL); diff --git a/examples/simple_system/gen/uart_regs.h b/examples/simple_system/gen/uart_regs.h index 4f4b166..e61d300 100644 --- a/examples/simple_system/gen/uart_regs.h +++ b/examples/simple_system/gen/uart_regs.h @@ -36,14 +36,14 @@ #ifndef _UART_REGS_H_ #define _UART_REGS_H_ -#include -#include -#include #include +#include "scc/register.h" +#include "scc/tlm_target.h" +#include "scc/utilities.h" namespace sysc { -class uart_regs : public sc_core::sc_module, public sysc::resetable { +class uart_regs : public sc_core::sc_module, public scc::resetable { protected: // storage declarations BEGIN_BF_DECL(txdata_t, uint32_t); @@ -84,18 +84,18 @@ protected: END_BF_DECL() r_div; // register declarations - sysc::sc_register txdata; - sysc::sc_register rxdata; - sysc::sc_register txctrl; - sysc::sc_register rxctrl; - sysc::sc_register ie; - sysc::sc_register ip; - sysc::sc_register div; + scc::sc_register txdata; + scc::sc_register rxdata; + scc::sc_register txctrl; + scc::sc_register rxctrl; + scc::sc_register ie; + scc::sc_register ip; + scc::sc_register div; public: uart_regs(sc_core::sc_module_name nm); - template void registerResources(sysc::tlm_target &target); + template void registerResources(scc::tlm_target &target); }; } ////////////////////////////////////////////////////////////////////////////// @@ -112,7 +112,7 @@ inline sysc::uart_regs::uart_regs(sc_core::sc_module_name nm) , NAMED(ip, r_ip, 0, *this) , NAMED(div, r_div, 0, *this) {} -template inline void sysc::uart_regs::registerResources(sysc::tlm_target &target) { +template inline void sysc::uart_regs::registerResources(scc::tlm_target &target) { target.addResource(txdata, 0x0UL); target.addResource(rxdata, 0x4UL); target.addResource(txctrl, 0x8UL); diff --git a/examples/simple_system/gpio.cpp b/examples/simple_system/gpio.cpp index beb77c3..c0ca85f 100644 --- a/examples/simple_system/gpio.cpp +++ b/examples/simple_system/gpio.cpp @@ -16,7 +16,7 @@ #include "gpio.h" #include "gen/gpio_regs.h" -#include "sysc/utilities.h" +#include "scc/utilities.h" namespace sysc { diff --git a/examples/simple_system/gpio.h b/examples/simple_system/gpio.h index 04e1f07..a289abe 100644 --- a/examples/simple_system/gpio.h +++ b/examples/simple_system/gpio.h @@ -17,13 +17,13 @@ #ifndef _GPIO_H_ #define _GPIO_H_ -#include +#include namespace sysc { class gpio_regs; -class gpio : public sc_core::sc_module, public tlm_target<> { +class gpio : public sc_core::sc_module, public scc::tlm_target<> { public: SC_HAS_PROCESS(gpio); sc_core::sc_in clk_i; diff --git a/examples/simple_system/plic.cpp b/examples/simple_system/plic.cpp index f2998cd..bf02fe2 100644 --- a/examples/simple_system/plic.cpp +++ b/examples/simple_system/plic.cpp @@ -38,8 +38,8 @@ #include "plic.h" #include "gen/plic_regs.h" -#include "sysc/utilities.h" -#include +#include "scc/utilities.h" +#include namespace sysc { @@ -75,7 +75,7 @@ plic::plic(sc_core::sc_module_name nm) plic::~plic() {} void plic::init_callbacks() { - m_claim_complete_write_cb = [=](sysc::sc_register reg, uint32_t v) -> bool { + m_claim_complete_write_cb = [=](scc::sc_register reg, uint32_t v) -> bool { reg.put(v); reset_pending_int(v); // std::cout << "Value of register: 0x" << std::hex << reg << std::endl; diff --git a/examples/simple_system/plic.h b/examples/simple_system/plic.h index 1d0bfd7..0cb60b5 100644 --- a/examples/simple_system/plic.h +++ b/examples/simple_system/plic.h @@ -17,14 +17,14 @@ #ifndef _PLIC_H_ #define _PLIC_H_ -#include -#include +#include +#include namespace sysc { class plic_regs; -class plic : public sc_core::sc_module, public tlm_target<> { +class plic : public sc_core::sc_module, public scc::tlm_target<> { public: SC_HAS_PROCESS(plic); sc_core::sc_in clk_i; @@ -49,7 +49,7 @@ protected: void clear_core_interrupt(); sc_core::sc_time clk; std::unique_ptr regs; - std::function, uint32_t)> m_claim_complete_write_cb; + std::function, uint32_t)> m_claim_complete_write_cb; }; } /* namespace sysc */ diff --git a/examples/simple_system/sc_main.cpp b/examples/simple_system/sc_main.cpp index 8f11759..90ef207 100644 --- a/examples/simple_system/sc_main.cpp +++ b/examples/simple_system/sc_main.cpp @@ -23,11 +23,12 @@ #include "simple_system.h" #include #include -#include -#include -#include +#include +#include +#include using namespace sysc; +using namespace scc; namespace po = boost::program_options; namespace { @@ -42,7 +43,7 @@ int sc_main(int argc, char *argv[]) { putenv(const_cast("SC_SIGNAL_WRITE_CHECK=DISABLE")); // sc_report_handler::set_handler(my_report_handler); - sysc::Logger::reporting_level() = log::DEBUG; + scc::Logger<>::reporting_level() = log::DEBUG; // todo: add module-name to log-file /////////////////////////////////////////////////////////////////////////// @@ -69,7 +70,7 @@ int sc_main(int argc, char *argv[]) { /////////////////////////////////////////////////////////////////////////// // set up tracing & transaction recording /////////////////////////////////////////////////////////////////////////// - sysc::tracer trace("simple_system", sysc::tracer::TEXT, vm.count("trace")); + tracer trace("simple_system", tracer::TEXT, vm.count("trace")); // todo: fix displayed clock period in VCD /////////////////////////////////////////////////////////////////////////// diff --git a/examples/simple_system/simple_system.h b/examples/simple_system/simple_system.h index 9d52557..b94860d 100644 --- a/examples/simple_system/simple_system.h +++ b/examples/simple_system/simple_system.h @@ -31,7 +31,7 @@ #include "test_initiator.h" #include #include -#include +#include namespace sysc { @@ -40,7 +40,7 @@ public: SC_HAS_PROCESS(simple_system); test_initiator i_master; - router<> i_router; + scc::router<> i_router; uart i_uart; spi i_spi; gpio i_gpio; diff --git a/examples/simple_system/spi.cpp b/examples/simple_system/spi.cpp index 9344cc2..152033a 100644 --- a/examples/simple_system/spi.cpp +++ b/examples/simple_system/spi.cpp @@ -16,7 +16,7 @@ #include "spi.h" #include "gen/spi_regs.h" -#include "sysc/utilities.h" +#include "scc/utilities.h" namespace sysc { diff --git a/examples/simple_system/spi.h b/examples/simple_system/spi.h index cdf5aee..b97fbf8 100644 --- a/examples/simple_system/spi.h +++ b/examples/simple_system/spi.h @@ -17,13 +17,13 @@ #ifndef _SPI_H_ #define _SPI_H_ -#include +#include namespace sysc { class spi_regs; -class spi : public sc_core::sc_module, public tlm_target<> { +class spi : public sc_core::sc_module, public scc::tlm_target<> { public: SC_HAS_PROCESS(spi); sc_core::sc_in clk_i; diff --git a/examples/simple_system/test_initiator.cpp b/examples/simple_system/test_initiator.cpp index 348a569..fb8f6c8 100644 --- a/examples/simple_system/test_initiator.cpp +++ b/examples/simple_system/test_initiator.cpp @@ -22,8 +22,8 @@ #include "test_initiator.h" #include -#include -#include +#include +#include // todo: move into gen folder somewhere (adapt code-generator) #define PLIC_PRIO1_REG 0x0C000004 diff --git a/examples/simple_system/test_initiator.h b/examples/simple_system/test_initiator.h index dd1bd65..ee69ace 100644 --- a/examples/simple_system/test_initiator.h +++ b/examples/simple_system/test_initiator.h @@ -23,7 +23,7 @@ #ifndef _TEST_INITIATOR_H_ #define _TEST_INITIATOR_H_ -#include +#include #include namespace sysc { diff --git a/examples/simple_system/uart.cpp b/examples/simple_system/uart.cpp index 28d9422..7b57bf7 100644 --- a/examples/simple_system/uart.cpp +++ b/examples/simple_system/uart.cpp @@ -16,7 +16,7 @@ #include "uart.h" #include "gen/uart_regs.h" -#include "sysc/utilities.h" +#include "scc/utilities.h" namespace sysc { diff --git a/examples/simple_system/uart.h b/examples/simple_system/uart.h index 6c80fc0..3725003 100644 --- a/examples/simple_system/uart.h +++ b/examples/simple_system/uart.h @@ -17,13 +17,13 @@ #ifndef _UART_H_ #define _UART_H_ -#include +#include namespace sysc { class uart_regs; -class uart : public sc_core::sc_module, public tlm_target<> { +class uart : public sc_core::sc_module, public scc::tlm_target<> { public: SC_HAS_PROCESS(uart); sc_core::sc_in clk_i; diff --git a/sc-components b/sc-components index cab7505..f1c733d 160000 --- a/sc-components +++ b/sc-components @@ -1 +1 @@ -Subproject commit cab7505af9f4093a93d7e41c519ad937bdc60f81 +Subproject commit f1c733dc2caed17742feca32a275eb21d15a4c8d