scc 2025.09
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
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
virtual axi::fsm::fsm_handlecreate_fsm_handle ()=0
 function to create a fsm_handle. Needs to be implemented by the derived class
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
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 *)

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.

Member Typedef Documentation

◆ payload_type

using axi::fsm::base::payload_type = axi::axi_protocol_types::tlm_payload_type

aliases used in the class

Definition at line 45 of file base.h.

◆ phase_type

using axi::fsm::base::phase_type = axi::axi_protocol_types::tlm_phase_type

Definition at line 46 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.

◆ ~base()

virtual axi::fsm::base::~base ( )
inlinevirtual

the destructor

Definition at line 57 of file base.h.

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::ace_target_pe, axi::pe::axi_target_pe, and axi::pe::simple_initiator_b.

◆ 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.

◆ process_fsm_clk_queue()

void axi::fsm::base::process_fsm_clk_queue ( )

processes the fsm_clk_queue and triggers the FSM accordingly. Should be registered as rising-edge clock callback

Definition at line 107 of file base.cpp.

◆ process_fsm_event()

void axi::fsm::base::process_fsm_event ( )

processes the fsm_event_queue and triggers FSM aligned

Definition at line 97 of file base.cpp.

◆ react() [1/3]

void axi::fsm::base::react ( axi::fsm::protocol_time_point_e event,
payload_type * trans )
inline

Definition at line 138 of file base.h.

◆ react() [2/3]

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.

◆ react() [3/3]

void axi::fsm::base::react ( axi::fsm::protocol_time_point_e event,
axi::fsm::fsm_handle * fsm_hndl )

Definition at line 128 of file base.cpp.

◆ schedule() [1/4]

void axi::fsm::base::schedule ( axi::fsm::protocol_time_point_e e,
payload_type * gp,
sc_core::sc_time delay,
bool syncronize = false )
inline

Definition at line 123 of file base.h.

◆ schedule() [2/4]

void axi::fsm::base::schedule ( axi::fsm::protocol_time_point_e e,
payload_type * gp,
unsigned cycles )
inline

Definition at line 110 of file base.h.

◆ schedule() [3/4]

void axi::fsm::base::schedule ( axi::fsm::protocol_time_point_e e,
tlm::scc::tlm_gp_shared_ptr & gp,
sc_core::sc_time delay,
bool syncronize = false )
inline

processes the fsm_sched_queue and propagates events to fsm_clk_queue. Should be registered as falling-edge clock callback

Definition at line 119 of file base.h.

◆ schedule() [4/4]

void axi::fsm::base::schedule ( axi::fsm::protocol_time_point_e e,
tlm::scc::tlm_gp_shared_ptr & gp,
unsigned cycles )
inline

processes the fsm_sched_queue and propagates events to fsm_clk_queue. Should be registered as falling-edge clock callback

Definition at line 107 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::ace_target_pe, axi::pe::axi_target_pe, and axi::pe::simple_initiator_b.

Member Data Documentation

◆ active_fsm

std::unordered_map<payload_type*, axi::fsm::fsm_handle*> axi::fsm::base::active_fsm

Definition at line 163 of file base.h.

◆ allocated_fsm

std::vector<std::unique_ptr<axi::fsm::fsm_handle> > axi::fsm::base::allocated_fsm

Definition at line 167 of file base.h.

◆ coherent

const bool axi::fsm::base::coherent

Definition at line 161 of file base.h.

◆ finish_evt

sc_core::sc_event axi::fsm::base::finish_evt

Definition at line 171 of file base.h.

◆ fsm_clk_queue

::scc::fifo_w_cb<std::tuple<axi::fsm::protocol_time_point_e, payload_type*, unsigned> > axi::fsm::base::fsm_clk_queue

Definition at line 153 of file base.h.

◆ fsm_clk_queue_hndl

sc_core::sc_process_handle axi::fsm::base::fsm_clk_queue_hndl

Definition at line 155 of file base.h.

◆ fsm_event_queue

::scc::peq<std::tuple<axi::fsm::protocol_time_point_e, payload_type*, bool> > axi::fsm::base::fsm_event_queue

Definition at line 151 of file base.h.

◆ idle_fsm

std::deque<axi::fsm::fsm_handle*> axi::fsm::base::idle_fsm

Definition at line 165 of file base.h.

◆ instance_name

std::string axi::fsm::base::instance_name

Definition at line 169 of file base.h.

◆ transfer_width_in_bytes

size_t axi::fsm::base::transfer_width_in_bytes

Definition at line 157 of file base.h.

◆ wr_start

const axi::fsm::protocol_time_point_e axi::fsm::base::wr_start

Definition at line 159 of file base.h.


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