|
| | router (const sc_core::sc_module_name &nm, cci::cci_broker_handle broker=cci::cci_get_broker()) |
| | Constructor for the router module.
|
|
| router ()=delete |
| | Deleted default constructor to enforce named instantiation.
|
|
| router (const router &)=delete |
| | Deleted copy constructor.
|
|
| ~router () |
| | Destructor for the router module. Cleans up any remaining PathIDExtension objects in the pool.
|
| void | add_target (TargetSocket &t, const uint64_t address, uint64_t size, bool masked=true, unsigned int priority=0) |
| | Adds a target to the router's address map.
|
| virtual void | add_initiator (InitiatorSocket &i) |
| | Adds an initiator to the router.
|
| void | get_cache_stats (uint64_t &hits, uint64_t &misses) const |
| | Get cache statistics (hits and misses).
|
| void | reset_cache_stats () |
| | Reset cache statistics to zero.
|
|
void | rename_last (std::string s) |
|
std::vector< std::shared_ptr< target_info > > | get_bound_targets () |
template<unsigned int BUSWIDTH = DEFAULT_TLM_BUSWIDTH, template< typename, typename > class CacheType = AddrMapNoCache>
class gs::router< BUSWIDTH, CacheType >
A SystemC TLM router module for transaction routing based on address.
This router connects multiple initiator sockets to multiple target sockets, routing transactions based on the address map configured via CCI parameters. It supports DMI, debug transport, and various TLM extensions.
- Template Parameters
-
| BUSWIDTH | The TLM bus width in bits. |
template<unsigned int BUSWIDTH = DEFAULT_TLM_BUSWIDTH, template< typename, typename > class CacheType = AddrMapNoCache>
| gs::router< BUSWIDTH, CacheType >::router |
( |
const sc_core::sc_module_name & | nm, |
|
|
cci::cci_broker_handle | broker = cci::cci_get_broker() ) |
|
inlineexplicit |
Constructor for the router module.
Initializes the base sc_module, initiator and target sockets, address map, CCI broker, and the lazy initialization parameter. Registers transport methods.
- Parameters
-
| nm | SystemC module name. |
| broker | Optional CCI broker handle. Defaults to the global broker. |
template<unsigned int BUSWIDTH = DEFAULT_TLM_BUSWIDTH, template< typename, typename > class CacheType = AddrMapNoCache>
| void gs::router< BUSWIDTH, CacheType >::add_target |
( |
TargetSocket & | t, |
|
|
const uint64_t | address, |
|
|
uint64_t | size, |
|
|
bool | masked = true, |
|
|
unsigned int | priority = 0 ) |
|
inline |
Adds a target to the router's address map.
This method configures CCI parameters for the target (address, size, relative_addresses) and binds the target socket to the router's initiator socket.
- Parameters
-
| t | The target socket to add. |
| address | The base address of the target. |
| size | The size of the target's address range. |
| masked | Boolean indicating if relative addresses should be used (defaults to true). |
| priority | unsigned int priority, lower values have higher priorities |
template<unsigned int BUSWIDTH = DEFAULT_TLM_BUSWIDTH, template< typename, typename > class CacheType = AddrMapNoCache>
| virtual void gs::router< BUSWIDTH, CacheType >::before_end_of_elaboration |
( |
| ) |
|
|
inlineoverrideprotectedvirtual |
Called before end of elaboration to ensure lazy initialization.
If lazy_init is false, this method triggers the lazy_initialize process.
template<unsigned int BUSWIDTH = DEFAULT_TLM_BUSWIDTH, template< typename, typename > class CacheType = AddrMapNoCache>
| std::shared_ptr< target_info > gs::router< BUSWIDTH, CacheType >::decode_address |
( |
tlm::tlm_generic_payload & | trans | ) |
|
|
inlineoverrideprotectedvirtual |
Decodes the address from a TLM generic payload to find the target.
This virtual function, overriding the base class, ensures that the router is initialized (via lazy_initialize) before attempting to find the target_info associated with the transaction's address using the internal addressMap.
- Parameters
-
| trans | The TLM generic payload. |
- Returns
- A shared_ptr to the target_info object if found, otherwise nullptr.
Implements gs::router_if< DEFAULT_TLM_BUSWIDTH >.
template<unsigned int BUSWIDTH = DEFAULT_TLM_BUSWIDTH, template< typename, typename > class CacheType = AddrMapNoCache>
| void gs::router< BUSWIDTH, CacheType >::reset_cache_stats |
( |
| ) |
|
|
inline |
Reset cache statistics to zero.
This method should be called before each benchmark iteration to ensure accurate measurement of cache performance for that specific test.