gem5  v20.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 ()=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, 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 ()
 
InputUnitgetInputUnit (unsigned port)
 
OutputUnitgetOutputUnit (unsigned port)
 
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
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...
 
const Paramsparams () const
 
 SimObject (const Params *_params)
 
- 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)
 
void setCurTick (Tick newVal)
 
 EventManager (EventManager &em)
 
 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)
 
void scheduleEventAbsolute (Tick timeAbs)
 

Private Attributes

Cycles m_latency
 
int m_virtual_networks
 
int m_vc_per_vnet
 
int m_num_vcs
 
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)
 
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 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 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 43 of file Router.cc.

References m_input_unit, and m_output_unit.

Referenced by functionalWrite().

◆ ~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,
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_net_ptr()

GarnetNetwork* Router::get_net_ptr ( )
inline

◆ get_num_inports()

int Router::get_num_inports ( )
inline

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

References m_output_unit.

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

◆ get_num_vcs()

int Router::get_num_vcs ( )
inline

Definition at line 75 of file Router.hh.

References m_num_vcs.

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

◆ get_num_vnets()

int Router::get_num_vnets ( )
inline

Definition at line 76 of file Router.hh.

References m_virtual_networks.

◆ get_pipe_stages()

Cycles Router::get_pipe_stages ( )
inline

Definition at line 74 of file Router.hh.

References m_latency.

Referenced by InputUnit::wakeup().

◆ get_vc_per_vnet()

int Router::get_vc_per_vnet ( )
inline

Definition at line 77 of file Router.hh.

References m_vc_per_vnet.

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

◆ getInportDirection()

PortDirection Router::getInportDirection ( int  inport)

Definition at line 134 of file Router.cc.

References m_input_unit.

Referenced by getOutputUnit().

◆ getInputUnit()

InputUnit* Router::getInputUnit ( unsigned  port)
inline

◆ getOutportDirection()

PortDirection Router::getOutportDirection ( int  outport)

Definition at line 128 of file Router.cc.

References m_output_unit.

Referenced by getOutputUnit().

◆ getOutputUnit()

OutputUnit* Router::getOutputUnit ( unsigned  port)
inline

◆ getPortDirectionName()

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

Definition at line 159 of file Router.cc.

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

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

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

Referenced by print().

◆ init_net_ptr()

void Router::init_net_ptr ( GarnetNetwork net_ptr)
inline

Definition at line 82 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.

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

◆ resetStats()

void Router::resetStats ( )
virtual

◆ route_compute()

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

Definition at line 140 of file Router.cc.

References RoutingUnit::outportCompute(), and routingUnit.

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

◆ schedule_wakeup()

void Router::schedule_wakeup ( Cycles  time)

◆ wakeup()

void Router::wakeup ( )
virtual

Member Data Documentation

◆ crossbarSwitch

CrossbarSwitch Router::crossbarSwitch
private

Definition at line 138 of file Router.hh.

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

◆ m_buffer_reads

Stats::Scalar Router::m_buffer_reads
private

Definition at line 144 of file Router.hh.

Referenced by collateStats(), and regStats().

◆ m_buffer_writes

Stats::Scalar Router::m_buffer_writes
private

Definition at line 145 of file Router.hh.

Referenced by collateStats(), and regStats().

◆ m_crossbar_activity

Stats::Scalar Router::m_crossbar_activity
private

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

Referenced by get_pipe_stages().

◆ m_network_ptr

GarnetNetwork* Router::m_network_ptr
private

◆ m_num_vcs

int Router::m_num_vcs
private

Definition at line 133 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 147 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 148 of file Router.hh.

Referenced by collateStats(), and regStats().

◆ m_vc_per_vnet

int Router::m_vc_per_vnet
private

Definition at line 133 of file Router.hh.

Referenced by get_vc_per_vnet().

◆ m_virtual_networks

int Router::m_virtual_networks
private

Definition at line 133 of file Router.hh.

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

◆ routingUnit

RoutingUnit Router::routingUnit
private

Definition at line 136 of file Router.hh.

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

◆ switchAllocator

SwitchAllocator Router::switchAllocator
private

Definition at line 137 of file Router.hh.

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


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

Generated on Thu May 28 2020 16:21:50 for gem5 by doxygen 1.8.13