#include <noc_scheduler.h>

Inheritance diagram for NoCScheduler:
Collaboration diagram for NoCScheduler:

List of all members.

Public Member Functions

 NoCScheduler ()
virtual ~NoCScheduler ()
bool schedule (SetOfNoCScheduleProblems &problems)
void assignSchedulingEntities (SetOfNoCScheduleProblems &problems, CNode *networkMappingNode)

Protected Member Functions

virtual bool solve ()=0
void assignSchedulingEntities (CNode *messagesNode)
void markPreferedSlotsOnLinks (SetOfNoCScheduleProblems &problems)
void setSchedulingProblem (NoCScheduleProblem *p)
NoCScheduleProblemgetSchedulingProblem () const
InterconnectGraphgetInterconnectGraph () const
MessagesIter messagesBegin ()
MessagesIter messagesEnd ()
MessagesCIter messagesBegin () const
MessagesCIter messagesEnd () const
NoCSchedulingEntitiesIter schedulingEntitiesBegin ()
NoCSchedulingEntitiesIter schedulingEntitiesEnd ()
uint nrSchedulingEntities () const
void findAllRoutes (const Node *src, const Node *dst, const CSize maxDetour, bool exact, Routes &routes)
void findRoutes (const Node *src, const Node *dst, const CSize minLength, const CSize maxLength, Route &route, Routes &routes)
CSize getLengthShortestPathBetweenNodes (const Node *src, const Node *dst)
uint minFreeSlotsOnLink (Link *l, const TTime startTime, const TTime duration)
bool findSlotsOnRoute (NoCSchedulingEntity *e, SlotReservations &s)
uint nrSlotsRequired (const TTime time, const CSize size, const uint nrPacketsPerSlotTable)
void findFreePackets (NoCSchedulingEntity *e, SlotReservations &slotsRoute, Packets &packets)
SlotReservations findFreeSlotsOnRoute (const Route *r, const TTime startTime, const TTime duation)
bool findSlotsOnRoute (NoCSchedulingEntity *e, SlotReservations &slotsForPackets, SlotReservations &s)
SlotReservations findFreeSlotsOnLink (const Link *l, const TTime startTime, const TTime duration)
SlotReservations findFreeSlotsOnFirstLinkRoute (const Route *r, const TTime startTime, const TTime duration)
void raisePreferenceLevelSlotsOnRoute (NoCSchedulingEntity *e)
void lowerPreferenceLevelSlotsOnRoute (NoCSchedulingEntity *e)
void ripupStream (MessagesIter iterMsg)
void findSlotsAllocatedForStream (NoCSchedulingEntity *e, SlotReservations &slotsAllocated)
void findFreeSlotsForStream (Route *r, SlotReservations &slotsRoute)
double severityConflict (NoCSchedulingEntity *e, Message *m, Route *r)
void ripupScheduleEntity (MessagesIter iterMsg)
void sortMessagesOnCost ()
void sortRoutesOnCost (Routes &routes, const TTime startTime, const TTime duration)
bool findScheduleEntityForMessage (Message *m, const CSize maxDetour)
TTime earliestStartTime (const Message *m) const
TTime maximalDuration (const Message *m, TTime startTime, CSize lengthRoute) const
TTime minimalDuration (const Message *m, TTime startTime, SlotReservations slotReservations) const
NoCSchedulingEntitygetFirstScheduledMessageInStream (Message *m)
void reserveResources (NoCSchedulingEntity *e)
void releaseResources (NoCSchedulingEntity *e)
void createRoutesHash (const CSize maxDetour)
void destroyRoutesHash ()
ostream & print (ostream &out) const

Private Attributes

NoCScheduleProblemcurScheduleProblem

Constructor & Destructor Documentation

NoCScheduler::NoCScheduler (  )  [inline]
virtual NoCScheduler::~NoCScheduler (  )  [inline, virtual]

Member Function Documentation

void NoCScheduler::assignSchedulingEntities ( SetOfNoCScheduleProblems problems,
CNode networkMappingNode 
)

