Go to the documentation of this file.
64 operationCollisionMatrices_(fu) {
68 const std::string opName =
132 CollisionMatrixStateIndex::const_iterator foundState =
138 targetState = (*foundState).second;
178 hash_set<FSAStateIndex> handledStates;
179 hash_set<FSAStateIndex> unfinishedStatesList;
180 unfinishedStatesList.insert(0);
182 while (!unfinishedStatesList.empty()) {
184 unfinishedStatesList.erase(state);
190 handledStates.find(resolvedState) == handledStates.end() &&
191 resolvedState != state)
192 unfinishedStatesList.insert(resolvedState);
194 handledStates.insert(state);
206 const std::string operationName) {
275 StateCollisionMatrixIndex::const_iterator i =
280 __FILE__, __LINE__,
__func__,
"No such state.");
282 return (*i).second->toDotString();
static const FSAStateIndex ILLEGAL_STATE
A state id which denotes an illegal state.
int FSAStateIndex
Type used for indexing the states.
virtual bool isLegalTransition(FSAStateIndex source, FSAStateTransitionIndex transition)
void orWith(const BitMatrix &another)
TransitionMap transitions_
The state transitions. In protected to allow fast access from derived classes.
FUFiniteStateAutomaton(const TTAMachine::FunctionUnit &fu, bool lazyBuilding=true)
void addCollisionMatrixForState(FSAStateIndex state, CollisionMatrix *matrix)
CollisionMatrix & operationCollisionMatrix(const std::string operationName)
virtual ~FUFiniteStateAutomaton()
virtual std::string stateName(FSAStateIndex state) const
StateCollisionMatrixIndex stateCollisionMatrices_
The collision matrices of each state.
FiniteStateAutomaton::FSAStateIndex resolveState(FiniteStateAutomaton::FSAStateIndex source, FiniteStateAutomaton::FSAStateTransitionIndex transition)
static const FSAStateIndex UNKNOWN_STATE
A state id which denotes an unknown (unresolved) state. Used for lazy construction of states.
virtual void setTransition(FSAStateIndex source, FSAStateIndex destination, FSAStateTransitionIndex transition)
FSAStateIndex joinState(FSAStateIndexSet sourceStates)
#define abortWithError(message)
const std::string & name() const
CollisionMatrix & at(int index)
virtual int operationCount() const
virtual FSAStateIndex destinationState(FSAStateIndex source, FSAStateTransitionIndex transition)
FSAStateTransitionIndex nopTransition_
The number of the NOP transition.
FUCollisionMatrixIndex operationCollisionMatrices_
Collision matrices of operations are stored here.
virtual bool isCollision(std::size_t row, std::size_t column) const
virtual FSAStateTransitionIndex transitionIndex(const std::string &transitionName) const
virtual FSAStateIndex addState()
int FSAStateTransitionIndex
Type used for indexing the transitions.
virtual void setTransitionName(FSAStateTransitionIndex transition, const std::string &name)
CollisionMatrixStateIndex collisionMatrixStates_
An index for quickly finding the state of a collision matrix.
virtual HWOperation * operation(const std::string &name) const
std::set< FSAStateIndex > FSAStateIndexSet
Type for a set of state indices.