| Index: src/trusted/validator_arm/dgen_input.py
|
| ===================================================================
|
| --- src/trusted/validator_arm/dgen_input.py (revision 9758)
|
| +++ src/trusted/validator_arm/dgen_input.py (working copy)
|
| @@ -20,7 +20,7 @@
|
| action_safety |
|
| action_arch |
|
| action_other) ';'
|
| -action_options_deprecated ::= (id (word (rule_restrict id?)?)?)?
|
| +action_options_deprecated ::= (id (word (rule_restrict_deprecated id?)?)?)?
|
| action_other ::= word ':=' bit_expr
|
| action_pattern ::= 'pattern' ':=' word rule_restrict?
|
| action_safety ::= 'safety' ':=' safety_check ('&' safety_check)*
|
| @@ -65,7 +65,8 @@
|
| pat_row ::= pattern+ action
|
| pattern ::= bitpattern | '-' | '"'
|
| row ::= '|' (pat_row | default_row)
|
| -rule_restrict ::= ('&' bitpattern)* ('&' 'other' ':' id)?
|
| +rule_restrict ::= ('&' bit_expr)* ('&' 'other' ':' id)?
|
| +rule_restrict_deprecated ::= ('&' bitpattern)* ('&' 'other' ':' id)?
|
| safety_check ::= id | bit_expr1 ('=>' id)? # note: single id only at end.
|
| table ::= table_desc table_actions header row+ footer
|
| table_actions ::= ( ('*' int decoder fields? action_options*)+ footer)?
|
| @@ -530,7 +531,7 @@
|
| else:
|
| context.define('rule', self._read_id_or_none(True))
|
| context.define('pattern', self._read_id_or_none(False))
|
| - self._rule_restrict(context)
|
| + self._rule_restrict_deprecated(context)
|
| other_restrictions = self._read_id_or_none(True)
|
| if other_restrictions:
|
| context.define('safety', [other_restrictions])
|
| @@ -711,6 +712,22 @@
|
| return self._pat_row(table, starred_actions, last_patterns, last_action)
|
|
|
| def _rule_restrict(self, context):
|
| + """ rule_restrict ::= ('&' bit_expr)* ('&' 'other' ':' id)? """
|
| +
|
| + restrictions = context.find('constraints')
|
| + if not restrictions:
|
| + context.define('constraints', dgen_core.RuleRestrictions())
|
| + while self._next_token().kind == '&':
|
| + self._read_token('&')
|
| + if self._next_token().kind == 'other':
|
| + self._read_token('other')
|
| + self._read_token(':')
|
| + restrictions.safety = self._id()
|
| + return
|
| + else:
|
| + restrictions.add(self._bit_expr(context))
|
| +
|
| + def _rule_restrict_deprecated(self, context):
|
| """ rule_restrict ::= ('&' bitpattern)* ('&' 'other' ':' id)? """
|
|
|
| restrictions = context.find('constraints')
|
| @@ -724,7 +741,9 @@
|
| restrictions.safety = self._id()
|
| return
|
| else:
|
| - restrictions.add(self._bitpattern32())
|
| + restrictions.add(
|
| + dgen_core.BitPattern.parse(self._bitpattern32(),
|
| + dgen_core.BitField('constraint', 31, 0)))
|
|
|
| def _safety_check(self, context):
|
| """safety_check ::= id | bit_expr ('=>' id)?
|
|
|