summaryrefslogtreecommitdiff
path: root/tb/sim
diff options
context:
space:
mode:
authorAlejandro Soto <alejandro@34project.org>2023-10-02 22:54:55 -0600
committerAlejandro Soto <alejandro@34project.org>2023-10-02 23:29:46 -0600
commit548187dfc392d0beef4cc86e7d3d22d885276e5d (patch)
treecdfbfb193efbed410e208003e97487e7474ef2e5 /tb/sim
parent461d40fd78d49bef4420c7044426cb181fc5e6d8 (diff)
tb/sim: add test: smp_boot
Diffstat (limited to '')
-rw-r--r--tb/sim/smp_boot.S25
-rw-r--r--tb/sim/smp_boot.py4
2 files changed, 29 insertions, 0 deletions
diff --git a/tb/sim/smp_boot.S b/tb/sim/smp_boot.S
new file mode 100644
index 0000000..669508b
--- /dev/null
+++ b/tb/sim/smp_boot.S
@@ -0,0 +1,25 @@
+.global reset
+
+reset:
+ adr r0, cpus
+
+.inc_cpus:
+ ldrex r1, [r0]
+ add r1, r1, #1
+ strex r2, r1, [r0]
+ teq r2, #0
+ bne .inc_cpus
+
+ cmp r1, #1
+ movne pc, lr
+
+ ldr r1, =0x30140000
+ ldr r2, [r1]
+ ldr r3, =0x01010100
+ str r3, [r1]
+ ldr r3, [r1]
+.wait:
+ ldr r1, [r0]
+ b .wait
+
+cpus: .word 0
diff --git a/tb/sim/smp_boot.py b/tb/sim/smp_boot.py
new file mode 100644
index 0000000..40c3012
--- /dev/null
+++ b/tb/sim/smp_boot.py
@@ -0,0 +1,4 @@
+def final():
+ assert_reg(r1, 4)
+ assert_reg(r2, 0x01010100)
+ assert_reg(r3, 0)