Harald Pretl
04/16/2024, 11:21 AMxschem
. I know about the working of XSCHEM_LIBRARY_PATH
, but: if I instantiate a cell from a subdirectory where the current cell (where I instantiate into) is located, is then always a relative path to the symbol formed? Or only, when the current cell’s location is contained in XSCHEM_LIBRARY_PATH
?Stefan Schippers
04/16/2024, 3:58 PMXSCHEM_LIBRARY_PATH
paths (starting from the first one) contains the first part of the symbol absolute location.
In this case the relative path is obtained by stripping off the leading matching part.
As a consequence it is advisable to put deeper directories first in XSCHEM_LIBRARY_PATH, like /`a/b/c/a/b/a` instead of /a:/a/b:/a/b/c
, so you will have the shortest relative paths.
Important note: if XSCHEM_LIBRARY_PATH
contains .
as one of the paths this is interpreted as the path of the parent schematic (the one instantiating the symbol). This is different than the usual meaning of .
which is the current working directory (the dir where you started xschem).
I strongly recommend to avoid using '`.`' in XSCHEM_LIBRARY_PATH
definitions in xschemrc
files, if you need to add the current directory use [pwd]
.Harald Pretl
04/16/2024, 4:04 PMStefan Schippers
04/16/2024, 4:19 PM[pwd]
instead of writing the actual path):
set XSCHEM_LIBRARY_PATH $XSCHEM_SHAREDIR/xschem_library:[pwd]
so an inverter inv.sym
in [pwd]
will have relative path inv.sym
, an opamp that is located in [pwd]/analoglib/opamp.sym
will have relative path analoglib/opamp.sym
.
However if you set this in `XSCHEM_LIBRARY_PATH`:
set XSCHEM_LIBRARY_PATH $XSCHEM_SHAREDIR/xschem_library:[pwd]/analoglib:[pwd]
then both the inv.sym
and the opamp.sym
will have relative paths of inv.sym
and opamp.sym
respectively.Harald Pretl
04/16/2024, 4:22 PMXSCHEM_LIBRARY_PATH
and its implications; they just get frustrated when they move blocks around that the symbols are not found): set XSCHEM_LIBRARY_PATH $XSCHEM_SHAREDIR/xschem_library:[pwd]
You think setting this by default is a good idea? Or any undesirable side effects?Stefan Schippers
04/16/2024, 4:59 PMset XSCHEM_LIBRARY_PATH $XSCHEM_SHAREDIR/xschem_library:[pwd]
If every used schematic is located under [pwd] you will not have any absolute path (only subdirectories of [pwd]) and design is portable.
One exception is adding a directory for the pdk, like:
set XSCHEM_LIBRARY_PATH $XSCHEM_SHAREDIR/xschem_library:${PDK_ROOT}/${PDK}/libs.tech/xschem:[pwd]
In this case used components in the design should either be xschem primitives (pins, vsources, labels and so on) or pdk elements (nfet_01v8.sym and so on) or stuff located hierarchically under [pwd].