From: Luke Kenneth Casson Leighton Date: Sun, 14 Jun 2020 16:51:17 +0000 (+0100) Subject: add sim-qemu test for byte-reversed LD/ST X-Git-Tag: div_pipeline~380 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0c54b26d1cb75ca03e8606d8b4d71c57799c1e6b;p=soc.git add sim-qemu test for byte-reversed LD/ST --- diff --git a/src/soc/simulator/test_sim.py b/src/soc/simulator/test_sim.py index 95aa4171..8b16c249 100644 --- a/src/soc/simulator/test_sim.py +++ b/src/soc/simulator/test_sim.py @@ -92,7 +92,25 @@ class DecoderTestCase(FHDLTestCase): [1, 2, 3], initial_mem) - def _tstldst_extended(self): + def test_ld_rev_ext(self): + lst = ["addi 1, 0, 0x5678", + "addi 2, 0, 0x1234", + "addi 4, 0, 0x40", + "stw 1, 0x40(2)", + "lwbrx 3, 4, 2"] + with Program(lst) as program: + self.run_tst_program(program, [1, 2, 3]) + + def test_st_rev_ext(self): + lst = ["addi 1, 0, 0x5678", + "addi 2, 0, 0x1234", + "addi 4, 0, 0x40", + "stwbrx 1, 4, 2", + "lwzx 3, 4, 2"] + with Program(lst) as program: + self.run_tst_program(program, [1, 2, 3]) + + def test_ldst_extended(self): lst = ["addi 1, 0, 0x5678", "addi 2, 0, 0x1234", "addi 4, 0, 0x40", @@ -150,7 +168,7 @@ class DecoderTestCase(FHDLTestCase): with Program(lst) as program: self.run_tst_program(program, [1]) - def test_2_load_store(self): + def tst_2_load_store(self): lst = ["addi 1, 0, 0x1004", "addi 2, 0, 0x1008", "addi 3, 0, 0x00ee",