From 21a45c7938c021cfaee254dedb5c16ea37806f6e Mon Sep 17 00:00:00 2001 From: travisutk Date: Sun, 14 Mar 2010 03:08:43 +0000 Subject: [PATCH 1/1] Glitching index on vcc. git-svn-id: https://svn.code.sf.net/p/goodfet/code/trunk@409 12e2690d-a6be-4b82-a7b7-67c4a43b65c8 --- client/GoodFETGlitch.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/client/GoodFETGlitch.py b/client/GoodFETGlitch.py index 96c8a19..ac0d8f6 100644 --- a/client/GoodFETGlitch.py +++ b/client/GoodFETGlitch.py @@ -29,6 +29,7 @@ class GoodFETGlitch(GoodFET): #Database connection w/ 30 second timeout. self.db=sqlite3.connect("glitch.db",30000); self.db.execute("create table if not exists glitches(time,vcc,gnd,trials,glitchcount,count,lock)"); + self.db.execute("create index if not exists glitchvcc on glitches(vcc);"); self.client=0; def setup(self,arch="avr"): self.client=getClient(arch); @@ -76,7 +77,7 @@ class GoodFETGlitch(GoodFET): trials=1; lock=0; #1 locks, 0 unlocked vstart=0; - vstop=1024; #Could be as high as 0xFFF + vstop=0xfff; #Could be as high as 0xFFF vstep=1; tstart=0; tstop=-1; #<0 defaults to full range @@ -131,13 +132,9 @@ class GoodFETGlitch(GoodFET): c=self.db.cursor(); c.execute("select vcc from glitches where vcc=? limit 1;",[vcc]); rows=c.fetchall(); - try: - c.next(); - #This voltage has been explored, because no complete exception has been thrown. + for a in rows: return True; - except: #Voltage hasn't been explored - return False; - + return False; def scanat(self,trials,vcc,gnd,time): client=self.client; db=self.db; -- 2.20.1