scc 2025.09
SystemC components library
axi::pe::axi_target_pe Class Reference

#include <axi_target_pe.h>

Inheritance diagram for axi::pe::axi_target_pe:
Collaboration diagram for axi::pe::axi_target_pe:

Classes

struct  bw_intor_impl

Public Types

using payload_type = axi::axi_protocol_types::tlm_payload_type
using phase_type = axi::axi_protocol_types::tlm_phase_type

Public Member Functions

void b_transport (payload_type &trans, sc_core::sc_time &t) override
tlm::tlm_sync_enum nb_transport_fw (payload_type &trans, phase_type &phase, sc_core::sc_time &t) override
bool get_direct_mem_ptr (payload_type &trans, tlm::tlm_dmi &dmi_data) override
unsigned int transport_dbg (payload_type &trans) override
void set_operation_cb (std::function< unsigned(payload_type &trans)> cb)
 Set the operation callback function.
void operation_resp (payload_type &trans, unsigned clk_delay=0)
bool is_active ()
const sc_core::sc_event & tx_finish_event ()
 axi_target_pe (const sc_core::sc_module_name &nm, size_t transfer_width, flavor_e flavor=flavor_e::AXI)
void set_bw_interface (axi::axi_bw_transport_if< axi_protocol_types > *ifs)
unsigned getAllOutStandingTx () const

Public Attributes

sc_core::sc_in< bool > clk_i {"clk_i"}
sc_core::sc_port< tlm::scc::pe::intor_fw_nb, 1, sc_core::SC_ZERO_OR_MORE_BOUND > fw_o {"fw_o"}
sc_core::sc_export< tlm::scc::pe::intor_bw_nbbw_i {"bw_i"}
cci::cci_param< unsigned > max_outstanding_tx {"max_outstanding_tx", 0}
 the number of supported outstanding transactions. If this limit is reached the target starts to do back-pressure
cci::cci_param< bool > rd_data_interleaving {"rd_data_interleaving", true}
 enable data interleaving on read responses if rd_data_beat_delay is greater than 0
cci::cci_param< int > wr_data_accept_delay {"wr_data_accept_delay", 0}
 the latency between between BEGIN(_PARTIAL)_REQ and END(_PARTIAL)_REQ (AWVALID to AWREADY and WVALID to WREADY) -> AWR, WBR
cci::cci_param< int > rd_addr_accept_delay {"rd_addr_accept_delay", 0}
 the latency between between BEGIN_REQ and END_REQ (ARVALID to ARREADY) -> APR
cci::cci_param< int > rd_data_beat_delay {"rd_data_beat_delay", 0}
 the latency between between END(_PARTIAL)_RESP and BEGIN(_PARTIAL)_RESP (RREADY to RVALID) -> RBV
cci::cci_param< int > rd_resp_delay {"rd_resp_delay", 0}
 the latency between request and response phase. Will be overwritten by the return of the callback function (if registered) -> RIV
cci::cci_param< int > wr_resp_delay {"wr_resp_delay", 0}
 the latency between request and response phase. Will be overwritten by the return of the callback function (if registered) -> BV

Protected Member Functions

 axi_target_pe (axi_target_pe const &)=delete
 axi_target_pe (axi_target_pe &&)=delete
axi_target_peoperator= (axi_target_pe const &)=delete
axi_target_peoperator= (axi_target_pe &&)=delete
void end_of_elaboration () override
void start_of_simulation () override
void fsm_clk_method ()
fsm::fsm_handlecreate_fsm_handle () override
void setup_callbacks (fsm::fsm_handle *) override
unsigned operations_callback (payload_type &trans)
void process_req2resp_fifos ()
void start_rd_resp_thread ()
void start_wr_resp_thread ()
void send_wr_resp_beat_thread ()
void send_rd_resp_beat_thread ()
scc::sc_variable< unsigned > & getOutStandingTx (tlm::tlm_command cmd)
scc::sc_variable< unsigned > const & getOutStandingTx (tlm::tlm_command cmd) const
void nb_fw (payload_type &trans, const phase_type &phase)
Protected Member Functions inherited from axi::fsm::base
 base (size_t transfer_width, bool coherent=false, axi::fsm::protocol_time_point_e wr_start=axi::fsm::RequestPhaseBeg)
 the constructor
