aboutsummaryrefslogtreecommitdiff
path: root/debug/programs/step.S
diff options
context:
space:
mode:
authorAndrew Waterman <waterman@eecs.berkeley.edu>2016-07-19 17:10:24 -0700
committerGitHub <noreply@github.com>2016-07-19 17:10:24 -0700
commita27ddca0570517e7e40a91c16e4c96c6c5f329e1 (patch)
tree361a63af04da0d4fc42fbe28f79c2d280c54f396 /debug/programs/step.S
parent0849aad0c23f24ed7728128873fc852839e988b1 (diff)
parentedfe598fd06366170628e88aa6dee762d2c37bbc (diff)
downloadriscv-tests-a27ddca0570517e7e40a91c16e4c96c6c5f329e1.zip
riscv-tests-a27ddca0570517e7e40a91c16e4c96c6c5f329e1.tar.gz
riscv-tests-a27ddca0570517e7e40a91c16e4c96c6c5f329e1.tar.bz2
Merge pull request #17 from timsifive/debug
Add end-to-end debug tests
Diffstat (limited to 'debug/programs/step.S')
-rw-r--r--debug/programs/step.S24
1 files changed, 24 insertions, 0 deletions
diff --git a/debug/programs/step.S b/debug/programs/step.S
new file mode 100644
index 0000000..6601548
--- /dev/null
+++ b/debug/programs/step.S
@@ -0,0 +1,24 @@
+// Test stepping over a variety of instructions.
+
+ .global main
+
+main:
+ la t0, trap_entry // 0, 4
+ csrw mtvec, t0 // 0x8
+
+ li t0, 5 // 0xc
+ beq zero, zero, one // 0x10
+ nop // 0x14
+one:
+ beq zero, t0, one // 0x18
+ jal two // 0x1c
+
+three:
+ .word 0 // 0x20
+ nop // 0x24
+
+two:
+ ret // 0x28
+
+trap_entry:
+ j trap_entry // 0x2c