gem5  v22.1.0.0
Public Types | Public Member Functions | Private Attributes | List of all members
gem5::ruby::garnet::Router Class Reference

#include <Router.hh>

Inheritance diagram for gem5::ruby::garnet::Router:
gem5::ruby::BasicRouter gem5::ruby::Consumer gem5::ClockedObject gem5::SimObject gem5::Clocked gem5::EventManager gem5::Serializable gem5::Drainable gem5::statistics::Group gem5::Named

Public Types

typedef GarnetRouterParams Params
 
- Public Types inherited from gem5::ClockedObject
using Params = ClockedObjectParams
 Parameters of ClockedObject. More...
 
- Public Types inherited from gem5::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)
 
bool functionalRead (Packet *pkt, WriteMask &mask)
 
uint32_t functionalWrite (Packet *)
 
- Public Member Functions inherited from gem5::ruby::BasicRouter
 PARAMS (BasicRouter)
 
 BasicRouter (const Params &p)
 
void print (std::ostream &out) const
 
- Public Member Functions inherited from gem5::ClockedObject
 ClockedObject (const ClockedObjectParams &p)
 
void serialize (CheckpointOut &cp) const override
 Serialize an object. More...
 
void unserialize (CheckpointIn &cp) override
 Unserialize an object. More...
 
- Public Member Functions inherited from gem5::SimObject
const Paramsparams () const
 
 SimObject (const Params &p)
 
