Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH, FT32] sim: correctly simulate PM write port
@ 2015-09-28 23:50 James Bowman
  2015-09-29  4:02 ` Mike Frysinger
  0 siblings, 1 reply; 4+ messages in thread
From: James Bowman @ 2015-09-28 23:50 UTC (permalink / raw)
  To: gdb-patches

The FT32 simulator was not correctly simulating the behavior of the
program memory (PM) write port.  This patch fixes it.

OK to apply?

[sim/ft32]

2015-09-28  James Bowman  <james.bowman@ftdichip.com>

	* interp.c (cpu_mem_write): fix PM write port
	behavior

diff --git a/sim/ft32/interp.c b/sim/ft32/interp.c
index a20907c..83328c8 100644
--- a/sim/ft32/interp.c
+++ b/sim/ft32/interp.c
@@ -205,8 +205,12 @@ static void cpu_mem_write (SIM_DESC sd, uint32_t dw, uint32_t ea, uint32_t d)
 	  cpu->state.pm_addr = d;
 	  break;
 	case 0x1fc88:
-	  /* Write to PM */
-	  ft32_write_item (sd, dw, cpu->state.pm_addr, d);
+	  if (cpu->state.pm_unlock)
+	    {
+	      /* Write to PM */
+	      ft32_write_item (sd, dw, cpu->state.pm_addr, d);
+	      cpu->state.pm_addr += 4;
+	    }
 	  break;
 	case 0x1fffc:
 	  /* Normal exit.  */


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH, FT32] sim: correctly simulate PM write port
  2015-09-28 23:50 [PATCH, FT32] sim: correctly simulate PM write port James Bowman
@ 2015-09-29  4:02 ` Mike Frysinger
  2015-09-29  5:05   ` James Bowman
  0 siblings, 1 reply; 4+ messages in thread
From: Mike Frysinger @ 2015-09-29  4:02 UTC (permalink / raw)
  To: James Bowman; +Cc: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 400 bytes --]

On 28 Sep 2015 23:49, James Bowman wrote:
> +	  if (cpu->state.pm_unlock)
> +	    {
> +	      /* Write to PM */

GNU style uses full sentences and two spaces after the period:
	/* Write to PM.  */

> +	      ft32_write_item (sd, dw, cpu->state.pm_addr, d);
> +	      cpu->state.pm_addr += 4;
> +	    }

what happens on the hardware when the PM is locked ?
is no error/status/register changed ?
-mike

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH, FT32] sim: correctly simulate PM write port
  2015-09-29  4:02 ` Mike Frysinger
@ 2015-09-29  5:05   ` James Bowman
  2015-09-30  3:37     ` Mike Frysinger
  0 siblings, 1 reply; 4+ messages in thread
From: James Bowman @ 2015-09-29  5:05 UTC (permalink / raw)
  To: Mike Frysinger; +Cc: gdb-patches

> GNU style uses full sentences and two spaces after the period:

Oops. Thanks.

> what happens on the hardware when the PM is locked ?
> is no error/status/register changed ?

That is correct. When it is locked, writes to the data register do nothing.

--
James Bowman
FTDI Open Source Liaison


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH, FT32] sim: correctly simulate PM write port
  2015-09-29  5:05   ` James Bowman
@ 2015-09-30  3:37     ` Mike Frysinger
  0 siblings, 0 replies; 4+ messages in thread
From: Mike Frysinger @ 2015-09-30  3:37 UTC (permalink / raw)
  To: James Bowman; +Cc: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 160 bytes --]

On 29 Sep 2015 05:04, James Bowman wrote:
> > GNU style uses full sentences and two spaces after the period:
> 
> Oops. Thanks.

pushed w/that fix
-mike

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-09-30  3:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-28 23:50 [PATCH, FT32] sim: correctly simulate PM write port James Bowman
2015-09-29  4:02 ` Mike Frysinger
2015-09-29  5:05   ` James Bowman
2015-09-30  3:37     ` Mike Frysinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox