Updated sc-components and adapted to namespace changes
This commit is contained in:
		| @@ -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<sysc::target_memory_map_entry<32>, 4> e300_plat_map = {{ | ||||
| const std::array<scc::target_memory_map_entry<32>, 4> e300_plat_map = {{ | ||||
|     {&i_plic, 0x0c000000, 0x200008}, | ||||
|     {&i_gpio, 0x10012000, 0x1000}, | ||||
|     {&i_uart, 0x10013000, 0x1000}, | ||||
|   | ||||
| @@ -36,14 +36,14 @@ | ||||
| #ifndef _GPIO_REGS_H_ | ||||
| #define _GPIO_REGS_H_ | ||||
|  | ||||
| #include <sysc/register.h> | ||||
| #include <sysc/tlm_target.h> | ||||
| #include <sysc/utilities.h> | ||||
| #include <util/bit_field.h> | ||||
| #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<uint32_t> value; | ||||
|     sysc::sc_register<uint32_t> input_en; | ||||
|     sysc::sc_register<uint32_t> output_en; | ||||
|     sysc::sc_register<uint32_t> port; | ||||
|     sysc::sc_register<uint32_t> pue; | ||||
|     sysc::sc_register<uint32_t> ds; | ||||
|     sysc::sc_register<uint32_t> rise_ie; | ||||
|     sysc::sc_register<uint32_t> rise_ip; | ||||
|     sysc::sc_register<uint32_t> fall_ie; | ||||
|     sysc::sc_register<uint32_t> fall_ip; | ||||
|     sysc::sc_register<uint32_t> high_ie; | ||||
|     sysc::sc_register<uint32_t> high_ip; | ||||
|     sysc::sc_register<uint32_t> low_ie; | ||||
|     sysc::sc_register<uint32_t> low_ip; | ||||
|     sysc::sc_register<uint32_t> iof_en; | ||||
|     sysc::sc_register<uint32_t> iof_sel; | ||||
|     sysc::sc_register<uint32_t> out_xor; | ||||
|     scc::sc_register<uint32_t> value; | ||||
|     scc::sc_register<uint32_t> input_en; | ||||
|     scc::sc_register<uint32_t> output_en; | ||||
|     scc::sc_register<uint32_t> port; | ||||
|     scc::sc_register<uint32_t> pue; | ||||
|     scc::sc_register<uint32_t> ds; | ||||
|     scc::sc_register<uint32_t> rise_ie; | ||||
|     scc::sc_register<uint32_t> rise_ip; | ||||
|     scc::sc_register<uint32_t> fall_ie; | ||||
|     scc::sc_register<uint32_t> fall_ip; | ||||
|     scc::sc_register<uint32_t> high_ie; | ||||
|     scc::sc_register<uint32_t> high_ip; | ||||
|     scc::sc_register<uint32_t> low_ie; | ||||
|     scc::sc_register<uint32_t> low_ip; | ||||
|     scc::sc_register<uint32_t> iof_en; | ||||
|     scc::sc_register<uint32_t> iof_sel; | ||||
|     scc::sc_register<uint32_t> out_xor; | ||||
|  | ||||
| public: | ||||
|     gpio_regs(sc_core::sc_module_name nm); | ||||
|  | ||||
|     template <unsigned BUSWIDTH = 32> void registerResources(sysc::tlm_target<BUSWIDTH> &target); | ||||
|     template <unsigned BUSWIDTH = 32> void registerResources(scc::tlm_target<BUSWIDTH> &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 <unsigned BUSWIDTH> inline void sysc::gpio_regs::registerResources(sysc::tlm_target<BUSWIDTH> &target) { | ||||
| template <unsigned BUSWIDTH> inline void sysc::gpio_regs::registerResources(scc::tlm_target<BUSWIDTH> &target) { | ||||
|     target.addResource(value, 0x0UL); | ||||
|     target.addResource(input_en, 0x4UL); | ||||
|     target.addResource(output_en, 0x8UL); | ||||
|   | ||||
| @@ -36,14 +36,14 @@ | ||||
| #ifndef _PLIC_REGS_H_ | ||||
| #define _PLIC_REGS_H_ | ||||
|  | ||||
| #include <sysc/register.h> | ||||
| #include <sysc/tlm_target.h> | ||||
| #include <sysc/utilities.h> | ||||
| #include <util/bit_field.h> | ||||
| #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_t, 255> priority; | ||||
|     sysc::sc_register<uint32_t> pending; | ||||
|     sysc::sc_register<uint32_t> enabled; | ||||
|     sysc::sc_register<threshold_t> threshold; | ||||
|     sysc::sc_register<uint32_t> claim_complete; | ||||
|     scc::sc_register_indexed<priority_t, 255> priority; | ||||
|     scc::sc_register<uint32_t> pending; | ||||
|     scc::sc_register<uint32_t> enabled; | ||||
|     scc::sc_register<threshold_t> threshold; | ||||
|     scc::sc_register<uint32_t> claim_complete; | ||||
|  | ||||
|     plic_regs(sc_core::sc_module_name nm); | ||||
|  | ||||
|     template <unsigned BUSWIDTH = 32> void registerResources(sysc::tlm_target<BUSWIDTH> &target); | ||||
|     template <unsigned BUSWIDTH = 32> void registerResources(scc::tlm_target<BUSWIDTH> &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 <unsigned BUSWIDTH> inline void sysc::plic_regs::registerResources(sysc::tlm_target<BUSWIDTH> &target) { | ||||
| template <unsigned BUSWIDTH> inline void sysc::plic_regs::registerResources(scc::tlm_target<BUSWIDTH> &target) { | ||||
|     target.addResource(priority, 0x4UL); | ||||
|     target.addResource(pending, 0x1000UL); | ||||
|     target.addResource(enabled, 0x2000UL); | ||||
|   | ||||
| @@ -36,14 +36,14 @@ | ||||
| #ifndef _SPI_REGS_H_ | ||||
| #define _SPI_REGS_H_ | ||||
|  | ||||
| #include <sysc/register.h> | ||||
| #include <sysc/tlm_target.h> | ||||
| #include <sysc/utilities.h> | ||||
| #include <util/bit_field.h> | ||||
| #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_t> sckdiv; | ||||
|     sysc::sc_register<sckmode_t> sckmode; | ||||
|     sysc::sc_register<uint32_t> csid; | ||||
|     sysc::sc_register<uint32_t> csdef; | ||||
|     sysc::sc_register<csmode_t> csmode; | ||||
|     sysc::sc_register<delay0_t> delay0; | ||||
|     sysc::sc_register<delay1_t> delay1; | ||||
|     sysc::sc_register<fmt_t> fmt; | ||||
|     sysc::sc_register<txdata_t> txdata; | ||||
|     sysc::sc_register<rxdata_t> rxdata; | ||||
|     sysc::sc_register<txmark_t> txmark; | ||||
|     sysc::sc_register<rxmark_t> rxmark; | ||||
|     sysc::sc_register<fctrl_t> fctrl; | ||||
|     sysc::sc_register<ffmt_t> ffmt; | ||||
|     sysc::sc_register<ie_t> ie; | ||||
|     sysc::sc_register<ip_t> ip; | ||||
|     scc::sc_register<sckdiv_t> sckdiv; | ||||
|     scc::sc_register<sckmode_t> sckmode; | ||||
|     scc::sc_register<uint32_t> csid; | ||||
|     scc::sc_register<uint32_t> csdef; | ||||
|     scc::sc_register<csmode_t> csmode; | ||||
|     scc::sc_register<delay0_t> delay0; | ||||
|     scc::sc_register<delay1_t> delay1; | ||||
|     scc::sc_register<fmt_t> fmt; | ||||
|     scc::sc_register<txdata_t> txdata; | ||||
|     scc::sc_register<rxdata_t> rxdata; | ||||
|     scc::sc_register<txmark_t> txmark; | ||||
|     scc::sc_register<rxmark_t> rxmark; | ||||
|     scc::sc_register<fctrl_t> fctrl; | ||||
|     scc::sc_register<ffmt_t> ffmt; | ||||
|     scc::sc_register<ie_t> ie; | ||||
|     scc::sc_register<ip_t> ip; | ||||
|  | ||||
| public: | ||||
|     spi_regs(sc_core::sc_module_name nm); | ||||
|  | ||||
|     template <unsigned BUSWIDTH = 32> void registerResources(sysc::tlm_target<BUSWIDTH> &target); | ||||
|     template <unsigned BUSWIDTH = 32> void registerResources(scc::tlm_target<BUSWIDTH> &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 <unsigned BUSWIDTH> inline void sysc::spi_regs::registerResources(sysc::tlm_target<BUSWIDTH> &target) { | ||||
| template <unsigned BUSWIDTH> inline void sysc::spi_regs::registerResources(scc::tlm_target<BUSWIDTH> &target) { | ||||
|     target.addResource(sckdiv, 0x0UL); | ||||
|     target.addResource(sckmode, 0x4UL); | ||||
|     target.addResource(csid, 0x10UL); | ||||
|   | ||||
| @@ -36,14 +36,14 @@ | ||||
| #ifndef _UART_REGS_H_ | ||||
| #define _UART_REGS_H_ | ||||
|  | ||||
| #include <sysc/register.h> | ||||
| #include <sysc/tlm_target.h> | ||||
| #include <sysc/utilities.h> | ||||
| #include <util/bit_field.h> | ||||
| #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_t> txdata; | ||||
|     sysc::sc_register<rxdata_t> rxdata; | ||||
|     sysc::sc_register<txctrl_t> txctrl; | ||||
|     sysc::sc_register<rxctrl_t> rxctrl; | ||||
|     sysc::sc_register<ie_t> ie; | ||||
|     sysc::sc_register<ip_t> ip; | ||||
|     sysc::sc_register<div_t> div; | ||||
|     scc::sc_register<txdata_t> txdata; | ||||
|     scc::sc_register<rxdata_t> rxdata; | ||||
|     scc::sc_register<txctrl_t> txctrl; | ||||
|     scc::sc_register<rxctrl_t> rxctrl; | ||||
|     scc::sc_register<ie_t> ie; | ||||
|     scc::sc_register<ip_t> ip; | ||||
|     scc::sc_register<div_t> div; | ||||
|  | ||||
| public: | ||||
|     uart_regs(sc_core::sc_module_name nm); | ||||
|  | ||||
|     template <unsigned BUSWIDTH = 32> void registerResources(sysc::tlm_target<BUSWIDTH> &target); | ||||
|     template <unsigned BUSWIDTH = 32> void registerResources(scc::tlm_target<BUSWIDTH> &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 <unsigned BUSWIDTH> inline void sysc::uart_regs::registerResources(sysc::tlm_target<BUSWIDTH> &target) { | ||||
| template <unsigned BUSWIDTH> inline void sysc::uart_regs::registerResources(scc::tlm_target<BUSWIDTH> &target) { | ||||
|     target.addResource(txdata, 0x0UL); | ||||
|     target.addResource(rxdata, 0x4UL); | ||||
|     target.addResource(txctrl, 0x8UL); | ||||
|   | ||||
| @@ -16,7 +16,7 @@ | ||||
|  | ||||
| #include "gpio.h" | ||||
| #include "gen/gpio_regs.h" | ||||
| #include "sysc/utilities.h" | ||||
| #include "scc/utilities.h" | ||||
|  | ||||
| namespace sysc { | ||||
|  | ||||
|   | ||||
| @@ -17,13 +17,13 @@ | ||||
| #ifndef _GPIO_H_ | ||||
| #define _GPIO_H_ | ||||
|  | ||||
| #include <sysc/tlm_target.h> | ||||
| #include <scc/tlm_target.h> | ||||
|  | ||||
| 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<sc_core::sc_time> clk_i; | ||||
|   | ||||
| @@ -38,8 +38,8 @@ | ||||
|  | ||||
| #include "plic.h" | ||||
| #include "gen/plic_regs.h" | ||||
| #include "sysc/utilities.h" | ||||
| #include <sysc/report.h> | ||||
| #include "scc/utilities.h" | ||||
| #include <scc/report.h> | ||||
|  | ||||
| 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<uint32_t> reg, uint32_t v) -> bool { | ||||
|     m_claim_complete_write_cb = [=](scc::sc_register<uint32_t> reg, uint32_t v) -> bool { | ||||
|         reg.put(v); | ||||
|         reset_pending_int(v); | ||||
|         // std::cout << "Value of register: 0x" << std::hex << reg << std::endl; | ||||
|   | ||||
| @@ -17,14 +17,14 @@ | ||||
| #ifndef _PLIC_H_ | ||||
| #define _PLIC_H_ | ||||
|  | ||||
| #include <sysc/register.h> | ||||
| #include <sysc/tlm_target.h> | ||||
| #include <scc/register.h> | ||||
| #include <scc/tlm_target.h> | ||||
|  | ||||
| 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<sc_core::sc_time> clk_i; | ||||
| @@ -49,7 +49,7 @@ protected: | ||||
|     void clear_core_interrupt(); | ||||
|     sc_core::sc_time clk; | ||||
|     std::unique_ptr<plic_regs> regs; | ||||
|     std::function<bool(sc_register<uint32_t>, uint32_t)> m_claim_complete_write_cb; | ||||
|     std::function<bool(scc::sc_register<uint32_t>, uint32_t)> m_claim_complete_write_cb; | ||||
| }; | ||||
|  | ||||
| } /* namespace sysc */ | ||||
|   | ||||
| @@ -23,11 +23,12 @@ | ||||
| #include "simple_system.h" | ||||
| #include <boost/program_options.hpp> | ||||
| #include <sstream> | ||||
| #include <sysc/report.h> | ||||
| #include <sysc/scv_tr_db.h> | ||||
| #include <sysc/tracer.h> | ||||
| #include <scc/report.h> | ||||
| #include <scc/scv_tr_db.h> | ||||
| #include <scc/tracer.h> | ||||
|  | ||||
| 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<char *>("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 | ||||
|  | ||||
|     /////////////////////////////////////////////////////////////////////////// | ||||
|   | ||||
| @@ -31,7 +31,7 @@ | ||||
| #include "test_initiator.h" | ||||
| #include <array> | ||||
| #include <sysc/kernel/sc_module.h> | ||||
| #include <sysc/router.h> | ||||
| #include <scc/router.h> | ||||
|  | ||||
| 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; | ||||
|   | ||||
| @@ -16,7 +16,7 @@ | ||||
|  | ||||
| #include "spi.h" | ||||
| #include "gen/spi_regs.h" | ||||
| #include "sysc/utilities.h" | ||||
| #include "scc/utilities.h" | ||||
|  | ||||
| namespace sysc { | ||||
|  | ||||
|   | ||||
| @@ -17,13 +17,13 @@ | ||||
| #ifndef _SPI_H_ | ||||
| #define _SPI_H_ | ||||
|  | ||||
| #include <sysc/tlm_target.h> | ||||
| #include <scc/tlm_target.h> | ||||
|  | ||||
| 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<sc_core::sc_time> clk_i; | ||||
|   | ||||
| @@ -22,8 +22,8 @@ | ||||
|  | ||||
| #include "test_initiator.h" | ||||
| #include <array> | ||||
| #include <sysc/report.h> | ||||
| #include <sysc/utilities.h> | ||||
| #include <scc/report.h> | ||||
| #include <scc/utilities.h> | ||||
|  | ||||
| // todo: move into gen folder somewhere (adapt code-generator) | ||||
| #define PLIC_PRIO1_REG 0x0C000004 | ||||
|   | ||||
| @@ -23,7 +23,7 @@ | ||||
| #ifndef _TEST_INITIATOR_H_ | ||||
| #define _TEST_INITIATOR_H_ | ||||
|  | ||||
| #include <sysc/utilities.h> | ||||
| #include <scc/utilities.h> | ||||
| #include <tlm_utils/simple_initiator_socket.h> | ||||
|  | ||||
| namespace sysc { | ||||
|   | ||||
| @@ -16,7 +16,7 @@ | ||||
|  | ||||
| #include "uart.h" | ||||
| #include "gen/uart_regs.h" | ||||
| #include "sysc/utilities.h" | ||||
| #include "scc/utilities.h" | ||||
|  | ||||
| namespace sysc { | ||||
|  | ||||
|   | ||||
| @@ -17,13 +17,13 @@ | ||||
| #ifndef _UART_H_ | ||||
| #define _UART_H_ | ||||
|  | ||||
| #include <sysc/tlm_target.h> | ||||
| #include <scc/tlm_target.h> | ||||
|  | ||||
| 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<sc_core::sc_time> clk_i; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user