gem5  v20.1.0.0
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 ()=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)
 
GarnetNetworkget_net_ptr ()
 
InputUnitgetInputUnit (unsigned port)
 
OutputUnitgetOutputUnit (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 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...
 
- 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
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)
 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 InforesolveStat (std::string name) const
 Resolve a stat by its name within this group. More...
 
 Group ()=delete
 
 Group (const Group &)=delete
 
Groupoperator= (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)
 
ClockedObjectgetObject ()
 
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
 
GarnetNetworkm_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 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 ()
 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
PowerStatepowerState
 
- 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 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
EventQueueeventq
 A pointer to this object's event queue. More...
 

Detailed Description

Definition at line 56 of file Router.hh.

Member Typedef Documentation

◆ Params

typedef GarnetRouterParams Router::Params

Definition at line 59 of file Router.hh.

Constructor & Destructor Documentation

◆ Router()

Router::Router ( const Params p)

Definition at line 44 of file Router.cc.

References m_input_unit, and m_output_unit.

◆ ~Router()

Router::~Router ( )
default

Member Function Documentation

◆ addInPort()

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

◆ addOutPort()

void Router::addOutPort ( PortDirection  outport_dirn,
NetworkLink link,
std::vector< NetDest > &  routing_table_entry,
int  link_weight,
CreditLink credit_link,
uint32_t  consumerVcs 
)

◆ 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_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 CrossbarSwitch::init(), SwitchAllocator::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()

uint32_t Router::get_num_vcs ( )
inline

Definition at line 76 of file Router.hh.

References m_num_vcs.

Referenced by InputUnit::InputUnit(), and SwitchAllocator::SwitchAllocator().

◆ get_num_vnets()

uint32_t Router::get_num_vnets ( )
inline

Definition at line 77 of file Router.hh.

References m_virtual_networks.

Referenced by OutputUnit::OutputUnit().

◆ 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()

uint32_t Router::get_vc_per_vnet ( )
inline

Definition at line 78 of file Router.hh.

References m_vc_per_vnet.

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

◆ getBitWidth()

int Router::getBitWidth ( )
inline

Definition at line 104 of file Router.hh.

References m_bit_width.

Referenced by InputUnit::wakeup().

◆ getInportDirection()

PortDirection Router::getInportDirection ( int  inport)

Definition at line 149 of file Router.cc.

References m_input_unit.

◆ getInputUnit()

InputUnit* Router::getInputUnit ( unsigned  port)
inline

◆ getOutportDirection()

PortDirection Router::getOutportDirection ( int  outport)

Definition at line 143 of file Router.cc.

References m_output_unit.

◆ getOutputUnit()

OutputUnit* Router::getOutputUnit ( unsigned  port)
inline

◆ getPortDirectionName()

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

◆ grant_switch()

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().

◆ 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 56 of file Router.cc.

References crossbarSwitch, BasicRouter::init(), CrossbarSwitch::init(), SwitchAllocator::init(), and switchAllocator.

◆ 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 65 of file Router.hh.

◆ 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 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().

◆ resetStats()

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

◆ route_compute()

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().

◆ schedule_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().

◆ wakeup()

void Router::wakeup ( )
virtual

Member Data Documentation

◆ crossbarSwitch

CrossbarSwitch Router::crossbarSwitch
private

Definition at line 142 of file Router.hh.

Referenced by collateStats(), functionalWrite(), grant_switch(), init(), resetStats(), and wakeup().

◆ m_bit_width

uint32_t Router::m_bit_width
private

Definition at line 137 of file Router.hh.

Referenced by addInPort(), addOutPort(), and getBitWidth().

◆ m_buffer_reads

Stats::Scalar Router::m_buffer_reads
private

Definition at line 148 of file Router.hh.

Referenced by collateStats(), and regStats().

◆ m_buffer_writes

Stats::Scalar Router::m_buffer_writes
private

Definition at line 149 of file Router.hh.

Referenced by collateStats(), and regStats().

◆ m_crossbar_activity

Stats::Scalar Router::m_crossbar_activity
private

Definition at line 154 of file Router.hh.

Referenced by collateStats(), and regStats().

◆ m_input_unit

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

◆ m_latency

Cycles Router::m_latency
private

Definition at line 135 of file Router.hh.

Referenced by get_pipe_stages().

◆ m_network_ptr

GarnetNetwork* Router::m_network_ptr
private

◆ m_num_vcs

uint32_t Router::m_num_vcs
private

Definition at line 136 of file Router.hh.

Referenced by get_num_vcs().

◆ m_output_unit

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

◆ m_sw_input_arbiter_activity

Stats::Scalar Router::m_sw_input_arbiter_activity
private

Definition at line 151 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 152 of file Router.hh.

Referenced by collateStats(), and regStats().

◆ m_vc_per_vnet

uint32_t Router::m_vc_per_vnet
private

Definition at line 136 of file Router.hh.

Referenced by get_vc_per_vnet().

◆ m_virtual_networks

uint32_t Router::m_virtual_networks
private

Definition at line 136 of file Router.hh.

Referenced by collateStats(), and get_num_vnets().

◆ routingUnit

RoutingUnit Router::routingUnit
private

Definition at line 140 of file Router.hh.

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

◆ switchAllocator

SwitchAllocator Router::switchAllocator
private

Definition at line 141 of file Router.hh.

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


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

Generated on Wed Sep 30 2020 14:02:30 for gem5 by doxygen 1.8.17