Link between two components. More...
#include <link.h>
Public Member Functions | |
Link (LinkId_t id) | |
Create a new link with a given ID. | |
void | setLatency (Cycle_t lat) |
set minimum link latency | |
void | addRecvLatency (int cycles, 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 | setFunctor (Event::HandlerBase *functor) |
Set the callback function to be called when a message is delivered. | |
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. | |
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 detaulTimeBase. | |
TimeConverter * | getDefaultTimeBase () |
Return the default Time Base for this link. | |
void | deliverEvent (Event *event) |
Causes an event to be delivered to the registered callback. | |
LinkId_t | getId () |
Return the ID of this link. | |
void | sendInitData (Event *init_data) |
Send data during the init() phase. | |
Event * | recvInitData () |
Receive an event (if any) during the init() phase. | |
Protected Attributes | |
ActivityQueue * | recvQueue |
Queue of events to be received by the owning component. | |
ActivityQueue * | initQueue |
Queue of events to be received during init by the owning component. | |
ActivityQueue * | configuredQueue |
Currently active Queue. | |
Event::HandlerBase * | rFunctor |
Recieve functor. | |
TimeConverter * | 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. | |
Static Protected Attributes | |
static ActivityQueue * | uninitQueue = NULL |
Unitialized queue. | |
static ActivityQueue * | afterInitQueue = NULL |
Unitialized queue. | |
Friends | |
class | LinkPair |
class | Simulation |
class | SyncBase |
class | boost::serialization::access |
Link between two components.
Carries events
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::addRecvLatency | ( | int | cycles, | |
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::SimulationBase::getTimeLord(), latency, and pair_link.
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 NULL if there is no pending event.
References SST::ActivityQueue::empty(), SST::ActivityQueue::front(), SST::Simulation::getCurrentSimCycle(), SST::Activity::getDeliveryTime(), SST::Simulation::getSimulation(), SST::ActivityQueue::pop(), and recvQueue.
void SST::Link::send | ( | Event * | event | ) | [inline] |
void SST::Link::send | ( | SimTime_t | delay, | |
Event * | event | |||
) | [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().
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().
void SST::Link::sendInitData | ( | Event * | init_data | ) |
Send data during the init() phase.
References SST::Simulation::getSimulation(), initQueue, SST::ActivityQueue::insert(), pair_link, SST::Event::setDeliveryLink(), and SST::Activity::setDeliveryTime().
Referenced by SST::Interfaces::SimpleMem::sendInitData().
void SST::Link::setDefaultTimeBase | ( | TimeConverter * | tc | ) |
Manually set the default detaulTimeBase.
tc | TimeConverter object for the timebase |
References defaultTimeBase.
Referenced by SST::Component::configureLink(), and SST::Simulation::performWireUp().
void SST::Link::setFunctor | ( | Event::HandlerBase * | functor | ) | [inline] |
Set the callback function to be called when a message is delivered.
References rFunctor.
Referenced by SST::Component::configureLink(), and SST::Component::selfLink().
ActivityQueue * SST::Link::afterInitQueue = NULL [static, protected] |
TimeConverter* SST::Link::defaultTimeBase [protected] |
Timebase used if no other timebase is specified.
Used to specify the untits 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().
SimTime_t SST::Link::latency [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(), send(), and setLatency().
Event::HandlerBase* SST::Link::rFunctor [protected] |
Recieve functor.
This functor is set when the link is connected. Determines what the receiver wants to be called
Referenced by setFunctor().
ActivityQueue * SST::Link::uninitQueue = NULL [static, protected] |