public class MappingCommSolver extends Z3Solver implements WorkloadImbalanceConstraints, WrkLdCommCostConstraints, CommunicationCostConstraints
Z3Solver.SatResult
Modifier and Type | Field and Description |
---|---|
private Graph |
graph
Application Graph
|
private Graph |
hsdf
Equivalent HSDF graph
|
private int |
maxDistance
Maximum distance in the network on chip between two clusters
|
private int |
minDistance
Minimum distance in the network on chip between two clusters
|
private Platform |
platform
Platform model
|
private int |
totalWork |
private java.util.Map<java.lang.String,com.microsoft.z3.Expr> |
varDecl
Different SMT variables
|
contextStatements, pushedContext, statementCountAfterPush, z3Solver
Constructor and Description |
---|
MappingCommSolver(Graph inputGraph,
Graph hsdf,
Solutions solutions,
Platform platform)
Build a mapping solver.
|
Modifier and Type | Method and Description |
---|---|
private com.microsoft.z3.BoolExpr |
assignedClusterId(java.lang.String actorName,
int clusterId)
Get actor to cluster assignment boolean SMT variable
|
private void |
calculateWorkImbalance(int numClustersUsed)
Calculate workload imbalance depending on number of clusters used.
|
private com.microsoft.z3.IntExpr |
clusterAllocatedWorkId(int clusterId)
Get workload allocated to a specific cluster SMT variable
|
private com.microsoft.z3.IntExpr |
clusterImbalanceId(int clusterId)
Get workload imbalance for a cluster SMT variable
|
private com.microsoft.z3.BoolExpr |
commLink(Channel chnnl,
int distance)
Communication distance of a channel SMT variable
|
private void |
communicationLinksAllocation()
A constraint specifying : depending on clusters where producer and consumer of channel is allocated the
distance between them will be calculated
|
private void |
defineClusterVariables()
Define required SMT variables for all the cluster
|
private void |
defineCommunicationVariables()
Define required SMT variables for all the communication channels
|
private void |
defineTaskVariables()
Define required SMT variables for all the tasks
|
void |
generateCommunicationCostConstraint(int commCostConstraint)
Sets the Communication cost constraint for the exploration query
|
void |
generateMappingConstraints()
Generate all the constraints required to solve this mapping problem.
|
void |
generateWorkImbalanceConstraint(int imbalanceConstraint)
Set an upper bound on max workload imbalance between the clusters.
|
int |
getCommunicationCost(java.util.Map<java.lang.String,java.lang.String> model)
Get the communication cost calculated in the model.
|
int |
getWorkLoadImbalance(java.util.Map<java.lang.String,java.lang.String> model) |
private com.microsoft.z3.IntNum |
taskDurationId(java.lang.String actorName)
Duration of actor
|
private void |
totalClustersUsed()
A calculation of total number of clusters used in allocation
If workload is allocated to a processor then it should be counted as used
or unused otherwise.
|
void |
totalClustersUsed(int numClusters)
A cost constraint on total number of clusters used
|
private com.microsoft.z3.IntExpr |
totalClustersUsedId()
Get Total clusters used cost SMT variable
|
private com.microsoft.z3.IntExpr |
totalCommCostId()
Get Total communication cost SMT variable
|
private void |
totalCommunicationCost()
Total communication cost depending on the task allocation.
|
private void |
totalWorkImbalance()
Calculate total workload imbalance
|
private com.microsoft.z3.IntExpr |
totalWorkImbalanceId()
Get Total workload imbalance cost SMT variable
|
private void |
uniqueProcessorAllocation()
A constraint specifying : every task should be allocated to a unique processor
|
private void |
workAllocatedPerCluster()
Calculation of work allocated per cluster
|
addVariableDeclaration, checkSat, declareFunction, generateAssertion, generateSatCode, getModel, getStatistics, popContext, printContext, pushContext, resetSolver, setTacTicSolver
check, getModel, getVersion, setRandomSeed
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
checkSat, getModel, popContext, pushContext
private Graph graph
private Graph hsdf
private Platform platform
private int totalWork
private int minDistance
private int maxDistance
private java.util.Map<java.lang.String,com.microsoft.z3.Expr> varDecl
public MappingCommSolver(Graph inputGraph, Graph hsdf, Solutions solutions, Platform platform)
inputGraph
- input application graph (SDF)hsdf
- equivalent HSDF of application graphsolutions
- solutions of application graphplatform
- platform for solving the problemprivate com.microsoft.z3.IntExpr totalCommCostId()
private com.microsoft.z3.IntExpr totalWorkImbalanceId()
private com.microsoft.z3.IntExpr totalClustersUsedId()
private com.microsoft.z3.IntExpr clusterAllocatedWorkId(int clusterId)
clusterId
- cluster idprivate com.microsoft.z3.IntExpr clusterImbalanceId(int clusterId)
clusterId
- cluster idprivate com.microsoft.z3.BoolExpr assignedClusterId(java.lang.String actorName, int clusterId)
actorName
- name of the actorclusterId
- cluster idprivate com.microsoft.z3.BoolExpr commLink(Channel chnnl, int distance)
chnnl
- application channeldistance
- distance between producer and consumer of channel in number of hopsprivate com.microsoft.z3.IntNum taskDurationId(java.lang.String actorName)
actorName
- name of actorprivate void defineClusterVariables()
private void defineTaskVariables()
private void defineCommunicationVariables()
private void workAllocatedPerCluster()
private void calculateWorkImbalance(int numClustersUsed)
numClustersUsed
- number of clusers usedprivate void totalWorkImbalance()
private void uniqueProcessorAllocation()
private void communicationLinksAllocation()
private void totalClustersUsed()
public void totalClustersUsed(int numClusters)
numClusters
- number of clusters to usepublic void generateWorkImbalanceConstraint(int imbalanceConstraint)
WorkloadImbalanceConstraints
generateWorkImbalanceConstraint
in interface WorkloadImbalanceConstraints
imbalanceConstraint
- Set upper bound on max workload imbalance.public void generateCommunicationCostConstraint(int commCostConstraint)
CommunicationCostConstraints
generateCommunicationCostConstraint
in interface CommunicationCostConstraints
public int getWorkLoadImbalance(java.util.Map<java.lang.String,java.lang.String> model)
getWorkLoadImbalance
in interface WorkloadImbalanceConstraints
model
- model returned by the Solver on a SAT result.public int getCommunicationCost(java.util.Map<java.lang.String,java.lang.String> model)
CommunicationCostConstraints
getCommunicationCost
in interface CommunicationCostConstraints
model
- model returned by the Solver on a SAT result.private void totalCommunicationCost()
public void generateMappingConstraints()