gem5
|
#include <NetworkInterface.hh>
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 Params * | params () 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 Params * | params () 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... | |
ProbeManager * | getProbeManager () |
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) | |
EventQueue * | eventQueue () 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 | |
GarnetNetwork * | m_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 |
flitBuffer * | outFlitQueue |
flitBuffer * | outCreditQueue |
int | m_deadlock_threshold |
NetworkLink * | inNetLink |
NetworkLink * | outNetLink |
CreditLink * | inCreditLink |
CreditLink * | outCreditLink |
std::deque< flit * > | m_stall_queue |
std::vector< int > | m_stall_count |
std::vector< flitBuffer * > | m_ni_out_vcs |
std::vector< Cycles > | m_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 SimObject * | find (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 | |
Clocked & | operator= (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 | |
EventQueue * | eventq |
A pointer to this object's event queue. More... | |
Definition at line 52 of file NetworkInterface.hh.
typedef GarnetNetworkInterfaceParams NetworkInterface::Params |
Definition at line 55 of file NetworkInterface.hh.
NetworkInterface::NetworkInterface | ( | const Params * | p | ) |
Definition at line 50 of file NetworkInterface.cc.
References ArmISA::i, INFINITE_, m_ni_out_vcs, m_ni_out_vcs_enqueue_time, m_num_vcs, m_router_id, m_stall_count, m_vc_allocator, m_vc_round_robin, m_virtual_networks, and outCreditQueue.
NetworkInterface::~NetworkInterface | ( | ) |
Definition at line 85 of file NetworkInterface.cc.
References m5::stl_helpers::deletePointers(), m_ni_out_vcs, m_out_vc_state, outCreditQueue, and outFlitQueue.
void NetworkInterface::addInPort | ( | NetworkLink * | in_link, |
CreditLink * | credit_link | ||
) |
Definition at line 94 of file NetworkInterface.cc.
References inNetLink, outCreditLink, outCreditQueue, NetworkLink::setLinkConsumer(), and NetworkLink::setSourceQueue().
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 | ||
) |
Definition at line 104 of file NetworkInterface.cc.
References inCreditLink, m_router_id, outFlitQueue, outNetLink, NetworkLink::setLinkConsumer(), and NetworkLink::setSourceQueue().
|
private |
Definition at line 406 of file NetworkInterface.cc.
References Clocked::curCycle(), curTick(), ArmISA::i, IDLE_, m_deadlock_threshold, m_out_vc_state, m_vc_allocator, m_vc_per_vnet, SimObject::name(), panic_if(), and vc_busy_counter.
Referenced by flitisizeMessage().
|
private |
Definition at line 506 of file NetworkInterface.cc.
References Clocked::clockEdge(), Clocked::curCycle(), inNode_ptr, m_ni_out_vcs, m_num_vcs, and Consumer::scheduleEvent().
Referenced by wakeup().
|
private |
Definition at line 281 of file NetworkInterface.cc.
References Clocked::clockEdge(), Clocked::cyclesToTicks(), flit::get_msg_ptr(), flit::get_vnet(), incrementStats(), m_stall_count, m_stall_queue, outNode_ptr, and sendCredit().
Referenced by wakeup().
void NetworkInterface::dequeueCallback | ( | ) |
Definition at line 133 of file NetworkInterface.cc.
References Clocked::clockEdge(), and Consumer::scheduleEventAbsolute().
Referenced by wakeup().
|
private |
Definition at line 327 of file NetworkInterface.cc.
References ACTIVE_, NetDest::add(), calculateVC(), NetDest::clear(), Clocked::curCycle(), RouteInfo::dest_ni, RouteInfo::dest_router, GarnetNetwork::get_router_id(), NetDest::getAllDest(), Message::getDestination(), Message::getMessageSize(), GarnetNetwork::getNiFlitSize(), RouteInfo::hops_traversed, ArmISA::i, GarnetNetwork::increment_injected_flits(), GarnetNetwork::increment_injected_packets(), ArmISA::m, m_id, m_net_ptr, m_ni_out_vcs, m_ni_out_vcs_enqueue_time, m_out_vc_state, m_router_id, Network::MessageSizeType_to_int(), RouteInfo::net_dest, NetDest::removeNetDest(), flit::set_src_delay(), RouteInfo::src_ni, RouteInfo::src_router, Clocked::ticksToCycles(), and RouteInfo::vnet.
Referenced by wakeup().
uint32_t NetworkInterface::functionalWrite | ( | Packet * | pkt | ) |
Definition at line 534 of file NetworkInterface.cc.
References flitBuffer::functionalWrite(), ArmISA::i, m_ni_out_vcs, m_num_vcs, and outFlitQueue.
|
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().
|
private |
Definition at line 143 of file NetworkInterface.cc.
References Clocked::curCycle(), flit::get_dequeue_time(), flit::get_enqueue_time(), flit::get_route(), flit::get_src_delay(), flit::get_type(), flit::get_vnet(), HEAD_TAIL_, RouteInfo::hops_traversed, GarnetNetwork::increment_flit_network_latency(), GarnetNetwork::increment_flit_queueing_latency(), GarnetNetwork::increment_packet_network_latency(), GarnetNetwork::increment_packet_queueing_latency(), GarnetNetwork::increment_received_flits(), GarnetNetwork::increment_received_packets(), GarnetNetwork::increment_total_hops(), m_net_ptr, and TAIL_.
Referenced by checkStallQueue(), and wakeup().
|
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.
|
inline |
Definition at line 73 of file NetworkInterface.hh.
References m_net_ptr.
Referenced by GarnetNetwork::GarnetNetwork().
|
virtual |
Implements Consumer.
Definition at line 528 of file NetworkInterface.cc.
|
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().
|
private |
Definition at line 274 of file NetworkInterface.cc.
References Clocked::curCycle(), flit::get_vc(), flitBuffer::insert(), and outCreditQueue.
Referenced by checkStallQueue(), and wakeup().
|
virtual |
Implements Consumer.
Definition at line 179 of file NetworkInterface.cc.
References ArmISA::b, checkReschedule(), checkStallQueue(), Clocked::clockEdge(), NetworkLink::consumeLink(), Clocked::curCycle(), Clocked::cyclesToTicks(), MessageBuffer::dequeue(), dequeueCallback(), DPRINTF, flitisizeMessage(), flit::get_msg_ptr(), flit::get_type(), flit::get_vc(), flit::get_vnet(), flitBuffer::getSize(), HEAD_TAIL_, IDLE_, inCreditLink, incrementStats(), inNetLink, inNode_ptr, Credit::is_free_signal(), MessageBuffer::isReady(), NetworkLink::isReady(), m_id, m_out_vc_state, m_router_id, m_stall_count, m_stall_queue, outCreditLink, outCreditQueue, outNode_ptr, MessageBuffer::peekMsgPtr(), Consumer::scheduleEventAbsolute(), scheduleOutputLink(), sendCredit(), flit::set_dequeue_time(), and TAIL_.
|
private |
Definition at line 91 of file NetworkInterface.hh.
Referenced by addOutPort(), and wakeup().
|
private |
Definition at line 89 of file NetworkInterface.hh.
Referenced by addInPort(), and wakeup().
|
private |
Definition at line 104 of file NetworkInterface.hh.
Referenced by addNode(), checkReschedule(), and wakeup().
|
private |
Definition at line 87 of file NetworkInterface.hh.
Referenced by calculateVC().
|
private |
Definition at line 79 of file NetworkInterface.hh.
Referenced by flitisizeMessage(), and wakeup().
|
private |
Definition at line 78 of file NetworkInterface.hh.
Referenced by flitisizeMessage(), incrementStats(), init(), init_net_ptr(), and scheduleOutputLink().
|
private |
Definition at line 100 of file NetworkInterface.hh.
Referenced by checkReschedule(), flitisizeMessage(), functionalWrite(), NetworkInterface(), scheduleOutputLink(), and ~NetworkInterface().
|
private |
Definition at line 101 of file NetworkInterface.hh.
Referenced by flitisizeMessage(), NetworkInterface(), and scheduleOutputLink().
|
private |
Definition at line 80 of file NetworkInterface.hh.
Referenced by checkReschedule(), functionalWrite(), init(), NetworkInterface(), and scheduleOutputLink().
|
private |
Definition at line 82 of file NetworkInterface.hh.
Referenced by calculateVC(), flitisizeMessage(), init(), scheduleOutputLink(), wakeup(), and ~NetworkInterface().
|
private |
Definition at line 81 of file NetworkInterface.hh.
Referenced by addOutPort(), flitisizeMessage(), get_router_id(), NetworkInterface(), and wakeup().
|
private |
Definition at line 96 of file NetworkInterface.hh.
Referenced by checkStallQueue(), NetworkInterface(), and wakeup().
|
private |
Definition at line 95 of file NetworkInterface.hh.
Referenced by checkStallQueue(), and wakeup().
|
private |
Definition at line 83 of file NetworkInterface.hh.
Referenced by calculateVC(), and NetworkInterface().
|
private |
Definition at line 80 of file NetworkInterface.hh.
Referenced by calculateVC(), get_vnet(), and scheduleOutputLink().
|
private |
Definition at line 84 of file NetworkInterface.hh.
Referenced by NetworkInterface(), and scheduleOutputLink().
|
private |
Definition at line 80 of file NetworkInterface.hh.
Referenced by get_vnet(), and NetworkInterface().
|
private |
Definition at line 92 of file NetworkInterface.hh.
Referenced by addInPort(), and wakeup().
|
private |
Definition at line 86 of file NetworkInterface.hh.
Referenced by addInPort(), NetworkInterface(), sendCredit(), wakeup(), and ~NetworkInterface().
|
private |
Definition at line 85 of file NetworkInterface.hh.
Referenced by addOutPort(), functionalWrite(), scheduleOutputLink(), and ~NetworkInterface().
|
private |
Definition at line 90 of file NetworkInterface.hh.
Referenced by addOutPort(), and scheduleOutputLink().
|
private |
Definition at line 106 of file NetworkInterface.hh.
Referenced by addNode(), checkStallQueue(), and wakeup().
|
private |
Definition at line 108 of file NetworkInterface.hh.
Referenced by calculateVC().