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" />
12 <a href=.
>start
</a> =
> <a href=geda-gnetlist_ug.html
>gnetlist_ug
</a></br>
13 <div class=
"table sectionedit1"><table class=
"inline">
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>
18 <!-- EDIT1 TABLE [1-175] -->
19 <h2 class=
"sectionedit2" id=
"hierarchy">Hierarchy
</h2>
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!
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
's schematic file.
31 Subcircuit symbols are loaded from the symbol library as normal. Subcircuit schematics are loaded from the
<em>source library
</em>.
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.
36 <!-- EDIT2 SECTION "Hierarchy" [177-1039] -->
37 <h3 class=
"sectionedit3" id=
"hierarchical_ports">Hierarchical ports
</h3>
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
's nets, gnetlist will look for the first pin on a component which has a “
<code>refdes=
</code>” attribute that matches the port
's name. You can normally use the “in-
1.sym” and “out-
1.sym” symbols from the generic “Input/Output” symbol library for this.
45 <!-- EDIT3 SECTION "Hierarchical ports" [1040-1549] -->
46 <h3 class=
"sectionedit4" id=
"renaming_components_and_nets">Renaming components and nets
</h3>
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
's name as a prefix.
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”.
58 <!-- EDIT4 SECTION "Renaming components and nets" [1550-] --></body>