|
quic/qbox
|
A SystemC TLM router module for transaction routing based on address. More...
#include <router.h>


Public Member Functions | |
| 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. | |
Public Member Functions inherited from gs::router_if< BUSWIDTH > | |
| void | rename_last (std::string s) |
| std::vector< std::shared_ptr< target_info > > | get_bound_targets () |
Public Attributes | |
| initiator_socket_type | initiator_socket |
| Initiator socket to connect to targets. | |
| tlm_utils::multi_passthrough_target_socket< router< BUSWIDTH, CacheType >, BUSWIDTH > | target_socket |
| Target socket to receive transactions from initiators. | |
| cci::cci_broker_handle | m_broker |
| CCI broker handle for configuration parameters. | |
Protected Member Functions | |
| std::shared_ptr< target_info > | decode_address (tlm::tlm_generic_payload &trans) override |
| Decodes the address from a TLM generic payload to find the target. | |
| virtual void | before_end_of_elaboration () override |
| Called before end of elaboration to ensure lazy initialization. | |
Protected Member Functions inherited from gs::router_if< BUSWIDTH > | |
| std::string | parent (std::string name) |
| std::string | nameFromSocket (std::string s) |
Additional Inherited Members | |
Protected Attributes inherited from gs::router_if< BUSWIDTH > | |
| std::vector< std::shared_ptr< target_info > > | bound_targets |
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.
| BUSWIDTH | The TLM bus width in bits. |
|
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.
| nm | SystemC module name. |
| broker | Optional CCI broker handle. Defaults to the global broker. |
|
inlinevirtual |
Adds an initiator to the router.
This method handles the binding between the initiator's port and the router's target socket.
| i | The initiator socket to add. |
|
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.
| 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 |
|
inlineoverrideprotectedvirtual |
Called before end of elaboration to ensure lazy initialization.
If lazy_init is false, this method triggers the lazy_initialize process.
|
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.
| trans | The TLM generic payload. |
target_info object if found, otherwise nullptr. Implements gs::router_if< BUSWIDTH >.
|
inline |
Get cache statistics (hits and misses).
This method exposes the cache performance metrics for benchmarking and analysis.
| hits | Output parameter for number of cache hits |
| misses | Output parameter for number of cache misses |
|
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.