aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt1
-rw-r--r--src/lt_bus.cc4
-rw-r--r--src/minimal_socket.cc4
-rw-r--r--src/models/lt_bus.h8
-rw-r--r--src/utils/sysc.h7
-rw-r--r--src/utils/tlm_initiator_socket_tagged.h2
-rw-r--r--src/utils/tlm_target_socket_tagged.h8
7 files changed, 16 insertions, 18 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ff29dfe..cb5d232 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -10,5 +10,6 @@ set (CMAKE_CXX_STANDARD ${SystemC_CXX_STANDARD} CACHE STRING "C++ standard to bu
foreach (X IN ITEMS event sc_export sc_export2 minimal_socket browse lt_bus)
add_executable(${X} src/${X}.cc)
target_include_directories(${X} PRIVATE src)
+ target_compile_options(${X} PRIVATE -Wall -Wextra)
target_link_libraries(${X} SystemC::systemc)
endforeach()
diff --git a/src/lt_bus.cc b/src/lt_bus.cc
index 443feb2..a1637db 100644
--- a/src/lt_bus.cc
+++ b/src/lt_bus.cc
@@ -14,7 +14,7 @@ struct target : public sc_core::sc_module {
tlm_utils::simple_target_socket<target> p_sock{"sock"};
private:
- void b_transport(tlm::tlm_generic_payload& tx, sc_core::sc_time& t) {
+ void b_transport(tlm::tlm_generic_payload& tx, sc_core::sc_time&) {
CLOGM(YELLOW, "transport 0x%llx w: %d r: %d", tx.get_address(),
tx.is_write(), tx.is_read());
tx.set_response_status(tlm::TLM_OK_RESPONSE);
@@ -92,7 +92,7 @@ extern "C" int sc_main(int, char*[]) {
bus.attach_initiator(init1.p_sock);
- bus.dump();
+ bus.show_mmap();
sc_core::sc_start();
diff --git a/src/minimal_socket.cc b/src/minimal_socket.cc
index 1daac6b..21107fd 100644
--- a/src/minimal_socket.cc
+++ b/src/minimal_socket.cc
@@ -51,7 +51,7 @@ struct initiator_socket : sc_export<bwd_if> {
struct target_socket : sc_export<fwd_if> {
sc_port<bwd_if> p_bwd;
- void bind(initiator_socket& init) {
+ void bind_init(initiator_socket& init) {
// Bind the sc_port / sc_export pairs between the initiator and target
// socket.
@@ -115,7 +115,7 @@ extern "C" int sc_main(int, char*[]) {
target T("target");
// Bind the initiator and target sockets.
- T.p_sock.bind(I.p_sock);
+ T.p_sock.bind_init(I.p_sock);
sc_core::sc_start();
return 0;
diff --git a/src/models/lt_bus.h b/src/models/lt_bus.h
index 37cfe84..c533c50 100644
--- a/src/models/lt_bus.h
+++ b/src/models/lt_bus.h
@@ -80,9 +80,9 @@ class lt_bus : public sc_core::sc_module {
m_mappings.push_back({addr, id});
}
- // -- DUMP -------------------------------------------------------------------
+ // -- SHOW_MMAP --------------------------------------------------------------
- void dump() const {
+ void show_mmap() const {
// Dump memory map.
for (const auto& map : m_mappings) {
std::printf("%08lx - %08lx :[%2ld] %s\n", map.addr.start, map.addr.end,
@@ -125,9 +125,7 @@ class lt_bus : public sc_core::sc_module {
// -- TLM_FW_TRANSPORT_IF ----------------------------------------------------
- void b_transport(usize id,
- tlm::tlm_generic_payload& tx,
- sc_core::sc_time& t) {
+ void b_transport(usize, tlm::tlm_generic_payload& tx, sc_core::sc_time& t) {
if (const auto r = decode(tx)) {
const auto start = tx.get_address();
assert(r.start <= start);
diff --git a/src/utils/sysc.h b/src/utils/sysc.h
index 02ad412..99c863b 100644
--- a/src/utils/sysc.h
+++ b/src/utils/sysc.h
@@ -4,9 +4,8 @@
#include <sysc/kernel/sc_module.h>
#include <sysc/kernel/sc_simcontext.h>
-struct scoped_push_hierarchy {
- [[nodiscard]] explicit scoped_push_hierarchy(sc_core::sc_module& mod)
- : m_mod(mod), m_simctx(sc_core::sc_get_curr_simcontext()) {
+struct [[nodiscard]] scoped_push_hierarchy {
+ explicit scoped_push_hierarchy(sc_core::sc_module& mod) : m_mod{mod} {
assert(m_simctx);
m_simctx->hierarchy_push(&m_mod);
}
@@ -17,7 +16,7 @@ struct scoped_push_hierarchy {
}
private:
- sc_core::sc_simcontext* m_simctx{nullptr};
+ sc_core::sc_simcontext* m_simctx{sc_core::sc_get_curr_simcontext()};
sc_core::sc_module& m_mod;
};
diff --git a/src/utils/tlm_initiator_socket_tagged.h b/src/utils/tlm_initiator_socket_tagged.h
index 194de61..d1e91a5 100644
--- a/src/utils/tlm_initiator_socket_tagged.h
+++ b/src/utils/tlm_initiator_socket_tagged.h
@@ -18,8 +18,8 @@ class tlm_initiator_socket_tagged : public tlm::tlm_initiator_socket<>,
Module* mod,
cb_invalidate_direct_mem_ptr i)
: tlm_initiator_socket<>{name},
- m_mod{mod},
m_id{id},
+ m_mod{mod},
m_invalidate_direct_mem_ptr{i} {
bind(*static_cast<tlm::tlm_bw_transport_if<>*>(this));
}
diff --git a/src/utils/tlm_target_socket_tagged.h b/src/utils/tlm_target_socket_tagged.h
index d8ca155..40139e7 100644
--- a/src/utils/tlm_target_socket_tagged.h
+++ b/src/utils/tlm_target_socket_tagged.h
@@ -25,8 +25,8 @@ class tlm_target_socket_tagged : public tlm::tlm_target_socket<>,
cb_get_direct_mem_ptr m,
cb_transport_dbg d)
: tlm_target_socket<>{name},
- m_mod{mod},
m_id{id},
+ m_mod{mod},
m_b_transport{b},
m_get_direct_mem_ptr{m},
m_transport_dbg{d} {
@@ -50,9 +50,9 @@ class tlm_target_socket_tagged : public tlm::tlm_target_socket<>,
return (m_mod->*m_transport_dbg)(m_id, tx);
}
- virtual tlm::tlm_sync_enum nb_transport_fw(tlm::tlm_generic_payload& tx,
- tlm::tlm_phase& phase,
- sc_core::sc_time& t) override {
+ virtual tlm::tlm_sync_enum nb_transport_fw(tlm::tlm_generic_payload&,
+ tlm::tlm_phase&,
+ sc_core::sc_time&) override {
std::fprintf(stderr,
"tlm_target_socket_tagged: nb_transport_fw not supported\n");
std::abort();