summaryrefslogtreecommitdiffstats
path: root/reverse-engineering
diff options
context:
space:
mode:
authorMichael Buesch <mb@bu3sch.de>2010-03-05 12:51:11 +0100
committerMichael Buesch <mb@bu3sch.de>2010-03-05 12:51:11 +0100
commita741033588a60ffa9b01e916e16c0bb1f6de5b2a (patch)
treeb0bed68a53290b88530fffcb84f47e3f3a929f80 /reverse-engineering
parentba957071e640ef799f45a6f868b59b008247fee3 (diff)
downloadtoprammer-a741033588a60ffa9b01e916e16c0bb1f6de5b2a.tar.xz
toprammer-a741033588a60ffa9b01e916e16c0bb1f6de5b2a.zip
Add sniffer patches
Signed-off-by: Michael Buesch <mb@bu3sch.de>
Diffstat (limited to 'reverse-engineering')
-rw-r--r--reverse-engineering/vccx-sniffer.patch39
-rw-r--r--reverse-engineering/vpp-sniffer.patch39
2 files changed, 78 insertions, 0 deletions
diff --git a/reverse-engineering/vccx-sniffer.patch b/reverse-engineering/vccx-sniffer.patch
new file mode 100644
index 0000000..c5b7c75
--- /dev/null
+++ b/reverse-engineering/vccx-sniffer.patch
@@ -0,0 +1,39 @@
+diff --git a/libtoprammer/toprammer_main.py b/libtoprammer/toprammer_main.py
+index 3962d44..4b00100 100644
+--- a/libtoprammer/toprammer_main.py
++++ b/libtoprammer/toprammer_main.py
+@@ -204,7 +204,34 @@ class TOP:
+ raise TOPException("Init: Unexpected status register (b): 0x%08X" % stat)
+
+ self.__bitfileUpload()
++
+ self.chip.initializeChip()
++ self.chip.setOutputEnableMask(0)
++ self.cmdSetVPPVoltage(12)
++ self.queueCommand("\x0E\x28\x01\x00")
++ self.flushCommands()
++
++ import hc4094sniffer
++ s = hc4094sniffer.Sniffer("/dev/ttyUSB0", 3)
++ count = 0
++ for i in range(0, 0xFF+1):
++ self.cmdLoadVCCXLayout(0)
++ self.cmdLoadVCCXLayout(i)
++ self.flushCommands()
++ time.sleep(0.1)
++ d = s.read()
++ d = ord(d[0]) | (ord(d[1]) << 8) | (ord(d[2]) << 16)
++ d ^= 0xFFFFFF
++ sys.stdout.write("0x%06X," % d)
++ count += 1
++ if count == 6:
++ count = 0
++ sys.stdout.write("\n")
++ else:
++ sys.stdout.write(" ")
++ sys.stdout.flush()
++
++ sys.exit(0)
+
+ def __bitfileUpload(self):
+ self.printDebug("Uploading bitfile %s..." % self.bitfile.getFilename())
diff --git a/reverse-engineering/vpp-sniffer.patch b/reverse-engineering/vpp-sniffer.patch
new file mode 100644
index 0000000..fc0f1ae
--- /dev/null
+++ b/reverse-engineering/vpp-sniffer.patch
@@ -0,0 +1,39 @@
+diff --git a/libtoprammer/toprammer_main.py b/libtoprammer/toprammer_main.py
+index 3962d44..b9e41ff 100644
+--- a/libtoprammer/toprammer_main.py
++++ b/libtoprammer/toprammer_main.py
+@@ -204,7 +204,34 @@ class TOP:
+ raise TOPException("Init: Unexpected status register (b): 0x%08X" % stat)
+
+ self.__bitfileUpload()
++
+ self.chip.initializeChip()
++ self.chip.setOutputEnableMask(0)
++ self.cmdSetVPPVoltage(12)
++ self.queueCommand("\x0E\x28\x01\x00")
++ self.flushCommands()
++
++ import hc4094sniffer
++ s = hc4094sniffer.Sniffer("/dev/ttyUSB0", 4)
++ count = 0
++ for i in range(0, 0xFF+1):
++ self.cmdLoadVPPLayout(0)
++ self.cmdLoadVPPLayout(i)
++ self.flushCommands()
++ time.sleep(0.1)
++ d = s.read()
++ d = ord(d[0]) | (ord(d[1]) << 8) | (ord(d[2]) << 16) | (ord(d[3]) << 24)
++ d ^= 0xFFFFFFFF
++ sys.stdout.write("0x%08X," % d)
++ count += 1
++ if count == 5:
++ count = 0
++ sys.stdout.write("\n")
++ else:
++ sys.stdout.write(" ")
++ sys.stdout.flush()
++
++ sys.exit(0)
+
+ def __bitfileUpload(self):
+ self.printDebug("Uploading bitfile %s..." % self.bitfile.getFilename())
bues.ch cgit interface