assignSchedulingEntities () Load scheduling entities for the scheduling problems from XML.

References CGetAttribute(), CGetChildNode(), CNextNode(), NoCScheduleProblem::getName(), SetOfNoCScheduleProblems::scheduleProblemsBegin(), SetOfNoCScheduleProblems::scheduleProblemsEnd(), and setSchedulingProblem().

Here is the call graph for this function:

void NoCScheduler::assignSchedulingEntities ( CNode messagesNode  )  [protected]
void NoCScheduler::createRoutesHash ( const CSize  maxDetour  )  [protected]
void NoCScheduler::destroyRoutesHash (  )  [protected]
TTime NoCScheduler::earliestStartTime ( const Message m  )  const [protected]

earliestStartTime () The function returns the earliest start time for the message m. The earliest start time is always later then the latest end time of messages earlier in the same stream.

References NoCSchedulingEntity::getDuration(), Message::getPreviousMessageInStream(), Message::getSchedulingEntity(), NoCSchedulingEntity::getStartTime(), and Message::getStartTime().

Referenced by findScheduleEntityForMessage(), ClassicNoCScheduler::findScheduleEntityForMessageUsingClassic(), KnowledgeNoCScheduler::findScheduleEntityForMessageUsingKnowledge(), and RandomNoCScheduler::findScheduleEntityForMessageUsingRandom().

Here is the call graph for this function:

void NoCScheduler::findAllRoutes ( const Node src,
const Node dst,
const CSize  maxDetour,
bool  exact,
Routes routes 
) [protected]
void NoCScheduler::findFreePackets ( NoCSchedulingEntity e,
SlotReservations slotsRoute,
Packets packets 
) [protected]

findFreePackets () The function locates all available packets within the timing constraints and available slots on the route (slotsRoute).

References Packet::endTime, NoCSchedulingEntity::getDuration(), getInterconnectGraph(), InterconnectGraph::getSlotTableSize(), NoCSchedulingEntity::getStartTime(), Packet::nrSlots, and Packet::startTime.

Referenced by findSlotsOnRoute(), and ClassicNoCScheduler::findSlotsOnRouteUsingClassic().

Here is the call graph for this function:

void NoCScheduler::findFreeSlotsForStream ( Route r,
SlotReservations slotsRoute 
) [protected]

findFreeSlotsForStream () The function locates all slots which are not used by any stream at any moment in time along the complete route r.

References getInterconnectGraph(), InterconnectGraph::getSlotTableSize(), SlotTable::isSlotFree(), Route::linksBegin(), Route::linksEnd(), Link::slotTableSeqBegin(), and Link::slotTableSeqEnd().

Referenced by ClassicNoCScheduler::findSlotsOnRouteUsingClassic().

Here is the call graph for this function:

SlotReservations NoCScheduler::findFreeSlotsOnFirstLinkRoute ( const Route r,
const TTime  startTime,
const TTime  duration 
) [protected]

findFreeSlotsOnFirstLinkRoute () The function computes all slots which are available in the first link of a route within the given time bounds, taking into account the time needed to reconfigure the NI. These slots are marked as true within the slot reservations.

References SlotTable::begin(), SlotTable::end(), SlotTable::getEndTime(), getInterconnectGraph(), InterconnectGraph::getReconfigurationTimeNI(), NoCSchedulingEntity::getRoute(), SlotTable::getSlotReservations(), InterconnectGraph::getSlotTablePeriod(), InterconnectGraph::getSlotTableSize(), SlotTable::getStartTime(), Route::linksBegin(), Link::slotTableSeqBegin(), and Link::slotTableSeqEnd().

Referenced by findFreeSlotsOnRoute().

Here is the call graph for this function:

SlotReservations NoCScheduler::findFreeSlotsOnLink ( const Link l,
const TTime  startTime,
const TTime  duration 
) [protected]

findFreeSlotsOnLink () The function computes all slots which are available in a link within the given time bounds. These slots are marked as true within the slot reservations.

