From 3ed0e5ec457ebcadc1e129c9f5cba7d216a7f22f Mon Sep 17 00:00:00 2001 From: Eyck Jentzsch Date: Tue, 20 Nov 2018 23:57:56 +0100 Subject: [PATCH] Adapted to latest sc-components change --- examples/simple_system/gen/e300_plat_t.h | 10 +++++----- examples/simple_system/simple_system.cpp | 14 ++++++++------ sc-components | 2 +- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/examples/simple_system/gen/e300_plat_t.h b/examples/simple_system/gen/e300_plat_t.h index de361b1..57ce875 100644 --- a/examples/simple_system/gen/e300_plat_t.h +++ b/examples/simple_system/gen/e300_plat_t.h @@ -17,11 +17,11 @@ #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 = {{ - {i_plic.socket, 0x0c000000, 0x200008}, - {i_gpio.socket, 0x10012000, 0x1000}, - {i_uart.socket, 0x10013000, 0x1000}, - {i_spi.socket, 0x10014000, 0x1000}, +const std::array, 4> e300_plat_map = {{ + {"plic", 0x0c000000, 0x200008}, + {"gpio", 0x10012000, 0x1000}, + {"uart", 0x10013000, 0x1000}, + {"spi", 0x10014000, 0x1000}, }}; #endif /* _E300_PLAT_MAP_H_ */ diff --git a/examples/simple_system/simple_system.cpp b/examples/simple_system/simple_system.cpp index da9d03a..852d33f 100644 --- a/examples/simple_system/simple_system.cpp +++ b/examples/simple_system/simple_system.cpp @@ -42,12 +42,14 @@ simple_system::simple_system(sc_core::sc_module_name nm) // bus connections i_master.intor(i_router.target[0]); - size_t i = 0; - for (const auto &e : e300_plat_map) { - i_router.initiator[i](e.target); - i_router.add_target_range(i, e.start, e.size); - i++; - } + i_router.bind_target(i_plic.socket, 0, "plic"); + i_router.bind_target(i_uart.socket, 1, "uart"); + i_router.bind_target(i_spi.socket, 2, "spi"); + i_router.bind_target(i_gpio.socket, 3, "gpio"); + + // target address ranges + for (const auto &e : e300_plat_map) + i_router.add_target_range(e.name, e.start, e.size); // clock/reset connections i_uart.clk_i(s_clk); diff --git a/sc-components b/sc-components index 0f5b5f6..6e0a8f8 160000 --- a/sc-components +++ b/sc-components @@ -1 +1 @@ -Subproject commit 0f5b5f68e7d5d481b4f8da2620df633495c989d9 +Subproject commit 6e0a8f8d259e4d8cca8b38dc089ed08f10db3a2d