From: James Bowman Date: Mon, 28 Sep 2015 23:49:36 +0000 (+0000) Subject: sim: ft32: correctly simulate PM write port X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=71c34ca7a0f54c8c8ad39b72ea1badf9f9a1ade7;p=binutils-gdb.git sim: ft32: correctly simulate PM write port The FT32 simulator was not correctly simulating the behavior of the program memory (PM) write port. When it is locked, writes to the data register do nothing. --- diff --git a/sim/ft32/ChangeLog b/sim/ft32/ChangeLog index 29f661fca23..47218b4e652 100644 --- a/sim/ft32/ChangeLog +++ b/sim/ft32/ChangeLog @@ -1,3 +1,7 @@ +2015-09-29 James Bowman + + * interp.c (cpu_mem_write): Do no write PM when locked. + 2015-09-22 James Bowman * ft32/interp.c (cpu_mem_read): Call getchar when ea is 0x10000. diff --git a/sim/ft32/interp.c b/sim/ft32/interp.c index a20907c5c86..c769ff7a3be 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. */