aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohannes Stoelp <johannes.stoelp@gmail.com>2023-10-29 18:05:02 +0100
committerJohannes Stoelp <johannes.stoelp@gmail.com>2023-10-29 18:12:17 +0100
commitb716fdae5ef9b76920fdd2bcd8aab97d9cde90a0 (patch)
tree2027817e4966ea5c7422152c287ce7b190316129 /src
parentf0646cfa16d909b107e81dafd2f3c8f80d28a5f8 (diff)
downloadsysc-playground-b716fdae5ef9b76920fdd2bcd8aab97d9cde90a0.tar.gz
sysc-playground-b716fdae5ef9b76920fdd2bcd8aab97d9cde90a0.zip
build: enable warnings and fix existing warnings
Diffstat (limited to 'src')
-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
6 files changed, 15 insertions, 18 deletions
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();