Best Directory structure and library path definitions for Hierarchical schematics and reusable symbols

When i currently create a Hierarchical schematic by right clicking and “Draw Hierarchical Entry” it places files in one directory level. I would rather create a central library of schematics/symbols like i seem to be able to do when i import 3rd party models. What am i missing to achieve this and have a nice project directory structure. Also when i try to simulate, simulation output files get dumped in the same directory level. This does not seem to occur when i run the demo examples. Is there a way to change this as well?

1 Like

A more specific question is that when i right click and “Draw Hierarchical Entry” its creating a symbol but it seems to be a one time use symbol compared to a 3rd party symbol that can show up in the IP tab. How do I get the symbol that I created from “Draw Hierarchical Entry” into the IP tab for reuse

If both top level schematics calling the lower-level hierarchical entry are in the same directory, then you can copy and paste the symbol for that lower-level hierarchical entry to the other top-level schematic and all will work.

If you want to use that lower-level hierarchical entry as piece of portable IP to use in any schematic, it’s possible, with effort, to create a symbol that includes its lower-level schematic as a subcircuit. I’m planing on eventually automating that conversion, but it isn’t implemented yet.

–Mike

1 Like

Could we hear some detail how can we do it?

I have a directory where is a symbol and the related implementation schematic. I add this directory to
QSPICE via Symbol Browser. In symbol file I tried to include the schematic via .inc/.lib statement
(with the absolute path of the schematic file) but none of them worked.

I am developing a control library and would be nice to have a simple way for the user to use it (e.g. search for the implementation file in the same directory where the symbol file is, or put all implementation schematic into one directory and define explicitly this implementation directory through inc/lib statement, or define the path of the implementation schematic file in symbol file relative to the path of symbol file etc.).

Could we hear some detail how can we do it?

  1. In the higher-level schematic, do top-level
    menu(not right click) command View=>Netlist.

  2. In the netlist, identity the subcircuit of the
    hierarchal block you wish to library as widely usable IP.

  3. Select that block of text and copy it to the
    clipboard with Ctrl-C.

  4. Close the netlist and paste(Ctrl-V) the text into
    a schematic(or a blank symbol). That will invoke
    the 3rd party import routine.

  5. You’ll now have a symbol that contains the
    circuitry that you can use in any schematic in
    any directory.

  6. Enjoy.

–Mike

2 Likes

Thank you for the instructions!

Mike, does that work with a C-Block/DLL? I’m guessing that the DLL would have to be either copied to the top-level schematic location or put in a specific folder where QSpice can find it, right?

–robert

No, it won’t work for a .DLL. Unless you use an absolute path name.

I’ll have to implement library search paths once enough people are using libraries of .DLLs.

–Mike

To create symbol with embedded .subckt, the key is to have .subckt script from your circuit. Here is a text based technique share as your reference, to convert a schematic into usable .subckt script, in case you don’t want to create hierarchal block but prefer text editor to modify netlist into subckt script.

5 Likes

Thank you for the tips

Hi guys, is there also a way to add input functions into symbol as a Laplace transfer function “fdt(s)” ?
Thx