add hrfid unit test
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Fri, 14 Aug 2020 17:17:48 +0000 (18:17 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Fri, 14 Aug 2020 17:17:48 +0000 (18:17 +0100)
src/soc/fu/trap/test/test_pipe_caller.py

index 5ec59766361470d8617dc567ab5e48ef129ca3e9..45fea5a23feb754522755525eaed58ac44d55421 100644 (file)
@@ -72,6 +72,14 @@ def set_alu_inputs(alu, dec2, sim):
 
 class TrapTestCase(TestAccumulatorBase):
 
+    def case_0_hrfid(self):
+        lst = ["hrfid"]
+        initial_regs = [0] * 32
+        initial_regs[1] = 1
+        initial_sprs = {'SRR0': 0x12345678, 'SRR1': 0x5678}
+        self.add_case(Program(lst, bigendian),
+                      initial_regs, initial_sprs)
+
     def case_1_rfid(self):
         lst = ["rfid"]
         initial_regs = [0] * 32