diff options
author | James Bowman <james.bowman@ftdichip.com> | 2015-09-28 23:49:36 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2015-09-29 23:36:56 -0400 |
commit | 71c34ca7a0f54c8c8ad39b72ea1badf9f9a1ade7 (patch) | |
tree | a65c1c798fd07be0509996cf3ea421cf784e1bc6 /sim/ft32/interp.c | |
parent | 1eefa9cbaf0516c0cb3bc384c8376332ad4c39b2 (diff) | |
download | gdb-71c34ca7a0f54c8c8ad39b72ea1badf9f9a1ade7.zip gdb-71c34ca7a0f54c8c8ad39b72ea1badf9f9a1ade7.tar.gz gdb-71c34ca7a0f54c8c8ad39b72ea1badf9f9a1ade7.tar.bz2 |
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.
Diffstat (limited to 'sim/ft32/interp.c')
-rw-r--r-- | sim/ft32/interp.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sim/ft32/interp.c b/sim/ft32/interp.c index a20907c..c769ff7 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. */ |