summaryrefslogtreecommitdiff
path: root/src/mem/slicc/symbols/State.py
diff options
context:
space:
mode:
authorDavid Hashe <david.hashe@amd.com>2015-07-20 09:15:18 -0500
committerDavid Hashe <david.hashe@amd.com>2015-07-20 09:15:18 -0500
commitee0d414fa8dac2371b439778374ec585b358e549 (patch)
tree94d386b04002226fcf816c64c589d544e67504af /src/mem/slicc/symbols/State.py
parent6a288d9de3422024b9e99caa8b3717d98e467314 (diff)
downloadgem5-ee0d414fa8dac2371b439778374ec585b358e549.tar.xz
slicc: support for transitions with a wildcard next state
This patches adds support for transitions of the form: transition(START, EVENTS, *) { ACTIONS } This allows a machine to collapse states that differ only in the next state transition to collapse into one, and can help shorten/simplfy some protocols significantly. When * is encountered as an end state of a transition, the next state is determined by calling the machine-specific getNextState function. The next state is determined before any actions of the transition execute, and therefore the next state calculation cannot depend on any of the transition actions.
Diffstat (limited to 'src/mem/slicc/symbols/State.py')
-rw-r--r--src/mem/slicc/symbols/State.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mem/slicc/symbols/State.py b/src/mem/slicc/symbols/State.py
index 123693256..164c585f6 100644
--- a/src/mem/slicc/symbols/State.py
+++ b/src/mem/slicc/symbols/State.py
@@ -30,5 +30,13 @@ from slicc.symbols.Symbol import Symbol
class State(Symbol):
def __repr__(self):
return "[State: %s]" % self.ident
+ def isWildcard(self):
+ return False
+
+class WildcardState(State):
+ def __repr__(self):
+ return "[State: *]"
+ def isWildcard(self):
+ return True
__all__ = [ "State" ]