Date:2010-10-16 13:18:51 (7 years 9 months ago)
Author:Werner Almesberger
Commit:df88430d481371a4167876df61a6e018a6ca4f12
Message:Test query to exercise the big resistor database we now have.

- boom/test.mbq: sample query (a bunch of 0402 resistors)
- boom/test.sub: basic substitution rules
- boom/Makefile: tie it all together
Files: boom/Makefile (1 diff)
boom/test.mbq (1 diff)
boom/test.sub (1 diff)

Change Details

boom/Makefile
1BOOM=PATH=/home/moko/svn.openmoko.org/trunk/eda/boom:../boom:$$PATH boom
2
3KITS = 1
4
5INV = dist/dk/db/digi-key.inv
6EQU = dist/dk/db/digi-key.equ
7DSC = dist/dk/db/digi-key.dsc
8CHR = manu/panasonic/panasonic.chr manu/stackpole/stackpole.chr
9
10.PHONY: all show again
11
12all: show
13
14show: test.ord $(DSC)
15        $(BOOM) prettyord -t $^
16
17again:
18        $(MAKE) spotless
19        $(MAKE) all
20
21test.ord: test.par $(INV) $(EQU)
22        $(BOOM) part2order $(KITS) $^ >$@ || { rm -f $@; exit 1; }
23
24test.par: $(EQU) $(INV) $(CHR) test.lst test.sub
25        $(BOOM) bom2part $^ >$@ || { rm -f $@; exit 1; }
26
27test.lst: test.mbq
28        perl ./mbq2lst $^ >$@ || { rm -f $@; exit 1; }
29
30spotless:
31        rm -f test.lst test.par test.ord
boom/test.mbq
11 R 0402 12R
21 R 0402 15R
31 R 0402 36R
41 R 0402 47R
51 R 0402 68R
61 R 0402 82R
7
81 R 0402 120R
91 R 0402 150R
101 R 0402 360R
111 R 0402 470R
121 R 0402 680R
131 R 0402 820R
14
151 R 0402 1k2
161 R 0402 1k5
171 R 0402 3k6
181 R 0402 4k7
191 R 0402 6k8
201 R 0402 8k2
21
221 R 0402 12k
231 R 0402 15k
241 R 0402 36k
251 R 0402 47k
261 R 0402 68k
271 R 0402 82k
28
291 R 0402 120k
301 R 0402 150k
311 R 0402 360k
321 R 0402 470k
331 R 0402 680k
341 R 0402 820k
boom/test.sub
1#SUB
2
3# Taken from ben-wpan. Removed anything project-specific but the translation
4# rules.
5
6-> T=unknown
7
8R[0-9P]* { # also handle RP...
9    -> T=R
10    VAL=$R -> R=$VAL
11# -> TOL=5%
12    FN=$% -> TOL=$FN
13}
14
15RP[0-9]* {
16    -> T=RA
17    # the other parameters have already been taken care of by R*
18}
19
20C[0-9]* {
21    -> T=C
22    VAL=*F -> C=$VAL
23    FN=*V -> V=>=$FN
24}
25
26L[0-9]* {
27    -> T=L
28    VAL=*H -> L=$VAL
29    FN=*A -> I=>=$FN
30}
31
32B[0-9]* {
33    -> T=FILTER M=BEAD
34    VAL=$R -> R=$VAL
35    FN=*A -> I=$FN
36    FN=*R -> Rdc=$FN
37}
38
39D[0-9]* {
40    -> T=D
41    VAL=*F { # heuristic to detect TVS
42    -> M=TVS
43    VAL=*F -> C=<=$VAL
44    FN=(*V)ac -> Vac=$FN:1
45    FN=(*V)dc -> Vdc=$FN:1
46
47    #
48    # Hack: some companies specify the class of varistors with Vdc = 9 V
49    # as Vac = 6.5 V while others use Vac = 7 V. Sometimes, Vac is even
50    # omitted entirely.
51    #
52    # Here, we work around the issue that Karmax use Vac = 6.5 V,
53    # Cooper/Bussmann use Vac = 7V if at all, and out schematics specify
54    # Vac = 6.5 V.
55    #
56    Vac=6.5V {
57        -> Vac=
58        -> Vdc=9V
59    }
60    }
61}

Archive Download the corresponding diff file

Branches:
master



interactive