User Tools

Site Tools


geda:hierarchy

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
geda:hierarchy [2016/02/29 09:10]
rlutz start writing section on netname=/net= mangling
geda:hierarchy [2016/02/29 09:42]
rlutz add missing pieces
Line 1: Line 1:
-//(This page is still incomplete.)//​ 
- 
 ====== Hierarchical schematics ====== ====== Hierarchical schematics ======
  
Line 43: Line 41:
 In ''​gschem'',​ you can navigate the schematic hierarchy using the commands from the “Hierarchy” menu.  To view the underlying schematic for a subcircuit component, select it and use **Hierarchy→Down Schematic**. ​ Once finished editing, use **Hierarchy→Up** to return to the original schematic. ​ (This works only if you accessed the subcircuit'​s schematic in that way.)  Analogously,​ you can edit the subcircuit symbol itself using **Hierarchy→Down Symbol**. In ''​gschem'',​ you can navigate the schematic hierarchy using the commands from the “Hierarchy” menu.  To view the underlying schematic for a subcircuit component, select it and use **Hierarchy→Down Schematic**. ​ Once finished editing, use **Hierarchy→Up** to return to the original schematic. ​ (This works only if you accessed the subcircuit'​s schematic in that way.)  Analogously,​ you can edit the subcircuit symbol itself using **Hierarchy→Down Symbol**.
  
-==== Input/​output pins ==== +As an alternative to using the same net name, you can add pins to a subsheet symbol to route nets to and from that schematic.  ​See the section //Input/output pins// below for details.
- +
-As an alternative to using the same net name, you can add pins to a subsheet symbol to route nets to and from that schematic.  ​For each pin on the symbol, you need to add a corresponding footprint-less I/O symbol to the subsheet whose ''​refdes=''​ matches the ''​pinlabel=''​ of the pin.  (You can normally use the ''​in-1.sym''​ and ''​out-1.sym''​ symbols from the generic “Input/Output” symbol library for this.) +
- +
-<note important>​ +
-If you get an error about a “Missing I/O symbol”, make sure you set a ''​refdes=''​ for the subsheet symbols. +
-</note> +
- +
-<note warning>​ +
-Make sure not to add more than one I/O symbol ​for each pin as this will silently produce an incorrect netlist. +
-</​note>​+
  
 ===== Hierarchy as a grouping/​instantiation mechanism ===== ===== Hierarchy as a grouping/​instantiation mechanism =====
  
-If you want to include a subcircuit multiple times in your schematic, you need a way to tell the components of one instantiation from those of another one (given that your subcircuit contains any components). ​ This is where uref mangling comes in.  You enable it by specifying+If you want to include a subcircuit multiple times in your schematic, you need a way to tell the components of one instantiation from those of another one (given that your subcircuit contains any components). ​ This is where refdef ​mangling comes in.  You enable it by specifying
  
   (hierarchy-uref-mangle "​enabled"​)   (hierarchy-uref-mangle "​enabled"​)
Line 65: Line 53:
   (hierarchy-uref-order "​prepend"​)   (hierarchy-uref-order "​prepend"​)
   (hierarchy-uref-separator ":"​)   (hierarchy-uref-separator ":"​)
 +
 +Named nets from one instantiation will connect to the same net of another one.  This means you can't use net names to connect (non-power) pins across the hierarchy any more; you need I/O pins instead. ​ Also, you will probably want to use separate net namespaces so you don't short-circuit nets between instantiations when using net names.
 +
 +==== Input/​output pins ====
 +
 +In order to connect a net to a subcircuit, you need to add a pin to the subcircuit symbol and a corresponding footprint-less I/O component to the subcircuit whose ''​refdes=''​ matches the ''​pinlabel=''​ of the pin.  During netlist generation, these two nets will be connected. ​ (You can normally use the ''​in-1.sym''​ and ''​out-1.sym''​ symbols from the generic “Input/​Output” symbol library for this.)
  
 <note important>​ <note important>​
-Named nets from one instantiation will connect to the same net of another one.  ​If you are using net names in the subcircuit, you will probably want to use separate net namespaces to avoid that.+If you get an error about a “Missing I/O symbol”make sure you set a ''​refdes=''​ for the subsheet symbols. 
 +</​note>​ 
 + 
 +<note warning>​ 
 +Make sure not to add more than one I/O symbol for each pin as this will silently produce an incorrect netlist.
 </​note>​ </​note>​
  
Line 73: Line 71:
  
 The typical and cleanest way to use hierarchy is to enable both refdes and net=/​netname= mangling. ​ This means that the subcircuit lives in a namespace of its own, and the only way to connect nets between the instantiating and the instantiated schematic is through pins of the subsheet symbol and I/O ports in its schematic. ​ If you want to include a subcircuit multiple times in your design, even though it's not strictly necessary, this is the recommended way to use hierarchy, as you would otherwise have to be very careful about avoiding naming nets in the subschematic which would cause them to be silently short-circuited between instantiations. The typical and cleanest way to use hierarchy is to enable both refdes and net=/​netname= mangling. ​ This means that the subcircuit lives in a namespace of its own, and the only way to connect nets between the instantiating and the instantiated schematic is through pins of the subsheet symbol and I/O ports in its schematic. ​ If you want to include a subcircuit multiple times in your design, even though it's not strictly necessary, this is the recommended way to use hierarchy, as you would otherwise have to be very careful about avoiding naming nets in the subschematic which would cause them to be silently short-circuited between instantiations.
 +
 +You enable net=/​netname= mangling it by specifying
 +
 +  (hierarchy-netattrib-mangle "​enabled"​)
 +  (hierarchy-netname-mangle "​enabled"​)
 +
 +in ''​gnetlistrc''​. ​ As with refdes mangling, you can also configure the way mangled net names are constructed.
  
 ==== netname= mangling vs. net= mangling ==== ==== netname= mangling vs. net= mangling ====
Line 79: Line 84:
  
 Usually, when using net namespaces, you would enable both ''​netname=''​ and ''​net=''​ mangling. ​ Depending on how you use hierarchy in your design, there might be use cases where you might want to disable one of them, though: If you disable ''​netname=''​ mangling, you gain the ability to use global net names and connect nets across the hierarchy by setting the ''​netname=''​ attribute while still having implicit nets separate. ​ If you disable ''​net=''​ mangling, all implicit pins (usually power and ground pins) across all of your schematic pages will be connected, so you don't have to use explicit power and ground pins on your subsheet symbols. ​ Both approaches come at the cost of reduced readability,​ though: you can't tell any more how a subsheet is connected to the rest of the design by just looking at the schematic. Usually, when using net namespaces, you would enable both ''​netname=''​ and ''​net=''​ mangling. ​ Depending on how you use hierarchy in your design, there might be use cases where you might want to disable one of them, though: If you disable ''​netname=''​ mangling, you gain the ability to use global net names and connect nets across the hierarchy by setting the ''​netname=''​ attribute while still having implicit nets separate. ​ If you disable ''​net=''​ mangling, all implicit pins (usually power and ground pins) across all of your schematic pages will be connected, so you don't have to use explicit power and ground pins on your subsheet symbols. ​ Both approaches come at the cost of reduced readability,​ though: you can't tell any more how a subsheet is connected to the rest of the design by just looking at the schematic.
- 
- 
- 
- 
- 
- 
- 
- 
- 
  
geda/hierarchy.txt · Last modified: 2016/02/29 09:42 by rlutz