virtual ~base ()
 the destructor
tlm::tlm_sync_enum nb_fw (payload_type &trans, phase_type const &phase, sc_core::sc_time &t)
 triggers the FSM based on TLM phases in the forward path. Should be called from np_transport_fw of the respective derived class
tlm::tlm_sync_enum nb_bw (payload_type &trans, phase_type const &phase, sc_core::sc_time &t)
 triggers the FSM based on TLM phases in the backward path. Should be called from np_transport_bw of the respective derived class
axi::fsm::fsm_handlefind_or_create (payload_type *gp=nullptr, bool ace=false)
 retrieve the FSM handle based on the transaction passed. If non exist one will be created
void process_fsm_event ()
 processes the fsm_event_queue and triggers FSM aligned
void process_fsm_clk_queue ()
 processes the fsm_clk_queue and triggers the FSM accordingly. Should be registered as rising-edge clock callback
void schedule (axi::fsm::protocol_time_point_e e, tlm::scc::tlm_gp_shared_ptr &gp, unsigned cycles)
 processes the fsm_sched_queue and propagates events to fsm_clk_queue. Should be registered as falling-edge clock callback
void schedule (axi::fsm::protocol_time_point_e e, payload_type *gp, unsigned cycles)
void schedule (axi::fsm::protocol_time_point_e e, tlm::scc::tlm_gp_shared_ptr &gp, sc_core::sc_time delay, bool syncronize=false)
 processes the fsm_sched_queue and propagates events to fsm_clk_queue. Should be registered as falling-edge clock callback
void schedule (axi::fsm::protocol_time_point_e e, payload_type *gp, sc_core::sc_time delay, bool syncronize=false)
void react (axi::fsm::protocol_time_point_e event, tlm::scc::tlm_gp_shared_ptr &trans)
 triggers the FSM with event and given transaction
void react (axi::fsm::protocol_time_point_e event, payload_type *trans)
void react (axi::fsm::protocol_time_point_e, axi::fsm::fsm_handle *)

Protected Attributes

axi::axi_bw_transport_if< axi_protocol_types > * socket_bw {nullptr}
std::function< unsigned(payload_type &trans)> operation_cb
scc::fifo_w_cb< std::tuple< payload_type *, unsigned > > rd_req2resp_fifo {"rd_req2resp_fifo"}
scc::fifo_w_cb< std::tuple< payload_type *, unsigned > > wr_req2resp_fifo {"wr_req2resp_fifo"}
sc_core::sc_fifo< payload_type * > rd_resp_fifo {1}
sc_core::sc_fifo< payload_type * > wr_resp_fifo {1}
sc_core::sc_fifo< std::tuple< fsm::fsm_handle *, axi::fsm::protocol_time_point_e > > wr_resp_beat_fifo {128}
sc_core::sc_fifo< std::tuple< fsm::fsm_handle *, axi::fsm::protocol_time_point_e > > rd_resp_beat_fifo {128}
scc::ordered_semaphore rd_resp {1}
scc::ordered_semaphore wr_resp_ch {1}
scc::ordered_semaphore rd_resp_ch {1}
sc_core::sc_clock * clk_if {nullptr}
std::unique_ptr< bw_intor_implbw_intor
std::array< unsigned, 3 > outstanding_cnt {{0, 0, 0}}
scc::sc_variable< unsigned > outstanding_rd_tx {"OutstandingRd", 0}
scc::sc_variable< unsigned > outstanding_wr_tx {"OutstandingWr", 0}
scc::sc_variable< unsigned > outstanding_ign_tx {"OutstandingIgn", 0}
std::array< tlm::tlm_generic_payload *, 3 > stalled_tx {nullptr, nullptr, nullptr}
std::array< axi::fsm::protocol_time_point_e, 3 > stalled_tp {{axi::fsm::CB_CNT, axi::fsm::CB_CNT, axi::fsm::CB_CNT}}
tlm_utils::peq_with_cb_and_phase< axi_target_pefw_peq {this, &axi_target_pe::nb_fw}
std::unordered_set< unsigned > active_rdresp_id
Protected Attributes inherited from axi::fsm::base
::scc::peq< std::tuple< axi::fsm::protocol_time_point_e, payload_type *, bool > > fsm_event_queue
::scc::fifo_w_cb< std::tuple< axi::fsm::protocol_time_point_e, payload_type *, unsigned > > fsm_clk_queue
sc_core::sc_process_handle fsm_clk_queue_hndl
size_t transfer_width_in_bytes
const axi::fsm::protocol_time_point_e wr_start
const bool coherent
std::unordered_map< payload_type *, axi::fsm::fsm_handle * > active_fsm
std::deque< axi::fsm::fsm_handle * > idle_fsm
std::vector< std::unique_ptr< axi::fsm::fsm_handle > > allocated_fsm
std::string instance_name
sc_core::sc_event finish_evt

