From: Luke Kenneth Casson Leighton Date: Sun, 30 Aug 2020 14:45:03 +0000 (+0100) Subject: reversal of FXM mask for one-hot selection in OP_MTCR decode X-Git-Tag: semi_working_ecp5~221 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=05bf9da9a9f4b9be556e28a8b0468009c639e1ae;p=soc.git reversal of FXM mask for one-hot selection in OP_MTCR decode --- diff --git a/libreriscv b/libreriscv index 8976b9bf..2f9e4490 160000 --- a/libreriscv +++ b/libreriscv @@ -1 +1 @@ -Subproject commit 8976b9bf14aab4e7bff0eabfa1412744ed0fe832 +Subproject commit 2f9e449034fd6963965c76e727cc4e3cfa3df9c6 diff --git a/src/soc/decoder/power_decoder2.py b/src/soc/decoder/power_decoder2.py index b0142c15..1bdcd3ff 100644 --- a/src/soc/decoder/power_decoder2.py +++ b/src/soc/decoder/power_decoder2.py @@ -557,7 +557,8 @@ class DecodeCROut(Elaboratable): m = Module() comb = m.d.comb op = self.dec.op - m.submodules.ppick = ppick = PriorityPicker(8) + m.submodules.ppick = ppick = PriorityPicker(8, reverse_i=True, + reverse_o=True) comb += self.cr_bitfield.ok.eq(0) comb += self.whole_reg.ok.eq(0) diff --git a/src/soc/fu/cr/test/test_pipe_caller.py b/src/soc/fu/cr/test/test_pipe_caller.py index b615c93f..fe794f89 100644 --- a/src/soc/fu/cr/test/test_pipe_caller.py +++ b/src/soc/fu/cr/test/test_pipe_caller.py @@ -110,6 +110,20 @@ class CRTestCase(TestAccumulatorBase): p.assembly = '\n'.join(dis)+'\n' self.add_case(p, initial_cr=cr) + def case_mtocrf_regression(self): + """microwatt 1.bin regression, same hack as above. + 106b4: 21 d9 96 7d .long 0x7d96d921 # mtocrf 12, 0b01101101 + """ + mask = 0b01101101 + dis = [f"mtocrf 12, {mask}"] + lst = bytes([0x21, 0xd9, 0x96, 0x7d]) # 0x7d96d921 + cr = 0x529e08fe + initial_regs = [0] * 32 + initial_regs[12] = 0xffffffffffffffff + p = Program(lst, bigendian) + p.assembly = '\n'.join(dis)+'\n' + self.add_case(p, initial_regs=initial_regs, initial_cr=cr) + def case_mfocrf_1(self): lst = [f"mfocrf 2, 1"] cr = 0x1234 diff --git a/src/soc/simple/test/test_issuer.py b/src/soc/simple/test/test_issuer.py index f81eef12..91e68a71 100644 --- a/src/soc/simple/test/test_issuer.py +++ b/src/soc/simple/test/test_issuer.py @@ -281,7 +281,7 @@ class TestRunner(FHDLTestCase): cr = yield from get_dmi(dmi, DBGCore.CR) print ("after test %s cr value %x" % (test.name, cr)) - # get CR + # get XER xer = yield from get_dmi(dmi, DBGCore.XER) print ("after test %s XER value %x" % (test.name, xer))