de.cau.cs.kieler.krep.compiler.ceq
Class Automaton

java.lang.Object
  extended by de.cau.cs.kieler.krep.compiler.ceq.Automaton

public class Automaton
extends Object

Implement automaton as part of clocked equations. An automaton contains other automata and dataflow equations.

Rating yellow
(2010-02-05) review by cmot, msp, tam

Constructor Summary
Automaton(String n)
          Generate an empty automaton.
 
Method Summary
 void add(State s)
          Add a new state to the automaton.
 LinkedList<AbstractInstruction> compile(int prioOffset)
          Compile an automaton into KLP assembler.
 LinkedList<AbstractInstruction> compileInit(boolean setInputs, boolean setOutputs, int prioOffset)
          Generate initialization code for the klp, which initializes the registers.
 DepGraph getDepGraph()
          Get the dependency graph from the initial state.
 LinkedList<Variable> getInputs()
          Get all inputs for the automaton.
 String getName()
          Get name of the automaton.
 LinkedList<Variable> getOutputs()
          Get all output signals for the automaton.
 void propagateConst()
          propagate constant values in equations.
 void replace(HashMap<String,Variable> equiv)
          Replace a Variable by another, equivalent variable.
 void setIO()
          Extract io of the automaton from the initial state.
 void simplify()
          simply the automaton by simplifying each state.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Automaton

public Automaton(String n)
Generate an empty automaton.

Parameters:
n - name of the automaton
Method Detail

getInputs

public LinkedList<Variable> getInputs()
Get all inputs for the automaton.

Returns:
inputs

getOutputs

public LinkedList<Variable> getOutputs()
Get all output signals for the automaton.

Returns:
outputs

getName

public String getName()
Get name of the automaton.

Returns:
unique name

toString

public String toString()
Overrides:
toString in class Object

add

public void add(State s)
Add a new state to the automaton.

Parameters:
s - the new state

compile

public LinkedList<AbstractInstruction> compile(int prioOffset)
Compile an automaton into KLP assembler.

Parameters:
prioOffset - minimal priority that can be used
Returns:
klp assembler that implements the automaton

propagateConst

public void propagateConst()
propagate constant values in equations.


simplify

public void simplify()
simply the automaton by simplifying each state.


setIO

public void setIO()
Extract io of the automaton from the initial state.


compileInit

public LinkedList<AbstractInstruction> compileInit(boolean setInputs,
                                                   boolean setOutputs,
                                                   int prioOffset)
Generate initialization code for the klp, which initializes the registers.

Parameters:
setInputs - should input registered be initialized?
setOutputs - should output registered be initialized?
prioOffset - minimal priority that can be used.
Returns:
Klp instructions to initialize the register required by the automaton

getDepGraph

public DepGraph getDepGraph()
Get the dependency graph from the initial state.

Returns:
dependency graph of the initial state

replace

public void replace(HashMap<String,Variable> equiv)
Replace a Variable by another, equivalent variable.

Parameters:
equiv - map of equivalent variables