gem5  v19.0.0.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Types | Public Member Functions | Private Attributes | List of all members
Router Class Reference

#include <Router.hh>

Inheritance diagram for Router:
BasicRouter Consumer ClockedObject SimObject Clocked EventManager Serializable Drainable Stats::Group

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 ()
 
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, const NetDest &routing_table_entry, int link_weight, CreditLink *credit_link)
 
Cycles get_pipe_stages ()
 
int get_num_vcs ()
 
int get_num_vnets ()
 
int get_vc_per_vnet ()
 
int get_num_inports ()
 
int get_num_outports ()
 
int get_id ()
 
void init_net_ptr (GarnetNetwork *net_ptr)
 
GarnetNetworkget_net_ptr ()
 
std::vector< InputUnit * > & get_inputUnit_ref ()
 
std::vector< OutputUnit * > & get_outputUnit_ref ()
 
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 Paramsparams () const
 
void print (std::ostream &out) const
 
- Public Member Functions inherited from ClockedObject
 ClockedObject (const ClockedObjectParams *p)
 
const Paramsparams () const
 
void serialize (CheckpointOut &cp) const override
 Serialize an object. More...
 
void unserialize (CheckpointIn &cp) override
 Unserialize an object. More...
 
Enums::PwrState pwrState () const
 
std::string pwrStateName () const
 
std::vector< double > pwrStateWeights () const
 Returns the percentage residency for each power state. More...
 
void computeStats ()
 Record stats values like state residency by computing the time difference from previous update. More...
 
void pwrState (Enums::PwrState)
 
- Public Member Functions inherited from SimObject
const Paramsparams () 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...
 
ProbeManagergetProbeManager ()
 Get the probe manager for this object. More...
 
virtual PortgetPort (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
 EventManager (EventManager &em)
 
 EventManager (EventManager *em)
 
 EventManager (EventQueue *eq)
 
EventQueueeventQueue () 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)
 
void setCurTick (Tick newVal)
 
- 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 ()=delete
 
 Group (const Group &)=delete
 
Groupoperator= (const Group &)=delete
 
 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...
 
- 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)
 
void scheduleEventAbsolute (Tick timeAbs)
 

Private Attributes

Cycles m_latency
 
int m_virtual_networks
 
int m_num_vcs
 
int m_vc_per_vnet
 
GarnetNetworkm_network_ptr
 
std::vector< InputUnit * > m_input_unit
 
std::vector< OutputUnit * > m_output_unit
 
RoutingUnitm_routing_unit
 
SwitchAllocatorm_sw_alloc
 
