analysis/buffersizing/buffer_capacity_constrained.cc File Reference
#include "storage_distribution.h"
#include "../../base/algo/repetition_vector.h"
#include "../../resource_allocation/binding_aware_sdfg/binding_aware_sdfg.h"
Define Documentation
Referenced by execSDFgraph().
Referenced by actorReadyToFire(), and analyzeDeadlock().
Referenced by findCausalDependencies().
Referenced by startActorFiring().
Referenced by endActorFiring().
Typedef Documentation
typedef CapacityConstrainedBufferStates::iterator CapacityConstrainedBufferStatesIter |
Function Documentation
static bool actorReadyToEnd | ( | SDFactor * | a | ) | [inline, static] |
actorReadyToEnd () The function returns true when the actor is ready to end its firing. Else the function returns false.
References CapacityConstrainedBufferState::actClk, currentState, and SDFcomponent::getId().
Referenced by analyzePeriodicPhase(), SDFstateSpaceSelfTimedMinimalLatencyAnalysis::TransitionSystem::execConstrainedSDFgraph(), SDFstateSpaceSelfTimedMinimalLatencyAnalysis::TransitionSystem::execSDFgraph(), and execSDFgraph().
static bool actorReadyToFire | ( | SDFactor * | a | ) | [inline, static] |
actorReadyToFire () The function returns true when the actor is ready to fire in state s. Else it returns false.
References c, CH_TOKENS, SDFport::getChannel(), SDFcomponent::getId(), SDFport::getRate(), SDFport::getType(), SDFactor::portsBegin(), and SDFactor::portsEnd().
Referenced by analyzePeriodicPhase(), SDFstateSpaceSelfTimedMinimalLatencyAnalysis::TransitionSystem::execConstrainedSDFgraph(), SDFstateSpaceSelfTimedMinimalLatencyAnalysis::TransitionSystem::execSDFgraph(), and execSDFgraph().
static bool addStorageDistributionToChecklist | ( | StorageDistribution * | d | ) | [static] |
addStorageDistributionToChecklist () The function add the storage distribution 'd' to the list of storage distributions which must still be checked. This list is ordered wrt to the size of the storage distribution. A storage distribution is only added if it is not already contained in the list. When the distribution is added to the list, the function returns 'true', else the function returns 'false'.
References ASSERT, c, _StorageDistributionSet::distributions, _StorageDistribution::next, _StorageDistributionSet::next, SDFgraph::nrChannels(), _StorageDistribution::prev, _StorageDistributionSet::prev, _StorageDistribution::sp, _StorageDistribution::sz, _StorageDistributionSet::sz, and _StorageDistributionSet::thr.
Referenced by exploreStorageDistribution(), and findMinimalStorageDistributions().
static void analyzeDeadlock | ( | bool * | dep | ) | [static] |
analyzeDeadlock () Analyze the deadlock in the schedule.
References c, CH_TOKENS, SDFgraph::channelsBegin(), SDFgraph::channelsEnd(), findStorageDependencies(), SDFchannel::getDstActor(), SDFchannel::getDstPort(), SDFcomponent::getId(), SDFport::getRate(), SDFchannel::getSrcActor(), and SDFgraph::nrActors().
Referenced by execSDFgraph().
static void analyzePeriodicPhase | ( | bool * | dep | ) | [static] |
analyzePeriodicPhase () Analyze the periodic phase of the schedule to find all blocked channels. This is done using the abstract dependency graph.
References a, actorReadyToEnd(), actorReadyToFire(), SDFgraph::actorsBegin(), SDFgraph::actorsEnd(), CapacityConstrainedBufferState::ch, clockStep(), copyState(), currentState, endActorFiring(), equalStates(), findCausalDependencies(), findStorageDependencies(), SDFcomponent::getId(), CapacityConstrainedBufferState::glbClk, SDFgraph::nrActors(), SDFgraph::nrChannels(), outputActorRepCnt, previousState, and startActorFiring().
Referenced by execSDFgraph().
static void clearState | ( | CapacityConstrainedBufferState & | s | ) | [static] |
clearState () The function sets the state to zero.
References CapacityConstrainedBufferState::actClk, CapacityConstrainedBufferState::ch, CapacityConstrainedBufferState::glbClk, SDFgraph::nrActors(), and SDFgraph::nrChannels().
Referenced by execSDFgraph().
static void clearStoredStates | ( | ) | [static] |
clearStoredStates () The function clears the list of stored states.
Referenced by SDFstateSpaceSelfTimedMinimalLatencyAnalysis::TransitionSystem::execConstrainedSDFgraph(), SDFstateSpaceSelfTimedMinimalLatencyAnalysis::TransitionSystem::execSDFgraph(), execSDFgraph(), and execStorageDistribution().
static SDFtime clockStep | ( | ) | [inline, static] |
clockStep () The function progresses time till the first end of firing transition becomes enabled. The time step is returned. In case of deadlock, the time step is equal to UINT_MAX.
References a, CapacityConstrainedBufferState::actClk, currentState, CapacityConstrainedBufferState::glbClk, and SDFgraph::nrActors().
Referenced by analyzePeriodicPhase(), SDFstateSpaceSelfTimedMinimalLatencyAnalysis::TransitionSystem::execConstrainedSDFgraph(), SDFstateSpaceSelfTimedMinimalLatencyAnalysis::TransitionSystem::execSDFgraph(), and execSDFgraph().
static void computeLbDistributionSz | ( | TimedSDFgraph * | g | ) | [static] |
References c, lbDistributionSz, minSz, and SDFgraph::nrChannels().
Referenced by initGlobals().
static void computeMinimalChannelSz | ( | TimedSDFgraph * | g | ) | [static] |
References c, SDFgraph::channelsBegin(), SDFgraph::channelsEnd(), gcd(), SDFchannel::getDstActor(), SDFchannel::getDstPort(), SDFcomponent::getId(), SDFchannel::getInitialTokens(), SDFport::getRate(), SDFchannel::getSrcActor(), SDFchannel::getSrcPort(), minSz, and SDFgraph::nrChannels().
Referenced by initGlobals().
static void computeMinimalChannelSzStep | ( | TimedSDFgraph * | g | ) | [static] |
References c, SDFgraph::channelsBegin(), SDFgraph::channelsEnd(), gcd(), SDFchannel::getDstPort(), SDFcomponent::getId(), SDFport::getRate(), SDFchannel::getSrcPort(), minSzStep, and SDFgraph::nrChannels().
Referenced by initGlobals().
static TDtime computeThroughput | ( | const CapacityConstrainedBufferStatesIter | cycleIter | ) | [inline, static] |
computeThroughput () The function calculates the throughput of the states on the cycle. Its value is equal to the average number of firings of an actor per time unit.
References CapacityConstrainedBufferState::glbClk.
Referenced by SDFstateSpaceSelfTimedMinimalLatencyAnalysis::TransitionSystem::execConstrainedSDFgraph(), and execSDFgraph().
void copyState | ( | CapacityConstrainedBufferState & | to, | |
const CapacityConstrainedBufferState & | from | |||
) | [inline] |
copyState () The function copies the state.
References CapacityConstrainedBufferState::actClk, CapacityConstrainedBufferState::ch, CapacityConstrainedBufferState::glbClk, SDFgraph::nrActors(), and SDFgraph::nrChannels().
Referenced by analyzePeriodicPhase(), execSDFgraph(), and pushStack().
static void deleteStorageDistribution | ( | StorageDistribution * | d | ) | [static] |
deleteStorageDistribution () Deallocate memory for a storage distribution.
References _StorageDistribution::dep, and _StorageDistribution::sp.
Referenced by exploreStorageDistribution(), findMinimalStorageDistributions(), and minimizeStorageDistributionsSet().
static void dfsVisitDependencies | ( | uint | a, | |
int * | color, | |||
int * | pi, | |||
bool ** | abstractDepGraph, | |||
bool * | dep | |||
) | [static] |
dfsVisitDependencies () The function performs a DFS on the abstract dependency graph from a node a to find all cycles of which a is part. Channels on a cycle are when needed marked to have a storage dependency.
References c, SDFgraph::channelsBegin(), SDFgraph::channelsEnd(), SDFchannel::getDstActor(), SDFcomponent::getId(), SDFchannel::getSrcActor(), and SDFgraph::nrActors().
Referenced by findStorageDependencies().
static void endActorFiring | ( | SDFactor * | a | ) | [inline, static] |
endActorFiring () Produce tokens on all output channels and remove the actor firing from the list of active firings.
References CapacityConstrainedBufferState::actClk, c, currentState, SDFport::getChannel(), SDFcomponent::getId(), SDFport::getRate(), SDFport::getType(), SDFactor::portsBegin(), SDFactor::portsEnd(), and PRODUCE.
Referenced by analyzePeriodicPhase(), SDFstateSpaceSelfTimedMinimalLatencyAnalysis::TransitionSystem::execConstrainedSDFgraph(), SDFstateSpaceSelfTimedMinimalLatencyAnalysis::TransitionSystem::execSDFgraph(), and execSDFgraph().
bool equalStates | ( | const CapacityConstrainedBufferState & | s1, | |
const CapacityConstrainedBufferState & | s2 | |||
) | [inline] |
equalStates () The function compares to states and returns true if they are equal.
References CapacityConstrainedBufferState::actClk, CapacityConstrainedBufferState::ch, CapacityConstrainedBufferState::glbClk, SDFgraph::nrActors(), and SDFgraph::nrChannels().
Referenced by analyzePeriodicPhase(), execSDFgraph(), findValueInHashTable(), and storeState().
execSDFgraph() Execute the SDF graph till a deadlock is found or a recurrent state. The throughput is returned.
References a, actorReadyToEnd(), actorReadyToFire(), SDFgraph::actorsBegin(), SDFgraph::actorsEnd(), analyzeDeadlock(), analyzePeriodicPhase(), c, CapacityConstrainedBufferState::ch, CH, SDFgraph::channelsBegin(), SDFgraph::channelsEnd(), clearState(), clearStoredStates(), clockStep(), computeThroughput(), currentState, endActorFiring(), SDFcomponent::getId(), SDFchannel::getInitialTokens(), CapacityConstrainedBufferState::glbClk, CapacityConstrainedBufferState::init(), TimedSDFchannel::modelsStorageSpace(), SDFgraph::nrActors(), SDFgraph::nrChannels(), outputActorRepCnt, previousState, startActorFiring(), and storeState().
Referenced by execStorageDistribution(), latencyAnalysisForRandomStaticOrderSingleProc(), and stateSpaceAbstractDepGraph().
static void execStorageDistribution | ( | StorageDistribution * | d | ) | [static] |
execStorageDistribution () Compute throughput and storage dependencies of the given storage distribution.
References c, clearStoredStates(), _StorageDistribution::dep, execSDFgraph(), SDFgraph::nrChannels(), _StorageDistribution::sp, and _StorageDistribution::thr.
Referenced by exploreStorageDistribution().
static void exploreStorageDistribution | ( | StorageDistributionSet * | ds, | |
StorageDistribution * | d | |||
) | [static] |
exploreStorageDistribution () The function computes the throughput of the storage distribution 'd' and adds new storage distributions to the list of distributions which must be checked based on the storage dependencies found in d. The function also updates the maximal throughput of the set of storage distributions when needed.
References addStorageDistributionToChecklist(), c, deleteStorageDistribution(), _StorageDistribution::dep, execStorageDistribution(), SDFgraph::getChannel(), SDFchannel::getDstActor(), SDFcomponent::getId(), SDFchannel::getSrcActor(), minSzStep, newStorageDistribution(), _StorageDistribution::next, SDFgraph::nrChannels(), _StorageDistribution::prev, _StorageDistribution::sp, _StorageDistribution::sz, _StorageDistributionSet::thr, and _StorageDistribution::thr.
Referenced by exploreStorageDistributionSet().
static void exploreStorageDistributionSet | ( | StorageDistributionSet * | ds | ) | [static] |
exploreStorageDistributionSet () Explore all distributions within the set and remove all non-minimal distributions from it.
References _StorageDistributionSet::distributions, exploreStorageDistribution(), minimizeStorageDistributionsSet(), and _StorageDistribution::next.
Referenced by findMinimalStorageDistributions().
static void findCausalDependencies | ( | SDFactor * | a, | |
bool ** | abstractDepGraph | |||
) | [static] |
findCausalDependencies () The function tracks all causal dependencies in the actor firing of actor a. Any causal dependency that is found is added to the abstract dependency graph.
References c, CH_TOKENS_PREV, SDFport::getChannel(), SDFchannel::getDstActor(), SDFcomponent::getId(), SDFport::getRate(), SDFchannel::getSrcActor(), SDFport::getType(), SDFactor::portsBegin(), and SDFactor::portsEnd().
Referenced by analyzePeriodicPhase().
static void findMaxThroughput | ( | TimedSDFgraph * | g, | |
double | maxThr | |||
) | [static] |
References maxThroughput.
Referenced by initGlobals().
static void findMinimalStorageDistributions | ( | ) | [static] |
findMinimalStorageDistributions () Explore the throughput/storage-size trade-off space till either all minimal storage distributions are found or the throughput bound is reached.
References addStorageDistributionToChecklist(), c, deleteStorageDistribution(), _StorageDistributionSet::distributions, exploreStorageDistributionSet(), lbDistributionSz, maxThroughput, minSz, newStorageDistribution(), _StorageDistributionSet::next, _StorageDistribution::next, SDFgraph::nrChannels(), _StorageDistributionSet::prev, _StorageDistribution::prev, _StorageDistribution::sp, _StorageDistributionSet::sz, _StorageDistribution::sz, _StorageDistributionSet::thr, and _StorageDistribution::thr.
Referenced by stateSpaceBufferAnalysisCapacityConstrainedModel().
static void findOutputActor | ( | TimedSDFgraph * | g | ) | [static] |
References a, SDFgraph::actorsBegin(), SDFgraph::actorsEnd(), FSMSADF::computeRepetitionVector(), SDFcomponent::getId(), and outputActorRepCnt.
Referenced by initGlobals().
static void findStorageDependencies | ( | bool ** | abstractDepGraph, | |
bool * | dep | |||
) | [static] |
findStorageDependencies () The function find all cycles in the abstract dependency graph. Any channel modeling storage space which is part of a cycle is marked to have a storage dependency.
References c, color, dfsVisitDependencies(), SDFgraph::getChannel(), SDFgraph::nrActors(), SDFgraph::nrChannels(), and pi.
Referenced by analyzeDeadlock(), and analyzePeriodicPhase().
static void initGlobals | ( | TimedSDFgraph * | g, | |
double | maxThr | |||
) | [static] |
References computeLbDistributionSz(), computeMinimalChannelSz(), computeMinimalChannelSzStep(), findMaxThroughput(), and findOutputActor().
Referenced by stateSpaceBufferAnalysisCapacityConstrainedModel().
static void minimizeStorageDistributionsSet | ( | StorageDistributionSet * | ds | ) | [static] |
minimizeMinStorageDistributions () The function removes all storage distributions within the supplied set of storage distributions which are non-minimal. All storage distributions within the set should have the same size.
References deleteStorageDistribution(), _StorageDistributionSet::distributions, _StorageDistribution::next, _StorageDistribution::prev, _StorageDistributionSet::prev, _StorageDistribution::thr, and _StorageDistributionSet::thr.
Referenced by exploreStorageDistributionSet().
static StorageDistribution* newStorageDistribution | ( | ) | [static] |
newStorageDistribution () Allocate memory for a new storage distribution.
References _StorageDistribution::dep, SDFgraph::nrChannels(), and _StorageDistribution::sp.
Referenced by exploreStorageDistribution(), and findMinimalStorageDistributions().
static void startActorFiring | ( | TimedSDFactor * | a | ) | [inline, static] |
startActorFiring () Start the actor firing. Remove tokens from all input channels and add the actor firing to the list of active actor firings and advance sequence position.
References CapacityConstrainedBufferState::actClk, c, CONSUME, currentState, SDFport::getChannel(), TimedSDFactor::getExecutionTime(), SDFcomponent::getId(), SDFport::getRate(), SDFport::getType(), SDFactor::portsBegin(), and SDFactor::portsEnd().
Referenced by analyzePeriodicPhase(), SDFstateSpaceSelfTimedMinimalLatencyAnalysis::TransitionSystem::execConstrainedSDFgraph(), SDFstateSpaceSelfTimedMinimalLatencyAnalysis::TransitionSystem::execSDFgraph(), and execSDFgraph().
StorageDistributionSet* stateSpaceBufferAnalysisCapacityConstrainedModel | ( | TimedSDFgraph * | gr, | |
double | maxThr | |||
) |
stateSpaceBufferAnalysisCapacityConstrainedModel () Analyze the trade-offs between storage distributions and throughput (using auto-concurrency). Storage space allocations are determined for all channels modelling storage space in the capacity constrained model.
References findMinimalStorageDistributions(), and initGlobals().
Referenced by analyzeSDFG().
static bool storeState | ( | CapacityConstrainedBufferState & | s, | |
CapacityConstrainedBufferStatesIter & | pos | |||
) | [static] |
storeState () The function stores the state s on whenever s is not already in the list of storedStates. When s is stored, the function returns true. When the state s is already in the list, the state s is not stored. The function returns false. The function always sets the pos variable to the position where the state s is in the list.
References equalStates().
Referenced by SDFstateSpaceSelfTimedMinimalLatencyAnalysis::TransitionSystem::execConstrainedSDFgraph(), SDFstateSpaceSelfTimedMinimalLatencyAnalysis::TransitionSystem::execSDFgraph(), and execSDFgraph().
Variable Documentation
CapacityConstrainedBufferState currentState(0, 0) [static] |
Referenced by actorReadyToEnd(), SDFstateSpaceMinimalLatencyAnalysis::analyze(), analyzePeriodicPhase(), clockStep(), endActorFiring(), SDFstateSpaceSelfTimedMinimalLatencyAnalysis::TransitionSystem::execConstrainedSDFgraph(), SDFstateSpaceSelfTimedMinimalLatencyAnalysis::TransitionSystem::execSDFgraph(), execSDFgraph(), and startActorFiring().
TimedSDFgraph* g [static] |
Pointer to SDF graph which is analyzed
Referenced by FSMSADF::ToolAnalyze::analyzeGraph(), Binding::analyzeThroughputApplication(), calcRepetitionVector(), FSMSADF::calcRepetitionVector(), CSDFgraph::calcRepetitionVector(), SDFgraph::clone(), TimedSDFgraph::clone(), FSMSADF::Graph::clone(), FSMSADF::ScenarioGraph::clone(), CSDFgraph::clone(), TimedCSDFgraph::clone(), FSMSADF::GraphBindingConstraints::clone(), componentToCSDFgraph(), componentToSDFgraph(), FSMSADF::MemoryDimAlgo::computeStorageDist(), SDF3Flow::computeStorageDistributions(), CSDFgraph::construct(), SDFchannel::construct(), CSDFchannel::construct(), constructArchitectureGraph(), constructCSDFgraph(), FSMSADF::Channel::constructFromXML(), constructPlatformGraph(), constructTimedCSDFgraph(), constructTimedCSDFgraphStructure(), createAcyclicGraph(), SDF3Flow::createAppGraph(), SDFgraph::createCopy(), TimedSDFgraph::createCopy(), FSMSADF::Graph::createCopy(), FSMSADF::ScenarioGraph::createCopy(), CSDFgraph::createCopy(), TimedCSDFgraph::createCopy(), createGraph(), FSMSADF::RandomGraph::createGraph(), BindingAwareSDFG::createMappedChannelToConnectionMPFlow(), BindingAwareSDFG::createMappedChannelToConnectionNSoC(), BindingAwareSDFG::createMappedChannelToTileMPFlow(), BindingAwareSDFG::createMappedChannelToTileNSoC(), NoCMapping::createNetworkNode(), SDFstateSpaceSelfTimedMinimalLatencyAnalysis::TransitionSystem::execConstrainedSDFgraph(), SDFstateSpaceSelfTimedMinimalLatencyAnalysis::TransitionSystem::execSDFgraph(), FSMSADF::ScenarioGraph::extractSDFgraph(), FSMSADF::findAllScenariosOfActor(), FSMSADF::RandomGraph::generateGraph(), FSMSADF::ToolGenerate::generateRandomGraph(), generateSDFgraph(), FSMSADF::NetworkInterfaceBinding::getInBandwidthUsedForGraph(), FSMSADF::MemoryBinding::getMemorySizeUsedForGraph(), FSMSADF::NetworkInterfaceBinding::getNrInConnectionsUsedForGraph(), FSMSADF::NetworkInterfaceBinding::getNrOutConnectionsUsedForGraph(), FSMSADF::NetworkInterfaceBinding::getOutBandwidthUsedForGraph(), FSMSADF::BindingAwareGraph::getScenarioOfScenarioGraph(), FSMSADF::ProcessorBinding::getWheelsizeUsedForGraph(), modelAutoConcurrencyInSDFgraph(), modelBufferSizeInSDFgraph(), reverseChannelsInSDFgraph(), FSMSADF::ToolTransform::transformGraph(), and transformHSDFtoAPG().
TBufSize lbDistributionSz [static] |
Referenced by computeLbDistributionSz(), and findMinimalStorageDistributions().
TDtime maxThroughput [static] |
Referenced by findMaxThroughput(), and findMinimalStorageDistributions().
StorageDistributionSet* minStorageDistributions = NULL [static] |
minStorageDistributions List of all minimal storage distributions.
Referenced by analyzeCSDFG(), and analyzeSDFG().
Globals These are initialized by calling the function initGlobals.
Referenced by computeLbDistributionSz(), computeMinimalChannelSz(), FSMSADF::MemoryDimAlgo::estimateStorageDist(), findMinimalStorageDistributions(), getLbDistributionSz(), and randomChannelBufferSizes().
Referenced by computeMinimalChannelSzStep(), and exploreStorageDistribution().
SDFactor* outputActor [static] |
TCnt outputActorRepCnt [static] |
CapacityConstrainedBufferState previousState(0, 0) [static] |
storedStates List of visited states that are stored.
Referenced by SDFstateSpaceSelfTimedMinimalLatencyAnalysis::TransitionSystem::execSDFgraph().