Go to the documentation of this file.
38 #include "debug/RubyNetwork.hh"
90 i !=
p.routers.end(); ++
i) {
91 Router* router = safe_cast<Router*>(*
i);
100 i !=
p.netifs.end(); ++
i) {
103 ni->init_net_ptr(
this);
141 Router* router = safe_cast<Router*>(*
i);
142 [[maybe_unused]]
int router_id =
148 assert(router_id == router->
get_id());
169 GarnetExtLink* garnet_link = safe_cast<GarnetExtLink*>(link);
198 DPRINTF(RubyNetwork,
"Enable external bridge for %s\n",
199 garnet_link->
name());
203 dest,
m_routers[dest]->get_vc_per_vnet());
205 m_nis[local_src]->addOutPort(net_link, credit_link, dest,
210 DPRINTF(RubyNetwork,
"Enable internal bridge for %s\n",
211 garnet_link->
name());
213 addInPort(dst_inport_dirn,
217 m_routers[dest]->addInPort(dst_inport_dirn, net_link, credit_link);
238 GarnetExtLink* garnet_link = safe_cast<GarnetExtLink*>(link);
267 DPRINTF(RubyNetwork,
"Enable external bridge for %s\n",
268 garnet_link->
name());
273 m_nis[local_dest]->addInPort(net_link, credit_link);
277 DPRINTF(RubyNetwork,
"Enable internal bridge for %s\n",
278 garnet_link->
name());
280 addOutPort(src_outport_dirn,
282 routing_table_entry, link->
m_weight,
287 addOutPort(src_outport_dirn, net_link,
305 GarnetIntLink* garnet_link = safe_cast<GarnetIntLink*>(link);
316 std::max(
m_routers[dest]->get_vc_per_vnet(),
333 DPRINTF(RubyNetwork,
"Enable destination bridge for %s\n",
334 garnet_link->
name());
335 m_routers[dest]->addInPort(dst_inport_dirn,
338 m_routers[dest]->addInPort(dst_inport_dirn, net_link, credit_link);
342 DPRINTF(RubyNetwork,
"Enable source bridge for %s\n",
343 garnet_link->
name());
350 m_routers[src]->addOutPort(src_outport_dirn, net_link,
370 return m_nis[local_ni]->get_router_id(vnet);
395 .
name(
name() +
".packet_network_latency")
401 .
name(
name() +
".packet_queueing_latency")
413 .
name(
name() +
".average_packet_vnet_latency")
419 .
name(
name() +
".average_packet_vqueue_latency")
425 .
name(
name() +
".average_packet_network_latency");
430 .
name(
name() +
".average_packet_queueing_latency");
435 .
name(
name() +
".average_packet_latency");
456 .
name(
name() +
".flit_network_latency")
462 .
name(
name() +
".flit_queueing_latency")
474 .
name(
name() +
".average_flit_vnet_latency")
479 .
name(
name() +
".average_flit_vqueue_latency")
485 .
name(
name() +
".average_flit_network_latency");
490 .
name(
name() +
".average_flit_queueing_latency");
495 .
name(
name() +
".average_flit_latency");
506 .
name(
name() +
".ext_in_link_utilization");
508 .
name(
name() +
".ext_out_link_utilization");
510 .
name(
name() +
".int_link_utilization");
512 .
name(
name() +
".avg_link_utilization");
521 for (
int source = 0; source <
m_routers.size(); ++source) {
527 for (
int dest = 0; dest <
m_routers.size(); ++dest) {
531 data_packets->
name(
name() +
".data_traffic_distribution." +
"n" +
535 ctrl_packets->
name(
name() +
".ctrl_traffic_distribution." +
"n" +
546 double time_delta = double(
curCycle() -
rs->getStartCycle());
560 (double(activity) / time_delta);
563 for (
int j = 0;
j < vc_load.size();
j++) {
591 out <<
"[GarnetNetwork]";
599 int vnet = route.
vnet;
610 uint32_t num_functional_writes = 0;
613 num_functional_writes +=
m_routers[
i]->functionalWrite(pkt);
616 for (
unsigned int i = 0;
i <
m_nis.size(); ++
i) {
617 num_functional_writes +=
m_nis[
i]->functionalWrite(pkt);
624 return num_functional_writes;
This is a simple scalar statistic, like a counter.
static uint32_t m_virtual_networks
statistics::Formula m_avg_flit_network_latency
uint32_t getBuffersPerCtrlVC()
std::string PortDirection
Cycles curCycle() const
Determine the current cycle, corresponding to a tick aligned to a clock edge.
statistics::Scalar m_total_int_link_utilization
std::vector< VNET_type > m_vnet_type
statistics::Formula m_avg_flit_queueing_latency
statistics::Vector m_packet_queueing_latency
statistics::Scalar m_total_ext_in_link_utilization
NetworkBridge * extNetBridge[2]
statistics::Vector m_packets_injected
const FlagsType nozero
Don't print if this is zero.
virtual void init()
init() is called after all C++ SimObjects have been created and all ports are connected.
const std::string to_string(sc_enc enc)
bool m_enable_fault_model
void createLinks(Network *net)
Derived & subname(off_type index, const std::string &name)
Set the subfield name for the given index, and marks this stat to print at the end of simulation.
std::vector< NetworkLink * > m_networklinks
NetworkLink * m_network_link
std::string csprintf(const char *format, const Args &...args)
std::vector< Router * > m_routers
statistics::Scalar m_total_ext_out_link_utilization
statistics::Scalar m_total_hops
statistics::Formula m_avg_hops
const FlagsType pdf
Print the percent of the total that this entry represents.
uint32_t m_buffers_per_data_vc
statistics::Formula m_avg_packet_vqueue_latency
std::vector< NetworkInterface * > m_nis
statistics::Formula m_avg_flit_vnet_latency
Derived & name(const std::string &name)
Set the name and marks this stat to print at the end of simulation.
void init_net_ptr(GarnetNetwork *net_ptr)
statistics::Formula m_avg_packet_vnet_latency
virtual std::string name() const
const Params & params() const
std::vector< std::vector< statistics::Scalar * > > m_data_traffic_distribution
NetworkBridge * intNetBridge[2]
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
int declare_router(int number_of_inputs, int number_of_outputs, int number_of_vcs_per_vnet, int number_of_buff_per_data_vc, int number_of_buff_per_ctrl_vc)
GarnetNetwork(const Params &p)
void init()
init() is called after all C++ SimObjects have been created and all ports are connected.
statistics::Formula m_avg_packet_network_latency
uint32_t m_max_vcs_per_vnet
void makeInternalLink(SwitchID src, SwitchID dest, BasicLink *link, std::vector< NetDest > &routing_table_entry, PortDirection src_outport_dirn, PortDirection dest_inport_dirn)
void setType(link_type type)
void printFaultVector(std::ostream &out)
NetworkBridge * srcCredBridge
NodeID getLocalNodeID(NodeID global_id) const
CreditLink * m_credit_link
std::vector< std::vector< MessageBuffer * > > m_fromNetQueues
statistics::Formula m_avg_packet_queueing_latency
std::vector< std::vector< statistics::Scalar * > > m_ctrl_traffic_distribution
std::vector< CreditLink * > m_creditlinks
const char * garnetVersion
void makeExtInLink(NodeID src, SwitchID dest, BasicLink *link, std::vector< NetDest > &routing_table_entry)
GarnetNetworkParams Params
NetworkBridge * dstCredBridge
statistics::Vector m_flit_network_latency
uint32_t getBuffersPerDataVC()
int get_router_id(int ni, int vnet)
virtual void regStats()
Callback to set stat parameters.
CreditLink * m_credit_links[2]
statistics::Vector m_flit_queueing_latency
std::vector< std::vector< MessageBuffer * > > m_toNetQueues
std::vector< std::string > m_vnet_type_names
statistics::Formula m_avg_packet_latency
statistics::Vector m_packet_network_latency
Topology * m_topology_ptr
statistics::Formula m_avg_flit_latency
statistics::Vector m_flits_injected
bool isFaultModelEnabled() const
statistics::Vector m_average_vc_load
const FlagsType oneline
Print all values on a single line.
statistics::Scalar m_average_link_utilization
uint32_t get_vc_per_vnet()
NetworkBridge * extCredBridge[2]
statistics::Vector m_flits_received
uint32_t m_buffers_per_ctrl_vc
void print(std::ostream &out) const
void update_traffic_distribution(RouteInfo route)
void printAggregateFaultProbability(std::ostream &out)
void makeExtOutLink(SwitchID src, NodeID dest, BasicLink *link, std::vector< NetDest > &routing_table_entry)
Derived & flags(Flags _flags)
Set the flags and marks this stat to print at the end of simulation.
uint32_t functionalWrite(Packet *pkt)
Function for performing a functional write.
statistics::Formula m_avg_flit_vqueue_latency
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
void regStats()
Callback to set stat parameters.
const FlagsType total
Print the total.
Derived & init(size_type size)
Set this vector to have the given size.
statistics::Vector m_packets_received
NetworkBridge * intCredBridge[2]
NetworkLink * m_network_links[2]
void resetStats()
Callback to reset stats.
NetworkBridge * srcNetBridge
NetworkBridge * dstNetBridge
Generated on Thu Jun 16 2022 10:41:57 for gem5 by doxygen 1.8.17