scc  2022.4.0
SystemC components library
axi::fsm::base Struct Referenceabstract

base class of all AXITLM based adapters and interfaces. More...

#include <base.h>

Inheritance diagram for axi::fsm::base:
Collaboration diagram for axi::fsm::base:

Public Types

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
 

Public Member Functions

 base (size_t transfer_width, bool coherent=false, axi::fsm::protocol_time_point_e wr_start=axi::fsm::RequestPhaseBeg)
 the constructor More...
 
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 More...
 
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 More...
 
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 More...
 
virtual axi::fsm::fsm_handlecreate_fsm_handle ()=0
 function to create a fsm_handle. Needs to be implemented by the derived class More...
 
virtual void setup_callbacks (axi::fsm::fsm_handle *)=0
 this function is called to add the callbacks to the fsm handle during creation. Needs to be implemented by the derived classes describing reactions upon entering and leaving a state More...
 
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 More...
 
void react (axi::fsm::protocol_time_point_e event, payload_type *trans)
 
void react (axi::fsm::protocol_time_point_e, axi::fsm::fsm_handle *)
 

Public Attributes

::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
 

Detailed Description

base class of all AXITLM based adapters and interfaces.

Definition at line 43 of file base.h.

Constructor & Destructor Documentation

◆ base()

axi::fsm::base::base ( size_t  transfer_width,
bool  coherent = false,
axi::fsm::protocol_time_point_e  wr_start = axi::fsm::RequestPhaseBeg 
)

the constructor

Parameters
transfer_widththe bus width in bytes
wr_startthe phase to start a write access

Definition at line 43 of file base.cpp.

Member Function Documentation

◆ create_fsm_handle()

virtual axi::fsm::fsm_handle* axi::fsm::base::create_fsm_handle ( )
pure virtual

function to create a fsm_handle. Needs to be implemented by the derived class

Returns

Implemented in axi::pe::simple_initiator_b, axi::pe::axi_target_pe, and axi::pe::ace_target_pe.

◆ find_or_create()

fsm_handle * axi::fsm::base::find_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

Parameters
gpthe pointer to the payload
aceflag indicating if the ACE protocaol has to be supported
Returns
handle to the FSM

Definition at line 65 of file base.cpp.

◆ nb_bw()

tlm_sync_enum axi::fsm::base::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

Parameters
transthe tlm generic payload
phasethe protocol phase
tthe annotated time for LT environments
Returns
the sync enum denoting if the transaction has been updated or just accepted

Definition at line 235 of file base.cpp.

◆ nb_fw()

tlm_sync_enum axi::fsm::base::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

Parameters
transthe tlm generic payload
phasethe protocol phase
tthe annotated time for LT environments
Returns
the sync enum denoting if the transaction has been updated or just accepted

Definition at line 190 of file base.cpp.

◆ react()

void axi::fsm::base::react ( axi::fsm::protocol_time_point_e  event,
tlm::scc::tlm_gp_shared_ptr trans 
)
inline

triggers the FSM with event and given transaction

Parameters
eventthe event triggering the FSM
transthe AXITLM transaction the event belongs to

Definition at line 134 of file base.h.

◆ setup_callbacks()

virtual void axi::fsm::base::setup_callbacks ( axi::fsm::fsm_handle )
pure virtual

this function is called to add the callbacks to the fsm handle during creation. Needs to be implemented by the derived classes describing reactions upon entering and leaving a state

Parameters
thehandle of the active fsm

Implemented in axi::pe::axi_target_pe, axi::pe::ace_target_pe, and axi::pe::simple_initiator_b.


The documentation for this struct was generated from the following files: