62 :
Network(
p), m_buffer_size(
p.buffer_size),
63 m_endpoint_bandwidth(
p.endpoint_bandwidth),
68 i !=
p.routers.end(); ++
i) {
70 s->init_net_ptr(
this);
71 auto id =
static_cast<size_t>(
s->params().router_id);
76 p.physical_vnets_channels;
78 p.physical_vnets_bandwidth;
79 bool physical_vnets = physical_vnets_channels.size() > 0;
80 int vnets =
p.number_of_virtual_networks;
82 fatal_if(physical_vnets && (physical_vnets_channels.size() != vnets),
83 "physical_vnets_channels must provide channel count for all vnets");
85 fatal_if(!physical_vnets && (physical_vnets_bandwidth.size() != 0),
86 "physical_vnets_bandwidth also requires physical_vnets_channels");
88 fatal_if((physical_vnets_bandwidth.size() != vnets) &&
89 (physical_vnets_bandwidth.size() != 0),
90 "physical_vnets_bandwidth must provide BW for all vnets");
118 int num_vnets =
params().number_of_virtual_networks;
123 routing_table_entry[0],
165 for (MessageSizeType
type = MessageSizeType_FIRST;
166 type < MessageSizeType_NUM; ++
type) {
169 csprintf(
"msg_count.%s", MessageSizeType_to_string(
type)).c_str());
176 csprintf(
"msg_byte.%s", MessageSizeType_to_string(
type)).c_str());
184 sum(it.second->getMsgCount(
type));
197 it.second->collateStats();
204 out <<
"[SimpleNetwork]";
216 if (it.second->functionalRead(pkt))
232 if (it.second->functionalRead(pkt,
mask))
245 uint32_t num_functional_writes = 0;
248 num_functional_writes += it.second->functionalWrite(pkt);
254 return num_functional_writes;
259 : statistics::
Group(parent)
ClockedObjectParams Params
Parameters of ClockedObject.
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
Topology * m_topology_ptr
static uint32_t MessageSizeType_to_int(MessageSizeType size_type)
std::vector< std::vector< MessageBuffer * > > m_fromNetQueues
NodeID getLocalNodeID(NodeID global_id) const
std::vector< std::vector< MessageBuffer * > > m_toNetQueues
const std::vector< MessageBuffer * > m_buffers
void regStats()
Callback to set stat parameters.
void print(std::ostream &out) const
std::vector< MessageBuffer * > m_int_link_buffers
void makeInternalLink(SwitchID src, SwitchID dest, BasicLink *link, std::vector< NetDest > &routing_table_entry, PortDirection src_outport, PortDirection dst_inport)
std::unordered_map< int, Switch * > m_switches
bool functionalRead(Packet *pkt)
uint32_t functionalWrite(Packet *pkt)
void makeExtOutLink(SwitchID src, NodeID dest, BasicLink *link, std::vector< NetDest > &routing_table_entry)
gem5::ruby::SimpleNetwork::NetworkStats networkStats
SimpleNetwork(const Params &p)
void init()
init() is called after all C++ SimObjects have been created and all ports are connected.
void makeExtInLink(NodeID src, SwitchID dest, BasicLink *link, std::vector< NetDest > &routing_table_entry)
void createLinks(Network *net)
#define fatal_if(cond,...)
Conditional fatal macro that checks the supplied condition and only causes a fatal error if the condi...
#define gem5_assert(cond,...)
The assert macro will function like a normal assert, but will use panic instead of straight abort().
const Params & params() const
virtual void init()
init() is called after all C++ SimObjects have been created and all ports are connected.
virtual void regStats()
Callback to set stat parameters.
std::string PortDirection
const FlagsType nozero
Don't print if this is zero.
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
T safe_cast(U &&ref_or_ptr)
std::string csprintf(const char *format, const Args &...args)
statistics::Formula * m_msg_bytes[MessageSizeType_NUM]
NetworkStats(statistics::Group *parent)
statistics::Formula * m_msg_counts[MessageSizeType_NUM]