gem5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
NetworkInterface Class Reference

#include <NetworkInterface.hh>

Inheritance diagram for NetworkInterface:
ClockedObject Consumer SimObject Clocked EventManager Serializable Drainable

Public Types

typedef
GarnetNetworkInterfaceParams 
Params
 
- Public Types inherited from ClockedObject
typedef ClockedObjectParams Params
 Parameters of ClockedObject. More...
 
- Public Types inherited from SimObject
typedef SimObjectParams Params
 

Public Member Functions

 NetworkInterface (const Params *p)
 
 ~NetworkInterface ()
 
void init ()
 init() is called after all C++ SimObjects have been created and all ports are connected. More...
 
void addInPort (NetworkLink *in_link, CreditLink *credit_link)
 
void addOutPort (NetworkLink *out_link, CreditLink *credit_link, SwitchID router_id)
 
void dequeueCallback ()
 
void wakeup ()
 
void addNode (std::vector< MessageBuffer * > &inNode, std::vector< MessageBuffer * > &outNode)
 
void print (std::ostream &out) const
 
int get_vnet (int vc)
 
int get_router_id ()
 
void init_net_ptr (GarnetNetwork *net_ptr)
 
uint32_t functionalWrite (Packet *)
 
- 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 resetStats ()
 Reset statistics associated with this object. 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 Member Functions

bool checkStallQueue ()
 
bool flitisizeMessage (MsgPtr msg_ptr, int vnet)
 
int calculateVC (int vnet)
 
void scheduleOutputLink ()
 This function looks at the NI buffers if some buffer has flits which are ready to traverse the link in the next cycle, and the downstream output vc associated with this flit has buffers left, the link is scheduled for the next cycle. More...
 
void checkReschedule ()
 
void sendCredit (flit *t_flit, bool is_free)
 
void incrementStats (flit *t_flit)
 

Private Attributes

GarnetNetworkm_net_ptr
 
const NodeID m_id
 
const int m_virtual_networks
 
const int m_vc_per_vnet
 
const int m_num_vcs
 
int m_router_id
 
std::vector< OutVcState * > m_out_vc_state
 
std::vector< int > m_vc_allocator
 
int m_vc_round_robin
 
flitBufferoutFlitQueue
 
flitBufferoutCreditQueue
 
int m_deadlock_threshold
 
NetworkLinkinNetLink
 
NetworkLinkoutNetLink
 
CreditLinkinCreditLink
 
CreditLinkoutCreditLink
 
std::deque< flit * > m_stall_queue
 
std::vector< int > m_stall_count
 
std::vector< flitBuffer * > m_ni_out_vcs
 
std::vector< Cyclesm_ni_out_vcs_enqueue_time
 
std::vector< MessageBuffer * > inNode_ptr
 
std::vector< MessageBuffer * > outNode_ptr
 
std::vector< int > vc_busy_counter
 

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 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 52 of file NetworkInterface.hh.

Member Typedef Documentation

typedef GarnetNetworkInterfaceParams NetworkInterface::Params

Definition at line 55 of file NetworkInterface.hh.

Constructor & Destructor Documentation

NetworkInterface::NetworkInterface ( const Params p)
NetworkInterface::~NetworkInterface ( )

Member Function Documentation

void NetworkInterface::addInPort ( NetworkLink in_link,
CreditLink credit_link 
)
void NetworkInterface::addNode ( std::vector< MessageBuffer * > &  inNode,
std::vector< MessageBuffer * > &  outNode 
)

Definition at line 119 of file NetworkInterface.cc.

References inNode_ptr, and outNode_ptr.

void NetworkInterface::addOutPort ( NetworkLink out_link,
CreditLink credit_link,
SwitchID  router_id 
)
int NetworkInterface::calculateVC ( int  vnet)
private
void NetworkInterface::checkReschedule ( )
private
bool NetworkInterface::checkStallQueue ( )
private
void NetworkInterface::dequeueCallback ( )

Definition at line 133 of file NetworkInterface.cc.

References Clocked::clockEdge(), and Consumer::scheduleEventAbsolute().

Referenced by wakeup().

bool NetworkInterface::flitisizeMessage ( MsgPtr  msg_ptr,
int  vnet 
)
private
uint32_t NetworkInterface::functionalWrite ( Packet pkt)
int NetworkInterface::get_router_id ( )
inline

Definition at line 72 of file NetworkInterface.hh.

References m_router_id.

int NetworkInterface::get_vnet ( int  vc)

Definition at line 491 of file NetworkInterface.cc.

References fatal, ArmISA::i, m_vc_per_vnet, and m_virtual_networks.

Referenced by scheduleOutputLink().

void NetworkInterface::incrementStats ( flit t_flit)
private
void NetworkInterface::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 SimObject.

Definition at line 78 of file NetworkInterface.cc.

References ArmISA::i, m_net_ptr, m_num_vcs, and m_out_vc_state.

