SST 15.0
Structural Simulation Toolkit
|
Link between two components. More...
#include <link.h>
Data Structures | |
class | AttachPoint |
Attach point for inspecting, modifying or dropping events sent on the Link. More... | |
Public Member Functions | |
void | addSendLatency (int cycles, const std::string &timebase) |
Set additional Latency to be added to events being sent out of this link. | |
void | addSendLatency (SimTime_t cycles, TimeConverter *timebase) |
Set additional Latency to be added to events being sent out of this link. | |
void | addSendLatency (SimTime_t cycles, TimeConverter timebase) |
void | addRecvLatency (int cycles, const std::string &timebase) |
Set additional Latency to be added on to events coming in on this link. | |
void | addRecvLatency (SimTime_t cycles, TimeConverter *timebase) |
Set additional Latency to be added on to events coming in on this link. | |
void | addRecvLatency (SimTime_t cycles, TimeConverter timebase) |
void | setFunctor (Event::HandlerBase *functor) |
Set the callback function to be called when a message is delivered. | |
void | replaceFunctor (Event::HandlerBase *functor) |
Replace the callback function to be called when a message is delivered. | |
Event::HandlerBase * | getFunctor () |
Get the callback function to be called when a message is delivered. | |
void | send (SimTime_t delay, TimeConverter *tc, Event *event) |
Send an event over the link with additional delay. | |
void | send (SimTime_t delay, TimeConverter tc, Event *event) |
Send an event over the link with additional delay. | |
void | send (SimTime_t delay, Event *event) |
Send an event with additional delay. | |
void | send (Event *event) |
Send an event with the Link's default delay. | |
Event * | recv () |
Retrieve a pending event from the Link. | |
void | setDefaultTimeBase (TimeConverter *tc) |
Manually set the default defaultTimeBase. | |
void | setDefaultTimeBase (TimeConverter tc) |
Manually set the default defaultTimeBase. | |
TimeConverter * | getDefaultTimeBase () |
Return the default Time Base for this link. | |
const TimeConverter * | getDefaultTimeBase () const |
Return the default Time Base for this link. | |
LinkId_t | getId () |
Return the ID of this link. | |
void | sendUntimedData (Event *data) |
Send data during the init() or complete() phase. | |
Event * | recvUntimedData () |
Receive an event (if any) during the init() or complete() phase. | |
bool | isConfigured () |
Return whether link has been configured. | |
Protected Member Functions | |
void | setAsSyncLink () |
void | setDeliveryInfo (uintptr_t info) |
Set the delivery_info for the link. | |
void | send_impl (SimTime_t delay, Event *event) |
Send an event over the link with additional delay. | |
Protected Attributes | |
ActivityQueue * | send_queue |
Queue of events to be received by the owning component. | |
uintptr_t | delivery_info |
Holds the delivery information. | |
SimTime_t | defaultTimeBase |
Timebase used if no other timebase is specified. | |
SimTime_t | latency |
Latency of the link. | |
Link * | pair_link |
Pointer to the opposite side of this link. | |
Friends | |
class | SST::Core::Serialization::serialize_impl< Link * > |
class | LinkPair |
class | RankSync |
class | ThreadSync |
class | Simulation_impl |
class | SyncManager |
class | ComponentInfo |
class | BaseComponent |
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_impl::getSimulation(), SST::Simulation_impl::getTimeLord(), 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(), 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, SST::Simulation_impl::getSimulation(), SST::TimeLord::getTimeConverter(), and SST::Simulation_impl::getTimeLord().
const TimeConverter * SST::Link::getDefaultTimeBase | ( | ) | const |
Return the default Time Base for this link.
References defaultTimeBase, SST::Simulation_impl::getSimulation(), SST::TimeLord::getTimeConverter(), and SST::Simulation_impl::getTimeLord().
Event::HandlerBase * SST::Link::getFunctor | ( | ) |
Get the callback function to be called when a message is delivered.
Polling links will return nullptr.
References pair_link.
|
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::Output::fatal(), SST::Simulation_impl::getCurrentSimCycle(), SST::Activity::getDeliveryTime(), SST::Simulation_impl::getSimulation(), SST::Simulation_impl::getSimulationOutput(), and pair_link.
Event * SST::Link::recvUntimedData | ( | ) |
Receive an event (if any) during the init() or complete() phase.
References SST::Activity::getDeliveryTime(), SST::Simulation_impl::getSimulation(), and pair_link.
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_impl::getSimulation(), SST::Simulation_impl::getSimulationOutput(), pair_link, and SST::SSTHandlerBase< returnT, argT >::transferAttachedToolInfo().
|
inline |
Send an event with the Link's default delay.
event | The event to send |
References send_impl().
|
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_impl().
|
inline |
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 send().
Referenced by send().
|
inline |
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(), and send_impl().
|
protected |
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 total delay to add |
event | - the Event to send |
References delivery_info, SST::Output::fatal(), SST::Simulation_impl::getSimulation(), SST::Simulation_impl::getSimulationOutput(), latency, pair_link, and send_queue.
void SST::Link::sendUntimedData | ( | Event * | data | ) |
Send data during the init() or complete() phase.
data | event to send |
References delivery_info, SST::Output::fatal(), SST::Simulation_impl::getSimulation(), SST::Simulation_impl::getSimulationOutput(), pair_link, send_queue, and SST::Activity::setDeliveryTime().
void SST::Link::setDefaultTimeBase | ( | TimeConverter * | tc | ) |
Manually set the default defaultTimeBase.
tc | TimeConverter object for the timebase |
References defaultTimeBase, and SST::TimeConverter::getFactor().
void SST::Link::setDefaultTimeBase | ( | TimeConverter | tc | ) |
Manually set the default defaultTimeBase.
tc | TimeConverter object for the timebase |
References defaultTimeBase, and SST::TimeConverter::getFactor().
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_impl::getSimulation(), SST::Simulation_impl::getSimulationOutput(), and pair_link.
|
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(), getDefaultTimeBase(), send(), setDefaultTimeBase(), and setDefaultTimeBase().
|
protected |
Holds the delivery information.
This is stored as a uintptr_t, but is actually a pointer converted using reinterpret_cast. For links connected to a Component/SubComponent, this holds a pointer to the delivery functor. For links connected to a Sync object, this holds a pointer to the remote link to send the event on after synchronization.
Referenced by send_impl(), sendUntimedData(), and setDeliveryInfo().
|
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 addSendLatency(), addSendLatency(), and send_impl().