public class MutExPipelinedScheduling extends MutualExclusionSolver implements PeriodProcConstraints, PeriodConstraints
Modifier and Type | Class and Description |
---|---|
private class |
MutExPipelinedScheduling.LeftEdgePipelined
Class to generate variables and constraints for pipelined scheduling
using Left-edge algorithm.
|
private class |
MutExPipelinedScheduling.OmegaAnalysis
Class to generate variables and constraints for pipelined scheduling
using Omega Analysis.
|
private class |
MutExPipelinedScheduling.PeriodSymmetry
Class and methods to test Period symmetry constraints for Pipelined scheduling
|
private class |
MutExPipelinedScheduling.TypeConstraints
Class to test type constraints for pipelined scheduling.
|
MutualExclusionSolver.LeftEdge
Z3Solver.SatResult
Modifier and Type | Field and Description |
---|---|
private java.util.Map<java.lang.String,com.microsoft.z3.BoolExpr> |
afterVarDecl
SMT variables for Left-edge scheduling to decide
the order of task execution.
|
private java.util.Map<java.lang.String,com.microsoft.z3.IntExpr> |
buffPipelinedDecl
SMT variables for buffer calculation
|
private java.util.Map<java.lang.String,com.microsoft.z3.IntExpr> |
capVarDecl
SMT cap variables for Omega analysis
|
boolean |
disablePrimes
Calculate pipelined schedule without using prime
variables (period locality)
|
private GraphAnalysisSdfAndHsdf |
graphAnalysis
Graph analysis object to determine some properties of the graph
|
private java.util.Map<java.lang.String,com.microsoft.z3.IntExpr> |
kDecl
SMT k-variables mapped with name
|
private com.microsoft.z3.IntExpr |
kMaxDecl
SMT variable for calculating kMax.
|
boolean |
omegaAnalysis
Enable pipeline scheduling using omega.
|
private com.microsoft.z3.IntExpr |
periodDecl
SMT variable for calculating period of the schedule.
|
boolean |
periodSymmetry
Enable Period symmetry
|
private java.util.Map<java.lang.String,com.microsoft.z3.IntExpr> |
periodSymVarDecl
SMT period symmetry variables
|
private java.util.Map<java.lang.String,com.microsoft.z3.IntExpr> |
primeDecl
SMT prime variables mapped with name
|
private com.microsoft.z3.IntExpr |
procUtilAtPeriodStartId
SMT variable for calculating processor utilization at the start
of the period.
|
boolean |
typeDifferentiateAlgo
Enable differentiation in the types of tasks, depending
on yPrime of task is less than xPrime (type I)
or xPrime of task is less than yPrime (type II)
|
bufferAnalysis, bufferAnalysisWithFunctions, graph, graphSymmetry, hsdf, lastActorList, latencyDecl, leftEdgeAlgorithm, mutualExclusionGraphAnalysis, overlappingActorList, overlappingActorWithGraphSymList, processorSymmetry, solutions, startActorList, totalBufDecl, totalProcDecl
contextStatements, pushedContext, statementCountAfterPush, z3Solver
Constructor and Description |
---|
MutExPipelinedScheduling(Graph inputGraph)
Build a mutual exclusion pipelined solver
|
Modifier and Type | Method and Description |
---|---|
(package private) com.microsoft.z3.BoolExpr |
afterVariableId(java.lang.String name1,
int index1,
java.lang.String name2,
int index2)
Get SMT boolean variable for order between the actor1 and actor2
|
private void |
assertMinKmax()
Generate SMT constraint for calculation of Kmax variable.
|
private void |
assertMinPeriod()
Generate a constraint for lower bound on the
period.
|
private void |
assertNonOverlapPeriodConstraint()
Generate constraints to contain an actor inside a period.
|
void |
assertPipelineConstraints()
Generate constraints for solving pipelined scheduling problem.
|
private com.microsoft.z3.IntExpr |
capPredXId(java.lang.String name)
Get SMT variable capX predicted of a task.
|
private com.microsoft.z3.IntExpr |
capPredXId(java.lang.String name,
int index)
Get SMT variable capX predicted of an actor instance
|
private com.microsoft.z3.IntExpr |
capXId(java.lang.String name)
Get SMT variable capX of a task.
|
private com.microsoft.z3.IntExpr |
capXId(java.lang.String name,
int index)
Get SMT variable capX of an actor instance
|
private com.microsoft.z3.IntExpr |
capYId(java.lang.String name)
Get SMT variable capY of a task
|
private com.microsoft.z3.IntExpr |
capYId(java.lang.String name,
int index)
Get SMT variable capY of an actor instance
|
private void |
defineInitialTokens()
Define variables required for initial tokens of all the channels.
|
private void |
defineKVariables()
Define all the K-variables required for period calculation
|
private void |
definePrimeVariables()
Define all the prime variables (xPrime and yPrime) for scheduling.
|
private com.microsoft.z3.IntExpr |
endPrimeId(java.lang.String name,
int index)
Get SMT variable for yPrime of an actor instance.
|
private void |
generateBufferAtProducerCalculation(java.lang.String srcActor,
java.lang.String dstActor,
int prodRate,
int consRate,
int srcRepCount,
int dstRepCount)
Generate constraints for calculation of the channel buffer size when the producer of the channel executes.
|
private void |
generateBufferBounds(java.lang.String srcActor,
java.lang.String dstActor,
int prodRate)
Generate constraints for lower and upper bound on the channel.
|
void |
generateBufferCalculationsPipelined()
Generate all the constraints required for calculation
of the buffer size in a pipelined schedule.
|
private void |
generateInitialTokensCalculation(java.lang.String srcActor,
java.lang.String dstActor,
int prodRate,
int consRate,
int srcRepCount,
int dstRepCount)
Generate constraints to calculate the initial tokens in the channel at the start of the period.
|
private void |
generateKvariableCalculations()
Generate SMT constraints for K-Variable Calculations.
|
private void |
generateMaxBufferCalculation(java.lang.String srcActor,
java.lang.String dstActor,
int srcRepCount)
Generate constraints to calculate maximum buffer size of a channel.
|
void |
generatePeriodConstraint(int periodConstraint)
Generate period cost for a problem
|
private void |
generatePrimeVariableCalculation()
Generate SMT constraints for Prime Variable Calculations
|
private com.microsoft.z3.IntExpr |
getKmaxDeclId()
Get SMT variable for kMax of the schedule.
|
int |
getPeriod(java.util.Map<java.lang.String,java.lang.String> model)
Get the period value calculated by the solver on a SAT result.
|
com.microsoft.z3.IntExpr |
getPeriodDeclId()
Get SMT variable for period of the schedule.
|
private com.microsoft.z3.IntExpr |
initialTokenId(java.lang.String name)
Get SMT variable for initial tokens on a channel
|
private com.microsoft.z3.IntExpr |
kEndId(java.lang.String name)
Get SMT variable for k end of a task.
|
private com.microsoft.z3.IntExpr |
kEndId(java.lang.String name,
int index)
Get SMT variable for k end of an actor instance.
|
private com.microsoft.z3.IntExpr |
kPredId(java.lang.String name)
Get SMT variable for k predicted of a task.
|
private com.microsoft.z3.IntExpr |
kStartId(java.lang.String name)
Get SMT variable for k start of a task.
|
private com.microsoft.z3.IntExpr |
kStartId(java.lang.String name,
int index)
Get SMT variable for k start of an actor instance.
|
private void |
minPeriodBound()
Generate a SMT constraint for lower bound on Period
Period >= (Sum exec.times) / (No of Processors)
|
private void |
omegaUnfoldingConstraint()
Generate a constraint on Latency depending on Omega_max value.
|
void |
resetSolver()
Reset the Z3 Solver.
|
private void |
selfEdgeActorConstraint()
Generate SMT constraints for scheduling self-edge actors
(end time - start time) <= (initial tokens * period)
|
private com.microsoft.z3.IntExpr |
startPrimeId(java.lang.String name,
int index)
Get SMT variable for xPrime of an actor instance.
|
private void |
testDisablePrime()
Generate constraints for pipelined scheduling using by disabling prime variables
This is also called as Period locality in our report.
|
private void |
testLeftEdgeConstraints()
Generate constraints for pipelined scheduling using Left-edge method of solving problem.
|
private void |
testOmegaAnalysis()
Generate constraints for pipelined scheduling using Omega analysis.
|
private void |
testPeriodSymmetry()
Generate constraints for pipelined scheduling using period symmetry constraints.
|
private void |
testPlainConstraints()
Generate constraints for pipelined scheduling using Prime and K variables.
|
private void |
testTypeConstraints()
Generate constraints for pipelined scheduling using Type constraints.
|
allProcessorUtilisedConstraints, assertBuffer, assertBufferBounds, assertBufferBoundsLinear, assertIndexLimits, assertMaxBuffer, assertMaxBufferLinear, assertNonPipelineConstraints, assertStartTimeBounds, assertUniqueIndex, bufferAtId, buffId, buffId, buildOverlappingActorList, consRateId, cpuId, cpuId, durationId, generateActorPrecedences, generateActorTimeDefinitions, generateBufferAnalysisDefinitions, generateBufferConstraint, generateCpuBounds, generateCpuDefinitions, generateLatencyCalculation, generateLatencyConstraint, generateMutualExclusion, generateProcessorConstraint, generateProcessorSymmetryDefinitions, getBufDeclId, getLastActors, getLatency, getLatencyDeclId, getProcDeclId, getProcessors, getStartActors, getTotalBufferSize, graphSymmetryLexicographic, idxId, maxBufferId, maxCpuId, maxCpuId, minLatencyBound, processorOverlapSymmetryConstraints, processorSymmetryConstraints, procUtilId, prodRateId, setRandomSeed, tasksEndedBeforeId, tasksStartedBeforeId, xId, xId, yId, yId
addVariableDeclaration, checkSat, declareFunction, generateAssertion, generateSatCode, getModel, getStatistics, popContext, printContext, pushContext, setTacTicSolver
check, getModel, getVersion, setRandomSeed
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
checkSat, getModel, popContext, pushContext
generateProcessorConstraint, getProcessors
public boolean typeDifferentiateAlgo
public boolean disablePrimes
public boolean periodSymmetry
public boolean omegaAnalysis
private com.microsoft.z3.IntExpr periodDecl
private com.microsoft.z3.IntExpr kMaxDecl
private com.microsoft.z3.IntExpr procUtilAtPeriodStartId
private java.util.Map<java.lang.String,com.microsoft.z3.IntExpr> kDecl
private java.util.Map<java.lang.String,com.microsoft.z3.IntExpr> primeDecl
private java.util.Map<java.lang.String,com.microsoft.z3.IntExpr> buffPipelinedDecl
private java.util.Map<java.lang.String,com.microsoft.z3.BoolExpr> afterVarDecl
private java.util.Map<java.lang.String,com.microsoft.z3.IntExpr> periodSymVarDecl
private java.util.Map<java.lang.String,com.microsoft.z3.IntExpr> capVarDecl
private GraphAnalysisSdfAndHsdf graphAnalysis
public MutExPipelinedScheduling(Graph inputGraph)
inputGraph
- input application graph SDFprivate com.microsoft.z3.IntExpr capXId(java.lang.String name)
name
- name of the taskprivate com.microsoft.z3.IntExpr capYId(java.lang.String name)
name
- name of the taskprivate com.microsoft.z3.IntExpr capPredXId(java.lang.String name)
name
- name of the taskprivate com.microsoft.z3.IntExpr capXId(java.lang.String name, int index)
name
- name of the actorindex
- instance idprivate com.microsoft.z3.IntExpr capYId(java.lang.String name, int index)
name
- name of the actorindex
- instance idprivate com.microsoft.z3.IntExpr capPredXId(java.lang.String name, int index)
name
- name of the actorindex
- instance idpublic com.microsoft.z3.IntExpr getPeriodDeclId()
private com.microsoft.z3.IntExpr kPredId(java.lang.String name)
name
- name of the taskprivate com.microsoft.z3.IntExpr kStartId(java.lang.String name)
name
- name of the taskprivate com.microsoft.z3.IntExpr kEndId(java.lang.String name)
name
- name of the taskprivate com.microsoft.z3.IntExpr kStartId(java.lang.String name, int index)
name
- name of the actorindex
- instance idprivate com.microsoft.z3.IntExpr kEndId(java.lang.String name, int index)
name
- name of the actorindex
- instance idprivate com.microsoft.z3.IntExpr startPrimeId(java.lang.String name, int index)
name
- name of the actorindex
- instance idprivate com.microsoft.z3.IntExpr endPrimeId(java.lang.String name, int index)
name
- name of the actorindex
- instance idprivate com.microsoft.z3.IntExpr initialTokenId(java.lang.String name)
name
- name of the channelprivate com.microsoft.z3.IntExpr getKmaxDeclId()
com.microsoft.z3.BoolExpr afterVariableId(java.lang.String name1, int index1, java.lang.String name2, int index2)
name1
- name of actor1index1
- instance id of actor1name2
- name of actor2index2
- instance id of actor2private void generateInitialTokensCalculation(java.lang.String srcActor, java.lang.String dstActor, int prodRate, int consRate, int srcRepCount, int dstRepCount)
srcActor
- source actor of the channeldstActor
- sink actor of the channelprodRate
- token production rateconsRate
- token consumption ratesrcRepCount
- source actor repetition countdstRepCount
- destination actor repetition countprivate void generateBufferAtProducerCalculation(java.lang.String srcActor, java.lang.String dstActor, int prodRate, int consRate, int srcRepCount, int dstRepCount)
srcActor
- source actor of the channeldstActor
- sink actor of the channelprodRate
- token production rateconsRate
- token consumption ratesrcRepCount
- source actor repetition countdstRepCount
- destination actor repetition countprivate void generateMaxBufferCalculation(java.lang.String srcActor, java.lang.String dstActor, int srcRepCount)
srcActor
- source actor of the channeldstActor
- sink actor of the channelsrcRepCount
- source actor repetition countprivate void generateBufferBounds(java.lang.String srcActor, java.lang.String dstActor, int prodRate)
srcActor
- source actor of the channeldstActor
- sink actor of the channelprodRate
- token production ratepublic void generateBufferCalculationsPipelined()
public void generatePeriodConstraint(int periodConstraint)
MutualExclusionSolver
generatePeriodConstraint
in interface PeriodConstraints
generatePeriodConstraint
in class MutualExclusionSolver
periodConstraint
- period cost constraintpublic void resetSolver()
Z3Solver
resetSolver
in class MutualExclusionSolver
public int getPeriod(java.util.Map<java.lang.String,java.lang.String> model)
PeriodConstraints
getPeriod
in interface PeriodConstraints
model
- model returned by the Solver on a SAT result.private void assertNonOverlapPeriodConstraint()
private void defineInitialTokens()
private void assertMinPeriod()
private void defineKVariables()
private void definePrimeVariables()
private void generatePrimeVariableCalculation()
private void generateKvariableCalculations()
private void assertMinKmax()
private void minPeriodBound()
private void omegaUnfoldingConstraint()
private void selfEdgeActorConstraint()
private void testPeriodSymmetry()
private void testDisablePrime()
private void testTypeConstraints()
private void testLeftEdgeConstraints()
private void testOmegaAnalysis()
private void testPlainConstraints()
public void assertPipelineConstraints()
MutualExclusionSolver
assertPipelineConstraints
in class MutualExclusionSolver