References SlotTable::getEndTime(), getInterconnectGraph(), SlotTable::getSlotReservations(), InterconnectGraph::getSlotTablePeriod(), InterconnectGraph::getSlotTableSize(), SlotTable::getStartTime(), Link::slotTableSeqBegin(), and Link::slotTableSeqEnd().

Referenced by findFreeSlotsOnRoute().

Here is the call graph for this function:

SlotReservations NoCScheduler::findFreeSlotsOnRoute ( const Route r,
const TTime  startTime,
const TTime  duration 
) [protected]

findFreeSlotsOnRoute () The function computes all slots which are available in consecutive links along a route within the given time bounds. Available slots are marked with true in the slot reservations.

References findFreeSlotsOnFirstLinkRoute(), findFreeSlotsOnLink(), getInterconnectGraph(), InterconnectGraph::getSlotTableSize(), Route::linksBegin(), and Route::linksEnd().

Referenced by findSlotsOnRoute().

Here is the call graph for this function:

void NoCScheduler::findRoutes ( const Node src,
const Node dst,
const CSize  minLength,
const CSize  maxLength,
Route route,
Routes routes 
) [protected]

findAllRoutes () The function finds all routes between the given source and destination node within the specified minimum and maximum length.

References Route::appendLink(), Route::containsNode(), Link::getDstNode(), Route::length(), Node::outgoingLinksBegin(), and Node::outgoingLinksEnd().

Referenced by findAllRoutes().

Here is the call graph for this function:

bool NoCScheduler::findScheduleEntityForMessage ( Message m,
const CSize  maxDetour 
) [protected]
void NoCScheduler::findSlotsAllocatedForStream ( NoCSchedulingEntity e,
SlotReservations slotsAllocated 
) [protected]

findSlotsAllocatedForStream () The function locates all slots which are used to sent messages from the same stream starting at the source link.

References getInterconnectGraph(), NoCSchedulingEntity::getMessage(), NoCSchedulingEntity::getRoute(), InterconnectGraph::getSlotTableSize(), Message::getStreamId(), Route::linksBegin(), Link::slotTableSeqBegin(), and Link::slotTableSeqEnd().

Referenced by ClassicNoCScheduler::findSlotsOnRouteUsingClassic().

Here is the call graph for this function:

bool NoCScheduler::findSlotsOnRoute ( NoCSchedulingEntity e,
SlotReservations s 
) [protected]

findSlotsOnRoute () The function looks for a set of slots which can be reserved along the route such that flits entering a router leave it in the next slot and there is enough space to transmit both the data and the packatization headers. On success, the slot reservations for the first link of the route are stored in s and the function returns true. On failure, the function returns false. The function tries to minimize the number of packets used.

References findFreeSlotsOnRoute(), NoCSchedulingEntity::getDuration(), getInterconnectGraph(), NoCSchedulingEntity::getRoute(), InterconnectGraph::getSlotTableSize(), NoCSchedulingEntity::getStartTime(), Route::length(), Route::linksBegin(), Route::linksEnd(), and Link::preferredSlots.

Referenced by findScheduleEntityForMessage(), KnowledgeNoCScheduler::findScheduleEntityForMessageUsingKnowledge(), and RandomNoCScheduler::findScheduleEntityForMessageUsingRandom().

Here is the call graph for this function:

bool NoCScheduler::findSlotsOnRoute ( NoCSchedulingEntity e,
SlotReservations slotsForPackets,
SlotReservations s 
) [protected]

findSlotsOnRoute () The function looks for a set of slots which can be reserved along the route such that flits entering a router leave it in the next slot and there is enough space to transmit both the data and the packatization headers. On success, the slot reservations for the first link of the route are stored in s and the function returns true. On failure, the function returns false. The function tries to minimize the number of packets used. It only uses slots from the slots marked in slotsForPackets. The caller of the function must guarantee that those slots are actually available for sending the data.

