From bd6b524767c90dc491196065c07e4cb2b2ec68df Mon Sep 17 00:00:00 2001 From: Eyck Jentzsch Date: Sun, 8 Feb 2026 17:46:29 +0100 Subject: [PATCH 1/2] adds unique id to eth frame --- src/interfaces/eth/eth_tlm.h | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/interfaces/eth/eth_tlm.h b/src/interfaces/eth/eth_tlm.h index 1fb47ab8..5da73a30 100644 --- a/src/interfaces/eth/eth_tlm.h +++ b/src/interfaces/eth/eth_tlm.h @@ -17,8 +17,10 @@ #ifndef _ETH_ETH_TLM_H_ #define _ETH_ETH_TLM_H_ +#include #include #include +#include #include #include #include @@ -82,8 +84,15 @@ struct eth_packet_payload : public tlm::nw::tlm_network_payload { void set_sender_clk_period(sc_core::sc_time period) { this->sender_clk_period = period; } + const uint64_t unique_id{get_id()}; + private: sc_core::sc_time sender_clk_period{sc_core::SC_ZERO_TIME}; + + static uint64_t get_id() { + static std::atomic_uint64_t id = 0; + return id.fetch_add(1); + } }; struct eth_packet_types { @@ -120,7 +129,7 @@ struct eth_channel : public sc_core::sc_module, eth_pkt_initiator_socket<> isck{"isck"}; - cci::cci_param channel_delay{"channel_delay", sc_core::SC_ZERO_TIME, "delay of the SPI channel"}; + cci::cci_param channel_delay{"channel_delay", sc_core::SC_ZERO_TIME, "delay of the ETH channel"}; eth_channel(sc_core::sc_module_name const& nm) : sc_core::sc_module(nm) @@ -130,10 +139,10 @@ struct eth_channel : public sc_core::sc_module, } void b_transport(transaction_type& trans, sc_core::sc_time& t) override { - t += channel_delay; + t += trans.get_data().size() * 8 * trans.get_sender_clk_period() + channel_delay.get_value(); isck->b_transport(trans, t); } - + // TODO: fix non-blocking channel timing tlm::tlm_sync_enum nb_transport_fw(transaction_type& trans, phase_type& phase, sc_core::sc_time& t) override { SCCTRACE(SCMOD) << "Received non-blocking transaction in fw path with phase " << phase.get_name(); if(phase == tlm::nw::REQUEST) { From b7a8cd5cabc98f8964effdb975fb2ff562c7decf Mon Sep 17 00:00:00 2001 From: Eyck Jentzsch Date: Sun, 8 Feb 2026 17:51:34 +0100 Subject: [PATCH 2/2] changes initial assignement to constructor to satify C++11 --- src/interfaces/eth/eth_tlm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/interfaces/eth/eth_tlm.h b/src/interfaces/eth/eth_tlm.h index 5da73a30..b36153dc 100644 --- a/src/interfaces/eth/eth_tlm.h +++ b/src/interfaces/eth/eth_tlm.h @@ -90,7 +90,7 @@ struct eth_packet_payload : public tlm::nw::tlm_network_payload { sc_core::sc_time sender_clk_period{sc_core::SC_ZERO_TIME}; static uint64_t get_id() { - static std::atomic_uint64_t id = 0; + static std::atomic_uint64_t id{0}; return id.fetch_add(1); } };