diff options
author | James Bowman <james.bowman@ftdichip.com> | 2015-10-07 15:19:08 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2015-10-12 20:23:26 -0400 |
commit | 8173c2a3c46efd8b12983b6095ff7bed4cda1c90 (patch) | |
tree | 81f791eede3d18072591889b1d5138bcc7bf5edc /sim | |
parent | cb781f0412a62a7e248721ed8fe6c491ccc9c456 (diff) | |
download | gdb-8173c2a3c46efd8b12983b6095ff7bed4cda1c90.zip gdb-8173c2a3c46efd8b12983b6095ff7bed4cda1c90.tar.gz gdb-8173c2a3c46efd8b12983b6095ff7bed4cda1c90.tar.bz2 |
sim: ft32: test coverage for link parameters and PM write port
Adds test coverage for recent features.
Diffstat (limited to 'sim')
-rw-r--r-- | sim/testsuite/sim/ft32/ChangeLog | 5 | ||||
-rw-r--r-- | sim/testsuite/sim/ft32/basic.s | 37 |
2 files changed, 42 insertions, 0 deletions
diff --git a/sim/testsuite/sim/ft32/ChangeLog b/sim/testsuite/sim/ft32/ChangeLog index a0cfa18..cb1d2f4 100644 --- a/sim/testsuite/sim/ft32/ChangeLog +++ b/sim/testsuite/sim/ft32/ChangeLog @@ -1,3 +1,8 @@ +2015-10-12 James Bowman <james.bowman@ftdichip.com> + + * basic.s: Add test for memory size link parameters. + Add test for program memory write port. + 2015-02-28 James Bowman <james.bowman@ftdichip.com> * basic.s, allinsn.exp, testutils.inc: New files. diff --git a/sim/testsuite/sim/ft32/basic.s b/sim/testsuite/sim/ft32/basic.s index c92f295..62977c8 100644 --- a/sim/testsuite/sim/ft32/basic.s +++ b/sim/testsuite/sim/ft32/basic.s @@ -5,6 +5,11 @@ start + ldk $r0,__PMSIZE + EXPECT $r0,0x00040000 + ldk $r0,__RAMSIZE + EXPECT $r0,0x00010000 + ldk $r4,10 add $r4,$r4,23 EXPECT $r4,33 @@ -784,6 +789,38 @@ tmp: .long 0 pop.l $r0 EXPECT $r0,0x12345678 +# PM write port + .equ PM_UNLOCK, 0x1fc80 + .equ PM_ADDR, 0x1fc84 + .equ PM_DATA, 0x1fc88 + + lpm.l $r0,k_12345678 + lpm.l $r1,k_abcdef01 + EXPECT $r0,0x12345678 + EXPECT $r1,0xabcdef01 + ldk.l $r3,(0x1337f7d1 >> 10) + ldl.l $r3,$r3,(0x1337f7d1 & 0x3ff) + EXPECT $r3,0x1337f7d1 + ldk $r4,k_12345678 + sta.l PM_ADDR,$r4 + + # write while locked does nothing + sta.l PM_DATA,$r1 + sta.l PM_DATA,$r0 + lpm.l $r0,k_12345678 + lpm.l $r1,k_abcdef01 + EXPECT $r0,0x12345678 + EXPECT $r1,0xabcdef01 + + # write while unlocked modifies program memory + sta.l PM_UNLOCK,$r3 + sta.l PM_DATA,$r1 + sta.l PM_DATA,$r0 + lpm.l $r0,k_12345678 + lpm.l $r1,k_abcdef01 + EXPECT $r0,0xabcdef01 + EXPECT $r1,0x12345678 + # final stack check EXPECT $sp,0x00000000 |