[Libre-soc-dev] Task 939 and its subtasks

Luke Kenneth Casson Leighton lkcl at lkcl.net
Wed Nov 23 18:11:54 GMT 2022


---
crowd-funded eco-conscious hardware: https://www.crowdsupply.com/eoma68

On Wed, Nov 23, 2022 at 1:11 PM Hendrik Boom via Libre-soc-dev
<libre-soc-dev at lists.libre-soc.org> wrote:

> I'd like to have an informal look at this grammar,

after noticing that it was near-identical to python, i fixed and then converted
David Beazley's GardenSnake.py python-ply example python-compiler/interpreter.

if you are familiar with lex / bison / yacc you can "extract" the BNF right out
of each function: look for the comment-fields:

https://git.libre-soc.org/?p=openpower-isa.git;a=blob;f=src/openpower/decoder/pseudo/parser.py;hb=HEAD

the lexer was a little more troublesome: i had to "insert" end-indent-markers
by adding a *third* State Machine / lexer,

https://git.libre-soc.org/?p=openpower-isa.git;a=blob;f=src/openpower/decoder/pseudo/lexer.py;hb=HEAD#l69

> its implementation,

above.  there is additionally an implementation of a Formal Correctness
Proof Engine (it does not create Sail but something similar), which does
exactly the same trick as parser.py above but instead of outputting
python source code it outputs Sail (or other, similar) source code.

> and any specifications

it's literally two pages - section 1.3.4 of the Power ISA, right at
the very front.  page 7.

> and test cases that are avaiable.

all simulator unit tests are in effect test cases, as we have
"ExpectedResults".  in the interests of expediency and because
there would be thousands of assembler-unit-tests i bypassed
one level of unit testing.

>  Where should I look for it.

above.

l.



More information about the Libre-soc-dev mailing list