- print ("form", form)
- gsc = GardenSnakeCompiler(form=form)
+def convert_to_python(pcode, form, incl_carry):
+
+ print("form", form)
+ gsc = GardenSnakeCompiler(form=form, incl_carry=incl_carry)
tree = gsc.compile(pcode, mode="exec", filename="string")
tree = ast.fix_missing_locations(tree)
regsused = {'read_regs': gsc.parser.read_regs,
'write_regs': gsc.parser.write_regs,
'uninit_regs': gsc.parser.uninit_regs,
tree = gsc.compile(pcode, mode="exec", filename="string")
tree = ast.fix_missing_locations(tree)
regsused = {'read_regs': gsc.parser.read_regs,
'write_regs': gsc.parser.write_regs,
'uninit_regs': gsc.parser.uninit_regs,
- from soc.decoder.helpers import (EXTS64, EXTZ64, ROTL64, ROTL32, MASK,)
+ from soc.decoder.helpers import (EXTS64, EXTZ64, ROTL64, ROTL32, MASK,
+ trunc_div, trunc_rem)
# read regs, drop them into dict for function
for rname in gsc.parser.read_regs:
regidx = yield getattr(decode.sigforms['X'], rname)
# read regs, drop them into dict for function
for rname in gsc.parser.read_regs:
regidx = yield getattr(decode.sigforms['X'], rname)
- d[rname] = gsc.gpr[regidx] # contents of regfile
- d["_%s" % rname] = regidx # actual register value
+ d[rname] = gsc.gpr[regidx] # contents of regfile
+ d["_%s" % rname] = regidx # actual register value
print("read reg", rname, regidx, hex(d[rname].value))
exec(compiled_code, d) # code gets executed here in dict "d"
print("read reg", rname, regidx, hex(d[rname].value))
exec(compiled_code, d) # code gets executed here in dict "d"