TUTORIAL: Manage XSCHEM design / symbol libraries

There are 2 ways to describe symbols in xschem,

In the first approach a 'npn.sym' symbol placed in a schematic will be saved as 'npn.sym' in the .sch file, when loading back the parent schematic xschem will go through the elements of XSCHEM_LIBRARY_PATH and look for a directory containing npn.sym.

In the second approach the 'npn.sym' will be saved as 'devices/npn.sym' (assuming devices/ is the directory containing this symbol) . This is because the XSCHEM_LIBRARY_PATH is pointing to something like /some/path/xschem_library/ and xschem_library/ contains devices/ (names are just given as examples, any dir name is allowed for xschem_library/ and devices/)

The first approach is preferred by pcb hobbysts, people working on small designs. the second approach is preferred for big designs where a one or more directory level indirection is desired for symbols, so any symbol in xschem is given as 'libname/symname.sym' (one level directory specification in symbol references) or 'libgroup/libname/symname.sym' (2 level directory specification in symbol references) instead of just 'symname.sym'

In any case the real path of the symbol reference is obtained by prepending the XSCHEM_LIBRARY_PATH paths to the symbol reference until the resulting file is found in the machine filesystem.

For VLSI / big designs I strongly suggest using the second approach, just as an example i have the following dirs:


then in my xschemrc i have the following:


You may choose either method, but please be consistent throughout your design.