References Packet::endTime, findFreePackets(), findFreeSlotsOnRoute(), NoCSchedulingEntity::getDuration(), getInterconnectGraph(), NoCSchedulingEntity::getMessage(), NoCSchedulingEntity::getRoute(), Message::getSize(), InterconnectGraph::getSlotTableSize(), NoCSchedulingEntity::getStartTime(), Packet::loop, Packet::nrSlots, nrSlotsRequired(), and Packet::startTime.

Here is the call graph for this function:

NoCSchedulingEntity * NoCScheduler::getFirstScheduledMessageInStream ( Message m  )  [protected]

getFirstScheduledMessageInStream () The function returns a pointer to the scheduling entity of the first message in the stream which is scheduled. Or NULL if no such message exists.

References Message::getNextMessageInStream(), Message::getPreviousMessageInStream(), and Message::getSchedulingEntity().

Referenced by ClassicNoCScheduler::findScheduleEntityForMessageUsingClassic().

Here is the call graph for this function:

CSize NoCScheduler::getLengthShortestPathBetweenNodes ( const Node src,
const Node dst 
) [protected]
void NoCScheduler::lowerPreferenceLevelSlotsOnRoute ( NoCSchedulingEntity e  )  [protected]

lowerPreferenceLevelSlotsOnRoute () The function decreases the preference level of the slots used by the scheduling entity on its route. This preference level indicates how often a slot in a link is used in the scheduling problem. When its preference level is equal to infinity (UINT_MAX), the slot is also used in another scheduling problem that is scheduled along with this problem.

References getInterconnectGraph(), NoCSchedulingEntity::getRoute(), NoCSchedulingEntity::getSlotReservations(), InterconnectGraph::getSlotTableSize(), Route::linksBegin(), Route::linksEnd(), and Link::preferredSlots.

Referenced by releaseResources().

Here is the call graph for this function:

void NoCScheduler::markPreferedSlotsOnLinks ( SetOfNoCScheduleProblems problems  )  [protected]

markPreferedSlotsOnLinks () The function marks every slot in every link of the interconnect graph in problem as prefered (with maximimal level - UINT_MAX) when this slot is used in any of the scheduling problems solved so far. This scheduler uses this information to minimize the number of newly allocated slots. Leaving as many slots free as possible for other applications.

References NoCScheduleProblem::getInterconnectGraph(), getSchedulingProblem(), NoCScheduleProblem::isProblemSolved(), NoCScheduleProblem::markPreferedSlots(), SetOfNoCScheduleProblems::scheduleProblemsBegin(), and SetOfNoCScheduleProblems::scheduleProblemsEnd().

Referenced by schedule().

Here is the call graph for this function:

TTime NoCScheduler::maximalDuration ( const Message m,
TTime  startTime,
CSize  lengthRoute 
) const [protected]

maximalDuration () The function returns the maximal duration for the message m. It considers the start time of messages which arrive later in the stream (i.e. higher sequence number) and the start time of this message.

References Message::getDuration(), Message::getNextMessageInStream(), NoCSchedulingEntity::getRoute(), Message::getSchedulingEntity(), NoCSchedulingEntity::getStartTime(), Message::getStartTime(), and Route::length().

Referenced by findScheduleEntityForMessage(), ClassicNoCScheduler::findScheduleEntityForMessageUsingClassic(), KnowledgeNoCScheduler::findScheduleEntityForMessageUsingKnowledge(), and RandomNoCScheduler::findScheduleEntityForMessageUsingRandom().

Here is the call graph for this function:

MessagesCIter NoCScheduler::messagesBegin (  )  const [inline, protected]

References getSchedulingProblem(), and NoCScheduleProblem::messagesBegin().

Here is the call graph for this function:

MessagesCIter NoCScheduler::messagesEnd (  )  const [inline, protected]

References getSchedulingProblem(), and NoCScheduleProblem::messagesEnd().

Here is the call graph for this function:

uint NoCScheduler::minFreeSlotsOnLink ( Link l,
const TTime  startTime,
const TTime  duration 
) [protected]

minFreeSlotsOnLink () The function returns the minimum number of slots available on the link between the given timing constraints.

