Libre RISC-V Mailing list Archives (accessible via public-inbox)
 help / color / Atom feed
* [libre-riscv-dev] parser precedence, code review / checking needed
@ 2020-04-03 15:19 Luke Kenneth Casson Leighton
  2020-04-03 18:22 ` Jacob Lifshay
  0 siblings, 1 reply; 6+ messages in thread
From: Luke Kenneth Casson Leighton @ 2020-04-03 15:19 UTC (permalink / raw)
  To: Libre-RISCV General Development

if anyone knows how to resolve operator precedence, my logic-dyslexia
is kicking in and i am having difficulty working out which operators
are supposed to be in which order, for bit-wise AND, OR, and
PLUS/MINUS, MUL/DIV.  someone else did the PLUS/MINUS MUL/DIV, i'm
attempting to add AND and OR and am getting it wrong

here's how python-ply is supposed to work:
http://www.dabeaz.com/ply/ply.html#ply_nn27

here's a patch showing the relevant files involved:
https://git.libre-riscv.org/?p=soc.git;a=commitdiff;h=39c8314f9a14fb5351a9dcbc8bd37753bdcd0fee

executing "python3 soc/decoder/power_pseudo.py" is a good test, with
this being good example code:
+cmpi = """
+in_range <-  (x | y) & (a | b)
+in_range <-  (x + y) - (a + b)
+"""

help appreciated.

l.

_______________________________________________
libre-riscv-dev mailing list
libre-riscv-dev@lists.libre-riscv.org
http://lists.libre-riscv.org/mailman/listinfo/libre-riscv-dev

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, back to index

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-03 15:19 [libre-riscv-dev] parser precedence, code review / checking needed Luke Kenneth Casson Leighton
2020-04-03 18:22 ` Jacob Lifshay
2020-04-03 18:49   ` Luke Kenneth Casson Leighton
2020-04-03 20:08     ` Jacob Lifshay
2020-04-03 21:44       ` Luke Kenneth Casson Leighton
2020-04-03 20:41   ` Hendrik Boom

Libre RISC-V Mailing list Archives (accessible via public-inbox)

Archives are clonable: git clone --mirror https://inbox.libre-soc.org/libre-riscv-dev

Example config snippet for mirrors


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git