57using stl_helpers::operator<<;
68 for (
auto& buffer :
p.port_buffers) {
69 m_port_buffers.emplace_back(buffer);
90 const NetDest& routing_table_entry,
91 Cycles link_latency,
int link_weight,
100 if (physical_vnets_channels.size() > 0 && !out.empty()) {
105 physical_vnets_bandwidth.resize(out.size(), bw_multiplier);
109 physical_vnets_channels, physical_vnets_bandwidth,
113 throttles.size(), link_latency, bw_multiplier,
120 for (
int i = 0;
i < out.size(); ++
i) {
125 intermediateBuffers.push_back(buffer_ptr);
131 perfectSwitch.addOutPort(intermediateBuffers, routing_table_entry,
132 dst_inport, routing_latency, link_weight);
135 throttles.back().addLinks(intermediateBuffers, out);
144 switchStats.m_avg_utilization += throttle.getUtilization();
148 for (
unsigned int type = MessageSizeType_FIRST;
149 type < MessageSizeType_NUM; ++type) {
152 MessageSizeType_to_string(MessageSizeType(type))).c_str());
159 MessageSizeType_to_string(MessageSizeType(type))).c_str());
165 *(
switchStats.m_msg_counts[type]) += throttle.getMsgCount(type);
217 uint32_t num_functional_writes = 0;
221 return num_functional_writes;
Tick cyclesToTicks(Cycles c) const
Cycles is a wrapper class for representing cycle counts, i.e.
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
void init()
init() is called after all C++ SimObjects have been created and all ports are connected.
BasicRouter(const Params &p)
static uint32_t MessageSizeType_to_int(MessageSizeType size_type)
void addInPort(const std::vector< MessageBuffer * > &in)
void init()
init() is called after all C++ SimObjects have been created and all ports are connected.
BaseRoutingUnit & m_routing_unit
const Cycles m_int_routing_latency
PerfectSwitch perfectSwitch
bool functionalRead(Packet *)
uint32_t functionalWrite(Packet *)
SimpleNetwork * m_network_ptr
void print(std::ostream &out) const
const Cycles m_ext_routing_latency
void addOutPort(std::string switch_name, const std::vector< MessageBuffer * > &out, const NetDest &routing_table_entry, Cycles link_latency, int link_weight, int bw_multiplier, bool is_external, PortDirection dst_inport="")
unsigned m_num_connected_buffers
std::vector< MessageBuffer * > m_port_buffers
std::list< Throttle > throttles
void resetStats()
Callback to reset stats.
void regStats()
Callback to set stat parameters.
gem5::ruby::Switch::SwitchStats switchStats
virtual void regStats()
Callback to set stat parameters.
std::string PortDirection
const FlagsType nozero
Don't print if this is zero.
Copyright (c) 2024 Arm Limited All rights reserved.
uint64_t Tick
Tick count type.
std::string csprintf(const char *format, const Args &...args)
SwitchStats(statistics::Group *parent)
statistics::Formula m_avg_utilization