diff options
Diffstat (limited to 'tb')
| -rw-r--r-- | tb/sim/strex.S | 16 | ||||
| -rw-r--r-- | tb/sim/strex.py | 9 |
2 files changed, 25 insertions, 0 deletions
diff --git a/tb/sim/strex.S b/tb/sim/strex.S new file mode 100644 index 0000000..5ea2b33 --- /dev/null +++ b/tb/sim/strex.S @@ -0,0 +1,16 @@ +.global reset + +reset: + ldr r0, =0x1000 + ldr r1, =0x01234567 + str r1, [r0] + mvn r1, r1 + str r1, [r0, #4] + strex r2, r0, [r0] @ Debe fallar + ldrex r3, [r0] + add r0, r0, #4 + ldrex r4, [r0] + strex r5, r3, [r0] @ Debe fallar + sub r0, r0, #4 + strex r6, r4, [r0] @ Debe servir + mov pc, lr diff --git a/tb/sim/strex.py b/tb/sim/strex.py new file mode 100644 index 0000000..d53c355 --- /dev/null +++ b/tb/sim/strex.py @@ -0,0 +1,9 @@ +mem_dumps = [range(0x1000, 0x1008)] + +def final(): + assert_reg(r2, 1) + assert_reg(r5, 1) + assert_reg(r6, 0) + + assert_mem(0x1000, 0xfedcba98) + assert_mem(0x1004, 0x01234567) |