Additional Inherited Members

Protected Types inherited from axi::fsm::base
using payload_type = axi::axi_protocol_types::tlm_payload_type
 aliases used in the class
using phase_type = axi::axi_protocol_types::tlm_phase_type

Detailed Description

the target protocol engine base class

Definition at line 47 of file axi_target_pe.h.

Member Typedef Documentation

◆ payload_type

using axi::pe::axi_target_pe::payload_type = axi::axi_protocol_types::tlm_payload_type

Definition at line 51 of file axi_target_pe.h.

◆ phase_type

using axi::pe::axi_target_pe::phase_type = axi::axi_protocol_types::tlm_phase_type

Definition at line 52 of file axi_target_pe.h.

Constructor & Destructor Documentation

◆ axi_target_pe()

axi_target_pe::axi_target_pe ( const sc_core::sc_module_name & nm,
size_t transfer_width,
flavor_e flavor = flavor_e::AXI )
explicit

the constructor. Protected as it should only be called by derived classes

Parameters
port
transfer_width
flavor(axi,ace,aceLite)

Definition at line 57 of file axi_target_pe.cpp.

Member Function Documentation

◆ b_transport()

void axi_target_pe::b_transport ( payload_type & trans,
sc_core::sc_time & t )
override

Definition at line 86 of file axi_target_pe.cpp.

◆ create_fsm_handle()

fsm_handle * axi_target_pe::create_fsm_handle ( )
overrideprotectedvirtual
See also
base::create_fsm_handle()

Implements axi::fsm::base.

Definition at line 108 of file axi_target_pe.cpp.

◆ end_of_elaboration()

void axi_target_pe::end_of_elaboration ( )
overrideprotected

Definition at line 79 of file axi_target_pe.cpp.

◆ fsm_clk_method()

void axi::pe::axi_target_pe::fsm_clk_method ( )
inlineprotected

Definition at line 160 of file axi_target_pe.h.

◆ get_direct_mem_ptr()

bool axi_target_pe::get_direct_mem_ptr ( payload_type & trans,
tlm::tlm_dmi & dmi_data )
override

Definition at line 101 of file axi_target_pe.cpp.

◆ getAllOutStandingTx()

unsigned axi::pe::axi_target_pe::getAllOutStandingTx ( ) const
inline

Definition at line 143 of file axi_target_pe.h.

◆ getOutStandingTx() [1/2]

scc::sc_variable< unsigned > & axi::pe::axi_target_pe::getOutStandingTx ( tlm::tlm_command cmd)
inlineprotected