References SlotTable::getEndTime(), getInterconnectGraph(), SlotTable::getNrFreeSlots(), InterconnectGraph::getSlotTablePeriod(), InterconnectGraph::getSlotTableSize(), SlotTable::getStartTime(), Link::slotTableSeqBegin(), and Link::slotTableSeqEnd().

Here is the call graph for this function:

TTime NoCScheduler::minimalDuration ( const Message m,
TTime  startTime,
SlotReservations  slotReservations 
) const [protected]

minimalDuration () The function returns the minimal duration for the message m. It considers the start time of messages the message given by 'startTime', the length of the route given by 'lengthRoute', and the slot reservations given by 'slotReservations'. The later is used to take the packatization overhead into account.

References InterconnectGraph::getFlitSize(), getInterconnectGraph(), InterconnectGraph::getPacketHeaderSize(), Message::getSize(), and InterconnectGraph::getSlotTableSize().

Referenced by findScheduleEntityForMessage(), ClassicNoCScheduler::findScheduleEntityForMessageUsingClassic(), KnowledgeNoCScheduler::findScheduleEntityForMessageUsingKnowledge(), and RandomNoCScheduler::findScheduleEntityForMessageUsingRandom().

Here is the call graph for this function:

uint NoCScheduler::nrSchedulingEntities (  )  const [inline, protected]

References getSchedulingProblem(), and NoCScheduleProblem::nrSchedulingEntities().

Here is the call graph for this function:

uint NoCScheduler::nrSlotsRequired ( const TTime  duration,
const CSize  size,
const uint  nrPacketsPerSlotTable 
) [protected]

nrSlotsRequired () The function computes the number of slots required to sent a communication event within the given time bounds along a route. It takes the packatization overhead into account.

References InterconnectGraph::getFlitSize(), getInterconnectGraph(), InterconnectGraph::getPacketHeaderSize(), and InterconnectGraph::getSlotTableSize().

Referenced by findSlotsOnRoute(), ClassicNoCScheduler::findSlotsOnRouteUsingClassic(), and KnowledgeNoCScheduler::setRequirementsMessage().

Here is the call graph for this function:

ostream & NoCScheduler::print ( ostream &  out  )  const [protected]

print () Output the status of the scheduler (overview of all link allocations) and the number of messages scheduled to the supplied output stream.

References getInterconnectGraph(), Message::getSchedulingEntity(), InterconnectGraph::linksEnd(), messagesBegin(), messagesEnd(), and Link::print().

Here is the call graph for this function:

void NoCScheduler::raisePreferenceLevelSlotsOnRoute ( NoCSchedulingEntity e  )  [protected]

raisePreferenceLevelSlotsOnRoute () The function increases the preference level of the slots used by the scheduling entity on its route. This preference level indicates how often a slot in a link is used in the scheduling problem. When its preference level is equal to infinity (UINT_MAX), the slot is also used in another scheduling problem that is scheduled along with this problem.

References getInterconnectGraph(), NoCSchedulingEntity::getRoute(), NoCSchedulingEntity::getSlotReservations(), InterconnectGraph::getSlotTableSize(), Route::linksBegin(), Route::linksEnd(), and Link::preferredSlots.

Referenced by reserveResources().

Here is the call graph for this function:

void NoCScheduler::releaseResources ( NoCSchedulingEntity e  )  [protected]

releaseResources () Release resources in the architecture graph claimed by the scheduling entity e.

References NoCSchedulingEntity::getRoute(), Route::linksBegin(), Route::linksEnd(), lowerPreferenceLevelSlotsOnRoute(), Link::releaseSlots(), and NoCSchedulingEntity::resourcesReserved().

Referenced by RandomNoCScheduler::random(), ripupScheduleEntity(), and ripupStream().

Here is the call graph for this function:

void NoCScheduler::ripupScheduleEntity ( MessagesIter  iterMsg  )  [protected]
void NoCScheduler::ripupStream ( MessagesIter  iterMsg  )  [protected]

ripupStream () Remove schedule of all messages which belong to the stream.

