* [libre-riscv-dev] 3.0B PDF spec parser and first auto-generator working well
@ 2020-04-04 13:33 Luke Kenneth Casson Leighton
0 siblings, 0 replies; only message in thread
From: Luke Kenneth Casson Leighton @ 2020-04-04 13:33 UTC (permalink / raw)
To: openpower-hdl-cores, Libre-RISCV General Development
making good progress. this (which can be seen here
https://libre-riscv.org/openpower/isa/fixedarith/)
vvvvvv
# Add Immediate Shifted
D-Form
* addis RT,RA,SI
if RA = 0 then RT <- EXTS(SI || [0]*16)
else RT <- (RA) + EXTS(SI || [0]*16)
Special Registers Altered:
None
^^^^^
gets turned into this:
vvvv
# auto-generated, do not edit
from soc.decoder.helpers import (EXTS,)
class fixedarith(ISACaller):
def op_addis(self, RA):
if RA == 0:
RT = EXTS(concat(SI, concat(0, repeat=16)))
else:
RT = RA + EXTS(concat(SI, concat(0, repeat=16)))
return (RT,)
instrs = {}
instrs['addis'] = (op_addis, ['RA'], [], ['RT']) # records input
and output regs
^^^^
no "laborious manually-written simulator code" was written. the next
phase is, obviously, to try actually executing these code-fragments.
that's what the base-class "ISACaller" is for.
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] only message in thread
only message in thread, back to index
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-04 13:33 [libre-riscv-dev] 3.0B PDF spec parser and first auto-generator working well Luke Kenneth Casson Leighton
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