void NetworkInterface::init_net_ptr ( GarnetNetwork net_ptr)
inline

Definition at line 73 of file NetworkInterface.hh.

References m_net_ptr.

Referenced by GarnetNetwork::GarnetNetwork().

void NetworkInterface::print ( std::ostream &  out) const
virtual

Implements Consumer.

Definition at line 528 of file NetworkInterface.cc.

void NetworkInterface::scheduleOutputLink ( )
private

This function looks at the NI buffers if some buffer has flits which are ready to traverse the link in the next cycle, and the downstream output vc associated with this flit has buffers left, the link is scheduled for the next cycle.

Definition at line 437 of file NetworkInterface.cc.

References Clocked::clockEdge(), Clocked::curCycle(), flit::get_type(), get_vnet(), HEAD_TAIL_, ArmISA::i, INFINITE_, flitBuffer::insert(), GarnetNetwork::isVNetOrdered(), m_net_ptr, m_ni_out_vcs, m_ni_out_vcs_enqueue_time, m_num_vcs, m_out_vc_state, m_vc_per_vnet, m_vc_round_robin, outFlitQueue, outNetLink, Consumer::scheduleEventAbsolute(), flit::set_time(), and TAIL_.

Referenced by wakeup().

void NetworkInterface::sendCredit ( flit t_flit,
bool  is_free 
)
private

Definition at line 274 of file NetworkInterface.cc.

References Clocked::curCycle(), flit::get_vc(), flitBuffer::insert(), and outCreditQueue.

Referenced by checkStallQueue(), and wakeup().

void NetworkInterface::wakeup ( )
virtual

Member Data Documentation

CreditLink* NetworkInterface::inCreditLink
private

Definition at line 91 of file NetworkInterface.hh.

Referenced by addOutPort(), and wakeup().

NetworkLink* NetworkInterface::inNetLink
private

Definition at line 89 of file NetworkInterface.hh.

Referenced by addInPort(), and wakeup().

std::vector<MessageBuffer *> NetworkInterface::inNode_ptr
private

Definition at line 104 of file NetworkInterface.hh.

Referenced by addNode(), checkReschedule(), and wakeup().

int NetworkInterface::m_deadlock_threshold
private

Definition at line 87 of file NetworkInterface.hh.

Referenced by calculateVC().

const NodeID NetworkInterface::m_id
private

Definition at line 79 of file NetworkInterface.hh.

Referenced by flitisizeMessage(), and wakeup().

GarnetNetwork* NetworkInterface::m_net_ptr
private
std::vector<flitBuffer *> NetworkInterface::m_ni_out_vcs
private
std::vector<Cycles> NetworkInterface::m_ni_out_vcs_enqueue_time
private

Definition at line 101 of file NetworkInterface.hh.

Referenced by flitisizeMessage(), NetworkInterface(), and scheduleOutputLink().

const int NetworkInterface::m_num_vcs
private
std::vector<OutVcState *> NetworkInterface::m_out_vc_state
private
int NetworkInterface::m_router_id
private
std::vector<int> NetworkInterface::m_stall_count
private

Definition at line 96 of file NetworkInterface.hh.

Referenced by checkStallQueue(), NetworkInterface(), and wakeup().

std::deque<flit *> NetworkInterface::m_stall_queue
private

Definition at line 95 of file NetworkInterface.hh.

Referenced by checkStallQueue(), and wakeup().

std::vector<int> NetworkInterface::m_vc_allocator
private

Definition at line 83 of file NetworkInterface.hh.

Referenced by calculateVC(), and NetworkInterface().

const int NetworkInterface::m_vc_per_vnet
private

Definition at line 80 of file NetworkInterface.hh.

Referenced by calculateVC(), get_vnet(), and scheduleOutputLink().

int NetworkInterface::m_vc_round_robin
private

Definition at line 84 of file NetworkInterface.hh.

Referenced by NetworkInterface(), and scheduleOutputLink().

const int NetworkInterface::m_virtual_networks
private

Definition at line 80 of file NetworkInterface.hh.

Referenced by get_vnet(), and NetworkInterface().

CreditLink* NetworkInterface::outCreditLink
private

Definition at line 92 of file NetworkInterface.hh.

Referenced by addInPort(), and wakeup().

flitBuffer* NetworkInterface::outCreditQueue
private
flitBuffer* NetworkInterface::outFlitQueue
private
NetworkLink* NetworkInterface::outNetLink
private

Definition at line 90 of file NetworkInterface.hh.

Referenced by addOutPort(), and scheduleOutputLink().

std::vector<MessageBuffer *> NetworkInterface::outNode_ptr
private

Definition at line 106 of file NetworkInterface.hh.

Referenced by addNode(), checkStallQueue(), and wakeup().

std::vector<int> NetworkInterface::vc_busy_counter
private

Definition at line 108 of file NetworkInterface.hh.

Referenced by calculateVC().


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

Generated on Fri Jun 9 2017 13:04:15 for gem5 by doxygen 1.8.6