diff --git a/doc/xschem_man/tutorial_use_existing_subckt.html b/doc/xschem_man/tutorial_use_existing_subckt.html index 68a30ab4..676bd271 100644 --- a/doc/xschem_man/tutorial_use_existing_subckt.html +++ b/doc/xschem_man/tutorial_use_existing_subckt.html @@ -198,6 +198,7 @@ x1 XZ XVCC XVSS XA XB XC symbol_include

+
  • Use a spice_sym_def=".include <file>" line in the symbol

    The second method is to declare the symbol type as subcircuit and @@ -226,6 +227,28 @@ x1 VSS TRIG OUT VSUPPLY CTRL TRIG DIS VSUPPLY ne555 and if the symbol is reused in another design the .include line travels with the symbol and you don't have to add the line in the top level.

    +
  • + +
  • Completely specify a subcircuit in the format section of the symbol

    +

    + The following set of symbol attrtibutes: +

    +
    +type=source
    +format="X@name @@in @@out sub_@name
    +.subckt sub_@name in out
    +@name out 0 V=@func
    +.ends sub_@name"
    +template="name=B1 FUNC="pow(V(in),2)""
    + 
    +

    will create a sub_xxx subcircuit with a unique name for every symbol instance using the @name attribute + (which is indeed unique). This allows to build subcircuits with arbitrary parameters (a math expression in the example). +

    + The problem of this approach is that it works by creating nested .subckt inside the parent schematic + (which could itself be a .subckt). Not all simulators support this (although ngspice seems to work OK with this). +

    +
  • +