summaryrefslogtreecommitdiff
path: root/tb
diff options
context:
space:
mode:
authorAlejandro Soto <alejandro@34project.org>2022-11-08 21:07:22 -0600
committerAlejandro Soto <alejandro@34project.org>2022-11-08 21:07:22 -0600
commitc2d559d927c0f1ace1cbfef698163525c2ea332c (patch)
tree41d0cfd57edb5f4bdf1d030cee56436439bce336 /tb
parentd84b1ef6335007feef8cfa6e4849741d13f015e9 (diff)
Add sim: sdram
Diffstat (limited to 'tb')
-rw-r--r--tb/sim/sdram.S14
-rw-r--r--tb/sim/sdram.py8
2 files changed, 22 insertions, 0 deletions
diff --git a/tb/sim/sdram.S b/tb/sim/sdram.S
new file mode 100644
index 0000000..1efb58e
--- /dev/null
+++ b/tb/sim/sdram.S
@@ -0,0 +1,14 @@
+.global reset
+
+reset:
+ ldr r0, =0x1000
+ ldr r1, =0x2000
+ mov r2, #0
+
+ .loop:
+ str r2, [r0], #4
+ add r2, r2, #1
+ cmp r0, r1
+ bne .loop
+
+ mov pc, lr
diff --git a/tb/sim/sdram.py b/tb/sim/sdram.py
new file mode 100644
index 0000000..2225941
--- /dev/null
+++ b/tb/sim/sdram.py
@@ -0,0 +1,8 @@
+START = 0x0000_1000
+END = 0x0000_2000
+
+cycles = 15000
+mem_dumps = [range(START, END)]
+
+def final():
+ assert_mem(START, list(range(0, (END - START) >> 2)))