35#include "debug/RubyNetwork.hh"
53 m_virtual_networks(
p.virt_nets), m_vc_per_vnet(
p.vcs_per_vnet),
54 m_num_vcs(m_virtual_networks * m_vc_per_vnet), m_bit_width(
p.
width),
55 m_network_ptr(nullptr), routingUnit(this), switchAllocator(this),
78 for (
int inport = 0; inport <
m_input_unit.size(); inport++) {
88 for (
int outport = 0; outport <
m_output_unit.size(); outport++) {
104 " not match that of Router%d(%d). Consider inserting SerDes "
117 m_input_unit.push_back(std::shared_ptr<InputUnit>(input_unit));
126 CreditLink *credit_link, uint32_t consumerVcs)
129 " Consider inserting SerDes Units");
142 m_output_unit.push_back(std::shared_ptr<OutputUnit>(output_unit));
206 .
name(
name() +
".crossbar_activity")
211 .
name(
name() +
".sw_input_arbiter_activity")
216 .
name(
name() +
".sw_output_arbiter_activity")
253 float fault_vector[num_fault_types];
255 out <<
"Router-" <<
m_id <<
" fault vector: " << std::endl;
256 for (
int fault_type_index = 0; fault_type_index < num_fault_types;
257 fault_type_index++) {
258 out <<
" - probability of (";
262 out << fault_vector[fault_type_index] << std::endl;
270 float aggregate_fault_prob;
272 &aggregate_fault_prob);
273 out <<
"Router-" <<
m_id <<
" fault probability: ";
274 out << aggregate_fault_prob << std::endl;
300 uint32_t num_functional_writes = 0;
304 num_functional_writes +=
m_input_unit[
i]->functionalWrite(pkt);
311 return num_functional_writes;
#define BASELINE_TEMPERATURE_CELCIUS
Tick clockEdge(Cycles cycles=Cycles(0)) const
Determine the tick when a cycle begins, by default the current one, but the argument also enables the...
Cycles is a wrapper class for representing cycle counts, i.e.
virtual std::string name() const
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.
void scheduleEvent(Cycles timeDelta)
std::string fault_type_to_string(int fault_type_index)
uint32_t functionalWrite(Packet *pkt)
bool functionalRead(Packet *pkt, WriteMask &mask)
double get_crossbar_activity()
void update_sw_winner(int inport, flit *t_flit)
void setLinkConsumer(Consumer *consumer)
void setSourceQueue(flitBuffer *src_queue, ClockedObject *srcClockObject)
virtual void setVcsPerVnet(uint32_t consumerVcs)
flitBuffer * getOutQueue()
void set_out_link(NetworkLink *link)
void set_credit_link(CreditLink *credit_link)
bool get_fault_vector(int temperature, float fault_vector[])
PortDirection getOutportDirection(int outport)
void addInPort(PortDirection inport_dirn, NetworkLink *link, CreditLink *credit_link)
void init()
init() is called after all C++ SimObjects have been created and all ports are connected.
uint32_t m_virtual_networks
uint32_t functionalWrite(Packet *)
statistics::Scalar m_buffer_reads
bool get_aggregate_fault_probability(int temperature, float *aggregate_fault_prob)
statistics::Scalar m_buffer_writes
GarnetNetwork * m_network_ptr
void printFaultVector(std::ostream &out)
PortDirection getInportDirection(int inport)
std::vector< std::shared_ptr< InputUnit > > m_input_unit
GarnetRouterParams Params
statistics::Scalar m_sw_input_arbiter_activity
SwitchAllocator switchAllocator
bool functionalRead(Packet *pkt, WriteMask &mask)
void printAggregateFaultProbability(std::ostream &out)
void resetStats()
Callback to reset stats.
std::string getPortDirectionName(PortDirection direction)
void grant_switch(int inport, flit *t_flit)
statistics::Scalar m_crossbar_activity
statistics::Scalar m_sw_output_arbiter_activity
int route_compute(RouteInfo route, int inport, PortDirection direction)
void addOutPort(PortDirection outport_dirn, NetworkLink *link, std::vector< NetDest > &routing_table_entry, int link_weight, CreditLink *credit_link, uint32_t consumerVcs)
void schedule_wakeup(Cycles time)
void regStats()
Callback to set stat parameters.
uint32_t get_vc_per_vnet()
CrossbarSwitch crossbarSwitch
std::vector< std::shared_ptr< OutputUnit > > m_output_unit
void addOutDirection(PortDirection outport_dirn, int outport)
void addInDirection(PortDirection inport_dirn, int inport)
void addRoute(std::vector< NetDest > &routing_table_entry)
void addWeight(int link_weight)
int outportCompute(RouteInfo route, int inport, PortDirection inport_dirn)
double get_input_arbiter_activity()
double get_output_arbiter_activity()
Derived & name(const std::string &name)
Set the name and marks this stat to print at the end of simulation.
Derived & flags(Flags _flags)
Set the flags and marks this stat to print at the end of simulation.
#define fatal_if(cond,...)
Conditional fatal macro that checks the supplied condition and only causes a fatal error if the condi...
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.
Tick curTick()
The universal simulation clock.