CrossbarSwitchm_switch
 
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 SimObjectfind (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 ()
 Get the fully-qualified name of the active section. More...
 
static void serializeAll (const std::string &cpt_dir)
 
static void unserializeGlobals (CheckpointIn &cp)
 
- Static Public Attributes inherited from Serializable
static int ckptCount = 0
 
static int ckptMaxCount = 0
 
static int ckptPrevCount = -1
 
- 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
 
Clockedoperator= (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 Member Functions inherited from Consumer
void scheduleEvent (Cycles timeDelta)
 
- Protected Attributes inherited from BasicRouter
uint32_t m_id
 
uint32_t m_latency
 
- Protected Attributes inherited from ClockedObject
Enums::PwrState _currPwrState
 To keep track of the current power state. More...
 
Tick prvEvalTick
 
ClockedObject::ClockedObjectStats stats
 
- Protected Attributes inherited from SimObject
const SimObjectParams * _params
 Cached copy of the object parameters. More...
 
- Protected Attributes inherited from EventManager
EventQueueeventq
 A pointer to this object's event queue. More...
 

Detailed Description

Definition at line 57 of file Router.hh.

Member Typedef Documentation

◆ Params

typedef GarnetRouterParams Router::Params

Definition at line 60 of file Router.hh.

Constructor & Destructor Documentation

◆ Router()

Router::Router ( const Params p)

◆ ~Router()

Router::~Router ( )

Member Function Documentation

◆ addInPort()

void Router::addInPort ( PortDirection  inport_dirn,
NetworkLink link,
CreditLink credit_link 
)

◆ addOutPort()

void Router::addOutPort ( PortDirection  outport_dirn,
NetworkLink link,
const NetDest routing_table_entry,
int  link_weight,
CreditLink credit_link 
)

◆ collateStats()

void Router::collateStats ( )

◆ functionalWrite()

uint32_t Router::functionalWrite ( Packet pkt)

◆ get_aggregate_fault_probability()

bool Router::get_aggregate_fault_probability ( int  temperature,
float *  aggregate_fault_prob 
)
inline

◆ get_fault_vector()

bool Router::get_fault_vector ( int  temperature,
float  fault_vector[] 
)
inline

◆ get_id()

int Router::get_id ( )
inline

◆ get_inputUnit_ref()

std::vector<InputUnit *>& Router::get_inputUnit_ref ( )
inline

Definition at line 89 of file Router.hh.

References m_input_unit.

Referenced by SwitchAllocator::init().

◆ get_net_ptr()

GarnetNetwork* Router::get_net_ptr ( )
inline

◆ get_num_inports()

int Router::get_num_inports ( )
inline

Definition at line 79 of file Router.hh.

References m_input_unit.

Referenced by SwitchAllocator::init(), CrossbarSwitch::init(), and GarnetNetwork::init().

◆ get_num_outports()

int Router::get_num_outports ( )
inline

Definition at line 80 of file Router.hh.

References m_output_unit.

Referenced by SwitchAllocator::init(), and GarnetNetwork::init().

◆ get_num_vcs()

int Router::get_num_vcs ( )
inline

◆ get_num_vnets()

int Router::get_num_vnets ( )
inline

Definition at line 77 of file Router.hh.

References m_virtual_networks.

◆ get_outputUnit_ref()

std::vector<OutputUnit *>& Router::get_outputUnit_ref ( )
inline

◆ get_pipe_stages()

Cycles Router::get_pipe_stages ( )
inline

Definition at line 75 of file Router.hh.

References m_latency.

Referenced by InputUnit::wakeup().

◆ get_vc_per_vnet()

int Router::get_vc_per_vnet ( )
inline

◆ getInportDirection()

PortDirection Router::getInportDirection ( int  inport)

Definition at line 156 of file Router.cc.

References m_input_unit.

Referenced by get_outputUnit_ref().

◆ getOutportDirection()

PortDirection Router::getOutportDirection ( int  outport)

Definition at line 150 of file Router.cc.

References m_output_unit.

Referenced by get_outputUnit_ref().

◆ getPortDirectionName()

std::string Router::getPortDirectionName ( PortDirection  direction)

Definition at line 181 of file Router.cc.

Referenced by SwitchAllocator::arbitrate_outports(), and get_outputUnit_ref().

◆ grant_switch()

void Router::grant_switch ( int  inport,
flit t_flit 
)

◆ init()

void Router::init ( )
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 76 of file Router.cc.

References BasicRouter::init(), SwitchAllocator::init(), CrossbarSwitch::init(), m_sw_alloc, and m_switch.

Referenced by print().

◆ init_net_ptr()

void Router::init_net_ptr ( GarnetNetwork net_ptr)
inline

Definition at line 83 of file Router.hh.

References m_network_ptr.

Referenced by GarnetNetwork::GarnetNetwork().

◆ print()

void Router::print ( std::ostream &  out) const
inlinevirtual

Implements Consumer.

Definition at line 66 of file Router.hh.

References addInPort(), addOutPort(), and init().

◆ printAggregateFaultProbability()

void Router::printAggregateFaultProbability ( std::ostream &  out)

◆ printFaultVector()

void Router::printFaultVector ( std::ostream &  out)

◆ regStats()

void Router::regStats ( )
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 191 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().

Referenced by get_outputUnit_ref().

◆ resetStats()

void Router::resetStats ( )
virtual

◆ route_compute()

int Router::route_compute ( RouteInfo  route,
int  inport,
PortDirection  direction 
)

Definition at line 162 of file Router.cc.

References m_routing_unit, and RoutingUnit::outportCompute().

Referenced by get_outputUnit_ref(), and InputUnit::wakeup().

◆ schedule_wakeup()

void Router::schedule_wakeup ( Cycles  time)

◆ wakeup()

void Router::wakeup ( )
virtual

Member Data Documentation

◆ m_buffer_reads

Stats::Scalar Router::m_buffer_reads
private

Definition at line 131 of file Router.hh.

Referenced by collateStats(), and regStats().

◆ m_buffer_writes

Stats::Scalar Router::m_buffer_writes
private

Definition at line 132 of file Router.hh.

Referenced by collateStats(), and regStats().

◆ m_crossbar_activity

Stats::Scalar Router::m_crossbar_activity
private

Definition at line 137 of file Router.hh.

Referenced by collateStats(), and regStats().

◆ m_input_unit

std::vector<InputUnit *> Router::m_input_unit
private

◆ m_latency

Cycles Router::m_latency
private

Definition at line 120 of file Router.hh.

Referenced by get_pipe_stages(), and Router().

◆ m_network_ptr

GarnetNetwork* Router::m_network_ptr
private

◆ m_num_vcs

int Router::m_num_vcs
private

Definition at line 121 of file Router.hh.

Referenced by get_num_vcs(), and Router().

◆ m_output_unit

std::vector<OutputUnit *> Router::m_output_unit
private

◆ m_routing_unit

RoutingUnit* Router::m_routing_unit
private

Definition at line 126 of file Router.hh.

Referenced by addInPort(), addOutPort(), route_compute(), Router(), and ~Router().

◆ m_sw_alloc

SwitchAllocator* Router::m_sw_alloc
private

Definition at line 127 of file Router.hh.

Referenced by collateStats(), init(), resetStats(), Router(), wakeup(), and ~Router().

◆ m_sw_input_arbiter_activity

Stats::Scalar Router::m_sw_input_arbiter_activity
private

Definition at line 134 of file Router.hh.

Referenced by collateStats(), and regStats().

◆ m_sw_output_arbiter_activity

Stats::Scalar Router::m_sw_output_arbiter_activity
private

Definition at line 135 of file Router.hh.

Referenced by collateStats(), and regStats().

◆ m_switch

CrossbarSwitch* Router::m_switch
private

◆ m_vc_per_vnet

int Router::m_vc_per_vnet
private

Definition at line 121 of file Router.hh.

Referenced by get_vc_per_vnet(), and Router().

◆ m_virtual_networks

int Router::m_virtual_networks
private

Definition at line 121 of file Router.hh.

Referenced by collateStats(), get_num_vnets(), resetStats(), and Router().


The documentation for this class was generated from the following files:

Generated on Fri Feb 28 2020 16:27:15 for gem5 by doxygen 1.8.13