[Libre-soc-bugs] [Bug 665] very basic nmigen-to-c compiler needed

bugzilla-daemon at libre-soc.org bugzilla-daemon at libre-soc.org
Sun Dec 26 13:42:34 GMT 2021


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

--- Comment #17 from Luke Kenneth Casson Leighton <lkcl at lkcl.net> ---
just added a very quick PowerDecode2 unit test which really does nothing
but put a LD instruction through the wringer

https://git.libre-soc.org/?p=openpower-isa.git;a=commitdiff;h=9e5d4975cf6a55642670a3f93ca0eb1893af1c95
https://git.libre-soc.org/?p=openpower-isa.git;a=commitdiff;h=86cc477b87b46087e3208ccad096c4c67147d643

there's no actual testing (no asserts), it's enough to get a compile
running though.

i fixed a couple of things, but left bool() and other functions, which
will be needed

also one thing to watch out for: brackets (operator precedence).
there are some warnings being outputted that "|" and "&" tend to
be problematic, it's generally a good idea to make things explicit,
although the code ends up larger, it's not really to be read by humans,
and at least there will be no issues due to the Abstract Syntax Tree
being mis-matched against the c standard.

where the AST would expect "or(x, and(y, z)" we do not want c operator
precedence to accidentally do that as "or(and(x,y), z)" and some
explicit brackets makes that potential problem go away

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


More information about the libre-soc-bugs mailing list