From patchwork Mon Sep 28 23:49:36 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Bowman X-Patchwork-Id: 8878 Received: (qmail 31859 invoked by alias); 28 Sep 2015 23:50:53 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 31839 invoked by uid 89); 28 Sep 2015 23:50:52 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=2.2 required=5.0 tests=AWL, BAYES_40, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_LOW, UNSUBSCRIBE_BODY autolearn=no version=3.3.2 X-HELO: smtp-out6.electric.net Received: from smtp-out6.electric.net (HELO smtp-out6.electric.net) (192.162.217.181) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Mon, 28 Sep 2015 23:50:51 +0000 Received: from 1ZgiC0-0008Bi-TJ by out6d.electric.net with emc1-ok (Exim 4.85) (envelope-from ) id 1ZgiC0-0008CC-Um for gdb-patches@sourceware.org; Mon, 28 Sep 2015 16:50:48 -0700 Received: by emcmailer; Mon, 28 Sep 2015 16:50:48 -0700 Received: from [188.39.184.227] (helo=GLAEXCH1.ftdi.local) by out6d.electric.net with esmtps (TLSv1:AES128-SHA:128) (Exim 4.85) (envelope-from ) id 1ZgiC0-0008Bi-TJ for gdb-patches@sourceware.org; Mon, 28 Sep 2015 16:50:48 -0700 Received: from GLAEXCH3.ftdi.local ([172.16.0.161]) by glaexch1 ([172.16.0.121]) with mapi id 14.01.0438.000; Tue, 29 Sep 2015 00:49:38 +0100 From: James Bowman To: "gdb-patches@sourceware.org" Subject: [PATCH, FT32] sim: correctly simulate PM write port Date: Mon, 28 Sep 2015 23:49:36 +0000 Message-ID: MIME-Version: 1.0 X-Outbound-IP: 188.39.184.227 X-Env-From: james.bowman@ftdichip.com X-PolicySMART: 3094660 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 * 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. */