virtual ~SimObject ()
 
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 gem5::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 gem5::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 gem5::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 gem5::statistics::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 (statistics::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...
 
void mergeStatGroup (Group *block)
 Merge the contents (stats & children) of a block to this block. More...
 
 Group ()=delete
 
 Group (const Group &)=delete
 
Groupoperator= (const Group &)=delete
 
- Public Member Functions inherited from gem5::Named
 Named (const std::string &name_)
 
virtual ~Named ()=default
 
virtual std::string name () const
 
- Public Member Functions inherited from gem5::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 gem5::ruby::Consumer
 Consumer (ClockedObject *em, Event::Priority ev_prio=Event::Default_Pri)
 
virtual ~Consumer ()
 
virtual void storeEventInfo (int info)
 
bool alreadyScheduled (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
 
statistics::Scalar m_buffer_reads
 
statistics::Scalar m_buffer_writes
 
statistics::Scalar m_sw_input_arbiter_activity
 
statistics::Scalar m_sw_output_arbiter_activity
 
statistics::Scalar m_crossbar_activity
 

Additional Inherited Members

- Static Public Member Functions inherited from gem5::SimObject
static void serializeAll (const std::string &cpt_dir)
 Create a checkpoint by serializing 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 void setSimObjectResolver (SimObjectResolver *resolver)
 There is a single object name resolver, and it is only set when simulation is restoring from checkpoints. More...
 
static SimObjectResolvergetSimObjectResolver ()
 There is a single object name resolver, and it is only set when simulation is restoring from checkpoints. More...
 
- Static Public Member Functions inherited from gem5::Serializable
static const std::string & currentSection ()
 Gets the fully-qualified name of the active section. More...
 
static void generateCheckpointOut (const std::string &cpt_dir, std::ofstream &outstream)
 Generate a checkpoint file so that the serialization can be routed to it. More...
 
- Public Attributes inherited from gem5::ClockedObject
PowerStatepowerState
 
- Protected Member Functions inherited from gem5::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 gem5::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 gem5::ruby::BasicRouter
uint32_t m_id
 
uint32_t m_latency
 
- Protected Attributes inherited from gem5::SimObject
const SimObjectParams & _params
 Cached copy of the object parameters. More...
 
- Protected Attributes inherited from gem5::EventManager
EventQueueeventq
 A pointer to this object's event queue. More...
 

Detailed Description

Definition at line 66 of file Router.hh.

Member Typedef Documentation

◆ Params

typedef GarnetRouterParams gem5::ruby::garnet::Router::Params

Definition at line 69 of file Router.hh.

Constructor & Destructor Documentation

◆ Router()

gem5::ruby::garnet::Router::Router ( const Params p)

Definition at line 51 of file Router.cc.

References m_input_unit, and m_output_unit.

◆ ~Router()

gem5::ruby::garnet::Router::~Router ( )
default

Member Function Documentation

◆ addInPort()

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

◆ addOutPort()

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

◆ collateStats()

void gem5::ruby::garnet::Router::collateStats ( )

◆ functionalRead()

bool gem5::ruby::garnet::Router::functionalRead ( Packet pkt,
WriteMask mask 
)

◆ functionalWrite()

uint32_t gem5::ruby::garnet::Router::functionalWrite ( Packet pkt)

◆ get_aggregate_fault_probability()

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

◆ get_fault_vector()

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

◆ get_id()

int gem5::ruby::garnet::Router::get_id ( )
inline

◆ get_net_ptr()

GarnetNetwork* gem5::ruby::garnet::Router::get_net_ptr ( )
inline

◆ get_num_inports()

int gem5::ruby::garnet::Router::get_num_inports ( )
inline

◆ get_num_outports()

int gem5::ruby::garnet::Router::get_num_outports ( )
inline

◆ get_num_vcs()

uint32_t gem5::ruby::garnet::Router::get_num_vcs ( )
inline

◆ get_num_vnets()

uint32_t gem5::ruby::garnet::Router::get_num_vnets ( )
inline

Definition at line 87 of file Router.hh.

References m_virtual_networks.

Referenced by gem5::ruby::garnet::OutputUnit::OutputUnit().

◆ get_pipe_stages()

Cycles gem5::ruby::garnet::Router::get_pipe_stages ( )
inline

Definition at line 85 of file Router.hh.

References m_latency.

Referenced by gem5::ruby::garnet::InputUnit::wakeup().

◆ get_vc_per_vnet()

uint32_t gem5::ruby::garnet::Router::get_vc_per_vnet ( )
inline

◆ getBitWidth()

int gem5::ruby::garnet::Router::getBitWidth ( )
inline

Definition at line 114 of file Router.hh.

References m_bit_width.

Referenced by gem5::ruby::garnet::InputUnit::wakeup().

◆ getInportDirection()

PortDirection gem5::ruby::garnet::Router::getInportDirection ( int  inport)

Definition at line 156 of file Router.cc.

References m_input_unit.

◆ getInputUnit()

InputUnit* gem5::ruby::garnet::Router::getInputUnit ( unsigned  port)
inline

◆ getOutportDirection()

PortDirection gem5::ruby::garnet::Router::getOutportDirection ( int  outport)

Definition at line 150 of file Router.cc.

References m_output_unit.

◆ getOutputUnit()

OutputUnit* gem5::ruby::garnet::Router::getOutputUnit ( unsigned  port)
inline

◆ getPortDirectionName()

std::string gem5::ruby::garnet::Router::getPortDirectionName ( PortDirection  direction)

◆ grant_switch()

void gem5::ruby::garnet::Router::grant_switch ( int  inport,
flit t_flit 
)

◆ init()

void gem5::ruby::garnet::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 gem5::ruby::BasicRouter.

Definition at line 63 of file Router.cc.

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

◆ init_net_ptr()

void gem5::ruby::garnet::Router::init_net_ptr ( GarnetNetwork net_ptr)
inline

Definition at line 93 of file Router.hh.

References m_network_ptr.

Referenced by gem5::ruby::garnet::GarnetNetwork::GarnetNetwork().

◆ print()

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

Implements gem5::ruby::Consumer.

Definition at line 75 of file Router.hh.

◆ printAggregateFaultProbability()

void gem5::ruby::garnet::Router::printAggregateFaultProbability ( std::ostream &  out)

◆ printFaultVector()

void gem5::ruby::garnet::Router::printFaultVector ( std::ostream &  out)

◆ regStats()

void gem5::ruby::garnet::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 gem5::statistics::Group.

Definition at line 191 of file Router.cc.

References m_buffer_reads, m_buffer_writes, m_crossbar_activity, m_sw_input_arbiter_activity, m_sw_output_arbiter_activity, gem5::Named::name(), gem5::statistics::DataWrap< Derived, InfoProxyType >::name(), gem5::statistics::nozero, and gem5::statistics::Group::regStats().

◆ resetStats()

void gem5::ruby::garnet::Router::resetStats ( )
virtual

◆ route_compute()

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

◆ schedule_wakeup()

void gem5::ruby::garnet::Router::schedule_wakeup ( Cycles  time)

◆ wakeup()

void gem5::ruby::garnet::Router::wakeup ( )
virtual

Member Data Documentation

◆ crossbarSwitch

CrossbarSwitch gem5::ruby::garnet::Router::crossbarSwitch
private

◆ m_bit_width

uint32_t gem5::ruby::garnet::Router::m_bit_width
private

Definition at line 148 of file Router.hh.

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

◆ m_buffer_reads

statistics::Scalar gem5::ruby::garnet::Router::m_buffer_reads
private

Definition at line 159 of file Router.hh.

Referenced by collateStats(), and regStats().

◆ m_buffer_writes

statistics::Scalar gem5::ruby::garnet::Router::m_buffer_writes
private

Definition at line 160 of file Router.hh.

Referenced by collateStats(), and regStats().

◆ m_crossbar_activity

statistics::Scalar gem5::ruby::garnet::Router::m_crossbar_activity
private

Definition at line 165 of file Router.hh.

Referenced by collateStats(), and regStats().

◆ m_input_unit

std::vector<std::shared_ptr<InputUnit> > gem5::ruby::garnet::Router::m_input_unit
private

◆ m_latency

Cycles gem5::ruby::garnet::Router::m_latency
private

Definition at line 146 of file Router.hh.

Referenced by get_pipe_stages().

◆ m_network_ptr

GarnetNetwork* gem5::ruby::garnet::Router::m_network_ptr
private

◆ m_num_vcs

uint32_t gem5::ruby::garnet::Router::m_num_vcs
private

Definition at line 147 of file Router.hh.

Referenced by get_num_vcs().

◆ m_output_unit

std::vector<std::shared_ptr<OutputUnit> > gem5::ruby::garnet::Router::m_output_unit
private

◆ m_sw_input_arbiter_activity

statistics::Scalar gem5::ruby::garnet::Router::m_sw_input_arbiter_activity
private

Definition at line 162 of file Router.hh.

Referenced by collateStats(), and regStats().

◆ m_sw_output_arbiter_activity

statistics::Scalar gem5::ruby::garnet::Router::m_sw_output_arbiter_activity
private

Definition at line 163 of file Router.hh.

Referenced by collateStats(), and regStats().

◆ m_vc_per_vnet

uint32_t gem5::ruby::garnet::Router::m_vc_per_vnet
private

Definition at line 147 of file Router.hh.

Referenced by get_vc_per_vnet().

◆ m_virtual_networks

uint32_t gem5::ruby::garnet::Router::m_virtual_networks
private

Definition at line 147 of file Router.hh.

Referenced by collateStats(), and get_num_vnets().

◆ routingUnit

RoutingUnit gem5::ruby::garnet::Router::routingUnit
private

Definition at line 151 of file Router.hh.

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

◆ switchAllocator

SwitchAllocator gem5::ruby::garnet::Router::switchAllocator
private

Definition at line 152 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 Dec 21 2022 10:24:24 for gem5 by doxygen 1.9.1