« Autonumbering | gEDA gschem User Guide | Printing »

## Hierarchy

When a design has several repeating subcircuits, it can sometimes be useful to draw a schematic for the subcircuit, and then include that subcircuit multiple times in the design. This creates a hierarchy of circuits.

Subcircuit schematics are searched for in a source library, and use the “in-1” and “out-1” symbols to indicate which nets to make available as connections for the schematics that include them. Each subcircuit has a symbol, which uses ”`source=`” attributes to specify the subcircuit's schematic pages.

See Configuring gschem for details of how to control where gschem looks for subcircuit schematics.

To add a subcircuit to a schematic, simply place the symbol representing it as a component in the schematic as usual. Subcircuits can in turn contain other subcircuits!

To view the underlying schematic for a subcircuit component, select it and use Hierarchy→Down Schematic. Once finished editing the subcircuit's schematic, use Hierarchy→Up to return to the original schematic.