1 <!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Transitional//EN"
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5 <link rel=
"stylesheet" media=
"screen" type=
"text/css" href=
"./style.css" />
6 <link rel=
"stylesheet" media=
"screen" type=
"text/css" href=
"./design.css" />
7 <link rel=
"stylesheet" media=
"print" type=
"text/css" href=
"./print.css" />
9 <meta http-equiv=
"Content-Type" content=
"text/html; charset=utf-8" />
14 <em>Translations of this page are also available in the following languages:
</em> <a href=
"geda-faq-gnetlist.fr.html" class=
"wikilink1" title=
"geda-faq-gnetlist.fr.html">Français
</a>,
<a href=
"geda-faq-gnetlist.ru.html" class=
"wikilink1" title=
"geda-faq-gnetlist.ru.html">Русский
</a>.
17 <h1 id=
"gnetlist">Gnetlist
</h1>
22 <h1 id=
"billofmaterialsbomgeneration">Bill of Materials (BOM) Generation
</h1>
26 There are five different backends for gnetlist which enable you to export a BOM. Call them with -g and be sure to give the output file name with the -o option:
28 <pre class=
"code"> gnetlist -g partslist3 -o output.bom schematic.sch
</pre>
31 gnetlist descends into sub sheets and list the contents of these schematics along with the parts from the top document.
35 The backends bom and bom2 require read access to a local file called attribs. This file should contain the name of the attributes to be listed each in a seperate line. E.g:
37 <pre class=
"code">value
42 Each of the backends lists and sorts the parts in different ways in an ascii file. Choose the one you like best:
51 The bom backend needs to read an attribs file (see above). The list produced by
"-g bom
" will contain as many lines as there are components. Columns are seperated by tab characters. Lines are not sorted.
56 <h4 id=
"bom2">bom2
</h4>
60 The bom2 backend also needs to read an attribs file. With
"-g bom2
" the refdeses of all components with the same value will be collected into a single line. Columns are seperated by colons. Different items in the same column are seperated by a komma character.
65 <h4 id=
"partslist1">partslist1
</h4>
69 A list produced by the partlist1 backend gives a line for each and every component. Lines are sorted alphabetically by refdes. Columns are
"refdes
",
"device
",
"value
",
"footprint
" and
"quantity
". Since every line contains just one part, the quantity is always
"1".
74 <h4 id=
"partslist2">partslist2
</h4>
78 This backend produces output similar to partslist1. Lines are sorted by the value of the device attribute.
83 <h4 id=
"partslist3">partslist3
</h4>
87 The backend partslist3 assembles all parts with the same value in a single line, very much like bom2. Lines are sorted by the value of the device attribute. The fourth column reports the number of parts in a line. Columns are seperated by the tab character, items by space.
92 <h1 id=
"designrulecheckdrc">Design Rule Check (DRC)
</h1>
97 <h2 id=
"howdoicheckmyschematics">How do I check my schematics?
</h2>
101 You can check your schematics using the drc2 gnetlist’s backend. It will check your schematics for some common errors, like duplicate references, unconnected pins, unused slots and more.
105 Run the drc2 backend with the following command:
107 <pre class=
"code">gnetlist -g drc2 -o MyDesign.drc MyDesign.sch
</pre>
110 With this command, the DRC output is written into the file “MyDesign.drc”. You can then view this file with a text editor and see the DRC warnings and errors.
115 <h2 id=
"howdoiseethedrcoutputinthescreenwithoutwritingtoafile">How do I see the DRC output in the screen, without writing to a file?
</h2>
119 Run the drc2 backend with the following command:
121 <pre class=
"code">gnetlist -g drc2 -o - MyDesign.sch
</pre>
124 This way, you will see the DRC output directly in your screen.
129 <h2 id=
"iwanttodisablesomeoftheschematicdrccheckshowcanidoit">I want to disable some of the schematic DRC checks. How can I do it?
</h2>
133 The drc2 backend is highly configurable. You have to put some special commands into a file and use the “-l” option of gnetlist with it.
137 The most common commands are:
140 <li class=
"level1"><div class=
"li"> (define dont-check-non-numbered-parts
1) ;; Disable the non-numbered parts check
</div>
142 <li class=
"level1"><div class=
"li"> (define dont-check-duplicated-references
1) ;; Disable the duplicate references check
</div>
144 <li class=
"level1"><div class=
"li"> (define dont-check-one-connection-nets
1) ;; Disable the check for nets with only one connection.
</div>
146 <li class=
"level1"><div class=
"li"> (define dont-check-pintypes-of-nets
1) ;; Disable the pintype check
</div>
148 <li class=
"level1"><div class=
"li"> (define dont-check-not-driven-nets
1) ;; Disable the driven net check
</div>
150 <li class=
"level1"><div class=
"li"> (define dont-check-unconnected-pins
1) ;; Disable the unconnected pins check
</div>
152 <li class=
"level1"><div class=
"li"> (define dont-check-duplicated-slots
1) ;; Disable the duplicated slots check
</div>
154 <li class=
"level1"><div class=
"li"> (define dont-check-unused-slots
1) ;; Disable the unused slots check
</div>
156 <li class=
"level1"><div class=
"li"> (define dont-check-slots
1) ;; Disable slot number check
</div>
158 <li class=
"level1"><div class=
"li"> (define action-unused-slots #\w) ;; Output an unused slots as a warning
</div>
160 <li class=
"level1"><div class=
"li"> (define action-unused-slots #\e) ;; Output an unused slots as an error
</div>
162 <li class=
"level1"><div class=
"li"> (define action-unused-slots #\c) ;; An unused slot is OK.
</div>
164 <li class=
"level1"><div class=
"li"> (define case_insensitive
1) ;; Do all checks case insensitive
</div>
169 There are some other advanced commands, to modify the DRC matrix and the pintype which can drive a net. See the backend file “gnet-drc2.scm” with a text editor. At the beginning there is the available documentation.
173 Copy the above lines you want into a file (for example “drc_rules.txt”), one per line, and run the drc checker:
175 <pre class=
"code">gnetlist -g drc2 -l drc_rules.txt -o MyDesign.drc MyDesign.sch
</pre>
178 With this command, the DRC output is written into the file “MyDesign.drc”. You can then view this file with a text editor and see the DRC warnings and errors.
183 <h2 id=
"caniincludethedrccheckingintoamakefileandstopwhenerrorsorwarningsarefound">Can I include the DRC checking into a Makefile and stop when errors or warnings are found?
</h2>
187 Yes. The drc2 backend will return an error if there are errors or warnings, so you can add the following to your Makefile:
189 <pre class=
"code">$(objects).drc : $(objects).sch
190 gnetlist -g drc2 $(objects).sch -o $(objects).drc
</pre>
193 If you are going to simulate your design, then you can add the following to your Makefile:
195 <pre class=
"code">$(objects).cir : $(objects).sch $(objects).drc
196 grep -v ERROR $(objects).drc
>/dev/null
2>&1
197 gnetlist -g spice-sdb $(objects).sch -o $(objects).cir
</pre>
200 If not, please use the above example and adapt it to your own workflow.
205 <h2 id=
"therearesomewarningsinmydesignimawareofcaniignorethewarningsinthereturnvalue">There are some warnings in my design I
'm aware of. Can I ignore the warnings in the return value?
</h2>
209 Use the “-O ignore-warnings-in-return-value” option:
211 <pre class=
"code">gnetlist -g drc2 -o - MyDesign.sch -O ignore-warnings-in-return-value
</pre>
214 Do this with caution! You will be missing all the warnings!
219 <h1 id=
"gnetlistbuildrun-timeproblems">Gnetlist build/run-time problems
</h1>
224 <h2 id=
"igetaparenthesismismatcherrorwhenrunninggnetlistwhatsup">I get a
"parenthesis mismatch
" error when running gnetlist. What
's up?
</h2>
228 Starting with Fedorea Core
6 and SuSE
10.2, many users have reported an error which looks like this:
230 <pre class=
"code">$gnetlist -g spice-sdb -o TwoStageAmp.cir TwoStageAmp.sch
231 Command line passed = gnetlist -g spice-sdb -o TwoStageAmp.cir TwoStageAmp.sch
232 gEDA/gnetlist version
20061020
233 gEDA/gnetlist comes with ABSOLUTELY NO WARRANTY; see COPYING for more details.
234 This is free software, and you are welcome to redistribute it under certain
235 conditions; please see the COPYING file for more details.
237 Remember to check that your schematic has no errors using the drc2 backend.
238 You can do it running
'gnetlist -g drc2 your_schematic.sch -o drc_output.txt
'
239 and seeing the contents of the file drc_output.txt.
241 Loading schematic [/home/nano/TwoStageAmp/TwoStageAmp.sch]
242 Probably parenthesis mismatch in /usr/share/gEDA/scheme/gnet-spice-sdb.scm
243 Most recently read form: (#@begin #
<unspecified
>)
244 ERROR: Unbound variable: spice-sdb
</pre>
247 Several gnetlist backends evince this problem, including spice-sdb and drc2.
251 This is a bug in guile-
1.8.X. The gEDA developers are working on a fix. Meanwhile, try to backrev your version of guile to
1.6.7, which is known to work flawlessly with gEDA.
256 <h2 id=
"thegnetlistbombackenddoesnotworkwhatiswrong">The gnetlist bom backend does not work. What is wrong?
</h2>
260 If when running gnetlist like this:
262 <pre class=
"code">gnetlist -g bom filename.sch
</pre>
265 and gnetlist outputs an error message like:
267 <pre class=
"code">Loading schematic [filename.sch]
268 ERROR: In procedure open-file:
269 ERROR: No such file or directory: “attribs”
</pre>
272 then you need to create a file called “attribs” in the current directory which contains the attributes which you want inside the bom file. An example of this file would be:
274 <pre class=
"code">device
278 For information about BOM generation see
<a href=
"#billofmaterialsbomgeneration" title=
":geda:faq-gnetlist.txt ↵" class=
"wikilink1">above
</a>.
283 <h2 id=
"somegnetlistbackendsoverflowthestackhowdoisolvethis">Some gnetlist backends overflow the stack. How do I solve this?
</h2>
287 If you get an error message like:
289 <pre class=
"code">ERROR: Stack overflow
</pre>
292 when running certain larger sized schematics through some of the backends, then add the following to a
<strong><code>~/.gEDA/gnetlistrc
</code></strong> or a local
<strong><code>gnetlistrc
</code></strong> (in the current working directory):
294 <pre class=
"code">(debug-options (list
'stack
200000))
295 (eval-options (list
'stack
200000))
</pre>
298 If this does not work, then edit the appropriate backend (usually named: gnet-backend_name.scm) and put the above lines at the top of this file. The gnetlist backends can be found in
<strong><code>${prefix}/share/gEDA/scheme
</code></strong>. Also send an e-mail to geda-user reminding the developers to fix this. Remember, you must subscribe to geda-user before you can post to the list.
303 <h2 id=
"gnetlisthascreatedanetlistwithduplicatepins">gnetlist has created a netlist with duplicate pins!?
</h2>
307 There has been at least one report of the following message coming from PCB after loading up a netlist created by gnetlist:
309 <pre class=
"code">28: Error! Element R117 pin
2 appears multiple times in the netlist file.
310 29: Error! Element C167 pin
2 appears multiple times in the netlist file.
</pre>
313 What has happened is gnetlist (really libgeda) created two nets instead of one. This happens when you draw two nets that cross each other and a pin connecting to the intersection of the two crossing nets. Note the cross nets are not connected together. A schematic which demonstrates this looks like this:
317 <a href=
"media/geda/ambiguous1.png" class=
"media" target=
"_blank" title=
"geda:ambiguous1.png">geda:ambiguous1.png
</a>
321 The developers are debating whether or not this is a bug in gnetlist, but for now make sure your net connections, especially those that involve pins connecting to the middle of other nets, are explicitly drawn. Here is how the above connection should be drawn to netlist properly:
325 <a href=
"media/geda/ambiguous1_fixed.png" class=
"media" target=
"_blank" title=
"geda:ambiguous1_fixed.png">geda:ambiguous1_fixed.png
</a>