gem5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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

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 ()
 Register statistics for this object. More...
 
void collateStats ()
 
void resetStats ()
 Reset statistics associated with this object. 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)
 
void regStats () override
 Register statistics for this 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 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 Clocked
void updateClockPeriod () const
 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...
 
- 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
 
Stats::Scalar numPwrStateTransitions
 
Stats::Distribution pwrStateClkGateDist
 
Stats::Vector pwrStateResidencyTicks
 
- 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

typedef GarnetRouterParams Router::Params

Definition at line 60 of file Router.hh.

Constructor & Destructor Documentation

Router::Router ( const Params p)
Router::~Router ( )

Member Function Documentation

void Router::addInPort ( PortDirection  inport_dirn,
NetworkLink link,
CreditLink credit_link 
)
void Router::addOutPort ( PortDirection  outport_dirn,
NetworkLink link,
const NetDest routing_table_entry,
int  link_weight,
CreditLink credit_link 
)
void Router::collateStats ( )
uint32_t Router::functionalWrite ( Packet pkt)
bool Router::get_aggregate_fault_probability ( int  temperature,
float *  aggregate_fault_prob 
)
inline
bool Router::get_fault_vector ( int  temperature,
float  fault_vector[] 
)
inline
int Router::get_id ( )
inline
std::vector<InputUnit *>& Router::get_inputUnit_ref ( )
inline

Definition at line 89 of file Router.hh.

References m_input_unit.

Referenced by SwitchAllocator::init().

GarnetNetwork* Router::get_net_ptr ( )
inline
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().

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

int Router::get_num_vcs ( )
inline
int Router::get_num_vnets ( )
inline

Definition at line 77 of file Router.hh.

References m_virtual_networks.

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

Definition at line 90 of file Router.hh.

References m_output_unit.

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

Cycles Router::get_pipe_stages ( )
inline

Definition at line 75 of file Router.hh.

References m_latency.

Referenced by InputUnit::wakeup().

int Router::get_vc_per_vnet ( )
inline
PortDirection Router::getInportDirection ( int  inport)

Definition at line 156 of file Router.cc.

References m_input_unit.

PortDirection Router::getOutportDirection ( int  outport)

Definition at line 150 of file Router.cc.

References m_output_unit.

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

Definition at line 181 of file Router.cc.

Referenced by SwitchAllocator::arbitrate_outports().

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

Definition at line 168 of file Router.cc.

References m_switch, and CrossbarSwitch::update_sw_winner().

Referenced by SwitchAllocator::arbitrate_outports().

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.

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

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

Implements Consumer.

Definition at line 66 of file Router.hh.

void Router::printAggregateFaultProbability ( std::ostream &  out)
void Router::printFaultVector ( std::ostream &  out)
void Router::regStats ( )
virtual
void Router::resetStats ( )
virtual

Reset statistics associated with this object.

Reimplemented from SimObject.

Definition at line 237 of file Router.cc.

References ArmISA::i, ArmISA::j, m_input_unit, and m_virtual_networks.

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 InputUnit::wakeup().

void Router::schedule_wakeup ( Cycles  time)

Definition at line 174 of file Router.cc.

References Consumer::scheduleEvent().

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

void Router::wakeup ( )
virtual

Member Data Documentation

Stats::Scalar Router::m_buffer_reads
private

Definition at line 131 of file Router.hh.

Referenced by collateStats(), and regStats().

Stats::Scalar Router::m_buffer_writes
private

Definition at line 132 of file Router.hh.

Referenced by collateStats(), and regStats().

Stats::Scalar Router::m_crossbar_activity
private

Definition at line 137 of file Router.hh.

Referenced by collateStats(), and regStats().

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

Definition at line 120 of file Router.hh.

Referenced by get_pipe_stages(), and Router().

GarnetNetwork* Router::m_network_ptr
private
int Router::m_num_vcs
private

Definition at line 121 of file Router.hh.

Referenced by get_num_vcs(), and Router().

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

Definition at line 126 of file Router.hh.

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

SwitchAllocator* Router::m_sw_alloc
private

Definition at line 127 of file Router.hh.

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

Stats::Scalar Router::m_sw_input_arbiter_activity
private

Definition at line 134 of file Router.hh.

Referenced by collateStats(), and regStats().

Stats::Scalar Router::m_sw_output_arbiter_activity
private

Definition at line 135 of file Router.hh.

Referenced by collateStats(), and regStats().

CrossbarSwitch* Router::m_switch
private

Definition at line 128 of file Router.hh.

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

int Router::m_vc_per_vnet
private

Definition at line 121 of file Router.hh.

Referenced by get_vc_per_vnet(), and Router().

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 Jun 9 2017 13:04:18 for gem5 by doxygen 1.8.6