public class UnfoldingScheduling extends Z3Solver implements ProcessorConstraints, LatencyConstraints, PeriodConstraints, PeriodProcConstraints
Z3Solver.SatResult
Modifier and Type | Field and Description |
---|---|
private java.util.Map<java.lang.String,com.microsoft.z3.IntExpr> |
cpuDecl
SMT variables for processor allocated to the tasks.
|
private java.util.Map<java.lang.String,com.microsoft.z3.IntExpr> |
durationDecl
SMT variables for duration of actors
|
private java.util.Map<java.lang.String,com.microsoft.z3.IntExpr> |
endTimeDecl
SMT variables for end time of tasks.
|
protected Graph |
graph
Application SDF graph
|
private GraphAnalysisSdfAndHsdf |
graphAnalysis
Graph analysis object to get trivial properties
|
boolean |
graphSymmetry
Task Symmetry
|
protected Graph |
hsdf
Equivalent Application HSDF graph
|
protected java.util.List<Actor> |
lastActorList
List of actors without successors.
|
protected com.microsoft.z3.IntExpr |
latencyDecl
SMT variable for Latency calculation of the schedule
|
int |
numGraphUnfold
Number of times the graph should be unfold
|
protected com.microsoft.z3.IntExpr |
periodDecl
SMT variable for Period calculation of the schedule
|
boolean |
processorSymmetry
Processor symmetry
|
protected Solutions |
solutions
Solutions to application graph
|
protected java.util.List<Actor> |
startActorList
List of actors without predecessors.
|
private java.util.Map<java.lang.String,com.microsoft.z3.IntExpr> |
startTimeDecl
SMT variables for start time of tasks.
|
private java.util.Map<java.lang.String,com.microsoft.z3.IntExpr> |
symmetryDecl
SMT variables for processor symmetry
|
protected com.microsoft.z3.IntExpr |
totalProcDecl
SMT variable for total processors used in the schedule
|
contextStatements, pushedContext, statementCountAfterPush, z3Solver
Constructor and Description |
---|
UnfoldingScheduling(Graph inputGraph)
Build an unfolding solver for pipelined scheduling
|
Modifier and Type | Method and Description |
---|---|
private void |
actorPrecedences()
Generate constraints for task precedences
|
private void |
assertCpuBounds()
Generate constraints for lower and upper bounds on the processor allocated to the tasks.
|
private void |
assertMinPeriod()
Lower bound on the period of the schedule
|
private void |
assertMutualExclusion()
Generate mutual exclusion constraints for all the tasks.
|
void |
assertPipelineConstraints()
Generate all the constraints for pipelined scheduling
|
(package private) com.microsoft.z3.IntExpr |
cpuId(java.lang.String name)
Get SMT variable for processor allocated to a task.
|
(package private) com.microsoft.z3.IntExpr |
cpuId(java.lang.String name,
int index)
Get SMT variable for processor allocated to an actor instance
|
private void |
defineActorDuration()
Define actor duration SMT variables for all the actors
|
private void |
defineEndTimes()
Define the end time SMT variables for all the tasks.
|
private void |
defineStartTimes()
Define the start time SMT variables for all the tasks.
|
(package private) com.microsoft.z3.IntExpr |
durationId(java.lang.String name)
Get SMT variable for duration of an actor.
|
private void |
generateActorTimeDefinitions()
Generate the actor start times, end times, and actor durations
|
private void |
generateCpuDefinitions()
Define variables for processor allocation of tasks
|
protected void |
generateLatencyCalculation()
Generate latency calculation of the schedule
|
void |
generateLatencyConstraint(int latencyConstraint)
Set the latency constraint for exploration query.
|
void |
generatePeriodConstraint(int periodConstraint)
Set the period constraint for exploration query.
|
void |
generateProcessorConstraint(int numProcessors)
Set an upper bound on number of processors to be used in the schedule.
|
private void |
generateProcessorSymmetryDefinitions()
Generate definitions for processor symmetry
|
int |
getLatency(java.util.Map<java.lang.String,java.lang.String> model)
Get the latency of the application graph calculated by the solver and returned in the model.
|
com.microsoft.z3.IntExpr |
getLatencyDeclId()
Get the SMT variable for latency calculation 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 the SMT variable for period calculation of the schedule
|
com.microsoft.z3.IntExpr |
getProcDeclId()
Get the SMT variable for total processors used in the schedule
|
int |
getProcessors(java.util.Map<java.lang.String,java.lang.String> model)
Get the number of processors used in the schedule represented in the model.
|
private void |
graphSymmetryLexicographic()
Generate task symmetry constraints
|
private void |
machinePeriodicity()
Generate constraints for machine periodicity of the schedule.
|
(package private) com.microsoft.z3.IntExpr |
maxCpuId(java.lang.String name,
int index)
Get SMT variable for maximum processor index on which a task can run for processor symmetry constraints.
|
private void |
minLatencyBound()
Generate a lower bound on the latency.
|
private void |
minPeriodBound()
Generate a lower bound on the period.
|
private void |
nonLazynessConstraint()
Non-lazy schedule constraints.
|
private void |
omegaUnfoldingConstraint()
Upper bound on the latency based on Omega_max
|
private void |
periodConstraints()
Generate bounds on start and end times with respect to the period.
|
private void |
processorSymmetryConstraints()
Generate processor symmetry constraints
|
void |
resetSolver()
Reset the Z3 Solver.
|
private void |
selfEdgeActorConstraint()
Special scheduling constraint for self-edge actors
|
private void |
timePeriodicity()
Generate constraints for time periodicity of the schedule.
|
(package private) com.microsoft.z3.IntExpr |
xId(java.lang.String name)
Get SMT variable for start time of a task.
|
(package private) com.microsoft.z3.IntExpr |
xId(java.lang.String name,
int index)
Get SMT variable for start time of an actor instance.
|
(package private) com.microsoft.z3.IntExpr |
yId(java.lang.String name)
Get SMT variable for end time of a task.
|
(package private) com.microsoft.z3.IntExpr |
yId(java.lang.String name,
int index)
Get SMT variable for end time of an actor instance.
|
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
protected Graph graph
protected Graph hsdf
public int numGraphUnfold
public boolean processorSymmetry
public boolean graphSymmetry
private GraphAnalysisSdfAndHsdf graphAnalysis
protected java.util.List<Actor> lastActorList
protected java.util.List<Actor> startActorList
protected Solutions solutions
private java.util.Map<java.lang.String,com.microsoft.z3.IntExpr> startTimeDecl
private java.util.Map<java.lang.String,com.microsoft.z3.IntExpr> endTimeDecl
private java.util.Map<java.lang.String,com.microsoft.z3.IntExpr> durationDecl
private java.util.Map<java.lang.String,com.microsoft.z3.IntExpr> cpuDecl
private java.util.Map<java.lang.String,com.microsoft.z3.IntExpr> symmetryDecl
protected com.microsoft.z3.IntExpr latencyDecl
protected com.microsoft.z3.IntExpr periodDecl
protected com.microsoft.z3.IntExpr totalProcDecl
public UnfoldingScheduling(Graph inputGraph)
inputGraph
- application graph SDFpublic com.microsoft.z3.IntExpr getLatencyDeclId()
public com.microsoft.z3.IntExpr getPeriodDeclId()
public com.microsoft.z3.IntExpr getProcDeclId()
com.microsoft.z3.IntExpr xId(java.lang.String name)
name
- name of the taskcom.microsoft.z3.IntExpr xId(java.lang.String name, int index)
name
- name of the actorindex
- instance idcom.microsoft.z3.IntExpr yId(java.lang.String name)
name
- name of the taskcom.microsoft.z3.IntExpr yId(java.lang.String name, int index)
name
- name of the actorindex
- instance idcom.microsoft.z3.IntExpr cpuId(java.lang.String name)
name
- name of the taskcom.microsoft.z3.IntExpr cpuId(java.lang.String name, int index)
name
- name of the actorindex
- instance idcom.microsoft.z3.IntExpr durationId(java.lang.String name)
name
- name of the actorcom.microsoft.z3.IntExpr maxCpuId(java.lang.String name, int index)
name
- name of the actorindex
- instance idprivate void defineStartTimes()
private void defineActorDuration()
private void defineEndTimes()
private void generateActorTimeDefinitions()
private void generateCpuDefinitions()
private void actorPrecedences()
private void assertMutualExclusion()
private void periodConstraints()
protected void generateLatencyCalculation()
private void timePeriodicity()
private void machinePeriodicity()
private void assertCpuBounds()
public void resetSolver()
Z3Solver
resetSolver
in class Z3Solver
private void graphSymmetryLexicographic()
private void processorSymmetryConstraints()
private void generateProcessorSymmetryDefinitions()
private void minPeriodBound()
private void minLatencyBound()
private void omegaUnfoldingConstraint()
private void selfEdgeActorConstraint()
private void assertMinPeriod()
private void nonLazynessConstraint()
public void assertPipelineConstraints()
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.public int getLatency(java.util.Map<java.lang.String,java.lang.String> model)
LatencyConstraints
getLatency
in interface LatencyConstraints
model
- model returned by the Solver on a SAT result.public int getProcessors(java.util.Map<java.lang.String,java.lang.String> model)
ProcessorConstraints
getProcessors
in interface ProcessorConstraints
model
- model returned by the Solver on a SAT result.public void generateProcessorConstraint(int numProcessors)
ProcessorConstraints
generateProcessorConstraint
in interface ProcessorConstraints
numProcessors
- number of processors to be used as a constraint.public void generateLatencyConstraint(int latencyConstraint)
LatencyConstraints
generateLatencyConstraint
in interface LatencyConstraints
latencyConstraint
- upper bound on the latency value for the exploration.public void generatePeriodConstraint(int periodConstraint)
PeriodConstraints
generatePeriodConstraint
in interface PeriodConstraints
periodConstraint
- period constraint for an exploration query.