public class GenericPlacementSolver extends Z3Solver implements CommunicationCostConstraints
Z3Solver.SatResult
Modifier and Type | Field and Description |
---|---|
(package private) DesignFlowSolution.Partition |
partition
Partitioning solution
|
(package private) Platform |
platform
Target platform
|
boolean |
useModuloDistances
Do we used modulo distances based on
arithmetic calculation (true)
or pre-calculated distances (false)?
|
private java.util.Map<java.lang.String,com.microsoft.z3.Expr> |
varDecl
SMT variables
|
contextStatements, pushedContext, statementCountAfterPush, z3Solver
Constructor and Description |
---|
GenericPlacementSolver(DesignFlowSolution.Partition partition,
Platform platform)
Build a placement solver.
|
Modifier and Type | Method and Description |
---|---|
private void |
boundsOnGroupCluster()
Put Lower and upper bound on cluster where a group cal be allocated
|
private com.microsoft.z3.IntExpr |
commCostId(int group1,
int group2)
Get SMT variable for communication cost between two groups
|
private void |
declareVariables()
Declare all the SMT variables required for solving
|
private com.microsoft.z3.IntExpr |
distanceId(int group1,
int group2)
Get SMT variable for distance between two groups
|
private void |
distinctClusterAllocation()
One group should be allocated only to one platform cluster.
|
void |
generateCommunicationCostConstraint(int constraintValue)
Sets the Communication cost constraint for the exploration query
|
void |
generatePlacementConstraints()
Generate all the placement constraints required to solve the problem.
|
private com.microsoft.z3.IntExpr |
getClusterGroupAllocationId(int group)
Get SMT variable for group to cluster allocation for a given group.
|
int |
getCommunicationCost(java.util.Map<java.lang.String,java.lang.String> model)
Get the communication cost calculated in the model.
|
void |
ifElseDistanceCalculation()
Generate if then else statements such that
if group1 is on cluster 1 and group2 is on cluster 2 then
distance between them is x-units.
|
DesignFlowSolution.Mapping |
modelToMapping(java.util.Map<java.lang.String,java.lang.String> model,
DesignFlowSolution designFlowSolution)
Convert model obtained from SMT solver to a mapping solution.
|
void |
moduloDistanceCalculation()
This works only for Mesh platforms.
|
private void |
totalCommCostCalculation()
Total distance based communication cost for the problem.
|
private com.microsoft.z3.IntExpr |
totalCommCostId()
Get SMT variable for total communication cost of the problem
|
private com.microsoft.z3.IntExpr |
xDistanceId(int group1,
int group2)
Get SMT variable for distance in x-dimension between two groups
|
private com.microsoft.z3.IntExpr |
yDistanceId(int group1,
int group2)
Get SMT variable for distance in y-dimension between two groups
|
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
DesignFlowSolution.Partition partition
Platform platform
private java.util.Map<java.lang.String,com.microsoft.z3.Expr> varDecl
public boolean useModuloDistances
public GenericPlacementSolver(DesignFlowSolution.Partition partition, Platform platform)
partition
- partitioning solutionplatform
- target platformprivate com.microsoft.z3.IntExpr commCostId(int group1, int group2)
group1
- group 1group2
- group 2private com.microsoft.z3.IntExpr distanceId(int group1, int group2)
group1
- group 1group2
- group 2private com.microsoft.z3.IntExpr xDistanceId(int group1, int group2)
group1
- group 1group2
- group 2private com.microsoft.z3.IntExpr yDistanceId(int group1, int group2)
group1
- group 1group2
- group 2private com.microsoft.z3.IntExpr totalCommCostId()
private com.microsoft.z3.IntExpr getClusterGroupAllocationId(int group)
group
- group idprivate void declareVariables()
public void ifElseDistanceCalculation()
public void moduloDistanceCalculation()
private void boundsOnGroupCluster()
private void totalCommCostCalculation()
private void distinctClusterAllocation()
public void generatePlacementConstraints()
public void generateCommunicationCostConstraint(int constraintValue)
CommunicationCostConstraints
generateCommunicationCostConstraint
in interface CommunicationCostConstraints
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.public DesignFlowSolution.Mapping modelToMapping(java.util.Map<java.lang.String,java.lang.String> model, DesignFlowSolution designFlowSolution)
model
- model obtained from the SMT solverdesignFlowSolution
- design flow solution