gem5
v20.1.0.0
|
#include <Router.hh>
Public Types | |
typedef GarnetRouterParams | Params |
Public Types inherited from BasicRouter | |
typedef BasicRouterParams | Params |
Public Types inherited from ClockedObject | |
typedef ClockedObjectParams | Params |
Parameters of ClockedObject. More... | |
Public Types inherited from SimObject | |
typedef SimObjectParams | Params |
Public Member Functions | |
Router (const Params *p) | |
~Router ()=default | |
void | wakeup () |
void | print (std::ostream &out) const |
void | init () |
init() is called after all C++ SimObjects have been created and all ports are connected. More... | |
void | addInPort (PortDirection inport_dirn, NetworkLink *link, CreditLink *credit_link) |
void | addOutPort (PortDirection outport_dirn, NetworkLink *link, std::vector< NetDest > &routing_table_entry, int link_weight, CreditLink *credit_link, uint32_t consumerVcs) |
Cycles | get_pipe_stages () |
uint32_t | get_num_vcs () |
uint32_t | get_num_vnets () |
uint32_t | get_vc_per_vnet () |
int | get_num_inports () |
int | get_num_outports () |
int | get_id () |
void | init_net_ptr (GarnetNetwork *net_ptr) |
GarnetNetwork * | get_net_ptr () |
InputUnit * | getInputUnit (unsigned port) |
OutputUnit * | getOutputUnit (unsigned port) |
int | getBitWidth () |
PortDirection | getOutportDirection (int outport) |
PortDirection | getInportDirection (int inport) |
int | route_compute (RouteInfo route, int inport, PortDirection direction) |
void | grant_switch (int inport, flit *t_flit) |
void | schedule_wakeup (Cycles time) |
std::string | getPortDirectionName (PortDirection direction) |
void | printFaultVector (std::ostream &out) |
void | printAggregateFaultProbability (std::ostream &out) |
void | regStats () |
Callback to set stat parameters. More... | |
void | collateStats () |
void | resetStats () |
Callback to reset stats. More... | |
bool | get_fault_vector (int temperature, float fault_vector[]) |
bool | get_aggregate_fault_probability (int temperature, float *aggregate_fault_prob) |
uint32_t | functionalWrite (Packet *) |
Public Member Functions inherited from BasicRouter | |
BasicRouter (const Params *p) | |
const Params * | params () const |
void | print (std::ostream &out) const |
Public Member Functions inherited from ClockedObject | |
ClockedObject (const ClockedObjectParams *p) | |
const Params * | params () const |
void | serialize (CheckpointOut &cp) const override |
Serialize an object. More... | |
void | unserialize (CheckpointIn &cp) override |
Unserialize an object. More... | |
Public Member Functions inherited from SimObject | |
const Params * | params () const |
SimObject (const Params *_params) | |
virtual | ~SimObject () |
virtual const std::string | name () const |
virtual void | loadState (CheckpointIn &cp) |
loadState() is called on each SimObject when restoring from a checkpoint. More... | |
virtual void | initState () |
initState() is called on each SimObject when not restoring from a checkpoint. More... | |
virtual void | regProbePoints () |
Register probe points for this object. More... | |
virtual void | regProbeListeners () |
Register probe listeners for this object. More... | |
ProbeManager * | getProbeManager () |
Get the probe manager for this object. More... | |
virtual Port & | getPort (const std::string &if_name, PortID idx=InvalidPortID) |
Get a port with a given name and index. More... | |
virtual void | startup () |
startup() is the final initialization call before simulation. More... | |
DrainState | drain () override |
Provide a default implementation of the drain interface for objects that don't need draining. More... | |
virtual void | memWriteback () |
Write back dirty buffers to memory using functional writes. More... | |
virtual void | memInvalidate () |
Invalidate the contents of memory buffers. More... | |
void | serialize (CheckpointOut &cp) const override |
Serialize an object. More... | |
void | unserialize (CheckpointIn &cp) override |
Unserialize an object. More... | |
Public Member Functions inherited from EventManager | |
EventQueue * | eventQueue () const |
void | schedule (Event &event, Tick when) |
void | deschedule (Event &event) |
void | reschedule (Event &event, Tick when, bool always=false) |
void | schedule (Event *event, Tick when) |
void | deschedule (Event *event) |
void | reschedule (Event *event, Tick when, bool always=false) |
void | wakeupEventQueue (Tick when=(Tick) -1) |
This function is not needed by the usual gem5 event loop but may be necessary in derived EventQueues which host gem5 on other schedulers. More... | |
void | setCurTick (Tick newVal) |
EventManager (EventManager &em) | |
Event manger manages events in the event queue. More... | |
EventManager (EventManager *em) | |
EventManager (EventQueue *eq) | |
Public Member Functions inherited from Serializable | |
Serializable () | |
virtual | ~Serializable () |
void | serializeSection (CheckpointOut &cp, const char *name) const |
Serialize an object into a new section. More... | |
void | serializeSection (CheckpointOut &cp, const std::string &name) const |
void | unserializeSection (CheckpointIn &cp, const char *name) |
Unserialize an a child object. More... | |
void | unserializeSection (CheckpointIn &cp, const std::string &name) |
Public Member Functions inherited from Drainable | |
DrainState | drainState () const |
Return the current drain state of an object. More... | |
virtual void | notifyFork () |
Notify a child process of a fork. More... | |
Public Member Functions inherited from Stats::Group | |
Group (Group *parent, const char *name=nullptr) | |
Construct a new statistics group. More... | |
virtual | ~Group () |
virtual void | preDumpStats () |
Callback before stats are dumped. More... | |
void | addStat (Stats::Info *info) |
Register a stat with this group. More... | |
const std::map< std::string, Group * > & | getStatGroups () const |
Get all child groups associated with this object. More... | |
const std::vector< Info * > & | getStats () const |
Get all stats associated with this object. More... | |
void | addStatGroup (const char *name, Group *block) |
Add a stat block as a child of this block. More... | |
const Info * | resolveStat (std::string name) const |
Resolve a stat by its name within this group. More... | |
Group ()=delete | |
Group (const Group &)=delete | |
Group & | operator= (const Group &)=delete |
Public Member Functions inherited from Clocked | |
void | updateClockPeriod () |
Update the tick to the current tick. More... | |
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 caller to determine a future cycle. More... | |
Cycles | curCycle () const |
Determine the current cycle, corresponding to a tick aligned to a clock edge. More... | |
Tick | nextCycle () const |
Based on the clock of the object, determine the start tick of the first cycle that is at least one cycle in the future. More... | |
uint64_t | frequency () const |
Tick | clockPeriod () const |
double | voltage () const |
Cycles | ticksToCycles (Tick t) const |
Tick | cyclesToTicks (Cycles c) const |
Public Member Functions inherited from Consumer | |
Consumer (ClockedObject *_em) | |
virtual | ~Consumer () |
virtual void | storeEventInfo (int info) |
bool | alreadyScheduled (Tick time) |
void | insertScheduledWakeupTime (Tick time) |
ClockedObject * | getObject () |
void | scheduleEventAbsolute (Tick timeAbs) |
void | scheduleEvent (Cycles timeDelta) |
Private Attributes | |
Cycles | m_latency |
uint32_t | m_virtual_networks |
uint32_t | m_vc_per_vnet |
uint32_t | m_num_vcs |
uint32_t | m_bit_width |
GarnetNetwork * | m_network_ptr |
RoutingUnit | routingUnit |
SwitchAllocator | switchAllocator |
CrossbarSwitch | crossbarSwitch |
std::vector< std::shared_ptr< InputUnit > > | m_input_unit |
std::vector< std::shared_ptr< OutputUnit > > | m_output_unit |
Stats::Scalar | m_buffer_reads |
Stats::Scalar | m_buffer_writes |
Stats::Scalar | m_sw_input_arbiter_activity |
Stats::Scalar | m_sw_output_arbiter_activity |
Stats::Scalar | m_crossbar_activity |
Additional Inherited Members | |
Static Public Member Functions inherited from SimObject | |
static void | serializeAll (CheckpointOut &cp) |
Serialize all SimObjects in the system. More... | |
static SimObject * | find (const char *name) |
Find the SimObject with the given name and return a pointer to it. More... | |
Static Public Member Functions inherited from Serializable | |
static const std::string & | currentSection () |
Gets the fully-qualified name of the active section. More... | |
static void | serializeAll (const std::string &cpt_dir) |
Serializes all the SimObjects. More... | |
static void | unserializeGlobals (CheckpointIn &cp) |
Public Attributes inherited from ClockedObject | |
PowerState * | powerState |
Protected Member Functions inherited from Drainable | |
Drainable () | |
virtual | ~Drainable () |
virtual void | drainResume () |
Resume execution after a successful drain. More... | |
void | signalDrainDone () const |
Signal that an object is drained. More... | |
Protected Member Functions inherited from Clocked | |
Clocked (ClockDomain &clk_domain) | |
Create a clocked object and set the clock domain based on the parameters. More... | |
Clocked (Clocked &)=delete | |
Clocked & | operator= (Clocked &)=delete |
virtual | ~Clocked () |
Virtual destructor due to inheritance. More... | |
void | resetClock () const |
Reset the object's clock using the current global tick value. More... | |
virtual void | clockPeriodUpdated () |
A hook subclasses can implement so they can do any extra work that's needed when the clock rate is changed. More... | |
Protected Attributes inherited from BasicRouter | |
uint32_t | m_id |
uint32_t | m_latency |
Protected Attributes inherited from SimObject | |
const SimObjectParams * | _params |
Cached copy of the object parameters. More... | |
Protected Attributes inherited from EventManager | |
EventQueue * | eventq |
A pointer to this object's event queue. More... | |
typedef GarnetRouterParams Router::Params |
Router::Router | ( | const Params * | p | ) |
Definition at line 44 of file Router.cc.
References m_input_unit, and m_output_unit.
|
default |
void Router::addInPort | ( | PortDirection | inport_dirn, |
NetworkLink * | link, | ||
CreditLink * | credit_link | ||
) |
Definition at line 93 of file Router.cc.
References RoutingUnit::addInDirection(), NetworkLink::bitWidth, fatal_if, get_vc_per_vnet(), InputUnit::getCreditQueue(), m_bit_width, BasicRouter::m_id, m_input_unit, SimObject::name(), routingUnit, InputUnit::set_credit_link(), InputUnit::set_in_link(), NetworkLink::setLinkConsumer(), NetworkLink::setSourceQueue(), and NetworkLink::setVcsPerVnet().
void Router::addOutPort | ( | PortDirection | outport_dirn, |
NetworkLink * | link, | ||
std::vector< NetDest > & | routing_table_entry, | ||
int | link_weight, | ||
CreditLink * | credit_link, | ||
uint32_t | consumerVcs | ||
) |
Definition at line 116 of file Router.cc.
References RoutingUnit::addOutDirection(), RoutingUnit::addRoute(), RoutingUnit::addWeight(), NetworkLink::bitWidth, fatal_if, OutputUnit::getOutQueue(), m_bit_width, m_output_unit, routingUnit, OutputUnit::set_credit_link(), OutputUnit::set_out_link(), NetworkLink::setLinkConsumer(), NetworkLink::setSourceQueue(), and NetworkLink::setVcsPerVnet().
void Router::collateStats | ( | ) |
Definition at line 215 of file Router.cc.
References crossbarSwitch, CrossbarSwitch::get_crossbar_activity(), SwitchAllocator::get_input_arbiter_activity(), SwitchAllocator::get_output_arbiter_activity(), ArmISA::i, ArmISA::j, m_buffer_reads, m_buffer_writes, m_crossbar_activity, m_input_unit, m_sw_input_arbiter_activity, m_sw_output_arbiter_activity, m_virtual_networks, and switchAllocator.
uint32_t Router::functionalWrite | ( | Packet * | pkt | ) |
Definition at line 271 of file Router.cc.
References crossbarSwitch, CrossbarSwitch::functionalWrite(), ArmISA::i, m_input_unit, and m_output_unit.
|
inline |
Definition at line 126 of file Router.hh.
References GarnetNetwork::fault_model, FaultModel::fault_prob(), BasicRouter::m_id, and m_network_ptr.
Referenced by printAggregateFaultProbability().
|
inline |
Definition at line 122 of file Router.hh.
References GarnetNetwork::fault_model, FaultModel::fault_vector(), BasicRouter::m_id, and m_network_ptr.
Referenced by printFaultVector().
|
inline |
Definition at line 81 of file Router.hh.
References BasicRouter::m_id.
Referenced by SwitchAllocator::arbitrate_outports(), OutputUnit::decrement_credit(), OutputUnit::increment_credit(), InputUnit::increment_credit(), GarnetNetwork::init(), RoutingUnit::outportCompute(), RoutingUnit::outportComputeXY(), CrossbarSwitch::wakeup(), and InputUnit::wakeup().
|
inline |
Definition at line 88 of file Router.hh.
References m_network_ptr.
Referenced by RoutingUnit::lookupRoutingTable(), RoutingUnit::outportCompute(), RoutingUnit::outportComputeXY(), OutputUnit::OutputUnit(), and SwitchAllocator::send_allowed().
|
inline |
Definition at line 79 of file Router.hh.
References m_input_unit.
Referenced by CrossbarSwitch::init(), SwitchAllocator::init(), and GarnetNetwork::init().
|
inline |
Definition at line 80 of file Router.hh.
References m_output_unit.
Referenced by SwitchAllocator::init(), and GarnetNetwork::init().
|
inline |
Definition at line 76 of file Router.hh.
References m_num_vcs.
Referenced by InputUnit::InputUnit(), and SwitchAllocator::SwitchAllocator().
|
inline |
Definition at line 77 of file Router.hh.
References m_virtual_networks.
Referenced by OutputUnit::OutputUnit().
|
inline |
|
inline |
Definition at line 78 of file Router.hh.
References m_vc_per_vnet.
Referenced by addInPort(), GarnetNetwork::init(), and SwitchAllocator::SwitchAllocator().
|
inline |
Definition at line 104 of file Router.hh.
References m_bit_width.
Referenced by InputUnit::wakeup().
PortDirection Router::getInportDirection | ( | int | inport | ) |
Definition at line 149 of file Router.cc.
References m_input_unit.
|
inline |
Definition at line 91 of file Router.hh.
References m_input_unit.
Referenced by SwitchAllocator::arbitrate_inports(), SwitchAllocator::arbitrate_outports(), SwitchAllocator::check_for_wakeup(), SwitchAllocator::send_allowed(), and SwitchAllocator::vc_allocate().
PortDirection Router::getOutportDirection | ( | int | outport | ) |
Definition at line 143 of file Router.cc.
References m_output_unit.
|
inline |
Definition at line 98 of file Router.hh.
References m_output_unit.
Referenced by SwitchAllocator::arbitrate_outports(), SwitchAllocator::send_allowed(), SwitchAllocator::vc_allocate(), and CrossbarSwitch::wakeup().
std::string Router::getPortDirectionName | ( | PortDirection | direction | ) |
Definition at line 174 of file Router.cc.
Referenced by SwitchAllocator::arbitrate_outports(), OutputUnit::decrement_credit(), and OutputUnit::increment_credit().
void Router::grant_switch | ( | int | inport, |
flit * | t_flit | ||
) |
Definition at line 161 of file Router.cc.
References crossbarSwitch, and CrossbarSwitch::update_sw_winner().
Referenced by SwitchAllocator::arbitrate_outports().
|
virtual |
init() is called after all C++ SimObjects have been created and all ports are connected.
Initializations that are independent of unserialization but rely on a fully instantiated and connected SimObject graph should be done here.
Reimplemented from BasicRouter.
Definition at line 56 of file Router.cc.
References crossbarSwitch, BasicRouter::init(), CrossbarSwitch::init(), SwitchAllocator::init(), and switchAllocator.
|
inline |
Definition at line 83 of file Router.hh.
References m_network_ptr.
Referenced by GarnetNetwork::GarnetNetwork().
|
inlinevirtual |
void Router::printAggregateFaultProbability | ( | std::ostream & | out | ) |
Definition at line 260 of file Router.cc.
References BASELINE_TEMPERATURE_CELCIUS, get_aggregate_fault_probability(), and BasicRouter::m_id.
Referenced by GarnetNetwork::init().
void Router::printFaultVector | ( | std::ostream & | out | ) |
Definition at line 242 of file Router.cc.
References BASELINE_TEMPERATURE_CELCIUS, GarnetNetwork::fault_model, FaultModel::fault_type_to_string(), get_fault_vector(), BasicRouter::m_id, m_network_ptr, and FaultModel::number_of_fault_types.
Referenced by GarnetNetwork::init().
|
virtual |
Callback to set stat parameters.
This callback is typically used for complex stats (e.g., distributions) that need parameters in addition to a name and a description. Stat names and descriptions should typically be set from the constructor usingo from the constructor using the ADD_STAT macro.
Reimplemented from Stats::Group.
Definition at line 184 of file Router.cc.
References Stats::DataWrap< Derived, InfoProxyType >::flags(), m_buffer_reads, m_buffer_writes, m_crossbar_activity, m_sw_input_arbiter_activity, m_sw_output_arbiter_activity, SimObject::name(), Stats::DataWrap< Derived, InfoProxyType >::name(), Stats::nozero, and Stats::Group::regStats().
|
virtual |
Callback to reset stats.
Reimplemented from Stats::Group.
Definition at line 231 of file Router.cc.
References crossbarSwitch, ArmISA::i, m_input_unit, CrossbarSwitch::resetStats(), SwitchAllocator::resetStats(), and switchAllocator.
int Router::route_compute | ( | RouteInfo | route, |
int | inport, | ||
PortDirection | direction | ||
) |
Definition at line 155 of file Router.cc.
References RoutingUnit::outportCompute(), and routingUnit.
Referenced by InputUnit::wakeup().
void Router::schedule_wakeup | ( | Cycles | time | ) |
Definition at line 167 of file Router.cc.
References Consumer::scheduleEvent().
Referenced by SwitchAllocator::check_for_wakeup(), and InputUnit::wakeup().
|
virtual |
Implements Consumer.
Definition at line 65 of file Router.cc.
References Clocked::clockEdge(), crossbarSwitch, curTick(), DPRINTF, BasicRouter::m_id, m_input_unit, m_output_unit, switchAllocator, SwitchAllocator::wakeup(), and CrossbarSwitch::wakeup().
|
private |
Definition at line 142 of file Router.hh.
Referenced by collateStats(), functionalWrite(), grant_switch(), init(), resetStats(), and wakeup().
|
private |
Definition at line 137 of file Router.hh.
Referenced by addInPort(), addOutPort(), and getBitWidth().
|
private |
Definition at line 148 of file Router.hh.
Referenced by collateStats(), and regStats().
|
private |
Definition at line 149 of file Router.hh.
Referenced by collateStats(), and regStats().
|
private |
Definition at line 154 of file Router.hh.
Referenced by collateStats(), and regStats().
|
private |
Definition at line 144 of file Router.hh.
Referenced by addInPort(), collateStats(), functionalWrite(), get_num_inports(), getInportDirection(), getInputUnit(), resetStats(), Router(), and wakeup().
|
private |
Definition at line 135 of file Router.hh.
Referenced by get_pipe_stages().
|
private |
Definition at line 138 of file Router.hh.
Referenced by get_aggregate_fault_probability(), get_fault_vector(), get_net_ptr(), init_net_ptr(), and printFaultVector().
|
private |
Definition at line 136 of file Router.hh.
Referenced by get_num_vcs().
|
private |
Definition at line 145 of file Router.hh.
Referenced by addOutPort(), functionalWrite(), get_num_outports(), getOutportDirection(), getOutputUnit(), Router(), and wakeup().
|
private |
Definition at line 151 of file Router.hh.
Referenced by collateStats(), and regStats().
|
private |
Definition at line 152 of file Router.hh.
Referenced by collateStats(), and regStats().
|
private |
Definition at line 136 of file Router.hh.
Referenced by get_vc_per_vnet().
|
private |
Definition at line 136 of file Router.hh.
Referenced by collateStats(), and get_num_vnets().
|
private |
Definition at line 140 of file Router.hh.
Referenced by addInPort(), addOutPort(), and route_compute().
|
private |
Definition at line 141 of file Router.hh.
Referenced by collateStats(), init(), resetStats(), and wakeup().