Update wiki pages
[geda-gaf.git] / docs / wiki / geda-gnetlist_scheme_primitives.html
blob96a5e83181a9b22e5b32a30511b69722af8de43d
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html>
4 <head>
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" />
10 </head>
11 <body>
13 <h1 class="sectionedit1" id="gnetlist_scheme_primitives">gnetlist Scheme primitives</h1>
14 <div class="level1">
16 <p>
17 Originally written by <em>John Doty</em>
18 </p>
19 <div class="table sectionedit2"><table class="inline">
20 <tr class="row0">
21 <th class="col0 leftalign"> <strong>Procedure</strong> </th><td class="col1"> <strong>gnetlist:get-packages</strong> <em>level</em> </td>
22 </tr>
23 <tr class="row1">
24 <td class="col0" colspan="2"> Yields a list of refdes values for the set of schematics. Duplicated values are only listed once. The string <em>level</em> must be present, but is unused.<br/>
25 <strong>Usage:</strong> <code>(gnelist:get-packages &quot;&quot;)</code> </td>
26 </tr>
27 <tr class="row2">
28 <th class="col0 leftalign"> <strong>Procedure</strong> </th><td class="col1"> <strong>gnetlist:get-non-unique-packages</strong> <em>level</em> </td>
29 </tr>
30 <tr class="row3">
31 <td class="col0" colspan="2"> The same as <strong>gnetlist:get-packages</strong>, but duplicated values are listed as many times as they appear. <br/>
32 <strong>Usage:</strong> <code>(gnetlist:get-non-unique-packages &quot;&quot;)</code> </td>
33 </tr>
34 <tr class="row4">
35 <th class="col0 leftalign"> <strong>Procedure</strong> </th><td class="col1"> <strong>gnetlist:get-pins</strong> <em>refdes</em> </td>
36 </tr>
37 <tr class="row5">
38 <td class="col0" colspan="2"> Yields a list of pin numbers for the specified <em>refdes</em> value, which must be a string. <br/>
39 <strong>Usage:</strong> <code>(gnetlist:get-pins &quot;R1&quot;)</code> </td>
40 </tr>
41 <tr class="row6">
42 <th class="col0 leftalign"> <strong>Procedure</strong> </th><td class="col1"> <strong>gnetlist:get-all-nets</strong> <em>level</em> </td>
43 </tr>
44 <tr class="row7">
45 <td class="col0" colspan="2"> Yields a list of net names of nets connected to pins of all components for the set of schematics. Duplicated values are listed as many times as they appear once per pin. The string <em>level</em> must be present, but is unused. <br/>
46 <strong>Usage:</strong> <code>(gnetlist:get-all-nets &quot;&quot;)</code> </td>
47 </tr>
48 <tr class="row8">
49 <th class="col0 leftalign"> <strong>Procedure</strong> </th><td class="col1"> <strong>gnetlist:get-all-unique-nets</strong> <em>level</em> </td>
50 </tr>
51 <tr class="row9">
52 <td class="col0" colspan="2"> The same as <strong>gnetlist:get-all-nets</strong>, but duplicated values are only listed once. <br/>
53 <strong>Usage:</strong> <code>(gnetlist:get-all-unique-nets &quot;&quot;)</code> </td>
54 </tr>
55 <tr class="row10">
56 <th class="col0 leftalign"> <strong>Procedure</strong> </th><td class="col1"> <strong>gnetlist:get-all-connections</strong> <em>net</em> </td>
57 </tr>
58 <tr class="row11">
59 <td class="col0" colspan="2"> Yields a list of all connections to the named <em>net</em>, which must be a string. Each element of the list is itself a two element list of the form <code>(refdes pinnumber)</code>. <br/>
60 <strong>Usage:</strong> <code>(gnetlist:get-all-connections &quot;3&quot;)</code> </td>
61 </tr>
62 <tr class="row12">
63 <th class="col0 leftalign"> <strong>Procedure</strong> </th><td class="col1"> <strong>gnetlist:get-nets</strong> <em>refdes pin</em> </td>
64 </tr>
65 <tr class="row13">
66 <td class="col0" colspan="2"> Yields a list of the form <code>(netname connection1 connection2 …)</code> where the <em>netname</em> is a name of the net connected to the <em>pin</em> of the component with the given <em>refdes</em>, and each connection is itself a two element list of the form <code>(refdes pinnumber)</code> representing the pin with the <em>pinnumber</em> of the component with the <em>refdes</em>. All arguments must be strings. <br/>
67 <strong>Usage:</strong> <code>(gnetlist:get-nets &quot;R1&quot; &quot;1&quot;)</code> <br/>
68 <em>BUG:</em> This function does not reliably list all of the connections, if a <a href="geda-na_howto.html" class="wikilink1" title="geda-na_howto.html">net=</a> connection is specified. All existing back ends that use this (excluding the <strong>cascade</strong> back end) use only the netname. </td>
69 </tr>
70 <tr class="row14">
71 <th class="col0 leftalign"> <strong>Procedure</strong> </th><td class="col1"> <strong>gnetlist:get-pins-nets</strong> <em>refdes</em> </td>
72 </tr>
73 <tr class="row15">
74 <td class="col0" colspan="2"> Yields a list of <code>(pinnumber . netname)</code> pairs detailing all pin connections for the given refdes. <br/>
75 <strong>Usage:</strong> <code>(gnetlist:get-pins-nets &quot;R1&quot;)</code> </td>
76 </tr>
77 <tr class="row16">
78 <th class="col0 leftalign"> <strong>Procedure</strong> </th><td class="col1"> <strong>gnetlist:get-all-package-attributes</strong> <em>refdes attribute</em> </td>
79 </tr>
80 <tr class="row17">
81 <td class="col0" colspan="2"> Yields the list of values of the first found named <em>attribute</em> attached to all symbol instances with the given <em>refdes</em>. If an instance has no such attribute, <code>#f</code> is added to the list. All arguments must be strings. <br/>
82 <strong>Usage:</strong> <code>(gnetlist:get-all-package-attributes &quot;D1&quot; &quot;slot&quot;)</code> </td>
83 </tr>
84 <tr class="row18">
85 <th class="col0 leftalign"> <strong>Procedure</strong> </th><td class="col1"> <strong>gnetlist:get-package-attribute</strong> <em>refdes attribute</em> </td>
86 </tr>
87 <tr class="row19">
88 <td class="col0" colspan="2"> Yields the value of the named <em>attribute</em> attached to a symbol instance with the given refdes. Yields <code>&quot;unknown&quot;</code> if the attribute is absent. It only yields one value, regardless of how many matching attributes exist in the set of schematics. All arguments must be strings. <br/>
89 <strong>Usage:</strong> <code>(gnetlist:get-package-attribute &quot;R1&quot; &quot;device&quot;)</code> <br/>
90 <em>BUG:</em> If there is more than one instance only the first instance encountered is inspected, so it may yield <code>&quot;unknown&quot;</code>, even if a matching attribute is present. </td>
91 </tr>
92 <tr class="row20">
93 <th class="col0 leftalign"> <strong>Procedure</strong> </th><td class="col1"> <strong>gnetlist:get-toplevel-attribute</strong> <em>attribute</em> </td>
94 </tr>
95 <tr class="row21">
96 <td class="col0" colspan="2"> Yields the value of the named <em>attribute</em>, which must be a string, at top level, that is, an attribute present in one of the schematics unattached to any object. Yields <code>&quot;not found&quot;</code> if no matching attribute is present. <br/>
97 <strong>Usage:</strong> <code>(gnetlist:get-toplevel-attribute &quot;schematic-name&quot;)</code> </td>
98 </tr>
99 <tr class="row22">
100 <th class="col0 leftalign"> <strong>Procedure</strong> </th><td class="col1"> <strong>gnetlist:get-renamed-nets</strong> <em>level</em> </td>
101 </tr>
102 <tr class="row23">
103 <td class="col0" colspan="2"> When <strong><code>gnetlist</code></strong> expands a hierarchical subcircuit, it first assigns every net within the subcircuit a unique name based on the refdes of the subcircuit instance and, if present, the netname within the subcircuit. If a net is attached to the higher level circuit, gnetlist then changes the name of the subcircuit net to the name of the higher level net to which it is attached. <strong>gnetlist:get-renamed-nets</strong> returns a list of lists of pairs of names. The first name in a pair is the initial unique netname within the subcircuit, the second is the higher level netname it has acquired. The string <em>level</em> argument must be present, but is unused. <br/>
104 <strong>Usage:</strong> <code>(gnetlist:get-renamed-nets &quot;&quot;)</code> </td>
105 </tr>
106 <tr class="row24">
107 <th class="col0 leftalign"> <strong>Procedure</strong> </th><td class="col1"> <strong>gnetlist:get-attribute-by-pinseq</strong> <em>refdes pinseq attribute</em> </td>
108 </tr>
109 <tr class="row25">
110 <td class="col0" colspan="2"> Yields the value of the named <em>attribute</em> attached to the pin with the named <em>pinseq</em> attribute to the package with the named <em>refdes</em> attribute. All arguments must be strings. <br/>
111 <strong>Usage:</strong> <code>(gnetlist:get-attribute-by-pinseq &quot;R1&quot; &quot;1&quot; &quot;pinlabel&quot;)</code> </td>
112 </tr>
113 <tr class="row26">
114 <th class="col0 leftalign"> <strong>Procedure</strong> </th><td class="col1"> <strong>gnetlist:get-attribute-by-pinnumber</strong> <em>refdes pinnumber attribute</em> </td>
115 </tr>
116 <tr class="row27">
117 <td class="col0" colspan="2"> Yields the value of the named <em>attribute</em> attached to the pin with the named <em>pinnumber</em> attribute to the package with the named <em>refdes</em> attribute. All arguments must be strings. <br/>
118 <strong>Usage:</strong> <code>(gnetlist:get-attribute-by-pinnumber &quot;R1&quot; &quot;1&quot; &quot;pinlabel&quot;)</code> </td>
119 </tr>
120 <tr class="row28">
121 <th class="col0 leftalign"> <strong>Procedure</strong> </th><td class="col1"> <strong>gnetlist:vams-get-package-attributes</strong> <em>refdes</em> </td>
122 </tr>
123 <tr class="row29">
124 <td class="col0" colspan="2"> Yields a list of the names of attributes attached to the package with the named <em>refdes</em>, which must be a string. <br/>
125 <strong>Usage:</strong> <code>(gnetlist:vams-get-package-attributes &quot;R1&quot;)</code> <br/>
126 <em>BUG:</em> If there is more than one instance only the first instance encountered is inspected. </td>
127 </tr>
128 <tr class="row30">
129 <th class="col0 leftalign"> <strong>Procedure</strong> </th><td class="col1"> <strong>gnetlist:get-slots</strong> <em>refdes</em> </td>
130 </tr>
131 <tr class="row31">
132 <td class="col0" colspan="2"> Yields a list of integers representing all slot attributes associated with a given <em>refdes</em>, which must be a string. Duplicated values are listed as many times as they appear. <br/>
133 <strong>Usage:</strong> <code>(gnetlist:get-slots &quot;D3&quot;)</code> </td>
134 </tr>
135 <tr class="row32">
136 <th class="col0 leftalign"> <strong>Procedure</strong> </th><td class="col1"> <strong>gnetlist:get-unique-slots</strong> <em>refdes</em> </td>
137 </tr>
138 <tr class="row33">
139 <td class="col0" colspan="2"> The same as <strong>gnetlist:get-slots</strong>, but duplicated values are listed only once. <br/>
140 <strong>Usage:</strong> <code>(gnetlist:get-unique-slots &quot;D3&quot;)</code> </td>
141 </tr>
142 <tr class="row34">
143 <th class="col0 leftalign"> <strong>Procedure</strong> </th><td class="col1"> <strong>gnetlist:graphical-objs-in-net-with-attrib-get-attrib</strong> <em>netname attribute-string attribute-name</em> </td>
144 </tr>
145 <tr class="row35">
146 <td class="col0" colspan="2"> This searches for a <a href="geda-master_attributes_list.html#graphical" class="wikilink1" title="geda-master_attributes_list.html">graphical symbol</a> attached to a net with the given <em>netname</em>. The symbol must have <em>attribute-string</em> (of the form <code>name=value</code>) attached. It yields the value of the specified attribute named <em>attribute-name</em>. All arguments must be strings. <br/>
147 <strong>Usage:</strong> <code>(gnetlist:graphical-objs-in-net-with-attrib-get-attrib &quot;undriven_net&quot; &quot;device=DRC_Directive&quot; &quot;value&quot;)</code> </td>
148 </tr>
149 <tr class="row36">
150 <th class="col0 leftalign"> <strong>Procedure</strong> </th><td class="col1"> <strong>gnetlist:get-backend-arguments</strong> </td>
151 </tr>
152 <tr class="row37">
153 <td class="col0" colspan="2"> Yields a list of arguments passed to the gnetlist backend via the <code>-O</code> command-line option. <br/>
154 <strong>Usage:</strong> <code>(gnetlist:get-backend-arguments)</code> </td>
155 </tr>
156 <tr class="row38">
157 <th class="col0 leftalign"> <strong>Procedure</strong> </th><td class="col1"> <strong>gnetlist:get-calling-flags</strong> </td>
158 </tr>
159 <tr class="row39">
160 <td class="col0" colspan="2"> Yields a list of lists of command line flags and values. Each flag must be known to the gnetlist front end. For example, the <code>-O nomunge_mode</code> option will yield <code>(&quot;nomunge_mode&quot; #t)</code>. <br/>
161 <strong>Usage:</strong> <code>(gnetlist:get-calling-flags)</code> <br/>
162 <em>NOTE:</em> This function is deprecated and should not be used in new code. New code should use <strong>gnetlist:get-backend-arguments</strong> directly. </td>
163 </tr>
164 <tr class="row40">
165 <th class="col0 leftalign"> <strong>Procedure</strong> </th><td class="col1"> <strong>gnetlist:get-input-files</strong> </td>
166 </tr>
167 <tr class="row41">
168 <td class="col0" colspan="2"> Yields a list of the files named on the command line. <br/>
169 <strong>Usage:</strong> <code>(gnetlist:get-input-files)</code> </td>
170 </tr>
171 <tr class="row42">
172 <th class="col0 leftalign"> <strong>Procedure</strong> </th><td class="col1"> <strong>gnetlist:get-command-line</strong> </td>
173 </tr>
174 <tr class="row43">
175 <td class="col0" colspan="2"> Yields the command line used to invoke the program. <br/>
176 <strong>Usage:</strong> <code>(gnetlist:get-command-line)</code> <br/>
177 <em>BUG:</em> As of <strong><code>gnetlist</code></strong> version 1.9.1 it is broken and outputs command line arguments passed to <strong><code>guile</code></strong> instead of those of <strong><code>gnetlist</code></strong>. </td>
178 </tr>
179 <tr class="row44">
180 <td class="col0" colspan="2"> Yields a number corresponding to the verbosity mode specified on the command-line: <code>1</code> for verbose mode, <code>-1</code> for quiet mode, and <code>0</code> otherwise. <br/>
181 <strong>Usage:</strong> <code>(gnetlist:get-verbosity)</code> </td>
182 </tr>
183 <tr class="row45">
184 <th class="col0 leftalign"> <strong>Procedure</strong> </th><td class="col1"> <strong>gnetlist-version</strong> </td>
185 </tr>
186 <tr class="row46">
187 <td class="col0" colspan="2"> Yields <code>#t</code> if the version numbers of the <strong><code>gnetlist</code></strong> rc files and that of gEDA/gaf do not differ, otherwise yields <code>#f</code> and outputs warning. <br/>
188 <strong>Usage:</strong> <code>(gnetlist-version)</code> </td>
189 </tr>
190 </table></div>
191 <!-- EDIT2 TABLE [80-8530] -->
193 See the <a href="geda-hierarchy.html" class="wikilink1" title="geda-hierarchy.html">hierarchy</a> page for information about <strong><code>gnetlist</code></strong> rc settings.
194 </p>
196 </div>
197 </body>
198 </html>