[FT32] sim: test coverage for link parameters, PM write port
Commit Message
Adds test coverage for recent features.
OK to apply?
[sim/testsuite/sim/ft32/ChangeLog]
2015-10-07 James Bowman <james.bowman@ftdichip.com>
* basic.s: Add test for memory size link parameters.
Add test for program memory write port.
Comments
On 07 Oct 2015 15:19, James Bowman wrote:
> Adds test coverage for recent features.
>
> OK to apply?
doesn't seem to actually work:
$ make check-sim
...
Testing basic.s on machine ft32.
Executing on host: /usr/local/src/gnu/gdb/build/build-ft32/gas/as-new
../../../../sim/testsuite/sim/ft32/basic.s -I../../../../sim/testsuite/sim/ft32 -o basic.s.o (timeout = 300)
spawn /usr/local/src/gnu/gdb/build/build-ft32/gas/as-new ../../../../sim/testsuite/sim/ft32/basic.s -I../../../../sim/testsuite/sim/ft32 -o basic.s.o
Executing on host: /usr/local/src/gnu/gdb/build/build-ft32/ld/ld-new basic.s.o -o basic.s.x (timeout = 300)
spawn /usr/local/src/gnu/gdb/build/build-ft32/ld/ld-new basic.s.o -o basic.s.x
basic.s.o: In function `__start':
(.text+0x50): undefined reference to `__PMSIZE'
basic.s.o: In function `__start':
(.text+0x6c): undefined reference to `__RAMSIZE'
linker exited with status 1
linker output is:
basic.s.o: In function `__start':
(.text+0x50): undefined reference to `__PMSIZE'
basic.s.o: In function `__start':
(.text+0x6c): undefined reference to `__RAMSIZE'
basic.s.o: In function `__start':
(.text+0x50): undefined reference to `__PMSIZE'
basic.s.o: In function `__start':
(.text+0x6c): undefined reference to `__RAMSIZE'
FAIL: ft32 basic.s (linking)
-mike
Hi Mike,
I just pulled a clean tree, built, and the test passes.
The __PMSIZE symbol was added to the linker script in commit
ea4a7f9986ed4614d8ffb85ccd4fa4bb49b6d420
on September 9th. Have you rebuilt "all-ld" for FT32 since that date?
On 12 Oct 2015 22:10, James Bowman wrote:
> I just pulled a clean tree, built, and the test passes.
>
> The __PMSIZE symbol was added to the linker script in commit
> ea4a7f9986ed4614d8ffb85ccd4fa4bb49b6d420
> on September 9th. Have you rebuilt "all-ld" for FT32 since that date?
thanks, that was it. pushed this change now!
-mike
@@ -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