projects
/
soc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
ab59cd7
)
Add test_branch_loop_ctr
author
Michael Nolan
<mtnolan2640@gmail.com>
Thu, 7 May 2020 19:54:32 +0000
(15:54 -0400)
committer
Michael Nolan
<mtnolan2640@gmail.com>
Thu, 7 May 2020 19:54:32 +0000
(15:54 -0400)
src/soc/decoder/isa/test_caller.py
patch
|
blob
|
history
diff --git
a/src/soc/decoder/isa/test_caller.py
b/src/soc/decoder/isa/test_caller.py
index 15a8997ed2e435580f4c7e7e3aa1108c50e74f0f..97499d49af265340ea02bbc13c576b7ee1c92a82 100644
(file)
--- a/
src/soc/decoder/isa/test_caller.py
+++ b/
src/soc/decoder/isa/test_caller.py
@@
-154,7
+154,19
@@
class DecoderTestCase(FHDLTestCase):
sim = self.run_tst_program(program)
# Verified with qemu
self.assertEqual(sim.gpr(2), SelectableInt(0x37, 64))
sim = self.run_tst_program(program)
# Verified with qemu
self.assertEqual(sim.gpr(2), SelectableInt(0x37, 64))
-
+
+ def test_branch_loop_ctr(self):
+ lst = ["addi 1, 0, 0",
+ "addi 2, 0, 7",
+ "mtspr 9, 2", # set ctr to 7
+ "addi 1, 1, 5",
+ "bc 16, 0, -0x4"] # bdnz to the addi above
+ with Program(lst) as program:
+ sim = self.run_tst_program(program)
+ # Verified with qemu
+ self.assertEqual(sim.gpr(1), SelectableInt(0x23, 64))
+
+
def test_add_compare(self):
lst = ["addis 1, 0, 0xffff",
def test_add_compare(self):
lst = ["addis 1, 0, 0xffff",