Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: James Bowman <james.bowman@ftdichip.com>
To: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: [PATCH, FT32] sim: test coverage for link parameters, PM write port
Date: Wed, 07 Oct 2015 15:20:00 -0000	[thread overview]
Message-ID: <CA9BBF0458F83C4F9051448B941B57D11AC81401@glaexch1> (raw)

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.

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
 


             reply	other threads:[~2015-10-07 15:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-07 15:20 James Bowman [this message]
2015-10-11  3:59 ` Mike Frysinger
2015-10-12 22:12   ` James Bowman
2015-10-13  0:23     ` Mike Frysinger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CA9BBF0458F83C4F9051448B941B57D11AC81401@glaexch1 \
    --to=james.bowman@ftdichip.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox