[FT32] sim: correctly simulate PM write port
Commit Message
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
Comments
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
> 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
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
@@ -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. */