Definition at line 191 of file axi_target_pe.h.

◆ getOutStandingTx() [2/2]

scc::sc_variable< unsigned > const & axi::pe::axi_target_pe::getOutStandingTx ( tlm::tlm_command cmd) const
inlineprotected

Definition at line 201 of file axi_target_pe.h.

◆ is_active()

bool axi::pe::axi_target_pe::is_active ( )
inline

returns true if any transaction is still in flight

Returns

Definition at line 123 of file axi_target_pe.h.

◆ nb_fw()

void axi::pe::axi_target_pe::nb_fw ( payload_type & trans,
const phase_type & phase )
inlineprotected

Definition at line 213 of file axi_target_pe.h.

◆ nb_transport_fw()

tlm_sync_enum axi_target_pe::nb_transport_fw ( payload_type & trans,
phase_type & phase,
sc_core::sc_time & t )
override

Definition at line 96 of file axi_target_pe.cpp.

◆ operation_resp()

void axi::pe::axi_target_pe::operation_resp ( payload_type & trans,
unsigned clk_delay = 0 )

start the response from an operation callback if latency is not set by the callback

Parameters
trans
sync

Definition at line 234 of file axi_target_pe.cpp.

◆ process_req2resp_fifos()

void axi::pe::axi_target_pe::process_req2resp_fifos ( )
protected

Definition at line 241 of file axi_target_pe.cpp.

◆ send_rd_resp_beat_thread()

void axi::pe::axi_target_pe::send_rd_resp_beat_thread ( )
protected

Definition at line 299 of file axi_target_pe.cpp.

◆ send_wr_resp_beat_thread()

void axi::pe::axi_target_pe::send_wr_resp_beat_thread ( )
protected

Definition at line 324 of file axi_target_pe.cpp.

◆ set_bw_interface()

void axi::pe::axi_target_pe::set_bw_interface ( axi::axi_bw_transport_if< axi_protocol_types > * ifs)
inline

Definition at line 141 of file axi_target_pe.h.

◆ set_operation_cb()

void axi::pe::axi_target_pe::set_operation_cb ( std::function< unsigned(payload_type &trans)> cb)
inline

Set the operation callback function.

This callback is invoked once a transaction arrives. This function is not allowed to block and returns the latency of the operation i.e. the duration until the reponse phase starts

Todo
refine API
Parameters
cbthe callback function

Definition at line 110 of file axi_target_pe.h.

◆ setup_callbacks()

void axi_target_pe::setup_callbacks ( fsm::fsm_handle * fsm_hndl)
overrideprotectedvirtual
See also
base::setup_callbacks(fsm::fsm_handle*)

Implements axi::fsm::base.

Definition at line 110 of file axi_target_pe.cpp.

◆ start_of_simulation()

void axi_target_pe::start_of_simulation ( )
overrideprotected

Definition at line 81 of file axi_target_pe.cpp.

◆ start_rd_resp_thread()

void axi::pe::axi_target_pe::start_rd_resp_thread ( )
protected

Definition at line 268 of file axi_target_pe.cpp.

◆ start_wr_resp_thread()

void axi::pe::axi_target_pe::start_wr_resp_thread ( )
protected

Definition at line 291 of file axi_target_pe.cpp.

◆ transport_dbg()

unsigned int axi_target_pe::transport_dbg ( payload_type & trans)
override

Definition at line 106 of file axi_target_pe.cpp.

◆ tx_finish_event()

const sc_core::sc_event & axi::pe::axi_target_pe::tx_finish_event ( )
inline

get the event being notfied upon the finishing of a transaction

Returns
reference to sc_event

Definition at line 129 of file axi_target_pe.h.

Member Data Documentation

◆ active_rdresp_id

std::unordered_set<unsigned> axi::pe::axi_target_pe::active_rdresp_id
protected

