Go to the documentation of this file.
38 #include "debug/RubyNetwork.hh"
89 i !=
p.routers.end(); ++
i) {
90 Router* router = safe_cast<Router*>(*
i);
99 i !=
p.netifs.end(); ++
i) {
102 ni->init_net_ptr(
this);
140 Router* router = safe_cast<Router*>(*
i);
141 [[maybe_unused]]
int router_id =
147 assert(router_id == router->
get_id());
168 GarnetExtLink* garnet_link = safe_cast<GarnetExtLink*>(link);
197 DPRINTF(RubyNetwork,
"Enable external bridge for %s\n",
198 garnet_link->
name());
202 dest,
m_routers[dest]->get_vc_per_vnet());
204 m_nis[local_src]->addOutPort(net_link, credit_link, dest,
209 DPRINTF(RubyNetwork,
"Enable internal bridge for %s\n",
210 garnet_link->
name());
212 addInPort(dst_inport_dirn,
216 m_routers[dest]->addInPort(dst_inport_dirn, net_link, credit_link);
237 GarnetExtLink* garnet_link = safe_cast<GarnetExtLink*>(link);
266 DPRINTF(RubyNetwork,
"Enable external bridge for %s\n",
267 garnet_link->
name());
272 m_nis[local_dest]->addInPort(net_link, credit_link);
276 DPRINTF(RubyNetwork,
"Enable internal bridge for %s\n",
277 garnet_link->
name());
279 addOutPort(src_outport_dirn,
281 routing_table_entry, link->
m_weight,
286 addOutPort(src_outport_dirn, net_link,
304 GarnetIntLink* garnet_link = safe_cast<GarnetIntLink*>(link);
315 std::max(
m_routers[dest]->get_vc_per_vnet(),
332 DPRINTF(RubyNetwork,
"Enable destination bridge for %s\n",
333 garnet_link->
name());
334 m_routers[dest]->addInPort(dst_inport_dirn,
337 m_routers[dest]->addInPort(dst_inport_dirn, net_link, credit_link);
341 DPRINTF(RubyNetwork,
"Enable source bridge for %s\n",
342 garnet_link->
name());
349 m_routers[src]->addOutPort(src_outport_dirn, net_link,
369 return m_nis[local_ni]->get_router_id(vnet);
394 .
name(
name() +
".packet_network_latency")
400 .
name(
name() +
".packet_queueing_latency")
412 .
name(
name() +
".average_packet_vnet_latency")
418 .
name(
name() +
".average_packet_vqueue_latency")
424 .
name(
name() +
".average_packet_network_latency");
429 .
name(
name() +
".average_packet_queueing_latency");
434 .
name(
name() +
".average_packet_latency");
455 .
name(
name() +
".flit_network_latency")
461 .
name(
name() +
".flit_queueing_latency")
473 .
name(
name() +
".average_flit_vnet_latency")
478 .
name(
name() +
".average_flit_vqueue_latency")
484 .
name(
name() +
".average_flit_network_latency");
489 .
name(
name() +
".average_flit_queueing_latency");
494 .
name(
name() +
".average_flit_latency");
505 .
name(
name() +
".ext_in_link_utilization");
507 .
name(
name() +
".ext_out_link_utilization");
509 .
name(
name() +
".int_link_utilization");
511 .
name(
name() +
".avg_link_utilization");
520 for (
int source = 0; source <
m_routers.size(); ++source) {
526 for (
int dest = 0; dest <
m_routers.size(); ++dest) {
530 data_packets->
name(
name() +
".data_traffic_distribution." +
"n" +
534 ctrl_packets->
name(
name() +
".ctrl_traffic_distribution." +
"n" +
545 double time_delta = double(
curCycle() -
rs->getStartCycle());
559 (double(activity) / time_delta);
562 for (
int j = 0;
j < vc_load.size();
j++) {
590 out <<
"[GarnetNetwork]";
598 int vnet = route.
vnet;
609 uint32_t num_functional_writes = 0;
612 num_functional_writes +=
m_routers[
i]->functionalWrite(pkt);
615 for (
unsigned int i = 0;
i <
m_nis.size(); ++
i) {
616 num_functional_writes +=
m_nis[
i]->functionalWrite(pkt);
623 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 Wed May 4 2022 12:14:01 for gem5 by doxygen 1.8.17