summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--README-DEVELOPERS.lyx6
-rw-r--r--README-DEVELOPERS.ps300
-rw-r--r--libtoprammer/chip.py11
-rw-r--r--libtoprammer/chip_generic_sram.py12
-rw-r--r--libtoprammer/toprammer_main.py6
-rw-r--r--libtoprammer/util.py9
-rwxr-xr-xtests/run-tests.sh4
-rw-r--r--tests/top2049/004-hm62256dip28.test4
-rwxr-xr-xtoprammer9
9 files changed, 197 insertions, 164 deletions
diff --git a/README-DEVELOPERS.lyx b/README-DEVELOPERS.lyx
index 1829529..c263f77 100644
--- a/README-DEVELOPERS.lyx
+++ b/README-DEVELOPERS.lyx
@@ -485,6 +485,12 @@ erase() Erase the DUT.
\end_layout
\begin_layout Description
+test() Run an optional unit-test on the chip.
+ The convenience wrapper genericTest(self, readFunc, writeFunc, size) may
+ be used to implement this method.
+\end_layout
+
+\begin_layout Description
readProgmem() Read the program memory and return it.
Reimplement this, if your DUT has program memory and supports reading it.
\end_layout
diff --git a/README-DEVELOPERS.ps b/README-DEVELOPERS.ps
index e7d1235..98e6079 100644
--- a/README-DEVELOPERS.ps
+++ b/README-DEVELOPERS.ps
@@ -1,7 +1,7 @@
%!PS-Adobe-2.0
%%Creator: dvips(k) 5.98 Copyright 2009 Radical Eye Software
%%Title: README-DEVELOPERS.dvi
-%%CreationDate: Sat Jan 15 23:34:25 2011
+%%CreationDate: Sun Jan 16 01:36:08 2011
%%Pages: 7
%%PageOrder: Ascend
%%BoundingBox: 0 0 596 842
@@ -11,7 +11,7 @@
%DVIPSWebPage: (www.radicaleye.com)
%DVIPSCommandLine: dvips -o README-DEVELOPERS.ps README-DEVELOPERS.dvi
%DVIPSParameters: dpi=600
-%DVIPSSource: TeX output 2011.01.15:2334
+%DVIPSSource: TeX output 2011.01.16:0136
%%BeginProcSet: tex.pro 0 0
%!
/TeXDict 300 dict def TeXDict begin/N{def}def/B{bind def}N/S{exch}N/X{S
@@ -2980,17 +2980,17 @@ FFC00003FC7F800007FC3F000007FC00000007FC00000007F800000007F80000000FF800
800000003F000000007C00000000F800000000F000000001E000000003C0000000078000
00000F00000C001E00000C003C00000C0038000018007000001800E000001801C0000018
038000003807000000300E000000701FFFFFFFF01FFFFFFFF03FFFFFFFF07FFFFFFFF0FF
-FFFFFFE0FFFFFFFFE0FFFFFFFFE026427BC131>I<06000000C007C00007C007FC007F80
-07FFFFFF0007FFFFFE0007FFFFFC0007FFFFF80007FFFFE00007FFFF8000063FFC000006
-000000000600000000060000000006000000000600000000060000000006000000000600
-0000000600000000060000000006000000000600000000060000000006000000000600FF
-00000607FFC000061F01F000063800FC0006F0007E0007C0003F000780001F800780001F
-C00700000FC00600000FE000000007F000000007F000000007F000000007F800000003F8
-00000003F800000003FC00000003FC00000003FC00000003FC00000003FC3E000003FC7F
-000003FCFF800003FCFF800003FCFF800003FCFF800003FCFF800003F8FF000007F8FE00
-0007F860000007F060000007F07000000FF03000000FE03800001FC01C00001FC01E0000
-3F800F00007F00078000FE0003C001FC0001F807F000007FFFE000001FFF00000007F800
-0026447BC131>53 D<000FFFFFFE000FFFFFFE000FFFFFFE000003FF80000001FF000000
+FFFFFFE0FFFFFFFFE0FFFFFFFFE026427BC131>I<000007FC0000003FFF000000FFFFC0
+0003FC03E00007E000F0001FC00038003F000058007E0001FC00FE0003FC00FC0007FC01
+F80007FC03F00007FC03F00007FC07E00003F80FE00001F00FE00000001FC00000001FC0
+0000001FC00000003F800000003F800000003F800000007F800000007F800000007F007F
+80007F01FFF0007F0780FC00FF0E003E00FF1C001F80FF38000FC0FF700007E0FF600007
+E0FFE00003F0FFC00003F8FFC00001F8FFC00001FCFF800001FCFF800000FEFF800000FE
+FF800000FEFF000000FFFF000000FFFF000000FFFF000000FF7F000000FF7F000000FF7F
+000000FF7F000000FF7F000000FF7F800000FF3F800000FF3F800000FF3F800000FE1F80
+0000FE1F800001FE1FC00001FC0FC00001FC0FC00003F807E00003F807E00007F003F000
+07E001F8000FC000FC001F80007E003F00003F80FE00000FFFF8000003FFE0000000FF80
+0028447CC131>54 D<000FFFFFFE000FFFFFFE000FFFFFFE000003FF80000001FF000000
00FF00000000FF00000000FF00000000FF00000000FF00000000FF00000000FF00000000
FF00000000FF00000000FF00000000FF00000000FF00000000FF00000000FF00000000FF
00000000FF00000000FF00000000FF00000000FF00000000FF00000000FF00000000FF00
@@ -3332,7 +3332,7 @@ ifelse
%%Page: 1 1
TeXDict begin 1 0 bop 1038 872 a Fh(T)-11 b(oprammer)45
b(-)g(Dev)l(elop)t(ers)h(guide)1583 1307 y Fg(Jan)m(uary)33
-b(15,)f(2011)515 1659 y Ff(1)131 b(De\034nitions)515
+b(16,)f(2011)515 1659 y Ff(1)131 b(De\034nitions)515
1841 y Fe(DUT)42 b Fd(Device)19 b(Under)f(T)-7 b(est.)34
b(The)18 b(device)h(put)g(in)n(to)f(the)h(ZIF)f(so)r(c)n(k)n(et)f(of)i
(the)g(programmer)515 2004 y Fe(VPP)42 b Fd(Programming)26
@@ -3466,213 +3466,217 @@ e(not)i(sen)n(t)g(immediately)-7 b(,)29 b(but)g(queued)515
b(This)29 b(is)f(done)g(to)g(sp)r(eed)h(up)g(device)f(access)f
(signi\034can)n(tly)-7 b(.)515 904 y(The)27 b(command)g(transmission)g
(queue)g(has)g(sev)n(eral)f(\035ushing)h(conditions:)639
-1063 y Fc(\017)41 b Fd(Commands)18 b(can)g(b)r(e)h(\035ushed)f
+1070 y Fc(\017)41 b Fd(Commands)18 b(can)g(b)r(e)h(\035ushed)f
(explicitely)h(using)f(the)g(\020\035ushCommands\(\)\021)25
-b(metho)r(d)722 1163 y(of)j(\020class)e(TOP\021.)639
-1325 y Fc(\017)41 b Fd(Commands)18 b(are)g(automatically)f(\035ushed)i
+b(metho)r(d)722 1170 y(of)j(\020class)e(TOP\021.)639
+1336 y Fc(\017)41 b Fd(Commands)18 b(are)g(automatically)f(\035ushed)i
(on)g(cmdReadBu\033erReg\(\))f(b)r(efore)g(read-)722
-1425 y(ing)30 b(the)h(data)f(from)g(the)h(device.)45
+1435 y(ing)30 b(the)h(data)f(from)g(the)h(device.)45
b(This)30 b(is)g(to)g(ensure)g(sequen)n(tial)g(consistency)f(of)722
-1524 y(the)f(commands.)639 1687 y Fc(\017)41 b Fd(Commands)27
+1535 y(the)f(commands.)639 1701 y Fc(\017)41 b Fd(Commands)27
b(are)g(\035ushed)h(on)f(v)-5 b(arious)26 b(v)n(oltage-la)n(y)n(out)e
-(op)r(erations.)515 1846 y(Y)-7 b(ou)27 b(usually)g(do)h(not)f(need)h
-(to)f(\035ush)h(commands)f(explicitely)-7 b(.)515 2119
+(op)r(erations.)515 1867 y(Y)-7 b(ou)27 b(usually)g(do)h(not)f(need)h
+(to)f(\035ush)h(commands)f(explicitely)-7 b(.)515 2142
y Ff(5)131 b(Implemen)l(ting)44 b(a)g(new)f(c)l(hip)j(\(DUT\))e
-(algorithm)515 2300 y Fd(The)32 b(reading)f(and)g(programming)f
+(algorithm)515 2324 y Fd(The)32 b(reading)f(and)g(programming)f
(algorithms)h(for)g(the)i(c)n(hips)e(\(DUT)-7 b(s\))33
-b(are)e(separated)515 2400 y(in)n(to)c(t)n(w)n(o)g(parts:)639
-2559 y Fc(\017)41 b Fd(Lo)n(w)27 b(lev)n(el)g(FPGA)i(b)r(ottom-half)639
-2721 y Fc(\017)41 b Fd(High)28 b(lev)n(el)f(Python)h(co)r(de)f
-(top-half)515 2880 y(The)35 b(FPGA)i(b)r(ottom-half)f(implemen)n(ts)f
+b(are)e(separated)515 2423 y(in)n(to)c(t)n(w)n(o)g(parts:)639
+2589 y Fc(\017)41 b Fd(Lo)n(w)27 b(lev)n(el)g(FPGA)i(b)r(ottom-half)639
+2755 y Fc(\017)41 b Fd(High)28 b(lev)n(el)f(Python)h(co)r(de)f
+(top-half)515 2921 y(The)35 b(FPGA)i(b)r(ottom-half)f(implemen)n(ts)f
(the)h(basic)f(op)r(erations)g(\(fetc)n(hing)g(data)g(from)515
-2980 y(DUT.)27 b(W)-7 b(riting)26 b(data)g(to)g(DUT.)h(etc...\).)37
+3021 y(DUT.)27 b(W)-7 b(riting)26 b(data)g(to)g(DUT.)h(etc...\).)37
b(It)27 b(ma)n(y)f(also)f(implemen)n(t)i(timingcritical)f(parts)515
-3079 y(of)e(the)h(algorithm.)34 b(Ev)n(erything)24 b(else)g(is)g
+3121 y(of)e(the)h(algorithm.)34 b(Ev)n(erything)24 b(else)g(is)g
(implemen)n(ted)h(in)f(the)h(high)f(lev)n(el)g(Python)g(co)r(de,)515
-3179 y(that)k(liv)n(es)e(on)i(the)g(other)f(end)g(of)h(the)g(USB)g
-(line.)515 3410 y Fb(5.1)112 b(Python)37 b(top-half)h(implemen)m
-(tation)515 3563 y Fd(The)27 b(DUT)i(sp)r(eci\034c)e(top-half)h(liv)n
+3220 y(that)k(liv)n(es)e(on)i(the)g(other)f(end)g(of)h(the)g(USB)g
+(line.)515 3453 y Fb(5.1)112 b(Python)37 b(top-half)h(implemen)m
+(tation)515 3606 y Fd(The)27 b(DUT)i(sp)r(eci\034c)e(top-half)h(liv)n
(es)f(in)h(the)g(\020c)n(hip_xxx.p)n(y\021)k(\034les,)c(where)f(xxx)g
-(is)h(the)g(ID)515 3663 y(of)23 b(the)h(DUT.)h(This)e(\034le)h(con)n
+(is)h(the)g(ID)515 3705 y(of)23 b(the)h(DUT.)h(This)e(\034le)h(con)n
(tains)f(a)g(class)g(deriv)n(ed)g(from)g(the)h(\020Chip\021)30
-b(class.)35 b(The)24 b(\020Chip\021)515 3762 y(class)g(pro)n(vides)g
+b(class.)35 b(The)24 b(\020Chip\021)515 3805 y(class)g(pro)n(vides)g
(some)h(basic)g(help)r(er)g(metho)r(ds)h(for)f(algorithm)f(implemen)n
-(tation.)36 b(It)26 b(also)515 3862 y(de\034nes)h(the)h(in)n(terface)f
+(tation.)36 b(It)26 b(also)515 3905 y(de\034nes)h(the)h(in)n(terface)f
(that)h(is)f(to)h(b)r(e)f(re-implemen)n(ted)h(in)f(the)h(deriv)n(ed)f
-(sub)r(class.)36 b(This)515 3962 y(in)n(terface)27 b(consists)f(of)i
-(the)g(follo)n(wing)e(metho)r(ds:)515 4120 y Fe(sh)m(utdo)m(wnChip\(\))
+(sub)r(class.)36 b(This)515 4004 y(in)n(terface)27 b(consists)f(of)i
+(the)g(follo)n(wing)e(metho)r(ds:)515 4170 y Fe(sh)m(utdo)m(wnChip\(\))
41 b Fd(Called)26 b(once)f(on)g(c)n(hip)h(sh)n(utdo)n(wn.)35
-b(The)26 b(default)g(implemen)n(tation)722 4220 y(turns)i(o\033)f(all)h
+b(The)26 b(default)g(implemen)n(tation)722 4270 y(turns)i(o\033)f(all)h
(v)n(oltages.)34 b(There's)27 b(usually)g(no)h(need)f(to)h(o)n(v)n
-(erride)d(that.)515 4382 y Fe(readSignature\(\))42 b
+(erride)d(that.)515 4436 y Fe(readSignature\(\))42 b
Fd(Read)31 b(the)i(DUT)f(signature)f(and)g(return)h(it.)49
-b(Reimplemen)n(t)33 b(this,)722 4482 y(if)28 b(y)n(our)f(DUT)h(supp)r
-(orts)f(signature)f(reading.)515 4645 y Fe(erase\(\))41
+b(Reimplemen)n(t)33 b(this,)722 4536 y(if)28 b(y)n(our)f(DUT)h(supp)r
+(orts)f(signature)f(reading.)515 4702 y Fe(erase\(\))41
b Fd(Erase)d(the)g(DUT.)h(Reimplemen)n(t)g(this,)i(if)e(y)n(our)d(DUT)j
-(supp)r(orts)f(electrical)722 4744 y(erasing.)515 4907
-y Fe(readProgmem\(\))h Fd(Read)22 b(the)g(program)e(memory)h(and)h
-(return)g(it.)35 b(Reimplemen)n(t)23 b(this,)722 5006
-y(if)28 b(y)n(our)f(DUT)h(has)f(program)e(memory)i(and)h(supp)r(orts)f
-(reading)f(it.)1926 5255 y(4)p eop end
+(supp)r(orts)f(electrical)722 4801 y(erasing.)1926 5255
+y(4)p eop end
%%Page: 5 5
-TeXDict begin 5 4 bop 515 523 a Fe(writeProgmem\(image\))36
+TeXDict begin 5 4 bop 515 523 a Fe(test\(\))41 b Fd(Run)28
+b(an)f(optional)f(unit-test)i(on)f(the)g(c)n(hip.)37
+b(The)27 b(con)n(v)n(enience)f(wrapp)r(er)g(gener-)722
+623 y(icT)-7 b(est\(self,)45 b(readF)-7 b(unc,)43 b(writeF)-7
+b(unc,)45 b(size\))c(ma)n(y)f(b)r(e)h(used)g(to)f(implemen)n(t)i(this)
+722 722 y(metho)r(d.)515 887 y Fe(readProgmem\(\))d Fd(Read)22
+b(the)g(program)e(memory)h(and)h(return)g(it.)35 b(Reimplemen)n(t)23
+b(this,)722 987 y(if)28 b(y)n(our)f(DUT)h(has)f(program)e(memory)i(and)
+h(supp)r(orts)f(reading)f(it.)515 1152 y Fe(writeProgmem\(image\))36
b Fd(W)-7 b(rite)39 b(the)h(program)c(memory)-7 b(.)71
-b(Reimplemen)n(t)39 b(this,)k(if)722 623 y(y)n(our)27
+b(Reimplemen)n(t)39 b(this,)k(if)722 1252 y(y)n(our)27
b(DUT)h(has)f(program)e(memory)i(and)g(supp)r(orts)h(writing)f(it.)515
-774 y Fe(readEEPR)m(OM\(\))41 b Fd(Read)27 b(the)g(\(E\)EPR)n(OM)i
+1417 y Fe(readEEPR)m(OM\(\))41 b Fd(Read)27 b(the)g(\(E\)EPR)n(OM)i
(memory)d(and)h(return)f(it.)38 b(Reimplemen)n(t)722
-874 y(this,)28 b(if)g(y)n(our)f(DUT)h(has)f(\(E\)EPR)n(OM)i(memory)e
-(and)g(supp)r(orts)g(reading)g(it.)515 1025 y Fe(writeEEPR)m(OM\(\))40
+1516 y(this,)28 b(if)g(y)n(our)f(DUT)h(has)f(\(E\)EPR)n(OM)i(memory)e
+(and)g(supp)r(orts)g(reading)g(it.)515 1681 y Fe(writeEEPR)m(OM\(\))40
b Fd(W)-7 b(rite)28 b(the)g(\(E\)EPR)n(OM)h(memory)-7
b(.)37 b(Reimplemen)n(t)28 b(this,)g(if)g(y)n(our)722
-1125 y(DUT)h(has)e(\(E\)EPR)n(OM)i(memory)d(and)i(supp)r(orts)f
-(writing)g(it.)515 1276 y Fe(readF)-8 b(use\(\))42 b
+1781 y(DUT)h(has)e(\(E\)EPR)n(OM)i(memory)d(and)i(supp)r(orts)f
+(writing)g(it.)515 1946 y Fe(readF)-8 b(use\(\))42 b
Fd(Read)31 b(the)h(F)-7 b(use)32 b(memory)f(and)h(return)f(it.)50
-b(Reimplemen)n(t)33 b(this,)g(if)f(y)n(our)722 1375 y(DUT)d(has)e(F)-7
-b(uses)27 b(and)g(supp)r(orts)g(reading)g(them.)515 1527
+b(Reimplemen)n(t)33 b(this,)g(if)f(y)n(our)722 2046 y(DUT)d(has)e(F)-7
+b(uses)27 b(and)g(supp)r(orts)g(reading)g(them.)515 2211
y Fe(writeF)-8 b(use\(\))41 b Fd(W)-7 b(rite)19 b(the)g(F)-7
b(use)20 b(memory)-7 b(.)33 b(Reimplemen)n(t)19 b(this,)j(if)d(y)n(our)
-f(DUT)i(has)e(F)-7 b(uses)722 1626 y(and)28 b(supp)r(orts)f(writing)g
-(them.)515 1778 y Fe(readLo)s(c)m(kbits\(\))42 b Fd(Read)31
+f(DUT)i(has)e(F)-7 b(uses)722 2310 y(and)28 b(supp)r(orts)f(writing)g
+(them.)515 2475 y Fe(readLo)s(c)m(kbits\(\))42 b Fd(Read)31
b(the)h(Lo)r(c)n(kbit)g(memory)e(and)i(return)f(it.)49
-b(Reimplemen)n(t)32 b(this,)722 1877 y(if)c(y)n(our)f(DUT)h(has)f(Lo)r
+b(Reimplemen)n(t)32 b(this,)722 2575 y(if)c(y)n(our)f(DUT)h(has)f(Lo)r
(c)n(kbits)g(and)g(supp)r(orts)g(reading)g(them.)515
-2029 y Fe(writeLo)s(c)m(kbits\(\))41 b Fd(W)-7 b(rite)30
+2740 y Fe(writeLo)s(c)m(kbits\(\))41 b Fd(W)-7 b(rite)30
b(the)f(Lo)r(c)n(kbit)g(memory)-7 b(.)41 b(Reimplemen)n(t)29
-b(this,)h(if)g(y)n(our)d(DUT)722 2128 y(has)g(Lo)r(c)n(kbits)g(and)h
-(supp)r(orts)f(writing)g(them.)515 2265 y(After)f(de\034ning)g(y)n(our)
+b(this,)h(if)g(y)n(our)d(DUT)722 2840 y(has)g(Lo)r(c)n(kbits)g(and)h
+(supp)r(orts)f(writing)g(them.)515 3004 y(After)f(de\034ning)g(y)n(our)
e(\020Chip\021-deriv)n(ed)h(class)g(y)n(ou)g(need)h(to)f(register)g
-(it.)36 b(This)26 b(is)g(done)f(b)n(y)515 2365 y(de\034ning)i(a)g
-(ChipDescription\(\):)722 2610 y Fa(ChipDescription\(C)o(hi)o(p_)o(MyD)
+(it.)36 b(This)26 b(is)g(done)f(b)n(y)515 3103 y(de\034ning)i(a)g
+(ChipDescription\(\):)722 3383 y Fa(ChipDescription\(C)o(hi)o(p_)o(MyD)
o(ev)o(ic)o(e,)37 b(bitfile)k(=)i(\020bitfileID\021,)38
-b(chipID)j(=)j(\020myChipID\021\))515 2756 y Fd(The)39
+b(chipID)j(=)j(\020myChipID\021\))515 3563 y Fd(The)39
b(c)n(hip)g(class)f(\(_not_)g(an)h(instance)g(of)g(it\))g(is)g(passed)f
-(as)h(\034rst)f(parameter.)70 b(The)515 2855 y(ID)33
+(as)h(\034rst)f(parameter.)70 b(The)515 3663 y(ID)33
b(string)f(of)g(the)h(required)f(bit\034le)h(is)g(past)f(as)g(second)g
-(parameter.)50 b(A)33 b(c)n(hipID)g(migh)n(t)515 2955
+(parameter.)50 b(A)33 b(c)n(hipID)g(migh)n(t)515 3763
y(also)28 b(b)r(e)h(passed.)41 b(If)29 b(the)g(c)n(hipID)h(is)f
(omitted,)h(the)f(bit\034leID)h(is)f(used)g(as)f(c)n(hipID.)i(There)515
-3055 y(are)g(more)h(optional)g(parameters)e(to)j(ChipDescription\(\).)
-49 b(See)31 b(the)h(inline)g(sourceco)r(de)515 3154 y(do)r(cumen)n
-(tation)27 b(for)g(details.)515 3380 y Fb(5.2)112 b(FPGA)37
-b(b)s(ottom-half)g(implemen)m(tation)515 3534 y Fd(F)-7
+3862 y(are)g(more)h(optional)g(parameters)e(to)j(ChipDescription\(\).)
+49 b(See)31 b(the)h(inline)g(sourceco)r(de)515 3962 y(do)r(cumen)n
+(tation)27 b(for)g(details.)515 4194 y Fb(5.2)112 b(FPGA)37
+b(b)s(ottom-half)g(implemen)m(tation)515 4347 y Fd(F)-7
b(or)25 b(the)i(FPGA)h(part)e(y)n(ou)f(need)i(to)f(get)g(the)h(Xilinx)g
(dev)n(elopmen)n(t)f(suite)g(\(ISE\))i(v)n(ersion)515
-3633 y(10.1)d(service)g(pac)n(k)h(3.)36 b(The)26 b("W)-7
+4447 y(10.1)d(service)g(pac)n(k)h(3.)36 b(The)26 b("W)-7
b(ebP)g(A)n(CK",)26 b(whic)n(h)h(is)f(su\036cien)n(t)g(for)g(our)g
-(purp)r(oses,)f(can)515 3733 y(b)r(e)j(do)n(wnloaded)e(for)h(free)g
+(purp)r(oses,)f(can)515 4546 y(b)r(e)j(do)n(wnloaded)e(for)h(free)g
(\(as)g(in)h(b)r(eer\))g(from)f(the)h(Xilinx)g(homepage:)722
-3879 y Fa(http://www.xilinx)o(.c)o(om)o(/su)o(pp)o(or)o(t/d)o(ow)o(nl)o
-(oad)o(/i)o(nd)o(ex.)o(ht)o(m)515 4024 y Fd(T)-7 b(o)24
+4726 y Fa(http://www.xilinx)o(.c)o(om)o(/su)o(pp)o(or)o(t/d)o(ow)o(nl)o
+(oad)o(/i)o(nd)o(ex.)o(ht)o(m)515 4907 y Fd(T)-7 b(o)24
b(create)f(a)g(new)i(sourceco)r(de)d(template)j(\034leset)f(for)f(a)h
-(new)g(c)n(hip,)h(go)e(to)i(the)f(libtopram-)515 4124
+(new)g(c)n(hip,)h(go)e(to)i(the)f(libtopram-)515 5006
y(mer/bit/src/)h(sub)r(directory)i(and)g(execute)g(the)h("create.sh")e
-(script:)722 4270 y Fa(./create.sh)39 b(name_of_chip)515
-4416 y Fd(Where)34 b("name_of_c)n(hip")e(is)j(the)g(name)f(of)h(the)g
+(script:)1926 5255 y(5)p eop end
+%%Page: 6 6
+TeXDict begin 6 5 bop 722 523 a Fa(./create.sh)39 b(name_of_chip)515
+706 y Fd(Where)34 b("name_of_c)n(hip")e(is)j(the)g(name)f(of)h(the)g
(new)g(c)n(hip.)58 b(No)n(w)34 b(go)g(to)g(libtopram-)515
-4515 y(mer/bit/src/name_of_c)n(hip/)27 b(and)32 b(implemen)n(t)g(the)g
-(b)r(ottom-half)g(algorithm)f(in)h(the)515 4615 y(name_of_c)n(hip.v)f
-(V)-7 b(erilog)32 b(\034le.)53 b(T)-7 b(o)32 b(build)i(the)f(.BIT)g
+805 y(mer/bit/src/name_of_c)n(hip/)27 b(and)32 b(implemen)n(t)g(the)g
+(b)r(ottom-half)g(algorithm)f(in)h(the)515 905 y(name_of_c)n(hip.v)f(V)
+-7 b(erilog)32 b(\034le.)53 b(T)-7 b(o)32 b(build)i(the)f(.BIT)g
(\034le)g(from)f(the)i(V)-7 b(erilog)32 b(sources,)515
-4715 y(go)26 b(to)i(the)g(libtoprammer/bit/)e(directory)g(and)h
-(execute:)722 4860 y Fa(./build.sh)40 b(name_of_chip)515
-5006 y Fd(\(if)28 b(y)n(ou)f(omit)h(the)f(c)n(hipname,)h(all)f(c)n
-(hips)g(will)h(b)r(e)g(rebuilt\).)1926 5255 y(5)p eop
-end
-%%Page: 6 6
-TeXDict begin 6 5 bop 515 523 a Ff(6)131 b(Automatic)44
-b(la)l(y)l(out)h(generator)515 705 y Fd(The)39 b(automatic)f(la)n(y)n
-(out)g(generator)f(\(la)n(y)n(out_generator.p)n(y\))e(can)k(b)r(e)g
-(used)g(to)g(auto-)515 804 y(matically)27 b(generate)f(a)i(V)n
-(CC/VPP/GND)h(la)n(y)n(out.)36 b(The)28 b(generator)d(will)j(then)h
-(tell)f(y)n(ou)515 904 y(ho)n(w)j(to)i(insert)f(the)g(c)n(hip)h(in)n
-(to)f(the)g(ZIF)h(so)r(c)n(k)n(et.)50 b(The)32 b(adv)-5
-b(an)n(tage)31 b(of)h(using)g(the)h(auto-)515 1004 y(generator)d
-(instead)j(of)f(hardco)r(ding)g(the)h(V)n(CC/VPP/GND)g(connections)f
-(in)h(the)g(c)n(hip)515 1103 y(implemen)n(tation)26 b(is)f(that)h(the)h
-(autogenerated)d(la)n(y)n(out)g(is)i(p)r(ortable)f(b)r(et)n(w)n(een)h
-(TOPxxxx)515 1203 y(programmers)g(and)i(it)h(is)g(m)n(uc)n(h)f(easier)g
-(to)g(implemen)n(t.)41 b(Y)-7 b(ou)29 b(do)g(not)f(ha)n(v)n(e)g(to)g
-(searc)n(h)f(a)515 1303 y(c)n(hip)g(p)r(osition)g(in)h(the)f(ZIF)h(so)r
-(c)n(k)n(et)e(that)h(\034ts)h(the)f(device)g(constrain)n(ts.)36
-b(The)27 b(autogener-)515 1402 y(ator)f(will)i(do)f(it)h(for)f(y)n(ou.)
-639 1502 y(The)20 b(c)n(hip)g(in)n(terface)f(of)h(the)g(autogenerator)e
+1005 y(go)26 b(to)i(the)g(libtoprammer/bit/)e(directory)g(and)h
+(execute:)722 1187 y Fa(./build.sh)40 b(name_of_chip)515
+1370 y Fd(\(if)28 b(y)n(ou)f(omit)h(the)f(c)n(hipname,)h(all)f(c)n
+(hips)g(will)h(b)r(e)g(rebuilt\).)515 1644 y Ff(6)131
+b(Automatic)44 b(la)l(y)l(out)h(generator)515 1826 y
+Fd(The)39 b(automatic)f(la)n(y)n(out)g(generator)f(\(la)n(y)n
+(out_generator.p)n(y\))e(can)k(b)r(e)g(used)g(to)g(auto-)515
+1926 y(matically)27 b(generate)f(a)i(V)n(CC/VPP/GND)h(la)n(y)n(out.)36
+b(The)28 b(generator)d(will)j(then)h(tell)f(y)n(ou)515
+2025 y(ho)n(w)j(to)i(insert)f(the)g(c)n(hip)h(in)n(to)f(the)g(ZIF)h(so)
+r(c)n(k)n(et.)50 b(The)32 b(adv)-5 b(an)n(tage)31 b(of)h(using)g(the)h
+(auto-)515 2125 y(generator)d(instead)j(of)f(hardco)r(ding)g(the)h(V)n
+(CC/VPP/GND)g(connections)f(in)h(the)g(c)n(hip)515 2225
+y(implemen)n(tation)26 b(is)f(that)h(the)h(autogenerated)d(la)n(y)n
+(out)g(is)i(p)r(ortable)f(b)r(et)n(w)n(een)h(TOPxxxx)515
+2324 y(programmers)g(and)i(it)h(is)g(m)n(uc)n(h)f(easier)g(to)g
+(implemen)n(t.)41 b(Y)-7 b(ou)29 b(do)g(not)f(ha)n(v)n(e)g(to)g(searc)n
+(h)f(a)515 2424 y(c)n(hip)g(p)r(osition)g(in)h(the)f(ZIF)h(so)r(c)n(k)n
+(et)e(that)h(\034ts)h(the)f(device)g(constrain)n(ts.)36
+b(The)27 b(autogener-)515 2524 y(ator)f(will)i(do)f(it)h(for)f(y)n(ou.)
+639 2623 y(The)20 b(c)n(hip)g(in)n(terface)f(of)h(the)g(autogenerator)e
(is)h(em)n(b)r(edded)i(in)n(to)e(\020class)g(Chip\021.)34
-b(So)20 b(y)n(ou)515 1601 y(don't)28 b(ha)n(v)n(e)f(to)h(w)n(ork)f
+b(So)20 b(y)n(ou)515 2723 y(don't)28 b(ha)n(v)n(e)f(to)h(w)n(ork)f
(with)i(\020class)e(La)n(y)n(outGenerator\021)k(directly)-7
-b(.)39 b(Y)-7 b(ou'll)28 b(do)g(it)h(through)515 1701
+b(.)39 b(Y)-7 b(ou'll)28 b(do)g(it)h(through)515 2822
y(\020class)d(Chip\021)34 b(instead.)j(So)27 b(let's)h(lo)r(ok)f(at)g
(\020class)g(Chip\021s)g(autogenerator)e(in)n(terface.)639
-1801 y(The)j(constructor)e(\(__init__\(\)\))h(has)g(some)g
-(autogenerator)e(related)i(parameters:)515 1967 y Fe(c)m(hipP)m(ac)m(k)
+2922 y(The)j(constructor)e(\(__init__\(\)\))h(has)g(some)g
+(autogenerator)e(related)i(parameters:)515 3088 y Fe(c)m(hipP)m(ac)m(k)
-5 b(age)43 b Fd(This)36 b(parameter)e(is)i(a)f(string)h(iden)n
(tifying)g(the)g(pac)n(k)-5 b(age)34 b(t)n(yp)r(e)i(of)g(the)722
-2066 y(DUT)26 b(c)n(hip.)36 b(It)25 b(is)g(something)g(lik)n(e)f
+3188 y(DUT)26 b(c)n(hip.)36 b(It)25 b(is)g(something)g(lik)n(e)f
(\020DIP28\021)31 b(or)25 b(\020DIP40\021,)f(etc...)37
-b(.)f(If)25 b(this)h(param-)722 2166 y(eter)i(is)f(passed)g(to)g(the)h
+b(.)f(If)25 b(this)h(param-)722 3287 y(eter)i(is)f(passed)g(to)g(the)h
(constructor,)e(the)i(autogenerator)d(is)i(enabled.)515
-2332 y Fe(c)m(hipPin)-8 b(V)m(CCX)42 b Fd(This)34 b(parameter)e(is)i
+3453 y Fe(c)m(hipPin)-8 b(V)m(CCX)42 b Fd(This)34 b(parameter)e(is)i
(an)g(in)n(teger)f(sp)r(ecifying)h(the)h(V)n(CC)f(pin)g(on)g(the)722
-2432 y(c)n(hip)26 b(pac)n(k)-5 b(age.)35 b(Note)26 b(that)g(it)h(sp)r
+3553 y(c)n(hip)26 b(pac)n(k)-5 b(age.)35 b(Note)26 b(that)g(it)h(sp)r
(eci\034es)f(the)g(V)n(CC)g(pin)h(on)e(the)i(c)n(hip)f(pac)n(k)-5
-b(age)24 b(and)722 2531 y(_not_)h(on)g(the)g(ZIF)h(so)r(c)n(k)n(et.)35
+b(age)24 b(and)722 3653 y(_not_)h(on)g(the)g(ZIF)h(so)r(c)n(k)n(et.)35
b(So)25 b(if)g(y)n(our)g(c)n(hip)g(datasheet)f(tells)i(y)n(ou)e(that)i
-(V)n(CC)f(is)722 2631 y(on)j(pin)g(8,)f(y)n(ou)g(pass)f(an)i(8)f(here.)
-515 2797 y Fe(c)m(hipPinsVPP)42 b Fd(This)27 b(parameter)e(is)i(an)f
+(V)n(CC)f(is)722 3752 y(on)j(pin)g(8,)f(y)n(ou)g(pass)f(an)i(8)f(here.)
+515 3918 y Fe(c)m(hipPinsVPP)42 b Fd(This)27 b(parameter)e(is)i(an)f
(in)n(teger)g(or)h(a)f(list)h(of)g(in)n(tegers)f(sp)r(ecifying)h(the)
-722 2897 y(VPP)34 b(pin\(s\))f(on)f(the)h(c)n(hip)f(pac)n(k)-5
+722 4018 y(VPP)34 b(pin\(s\))f(on)f(the)h(c)n(hip)f(pac)n(k)-5
b(age.)49 b(Note)32 b(that)h(it)g(sp)r(eci\034es)f(the)h(V)n(CC)f(pin)g
-(on)722 2996 y(the)27 b(c)n(hip)f(pac)n(k)-5 b(age)24
+(on)722 4118 y(the)27 b(c)n(hip)f(pac)n(k)-5 b(age)24
b(and)i(_not_)g(on)f(the)i(ZIF)f(so)r(c)n(k)n(et.)35
-b(So)26 b(if)h(y)n(our)e(c)n(hip)h(datasheet)722 3096
+b(So)26 b(if)h(y)n(our)e(c)n(hip)h(datasheet)722 4217
y(tells)35 b(y)n(ou)e(that)h(V)n(CC)g(is)g(on)g(pin)h(1,)g(y)n(ou)f
(pass)f(an)h(1)g(here.)56 b(If)34 b(y)n(our)f(c)n(hip)h(needs)722
-3196 y(m)n(ultiple)d(VPP)h(v)n(oltages,)d(just)i(pass)f(a)g(list)h(of)f
+4317 y(m)n(ultiple)d(VPP)h(v)n(oltages,)d(just)i(pass)f(a)g(list)h(of)f
(pins.)46 b(Sp)r(ecify)31 b(all)f(p)r(ossible)g(VPP)722
-3295 y(pins)25 b(here.)35 b(Whic)n(h)25 b(pin)g(is)g(actually)e(activ)
+4416 y(pins)25 b(here.)35 b(Whic)n(h)25 b(pin)g(is)g(actually)e(activ)
-5 b(ated)25 b(is)f(decided)h(later)f(in)h(applyVPP\(\).)515
-3461 y Fe(c)m(hipPinGND)41 b Fd(This)d(parameter)e(is)i(an)g(in)n
+4583 y Fe(c)m(hipPinGND)41 b Fd(This)d(parameter)e(is)i(an)g(in)n
(teger)e(sp)r(ecifying)i(the)g(GND)h(pin)f(on)g(the)722
-3561 y(c)n(hip)26 b(pac)n(k)-5 b(age.)35 b(Note)26 b(that)g(it)h(sp)r
+4682 y(c)n(hip)26 b(pac)n(k)-5 b(age.)35 b(Note)26 b(that)g(it)h(sp)r
(eci\034es)f(the)g(V)n(CC)g(pin)h(on)e(the)i(c)n(hip)f(pac)n(k)-5
-b(age)24 b(and)722 3660 y(_not_)h(on)g(the)g(ZIF)h(so)r(c)n(k)n(et.)35
+b(age)24 b(and)722 4782 y(_not_)h(on)g(the)g(ZIF)h(so)r(c)n(k)n(et.)35
b(So)25 b(if)g(y)n(our)g(c)n(hip)g(datasheet)f(tells)i(y)n(ou)e(that)i
-(V)n(CC)f(is)722 3760 y(on)j(pin)g(5,)f(y)n(ou)g(pass)f(an)i(5)f(here.)
-515 3926 y(After)h(passing)e(all)h(parameters)f(to)h(the)h(\020class)e
-(Chip\021)34 b(constructor,)26 b(the)i(autogenerator)515
-4026 y(is)c(initialized)h(and)f(ready)g(to)g(b)r(e)h(used.)36
-b(The)24 b(follo)n(wing)g(metho)r(ds)g(can)h(b)r(e)g(used)f(to)g(apply)
-515 4125 y(or)i(disable)i(a)f(la)n(y)n(out:)515 4291
-y Fe(applyV)m(CCX\(on\))42 b Fd(This)27 b(metho)r(d)h(enables)f(or)f
-(disables)g(\(dep)r(ending)i(on)f(the)h(param-)722 4391
+(V)n(CC)f(is)722 4881 y(on)j(pin)g(5,)f(y)n(ou)g(pass)f(an)i(5)f(here.)
+1926 5255 y(6)p eop end
+%%Page: 7 7
+TeXDict begin 7 6 bop 515 523 a Fd(After)28 b(passing)e(all)h
+(parameters)f(to)h(the)h(\020class)e(Chip\021)34 b(constructor,)26
+b(the)i(autogenerator)515 623 y(is)c(initialized)h(and)f(ready)g(to)g
+(b)r(e)h(used.)36 b(The)24 b(follo)n(wing)g(metho)r(ds)g(can)h(b)r(e)g
+(used)f(to)g(apply)515 722 y(or)i(disable)i(a)f(la)n(y)n(out:)515
+888 y Fe(applyV)m(CCX\(on\))42 b Fd(This)27 b(metho)r(d)h(enables)f(or)
+f(disables)g(\(dep)r(ending)i(on)f(the)h(param-)722 988
y(eter\))37 b(a)f(la)n(y)n(out.)63 b(Enabling)37 b(the)g(la)n(y)n(out)f
(means)g(that)h(the)g(V)n(CCX)g(pin)g(will)g(b)r(e)722
-4491 y(activ)n(ely)22 b(driv)n(en)h(b)n(y)f(the)i(con\034gured)d(V)n
+1088 y(activ)n(ely)22 b(driv)n(en)h(b)n(y)f(the)i(con\034gured)d(V)n
(CCX)j(v)n(oltage.)33 b(Disabling)23 b(the)g(la)n(y)n(out)f(will)722
-4590 y(tristate)27 b(the)h(driv)n(er.)515 4756 y Fe(applyVPP\(on,pac)m
+1187 y(tristate)27 b(the)h(driv)n(er.)515 1353 y Fe(applyVPP\(on,pac)m
(k)-5 b(agePinsT)d(oT)g(urnOn\))43 b Fd(This)18 b(metho)r(d)h(enables)f
-(or)f(disables)h(\(de-)722 4856 y(p)r(ending)29 b(on)e(the)i
+(or)f(disables)h(\(de-)722 1453 y(p)r(ending)29 b(on)e(the)i
(parameter\))d(a)i(la)n(y)n(out.)37 b(Enabling)28 b(the)g(la)n(y)n(out)
-f(means)g(that)i(the)722 4956 y(VPP)22 b(pins)f(will)f(b)r(e)h(activ)n
+f(means)g(that)i(the)722 1553 y(VPP)22 b(pins)f(will)f(b)r(e)h(activ)n
(ely)f(driv)n(en)g(b)n(y)g(the)h(con\034gured)e(VPP)j(v)n(oltage.)32
-b(Disabling)1926 5255 y(6)p eop end
-%%Page: 7 7
-TeXDict begin 7 6 bop 722 523 a Fd(the)32 b(la)n(y)n(out)d(will)j
-(tristate)e(the)i(driv)n(er.)46 b(The)31 b(\034rst)g(parameter)e
-(\020on\021)37 b(is)31 b(a)g(b)r(o)r(olean)722 623 y(to)24
-b(turn)g(ON)g(or)f(OFF)h(the)g(VPP)h(la)n(y)n(out.)35
-b(The)24 b(second)f(parameter)f(is)i(an)g(optional)722
-722 y(list)f(of)g(pac)n(k)-5 b(age-pin-n)n(um)n(b)r(ers)21
-b(sp)r(ecifying)h(whic)n(h)h(VPP)h(is)f(turned)g(on.)35
-b(If)24 b(the)f(sec-)722 822 y(ond)28 b(parameter)e(is)h(not)g(passed,)
-g(all)g(p)r(ossible)g(VPPs)i(that)f(w)n(ere)e(sp)r(eci\034ed)i(in)g
-(the)722 922 y(constructor)21 b(are)h(turned)h(on.)34
+b(Disabling)722 1652 y(the)g(la)n(y)n(out)d(will)j(tristate)e(the)i
+(driv)n(er.)46 b(The)31 b(\034rst)g(parameter)e(\020on\021)37
+b(is)31 b(a)g(b)r(o)r(olean)722 1752 y(to)24 b(turn)g(ON)g(or)f(OFF)h
+(the)g(VPP)h(la)n(y)n(out.)35 b(The)24 b(second)f(parameter)f(is)i(an)g
+(optional)722 1851 y(list)f(of)g(pac)n(k)-5 b(age-pin-n)n(um)n(b)r(ers)
+21 b(sp)r(ecifying)h(whic)n(h)h(VPP)h(is)f(turned)g(on.)35
+b(If)24 b(the)f(sec-)722 1951 y(ond)28 b(parameter)e(is)h(not)g
+(passed,)g(all)g(p)r(ossible)g(VPPs)i(that)f(w)n(ere)e(sp)r(eci\034ed)i
+(in)g(the)722 2051 y(constructor)21 b(are)h(turned)h(on.)34
b(The)23 b(second)f(parameter)f(is)h(un)n(used,)i(if)f(\020on=F)-7
-b(alse\021.)515 1088 y Fe(applyGND\(on\))42 b Fd(This)34
+b(alse\021.)515 2217 y Fe(applyGND\(on\))42 b Fd(This)34
b(metho)r(d)g(enables)g(or)g(disables)f(\(dep)r(ending)i(on)f(the)h
-(param-)722 1187 y(eter\))j(a)g(la)n(y)n(out.)67 b(Enabling)38
+(param-)722 2316 y(eter\))j(a)g(la)n(y)n(out.)67 b(Enabling)38
b(the)g(la)n(y)n(out)f(means)h(that)g(the)g(GND)h(pins)f(will)h(b)r(e)
-722 1287 y(activ)n(ely)27 b(driv)n(en)g(b)n(y)g(GND.)i(Disabling)e(the)
+722 2416 y(activ)n(ely)27 b(driv)n(en)g(b)n(y)g(GND.)i(Disabling)e(the)
h(la)n(y)n(out)e(will)i(tristate)f(the)h(driv)n(er.)1926
5255 y(7)p eop end
%%Trailer
diff --git a/libtoprammer/chip.py b/libtoprammer/chip.py
index 4a264ad..f778733 100644
--- a/libtoprammer/chip.py
+++ b/libtoprammer/chip.py
@@ -185,6 +185,13 @@ class Chip:
self.top.progressMeter(AbstractUserInterface.PROGRESSMETER_CHIPACCESS,
step)
+ def genericTest(self, readFunc, writeFunc, size):
+ "Generic test. Call from test() in the chip implementation, if desired."
+ image = genRandomBlob(size)
+ writeFunc(image)
+ if readFunc() != image:
+ self.throwError("Unit-test failed. The chip may be physically broken.")
+
def shutdownChip(self):
# Override me in the subclass, if required.
self.printDebug("Default chip shutdown")
@@ -202,6 +209,10 @@ class Chip:
# Override me in the subclass, if required.
raise TOPException("Chip erasing not supported on " + self.chipID)
+ def test(self):
+ # Override me in the subclass, if required.
+ raise TOPException("Chip testing not supported on " + self.chipID)
+
def readProgmem(self):
# Override me in the subclass, if required.
raise TOPException("Program memory reading not supported on " + self.chipID)
diff --git a/libtoprammer/chip_generic_sram.py b/libtoprammer/chip_generic_sram.py
index 9f7b8f8..c682447 100644
--- a/libtoprammer/chip_generic_sram.py
+++ b/libtoprammer/chip_generic_sram.py
@@ -37,17 +37,13 @@ class Chip_genericSRAM(Chip):
self.nrDataBits = nrDataBits
assert(nrDataBits == 8)
- def shutdownChip(self):
- self.printDebug("Shutdown chip")
- # Keep it powered up
- self.top.cmdSetVCCXVoltage(self.VCCXVoltage)
- self.applyVCCX(True)
- self.applyVPP(False)
- self.applyGND(True)
-
def erase(self):
self.writeRAM(chr(0) * self.__sizeBytes())
+ def test(self):
+ self.genericTest(self.readRAM, self.writeRAM,
+ self.__sizeBytes())
+
def readRAM(self):
image = []
diff --git a/libtoprammer/toprammer_main.py b/libtoprammer/toprammer_main.py
index 3d6ddbd..cc9bea9 100644
--- a/libtoprammer/toprammer_main.py
+++ b/libtoprammer/toprammer_main.py
@@ -317,6 +317,12 @@ class TOP:
self.checkChip()
self.chip.erase()
+ def testChip(self):
+ """Run a unit-test on the chip."""
+ self.printDebug("Running chip unit-test...")
+ self.checkChip()
+ self.chip.test()
+
def readProgmem(self):
"""Reads the program memory image and returns it."""
self.printDebug("Reading program memory from chip...")
diff --git a/libtoprammer/util.py b/libtoprammer/util.py
index 72e47e0..09bedb4 100644
--- a/libtoprammer/util.py
+++ b/libtoprammer/util.py
@@ -3,7 +3,7 @@
#
# Utility functions
#
-# Copyright (c) 2009-2010 Michael Buesch <mb@bu3sch.de>
+# Copyright (c) 2009-2011 Michael Buesch <mb@bu3sch.de>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -23,10 +23,17 @@
import sys
import re
import math
+import random
class TOPException(Exception): pass
+def genRandomBlob(size):
+ blob = []
+ for i in range(0, size):
+ blob.append(chr(random.randint(0, 0xFF)))
+ return "".join(blob)
+
def nrBitsSet(integer):
count = 0
while integer:
diff --git a/tests/run-tests.sh b/tests/run-tests.sh
index 3592a83..b18d352 100755
--- a/tests/run-tests.sh
+++ b/tests/run-tests.sh
@@ -52,8 +52,8 @@ function toprammer
local args="$@"
local logfile="$tmpdir/toprammer.log"
- [ -n "$current_chipid" ] && args="$args --chip-id $current_chipid"
- args="$args -B -I bin -O bin"
+ [ -n "$current_chipid" ] && args="--chip-id $current_chipid $args"
+ args="-B -I bin -O bin $args"
echo " toprammer $args"
cd "$basedir/.." || die "Failed to chdir"
diff --git a/tests/top2049/004-hm62256dip28.test b/tests/top2049/004-hm62256dip28.test
index 84a7279..06c1354 100644
--- a/tests/top2049/004-hm62256dip28.test
+++ b/tests/top2049/004-hm62256dip28.test
@@ -8,7 +8,5 @@ function test_init
function test_run
{
- toprammer --write-ram "$testfile_32k"
- toprammer --read-ram "$tmpfile"
- compare_files "$testfile_32k" "$tmpfile" || die "RAM mismatch"
+ toprammer --test
}
diff --git a/toprammer b/toprammer
index 23732db..cde6a90 100755
--- a/toprammer
+++ b/toprammer
@@ -37,6 +37,7 @@ def usage():
print "Actions:"
print " -s|--read-sig FILE Read the signature bytes"
print " -x|--erase Erase the chip"
+ print " -T|--test Run chip unit-test"
print ""
print " -p|--read-prog FILE Read the program memory"
print " -P|--write-prog FILE Write the program memory"
@@ -124,9 +125,9 @@ def main(argv):
opt_outformat = "bin"
try:
(opts, args) = getopt.getopt(sys.argv[1:],
- "hc:d:V:Qs:xp:P:e:E:f:F:o:Ul:L:r:R:BtI:O:",
+ "hc:d:V:Qs:xTp:P:e:E:f:F:o:Ul:L:r:R:BtI:O:",
[ "help", "chip-id=", "device=", "verbose=", "noqueue",
- "read-sig=", "erase", "read-prog=", "write-prog=",
+ "read-sig=", "erase", "test", "read-prog=", "write-prog=",
"read-eeprom=", "write-eeprom=", "read-fuse=", "write-fuse=",
"read-lock=", "write-lock=", "read-ram=", "write-ram=",
"force=", "force-upload", "broken", "list",
@@ -165,6 +166,8 @@ def main(argv):
opt_file = v
if o in ("-x", "--erase"):
opt_action = "erase"
+ if o in ("-T", "--test"):
+ opt_action = "test"
if o in ("-P", "--write-prog"):
opt_action = "write-prog"
opt_file = v
@@ -222,6 +225,8 @@ def main(argv):
fileOut(opt_file, opt_outformat, top.readSignature())
elif opt_action == "erase":
top.eraseChip()
+ elif opt_action == "test":
+ top.testChip()
elif opt_action == "read-prog":
fileOut(opt_file, opt_outformat, top.readProgmem())
elif opt_action == "write-prog":
bues.ch cgit interface