Go to the documentation of this file.
37 #include "debug/RubyNetwork.hh"
79 i !=
p.routers.end(); ++
i) {
80 Router* router = safe_cast<Router*>(*
i);
89 i !=
p.netifs.end(); ++
i) {
92 ni->init_net_ptr(
this);
130 Router* router = safe_cast<Router*>(*
i);
131 M5_VAR_USED
int router_id =
137 assert(router_id == router->
get_id());
158 GarnetExtLink* garnet_link = safe_cast<GarnetExtLink*>(link);
187 DPRINTF(RubyNetwork,
"Enable external bridge for %s\n",
188 garnet_link->
name());
192 dest,
m_routers[dest]->get_vc_per_vnet());
194 m_nis[local_src]->addOutPort(net_link, credit_link, dest,
199 DPRINTF(RubyNetwork,
"Enable internal bridge for %s\n",
200 garnet_link->
name());
202 addInPort(dst_inport_dirn,
206 m_routers[dest]->addInPort(dst_inport_dirn, net_link, credit_link);
227 GarnetExtLink* garnet_link = safe_cast<GarnetExtLink*>(link);
256 DPRINTF(RubyNetwork,
"Enable external bridge for %s\n",
257 garnet_link->
name());
262 m_nis[local_dest]->addInPort(net_link, credit_link);
266 DPRINTF(RubyNetwork,
"Enable internal bridge for %s\n",
267 garnet_link->
name());
269 addOutPort(src_outport_dirn,
271 routing_table_entry, link->
m_weight,
276 addOutPort(src_outport_dirn, net_link,
294 GarnetIntLink* garnet_link = safe_cast<GarnetIntLink*>(link);
305 std::max(
m_routers[dest]->get_vc_per_vnet(),
322 DPRINTF(RubyNetwork,
"Enable destination bridge for %s\n",
323 garnet_link->
name());
324 m_routers[dest]->addInPort(dst_inport_dirn,
327 m_routers[dest]->addInPort(dst_inport_dirn, net_link, credit_link);
331 DPRINTF(RubyNetwork,
"Enable source bridge for %s\n",
332 garnet_link->
name());
339 m_routers[src]->addOutPort(src_outport_dirn, net_link,
359 return m_nis[local_ni]->get_router_id(vnet);
382 .
name(
name() +
".packet_network_latency")
388 .
name(
name() +
".packet_queueing_latency")
400 .
name(
name() +
".average_packet_vnet_latency")
406 .
name(
name() +
".average_packet_vqueue_latency")
412 .
name(
name() +
".average_packet_network_latency");
417 .
name(
name() +
".average_packet_queueing_latency");
422 .
name(
name() +
".average_packet_latency");
441 .
name(
name() +
".flit_network_latency")
447 .
name(
name() +
".flit_queueing_latency")
459 .
name(
name() +
".average_flit_vnet_latency")
464 .
name(
name() +
".average_flit_vqueue_latency")
470 .
name(
name() +
".average_flit_network_latency");
475 .
name(
name() +
".average_flit_queueing_latency");
480 .
name(
name() +
".average_flit_latency");
491 .
name(
name() +
".ext_in_link_utilization");
493 .
name(
name() +
".ext_out_link_utilization");
495 .
name(
name() +
".int_link_utilization");
497 .
name(
name() +
".avg_link_utilization");
509 double time_delta = double(
curCycle() -
rs->getStartCycle());
523 (double(activity) / time_delta);
526 for (
int j = 0;
j < vc_load.size();
j++) {
554 out <<
"[GarnetNetwork]";
560 uint32_t num_functional_writes = 0;
563 num_functional_writes +=
m_routers[
i]->functionalWrite(pkt);
566 for (
unsigned int i = 0;
i <
m_nis.size(); ++
i) {
567 num_functional_writes +=
m_nis[
i]->functionalWrite(pkt);
574 return num_functional_writes;
std::vector< std::string > m_vnet_type_names
Stats::Scalar m_average_link_utilization
Stats::Formula m_avg_packet_vnet_latency
virtual void regStats()
Callback to set stat parameters.
void resetStats()
Callback to reset stats.
std::vector< VNET_type > m_vnet_type
std::vector< NetworkInterface * > m_nis
Stats::Vector m_packet_network_latency
Stats::Vector m_flits_injected
int get_router_id(int ni, int vnet)
void init()
init() is called after all C++ SimObjects have been created and all ports are connected.
void printAggregateFaultProbability(std::ostream &out)
Stats::Scalar m_total_ext_out_link_utilization
std::vector< std::vector< MessageBuffer * > > m_toNetQueues
void makeExtInLink(NodeID src, SwitchID dest, BasicLink *link, std::vector< NetDest > &routing_table_entry)
std::vector< Router * > m_routers
NetworkBridge * extNetBridge[2]
const char * garnetVersion
void setType(link_type type)
GarnetNetworkParams Params
static uint32_t m_virtual_networks
uint32_t get_vc_per_vnet()
CreditLink * m_credit_link
uint32_t getBuffersPerCtrlVC()
Stats::Scalar m_total_hops
Stats::Vector m_flit_network_latency
void printFaultVector(std::ostream &out)
Derived & flags(Flags _flags)
Set the flags and marks this stat to print at the end of simulation.
Stats::Formula m_avg_hops
CreditLink * m_credit_links[2]
Stats::Formula m_avg_flit_network_latency
NetworkBridge * dstNetBridge
void makeInternalLink(SwitchID src, SwitchID dest, BasicLink *link, std::vector< NetDest > &routing_table_entry, PortDirection src_outport_dirn, PortDirection dest_inport_dirn)
NodeID getLocalNodeID(NodeID global_id) const
const FlagsType oneline
Print all values on a single line.
Stats::Formula m_avg_packet_latency
Stats::Vector m_packets_received
NetworkLink * m_network_links[2]
Stats::Formula m_avg_packet_vqueue_latency
Cycles curCycle() const
Determine the current cycle, corresponding to a tick aligned to a clock edge.
bool isFaultModelEnabled() const
void print(std::ostream &out) const
GarnetNetwork(const Params &p)
Stats::Scalar m_total_int_link_utilization
bool m_enable_fault_model
uint32_t m_buffers_per_data_vc
NetworkBridge * srcNetBridge
void makeExtOutLink(SwitchID src, NodeID dest, BasicLink *link, std::vector< NetDest > &routing_table_entry)
Derived & name(const std::string &name)
Set the name and marks this stat to print at the end of simulation.
Derived & init(size_type size)
Set this vector to have the given size.
Stats::Formula m_avg_flit_vqueue_latency
const FlagsType nozero
Don't print if this is zero.
std::vector< std::vector< MessageBuffer * > > m_fromNetQueues
virtual const std::string name() const
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)
uint32_t getBuffersPerDataVC()
Stats::Vector m_flit_queueing_latency
Stats::Vector m_average_vc_load
NetworkLink * m_network_link
NetworkBridge * extCredBridge[2]
Stats::Formula m_avg_packet_network_latency
NetworkBridge * intCredBridge[2]
Stats::Formula m_avg_flit_queueing_latency
uint32_t m_max_vcs_per_vnet
const FlagsType pdf
Print the percent of the total that this entry represents.
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
void createLinks(Network *net)
virtual void init()
init() is called after all C++ SimObjects have been created and all ports are connected.
uint32_t m_buffers_per_ctrl_vc
Stats::Formula m_avg_flit_latency
std::string PortDirection
Stats::Formula m_avg_flit_vnet_latency
std::vector< CreditLink * > m_creditlinks
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.
NetworkBridge * intNetBridge[2]
void regStats()
Callback to set stat parameters.
void init_net_ptr(GarnetNetwork *net_ptr)
const Params & params() const
Stats::Vector m_packets_injected
Stats::Vector m_flits_received
Stats::Formula m_avg_packet_queueing_latency
Stats::Vector m_packet_queueing_latency
const FlagsType total
Print the total.
uint32_t functionalWrite(Packet *pkt)
Function for performing a functional write.
Stats::Scalar m_total_ext_in_link_utilization
std::vector< NetworkLink * > m_networklinks
std::string csprintf(const char *format, const Args &...args)
NetworkBridge * srcCredBridge
NetworkBridge * dstCredBridge
Topology * m_topology_ptr
Generated on Tue Mar 23 2021 19:41:28 for gem5 by doxygen 1.8.17