SST
11.0.0
StructuralSimulationToolkit
|
Link between two components. More...
#include <link.h>
Public Member Functions | |
Link (LinkId_t id) | |
Create a new link with a given ID. | |
void | addSendLatency (int cycles, const std::string &timebase) |
Set additional Latency to be added to events being sent out of this link. More... | |
void | addSendLatency (SimTime_t cycles, TimeConverter *timebase) |
Set additional Latency to be added to events being sent out of this link. More... | |
void | addRecvLatency (int cycles, const std::string &timebase) |
Set additional Latency to be added on to events coming in on this link. More... | |
void | addRecvLatency (SimTime_t cycles, TimeConverter *timebase) |
Set additional Latency to be added on to events coming in on this link. More... | |
void | setFunctor (Event::HandlerBase *functor) |
Set the callback function to be called when a message is delivered. More... | |
void | replaceFunctor (Event::HandlerBase *functor) |
Replace the callback function to be called when a message is delivered. More... | |
void | setPolling () |
Specifies that this link has no callback, and is poll-based only. | |
void | send (SimTime_t delay, TimeConverter *tc, Event *event) |
Send an event over the link with additional delay. More... | |
void | send (SimTime_t delay, Event *event) |
Send an event with additional delay. More... | |
void | send (Event *event) |
Send an event with the Link's default delay. More... | |
Event * | recv () |
Retrieve a pending event from the Link. More... | |
void | setDefaultTimeBase (TimeConverter *tc) |
Manually set the default detaulTimeBase. More... | |
TimeConverter * | getDefaultTimeBase () |
Return the default Time Base for this link. More... | |
const TimeConverter * | getDefaultTimeBase () const |
Return the default Time Base for this link. More... | |
void | deliverEvent (Event *event) const |
Causes an event to be delivered to the registered callback. | |
LinkId_t | getId () |
Return the ID of this link. More... | |
void | sendUntimedData (Event *data) |
Send data during the init() or complete() phase. More... | |
Event * | recvUntimedData () |
Receive an event (if any) during the init() or complete() phase. More... | |
void | sendInitData (Event *init_data) |
Send data during the init() or complete() phase. More... | |
Event * | recvInitData () |
Receive an event (if any) during the init() or complete() phase. More... | |
void | setAsConfigured () |
bool | isConfigured () |
Return whether link has been configured. More... | |
Protected Attributes | |
ActivityQueue * | recvQueue |
Queue of events to be received by the owning component. | |
ActivityQueue * | untimedQueue |
Queue of events to be received during init by the owning component. | |
ActivityQueue * | configuredQueue |
Currently active Queue. | |
Event::HandlerBase * | rFunctor |
Receive functor. More... | |
TimeConverter * | defaultTimeBase |
Timebase used if no other timebase is specified. More... | |
SimTime_t | latency |
Latency of the link. More... | |
Link * | pair_link |
Pointer to the opposite side of this link. | |
Static Protected Attributes | |
static ActivityQueue * | uninitQueue = new UninitializedQueue("ERROR: Trying to send or recv from link during initialization. Send and Recv cannot be called before setup.") |
Uninitialized queue. More... | |
static ActivityQueue * | afterInitQueue = new UninitializedQueue("ERROR: Trying to call sendUntimedData/sendInitData or recvUntimedData/recvInitData during the run phase.") |
Uninitialized queue. More... | |
static ActivityQueue * | afterRunQueue = new UninitializedQueue("ERROR: Trying to call send or recv during complete phase.") |
Uninitialized queue. More... | |
Friends | |
class | LinkPair |
class | RankSync |
class | ThreadSync |
class | Simulation_impl |
class | SyncManager |
class | ComponentInfo |
Link between two components.
Carries events
void SST::Link::addRecvLatency | ( | int | cycles, |
const std::string & | timebase | ||
) |
Set additional Latency to be added on to events coming in on this link.
cycles | Number of Cycles to be added |
timebase | Base Units of cycles |
References SST::TimeLord::getSimCycles(), SST::Simulation::getSimulation(), SST::Simulation::getTimeLord(), latency, and pair_link.
void SST::Link::addRecvLatency | ( | SimTime_t | cycles, |
TimeConverter * | timebase | ||
) |
Set additional Latency to be added on to events coming in on this link.
cycles | Number of Cycles to be added |
timebase | Base Units of cycles |
References SST::TimeConverter::convertToCoreTime(), latency, and pair_link.
void SST::Link::addSendLatency | ( | int | cycles, |
const std::string & | timebase | ||
) |
Set additional Latency to be added to events being sent out of this link.
cycles | Number of Cycles to be added |
timebase | Base Units of cycles |
References SST::TimeLord::getSimCycles(), SST::Simulation_impl::getSimulation(), SST::Simulation_impl::getTimeLord(), and latency.
void SST::Link::addSendLatency | ( | SimTime_t | cycles, |
TimeConverter * | timebase | ||
) |
Set additional Latency to be added to events being sent out of this link.
cycles | Number of Cycles to be added |
timebase | Base Units of cycles |
References SST::TimeConverter::convertToCoreTime(), and latency.
TimeConverter * SST::Link::getDefaultTimeBase | ( | ) |
Return the default Time Base for this link.
References defaultTimeBase.
const TimeConverter * SST::Link::getDefaultTimeBase | ( | ) | const |
Return the default Time Base for this link.
References defaultTimeBase.
|
inline |
Return the ID of this link.
|
inline |
Return whether link has been configured.
Event * SST::Link::recv | ( | ) |
Retrieve a pending event from the Link.
For links which do not have a set event handler, they can be polled with this function. Returns nullptr if there is no pending event. Not available for HANDLER-type links.
References SST::ActivityQueue::empty(), SST::Output::fatal(), SST::ActivityQueue::front(), SST::Simulation::getCurrentSimCycle(), SST::Activity::getDeliveryTime(), SST::Simulation::getSimulation(), SST::Simulation::getSimulationOutput(), SST::ActivityQueue::pop(), and recvQueue.
|
inline |
Receive an event (if any) during the init() or complete() phase.
Same as recvUntimedData()
References recvUntimedData().
Referenced by SST::Interfaces::SimpleMem::recvInitData().
Event * SST::Link::recvUntimedData | ( | ) |
Receive an event (if any) during the init() or complete() phase.
References SST::ActivityQueue::empty(), SST::ActivityQueue::front(), SST::Activity::getDeliveryTime(), SST::Simulation_impl::getSimulation(), SST::ActivityQueue::pop(), and untimedQueue.
Referenced by recvInitData().
void SST::Link::replaceFunctor | ( | Event::HandlerBase * | functor | ) |
Replace the callback function to be called when a message is delivered.
Any previous handler will be deleted. Not available for Polling links.
functor | Functor to call when message is delivered |
References SST::Output::fatal(), SST::Simulation::getSimulation(), SST::Simulation::getSimulationOutput(), and rFunctor.
void SST::Link::send | ( | SimTime_t | delay, |
TimeConverter * | tc, | ||
Event * | event | ||
) |
Send an event over the link with additional delay.
Sends an event over a link with an additional delay specified with a TimeConverter. I.e. the total delay is the link's delay + the additional specified delay.
delay | - additional delay |
tc | - time converter to specify units for the additional delay |
event | - the Event to send |
References SST::TimeConverter::convertToCoreTime(), SST::Output::fatal(), SST::Simulation::getCurrentSimCycle(), SST::Simulation::getSimulation(), SST::Simulation::getSimulationOutput(), SST::ActivityQueue::insert(), latency, pair_link, and recvQueue.
Referenced by send().
|
inline |
Send an event with additional delay.
Sends an event over a link with additional delay specified by the Link's default timebase.
delay | The additional delay, in units of the default Link timebase |
event | The event to send |
References defaultTimeBase, and send().
|
inline |
|
inline |
Send data during the init() or complete() phase.
Same as sendUntimedData()
init_data | data to send |
References sendUntimedData().
Referenced by SST::Interfaces::SimpleMem::sendInitData().
void SST::Link::sendUntimedData | ( | Event * | data | ) |
Send data during the init() or complete() phase.
data | event to send |
References SST::Simulation_impl::getSimulation(), SST::ActivityQueue::insert(), pair_link, SST::Event::setDeliveryLink(), SST::Activity::setDeliveryTime(), and untimedQueue.
Referenced by sendInitData().
void SST::Link::setDefaultTimeBase | ( | TimeConverter * | tc | ) |
Manually set the default detaulTimeBase.
tc | TimeConverter object for the timebase |
References defaultTimeBase.
Referenced by SST::BaseComponent::configureLink().
void SST::Link::setFunctor | ( | Event::HandlerBase * | functor | ) |
Set the callback function to be called when a message is delivered.
Not available for Polling links.
functor | Functor to call when message is delivered |
References SST::Output::fatal(), SST::Simulation::getSimulation(), SST::Simulation::getSimulationOutput(), and rFunctor.
Referenced by SST::BaseComponent::configureLink().
|
staticprotected |
Uninitialized queue.
Used for error detection
|
staticprotected |
Uninitialized queue.
Used for error detection
|
protected |
Timebase used if no other timebase is specified.
Used to specify the units for added delays when sending, such as in Link::send(). Often set by the Component::registerClock() function if the regAll argument is true.
Referenced by getDefaultTimeBase(), send(), and setDefaultTimeBase().
|
protected |
Latency of the link.
It is used by the partitioner as the weight. This latency is added to the delay put on the event by the component.
Referenced by addRecvLatency(), addSendLatency(), and send().
|
protected |
Receive functor.
This functor is set when the link is connected. Determines what the receiver wants to be called
Referenced by replaceFunctor(), and setFunctor().
|
staticprotected |