References NoCScheduleProblem::getMessages(), Message::getSchedulingEntity(), getSchedulingProblem(), Message::getStreamId(), messagesBegin(), messagesEnd(), releaseResources(), and Message::setSchedulingEntity().

Referenced by ClassicNoCScheduler::classic().

Here is the call graph for this function:

bool NoCScheduler::schedule ( SetOfNoCScheduleProblems problems  ) 

schedule () The function tries to find a valid schedule for all scheduling problems. On success, the function returns true. Otherwise, it returns false.

References NoCScheduleProblem::getName(), NoCScheduleProblem::isProblemSolved(), logError(), markPreferedSlotsOnLinks(), SetOfNoCScheduleProblems::scheduleProblemsBegin(), SetOfNoCScheduleProblems::scheduleProblemsEnd(), setSchedulingProblem(), NoCScheduleProblem::setSolvedFlag(), and solve().

Referenced by NoCMapping::scheduleCommunication(), and solveSchedulingProblems().

Here is the call graph for this function:

NoCSchedulingEntitiesIter NoCScheduler::schedulingEntitiesBegin (  )  [inline, protected]

References getSchedulingProblem(), and NoCScheduleProblem::schedulingEntitiesBegin().

Here is the call graph for this function:

NoCSchedulingEntitiesIter NoCScheduler::schedulingEntitiesEnd (  )  [inline, protected]

References getSchedulingProblem(), and NoCScheduleProblem::schedulingEntitiesEnd().

Here is the call graph for this function:

void NoCScheduler::setSchedulingProblem ( NoCScheduleProblem p  )  [inline, protected]

References curScheduleProblem.

Referenced by assignSchedulingEntities(), and schedule().

double NoCScheduler::severityConflict ( NoCSchedulingEntity e,
Message m,
Route r 
) [protected]

severityConflictSchedulingEntities () The function computes the severity of a conflict between a scheduling entity 'e' and a message 'm' which must be scheduled over a route 'r'. The severity is defined as the number of slots used by 'e' on the route 'r'. Only slots within the time bounds of 'm' are counted.

References Message::getDuration(), NoCSchedulingEntity::getDuration(), getInterconnectGraph(), NoCSchedulingEntity::getRoute(), NoCSchedulingEntity::getSlotReservations(), InterconnectGraph::getSlotTablePeriod(), InterconnectGraph::getSlotTableSize(), Message::getStartTime(), NoCSchedulingEntity::getStartTime(), Route::length(), Route::linksBegin(), and Route::linksEnd().

Referenced by ripupScheduleEntity().

Here is the call graph for this function:

virtual bool NoCScheduler::solve (  )  [protected, pure virtual]
void NoCScheduler::sortMessagesOnCost (  )  [protected]

sortMessagesOnCost () The function sorts all messages using a cost function with cost from high to low. The cost of a communication event is determined by its size and time bounds.

References Message::getDuration(), NoCScheduleProblem::getMessages(), getSchedulingProblem(), Message::getSize(), messagesBegin(), messagesEnd(), and Message::setCost().

Referenced by ClassicNoCScheduler::classic(), GreedyNoCScheduler::greedy(), KnowledgeNoCScheduler::knowledge(), and RipupNoCScheduler::ripup().

Here is the call graph for this function:

void NoCScheduler::sortRoutesOnCost ( Routes routes,
const TTime  startTime,
const TTime  duration 
) [protected]

sortRoutesOnCost () The function sorts all routes using a cost function with cost from high to low. The cost is determined by the minimum number of free slots available overall links within the given time bounds.

References SlotTable::getEndTime(), getInterconnectGraph(), SlotTable::getNrFreeSlots(), InterconnectGraph::getSlotTablePeriod(), InterconnectGraph::getSlotTableSize(), SlotTable::getStartTime(), Route::linksBegin(), Route::linksEnd(), Route::setCost(), Link::slotTableSeqBegin(), and Link::slotTableSeqEnd().

Referenced by findScheduleEntityForMessage(), and ripupScheduleEntity().

Here is the call graph for this function:


Member Data Documentation


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