Definition at line 218 of file axi_target_pe.h.

◆ bw_i

sc_core::sc_export<tlm::scc::pe::intor_bw_nb> axi::pe::axi_target_pe::bw_i {"bw_i"}

Definition at line 58 of file axi_target_pe.h.

◆ bw_intor

std::unique_ptr<bw_intor_impl> axi::pe::axi_target_pe::bw_intor
protected

Definition at line 186 of file axi_target_pe.h.

◆ clk_i

sc_core::sc_in<bool> axi::pe::axi_target_pe::clk_i {"clk_i"}

Definition at line 54 of file axi_target_pe.h.

◆ clk_if

sc_core::sc_clock* axi::pe::axi_target_pe::clk_if {nullptr}
protected

Definition at line 185 of file axi_target_pe.h.

◆ fw_o

sc_core::sc_port<tlm::scc::pe::intor_fw_nb, 1, sc_core::SC_ZERO_OR_MORE_BOUND> axi::pe::axi_target_pe::fw_o {"fw_o"}

Definition at line 56 of file axi_target_pe.h.

◆ fw_peq

tlm_utils::peq_with_cb_and_phase<axi_target_pe> axi::pe::axi_target_pe::fw_peq {this, &axi_target_pe::nb_fw}
protected

Definition at line 217 of file axi_target_pe.h.

◆ max_outstanding_tx

cci::cci_param<unsigned> axi::pe::axi_target_pe::max_outstanding_tx {"max_outstanding_tx", 0}

the number of supported outstanding transactions. If this limit is reached the target starts to do back-pressure

Definition at line 64 of file axi_target_pe.h.

◆ operation_cb

std::function<unsigned(payload_type& trans)> axi::pe::axi_target_pe::operation_cb
protected

Definition at line 173 of file axi_target_pe.h.

◆ outstanding_cnt

std::array<unsigned, 3> axi::pe::axi_target_pe::outstanding_cnt {{0, 0, 0}}
protected

Definition at line 187 of file axi_target_pe.h.

◆ outstanding_ign_tx

scc::sc_variable<unsigned> axi::pe::axi_target_pe::outstanding_ign_tx {"OutstandingIgn", 0}
protected

Definition at line 190 of file axi_target_pe.h.

◆ outstanding_rd_tx

scc::sc_variable<unsigned> axi::pe::axi_target_pe::outstanding_rd_tx {"OutstandingRd", 0}
protected

Definition at line 188 of file axi_target_pe.h.

◆ outstanding_wr_tx

scc::sc_variable<unsigned> axi::pe::axi_target_pe::outstanding_wr_tx {"OutstandingWr", 0}
protected

Definition at line 189 of file axi_target_pe.h.

◆ rd_addr_accept_delay

cci::cci_param<int> axi::pe::axi_target_pe::rd_addr_accept_delay {"rd_addr_accept_delay", 0}

the latency between between BEGIN_REQ and END_REQ (ARVALID to ARREADY) -> APR

Definition at line 77 of file axi_target_pe.h.

◆ rd_data_beat_delay

cci::cci_param<int> axi::pe::axi_target_pe::rd_data_beat_delay {"rd_data_beat_delay", 0}

the latency between between END(_PARTIAL)_RESP and BEGIN(_PARTIAL)_RESP (RREADY to RVALID) -> RBV

Definition at line 81 of file axi_target_pe.h.

◆ rd_data_interleaving

cci::cci_param<bool> axi::pe::axi_target_pe::rd_data_interleaving {"rd_data_interleaving", true}

enable data interleaving on read responses if rd_data_beat_delay is greater than 0

Definition at line 68 of file axi_target_pe.h.

◆ rd_req2resp_fifo

scc::fifo_w_cb<std::tuple<payload_type*, unsigned> > axi::pe::axi_target_pe::rd_req2resp_fifo {"rd_req2resp_fifo"}
protected

Definition at line 174 of file axi_target_pe.h.

