missing NULL terminator in set_config_x
[geda-gaf.git] / docs / wiki / geda-gnetlist_ug-hierarchy.html
blob785d0d46e635b2eae50900c5e60b4ac1d6822647
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>
12 <a href=.>start</a>&nbsp;=>&nbsp;<a href=geda-gnetlist_ug.html>gnetlist_ug</a></br>
13 <div class="table sectionedit1"><table class="inline">
14 <tr class="row0">
15 <td class="col0 leftalign"> « <a href="geda-gnetlist_ug-basic_netlisting.html" class="wikilink1" title="geda-gnetlist_ug-basic_netlisting.html">Basic netlisting</a> </td><td class="col1 centeralign"> <strong><a href="geda-gnetlist_ug.html" class="wikilink1" title="geda-gnetlist_ug.html">gEDA gnetlist User Guide</a></strong> </td><td class="col2 rightalign"> <a href="geda-gnetlist_ug-slotting.html" class="wikilink1" title="geda-gnetlist_ug-slotting.html">Slots and slotting</a> » </td>
16 </tr>
17 </table></div>
18 <!-- EDIT1 TABLE [1-175] -->
19 <h2 class="sectionedit2" id="hierarchy">Hierarchy</h2>
20 <div class="level2">
22 <p>
23 gnetlist has support for <em>hierarchical schematics</em>. These are schematic diagrams that include other schematic diagrams as <em>subcircuits</em>. This can be very useful for designs that use the same circuit multiple times, or for re-using a circuit in multiple designs. Subcircuits can in turn contain other subcircuits!
24 </p>
26 <p>
27 Each subcircuit schematic diagram needs to have a subcircuit symbol associated with it. The “<code>device=</code>” attribute on a subcircuit symbol is ignored. The “<code>source=</code>” attribute should be used to specify the name of the subcircuit&#039;s schematic file.
28 </p>
30 <p>
31 Subcircuit symbols are loaded from the symbol library as normal. Subcircuit schematics are loaded from the <em>source library</em>.
32 </p>
33 <div class="notetip">See <a href="geda-gnetlist_ug-config.html" class="wikilink1" title="geda-gnetlist_ug-config.html">Configuring gnetlist</a> for details of how to control where gnetlist looks for subcircuit schematic files.
34 </div>
35 </div>
36 <!-- EDIT2 SECTION "Hierarchy" [177-1039] -->
37 <h3 class="sectionedit3" id="hierarchical_ports">Hierarchical ports</h3>
38 <div class="level3">
40 <p>
41 The pins on a subcircuit symbol define the <em>ports</em> where designs that include the circuit can connect to it. Each port should be named using a “<code>pinlabel=</code>” attribute. To define the points where a port attaches to the subcircuit&#039;s nets, gnetlist will look for the first pin on a component which has a “<code>refdes=</code>” attribute that matches the port&#039;s name. You can normally use the “in-1.sym” and “out-1.sym” symbols from the generic “Input/Output” symbol library for this.
42 </p>
44 </div>
45 <!-- EDIT3 SECTION "Hierarchical ports" [1040-1549] -->
46 <h3 class="sectionedit4" id="renaming_components_and_nets">Renaming components and nets</h3>
47 <div class="level3">
49 <p>
50 Each subcircuit symbol placed into a schematic must have a “<code>refdes=</code>” attribute attached to it. This is the name of the <em>subcircuit instance</em>. In order to uniquely identify components and nets in each instance of a hierarchical subcircuit, gnetlist will rename them using the subcircuit&#039;s name as a prefix.
51 </p>
53 <p>
54 For example, consider a subcircuit that contains a component with “<code>refdes=U1</code>” and a net with “<code>netname=FEEDBACK</code>”. Now, suppose the subcircuit symbol is placed in a schematic and an attribute “<code>refdes=A1</code>” is attached to it. When the schematic is processed using gnetlist, gnetlist will rename the component to “A1/U1” and rename the net to “A1/FEEDBACK”.
55 </p>
57 </div>
58 <!-- EDIT4 SECTION "Renaming components and nets" [1550-] --></body>
59 </html>