From 980462162e42727dcde1199284fa41a5a38136b0 Mon Sep 17 00:00:00 2001 From: dodge-this Date: Tue, 31 Aug 2010 20:03:45 +0000 Subject: [PATCH] tweak here, tie there git-svn-id: https://svn.code.sf.net/p/goodfet/code/trunk@718 12e2690d-a6be-4b82-a7b7-67c4a43b65c8 --- client/GoodFETARM7.py | 29 ++++++++++++++++++++++++++--- client/gplay-arm.py | 9 +++++++++ 2 files changed, 35 insertions(+), 3 deletions(-) diff --git a/client/GoodFETARM7.py b/client/GoodFETARM7.py index 21f4fe7..9eb7d0d 100644 --- a/client/GoodFETARM7.py +++ b/client/GoodFETARM7.py @@ -313,9 +313,9 @@ class GoodFETARM(GoodFET): """Set ARM Registers""" for x in xrange(15): if (1< 0): + count = (wordcount, 0xe)[wordcount>0xd] + bitmask = LDM_BITMASKS[count] + self.ARMset_register(14,adr) + print len(wordarray),bin(bitmask) + self.ARMset_registers(wordarray[:count],bitmask) + self.ARM_nop(1) + self.ARMdebuginstr(ARM_INSTR_STMIA_R14_r0_rx | bitmask ,0) + #FIXME: do we need the extra nop here? + self.ARMrestart() + self.ARMwaitDBG() + wordarray = wordarray[count:] + wordcount -= count + adr += count*4 + print hex(adr) + # FIXME: handle the rest of the wordcount here. def ARMwriteMem(self, adr, wordarray): r0 = self.ARMget_register(0); # store R0 and R1 r1 = self.ARMget_register(1); diff --git a/client/gplay-arm.py b/client/gplay-arm.py index eb253b3..81fde03 100755 --- a/client/gplay-arm.py +++ b/client/gplay-arm.py @@ -109,6 +109,15 @@ def test(): print "PC:",client.ARMgetPC() print "PC:",client.ARMgetPC() print "PC:",client.ARMgetPC() + print "Testing readChunk/writeChunk" + mem=client.ARMreadChunk(0x200000,32) + client.ARMwriteChunk(0x200000,mem) + mem2=client.ARMreadChunk(0x200000,32) + if (mem != mem2): + print "Failed: \n%s\n%s"%(repr([hex(x) for x in mem]), repr([hex(x) for x in mem2])) + else: + print "Passed." + def test1(): global data -- 2.20.1