◆ rd_resp

scc::ordered_semaphore axi::pe::axi_target_pe::rd_resp {1}
protected

Definition at line 181 of file axi_target_pe.h.

◆ rd_resp_beat_fifo

sc_core::sc_fifo<std::tuple<fsm::fsm_handle*, axi::fsm::protocol_time_point_e> > axi::pe::axi_target_pe::rd_resp_beat_fifo {128}
protected

Definition at line 180 of file axi_target_pe.h.

◆ rd_resp_ch

scc::ordered_semaphore axi::pe::axi_target_pe::rd_resp_ch {1}
protected

Definition at line 181 of file axi_target_pe.h.

◆ rd_resp_delay

cci::cci_param<int> axi::pe::axi_target_pe::rd_resp_delay {"rd_resp_delay", 0}

the latency between request and response phase. Will be overwritten by the return of the callback function (if registered) -> RIV

Definition at line 86 of file axi_target_pe.h.

◆ rd_resp_fifo

sc_core::sc_fifo<payload_type*> axi::pe::axi_target_pe::rd_resp_fifo {1}
protected

Definition at line 177 of file axi_target_pe.h.

◆ socket_bw

axi::axi_bw_transport_if<axi_protocol_types>* axi::pe::axi_target_pe::socket_bw {nullptr}
protected

Definition at line 172 of file axi_target_pe.h.

◆ stalled_tp

std::array<axi::fsm::protocol_time_point_e, 3> axi::pe::axi_target_pe::stalled_tp {{axi::fsm::CB_CNT, axi::fsm::CB_CNT, axi::fsm::CB_CNT}}
protected

Definition at line 212 of file axi_target_pe.h.

◆ stalled_tx

std::array<tlm::tlm_generic_payload*, 3> axi::pe::axi_target_pe::stalled_tx {nullptr, nullptr, nullptr}
protected

Definition at line 211 of file axi_target_pe.h.

◆ wr_data_accept_delay

cci::cci_param<int> axi::pe::axi_target_pe::wr_data_accept_delay {"wr_data_accept_delay", 0}

the latency between between BEGIN(_PARTIAL)_REQ and END(_PARTIAL)_REQ (AWVALID to AWREADY and WVALID to WREADY) -> AWR, WBR

Definition at line 73 of file axi_target_pe.h.

◆ wr_req2resp_fifo

scc::fifo_w_cb<std::tuple<payload_type*, unsigned> > axi::pe::axi_target_pe::wr_req2resp_fifo {"wr_req2resp_fifo"}
protected

Definition at line 175 of file axi_target_pe.h.

◆ wr_resp_beat_fifo

sc_core::sc_fifo<std::tuple<fsm::fsm_handle*, axi::fsm::protocol_time_point_e> > axi::pe::axi_target_pe::wr_resp_beat_fifo {128}
protected

Definition at line 180 of file axi_target_pe.h.

◆ wr_resp_ch

scc::ordered_semaphore axi::pe::axi_target_pe::wr_resp_ch {1}
protected

Definition at line 181 of file axi_target_pe.h.

◆ wr_resp_delay

cci::cci_param<int> axi::pe::axi_target_pe::wr_resp_delay {"wr_resp_delay", 0}

the latency between request and response phase. Will be overwritten by the return of the callback function (if registered) -> BV

Definition at line 91 of file axi_target_pe.h.

◆ wr_resp_fifo

sc_core::sc_fifo<payload_type*> axi::pe::axi_target_pe::wr_resp_fifo {1}
protected

Definition at line 177 of file axi_target_pe.h.


The documentation for this class was generated from the following files:
  • /home/eyck/Projects/MINRES/SystemC-Components/third_party/axi_chi/axi/pe/axi_target_pe.h
  • /home/eyck/Projects/MINRES/SystemC-Components/third_party/axi_chi/axi/pe/axi_target_pe.cpp