[Libre-soc-bugs] [Bug 671] convert spec pseudocode to use XLEN width

bugzilla-daemon at libre-soc.org bugzilla-daemon at libre-soc.org
Sun Aug 22 18:25:53 BST 2021


https://bugs.libre-soc.org/show_bug.cgi?id=671

--- Comment #6 from Luke Kenneth Casson Leighton <lkcl at lkcl.net> ---
too low level.  already taken care of, see comment #1

what does need fixing is "XLEN-1" or in fact any expression "z-1" to be
recognised as {EXPR} {MINUS} {NUMBER}

and that's probably best done by stopping the lexer.py from recognising "minus"
in t_NUMBER's regexp, and teaching the parser about a new BNF number "MINUS
NUMBER" which returns t[2] after first inverting the Constant value in t[2]

then have to worry about the ordering, because if the parser encounters that
before it encounters extpressions we end up with exactly the same issue, sigh:
{MINUS} followed by {NUMBER} gets eaten and replaced by ast.{-Constant} is
exactly what we want to avoid, give {EXPR} {MINUS} {NUMBER} higher priority.

i *think* that's achieved by getting the order right that BNF functions are
added into parser.py.

i think.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the libre-soc-bugs mailing list