public final class KPassa
extends java.lang.Object
KPassa kpassa = new KPassa("",DFPNType.SDF);
SDFGraph sdf = kpassa.getSdfGraph();
SDFVertex[] vertexTab = new SDFVertex[4];
SDFArc[] arcTab = new SDFArc[4];
vertexTab[0]=sdf.addVertex(0,1);
vertexTab[1]=sdf.addVertex(2,1);
vertexTab[2]=sdf.addVertex(2,0);
vertexTab[3]=sdf.addVertex(0,2);
arcTab[0]=sdf.addArc(vertexTab[0].getOutPorts().get(0), vertexTab[1].getInPorts().get(0), 0);
arcTab[1]=sdf.addArc(vertexTab[1].getOutPorts().get(0), vertexTab[2].getInPorts().get(0), 0);
vertexTab[1].getInPorts().get(1).setWeight(2);
arcTab[2]=sdf.addArc(vertexTab[3].getOutPorts().get(0), vertexTab[1].getInPorts().get(1), 0);
vertexTab[2].getInPorts().get(1).setWeight(2);
arcTab[3]=sdf.addArc(vertexTab[3].getOutPorts().get(1), vertexTab[2].getInPorts().get(1), 0);
kpassa.checkLiveness();
SDFGraph cfg = kpassa.buildControlFlowGraph().getSdfGraph();
KPassaListener
,
MarkedGraphListener
Constructor and Description |
---|
KPassa(DFPNType graphType)
A KPassa object contains a single graph of type graphType.
|
KPassa(java.lang.String graphName,
DFPNType graphType)
A KPassa object contains a single graph of type graphType and a name graphName.
|
Modifier and Type | Method and Description |
---|---|
void |
addKPassaListener(KPassaListener listener)
This method adds a
KPassaListener to the list of listeners |
KPassa |
buildControlFlowGraph()
This method builds the control flow graph of the SDF graph.
|
java.util.Map<? extends SDFVertex,java.lang.Integer> |
checkBalancedEquation()
This method checks the balanced equation on the SDF graph
|
boolean |
checkLiveness()
Check wether the graph is live or not i.e.
|
java.util.Map<MGVertex,BinaryWord> |
computeASAPExecution()
To compute the ASAP schedule of a graph.
|
void |
computeBalancedScheduling()
Perform the balanced scheduling algorithm.
|
java.util.Map<MGArc,java.lang.Integer> |
computeMaxBuffer(FireableStrategy _fireableStrategy,
FiringStrategy _simuStrategy)
This algorithm runs a single period of execution of a graph and returns the required size of the places
for this execution.
|
void |
computePeriodicity()
Find the periodicity of the marked graph The result can be accessed from
MarkedGraphImpl.getPeriod() and
MarkedGraphImpl.getPeriodicity() |
java.util.Set<StronglyConnectedComponent<MGVertex,MGArc>> |
computeSSC()
Find the strongly connected components in the marked graph
|
void |
equalize()
Perform the equalization algorithm
|
void |
exportToLucyn()
This method exports the current marked graph to the lucy-n format.
Lucy-n is developed by Louis Mandel from the INRIA/ENS team PARKAS. |
AsynchMGImpl |
getAsynchronousMarkedGraph()
To access to the graph as an AsynchMG
It works only when type is DFPNType.MG
|
KRGGraph |
getKRGGraph()
To access to the graph as an KRG
It works only when type is DFPNType.KRG
|
MarkedGraph<?> |
getMarkedGraph()
To access to the graph without knowing its exact type.
|
SDFGraph |
getSdfGraph()
To access to the graph as an SDF
It works only when type is DFPNType.SDF
|
SynchronousMarkedGraph |
getSynchronousMarkedGraph()
This method returns the graph that is currently used.
|
void |
isSteadyState()
Check whether the current marking is reachable from itself by following
an ASAP simulation.
|
void |
listCycle()
List the cycle in the marked graph The list can be accessed from
MarkedGraphImpl.getCycleList() |
void |
loadBalancedMarking()
Load the balanced marking computed by the balanced scheduling algorithm.
|
void |
loadInitialMarking()
Load the initial marking of the marked graph.
|
void |
loadInitialMarkingAfterEqualization()
Load the marking of the marked graph after the equalization algorithm.
|
void |
runSimulation()
Run an automatic ASAP simulation of the marked graph until it has reached
a marking that has already been encountered.
|
void |
validate()
This method is used to validate the connections of the graphs.
|
public KPassa(DFPNType graphType)
graphType
- the type of the graph to createpublic KPassa(java.lang.String graphName, DFPNType graphType)
graphName
- the name of the graphgraphType
- the type of the graphpublic KRGGraph getKRGGraph()
public SDFGraph getSdfGraph()
public AsynchMGImpl getAsynchronousMarkedGraph()
@API public SynchronousMarkedGraph getSynchronousMarkedGraph()
SynchronousMarkedGraphImpl
contains the methods required to build
and modify the graph. It also contains the accessors to the marking and
scheduling computed by the scheduling algorithm.public MarkedGraph<?> getMarkedGraph()
@API public void addKPassaListener(KPassaListener listener)
KPassaListener
to the list of listenerslistener
- to add.@API public void exportToLucyn()
LucyNExporter
@API public void listCycle()
MarkedGraphImpl.getCycleList()
@API public java.util.Set<StronglyConnectedComponent<MGVertex,MGArc>> computeSSC()
@API public void computePeriodicity()
MarkedGraphImpl.getPeriod()
and
MarkedGraphImpl.getPeriodicity()
@API public void equalize()
@API public void computeBalancedScheduling()
SynchronousMarkedGraphImpl
for details
on how to access the computed markings and schedule.@API public void loadInitialMarking()
@API public void loadInitialMarkingAfterEqualization()
@API public void loadBalancedMarking()
@API public void runSimulation()
Vertex
objects.@API public void isSteadyState()
public void validate()
public java.util.Map<? extends SDFVertex,java.lang.Integer> checkBalancedEquation() throws java.lang.Exception
java.lang.Exception
public boolean checkLiveness() throws KPassaException
KPassaException
public java.util.Map<MGArc,java.lang.Integer> computeMaxBuffer(FireableStrategy _fireableStrategy, FiringStrategy _simuStrategy)
_fireableStrategy
- the fireable strategy considered for this simulation_simuStrategy
- the firing strategy considered for this simulationSDFArc
)public KPassa buildControlFlowGraph() throws KPassaException
KPassaException
public java.util.Map<MGVertex,BinaryWord> computeASAPExecution() throws KPassaException
KPassaException