Dear <@U01819B63HP>, hope you are doing fine. We h...
# analog-design
v
Dear @Stefan Schippers, hope you are doing fine. We have been simulating in xschem using symbols with relative paths. The problem arises when we use a symbol that references another one, both with relative paths. We have a folder that contains two schematics with symbols, where symbol1 references symbol2 with a relative path. The folder follows the next structure
Copy code
symbols/
      - symbol1.sym  (e.g.: SR_latch)
      - symbol1.sch
      - symbol2.sym  (e.g.: nor)
      - symbol2.sch
testbenches/
      testbench_a/
                 - testbench1.sch
testbench1.sch
declares symbol1 with the following path:
../../symbols/symbol1.sym
. This way, when I press the
netlist
button, xschem tries to generate the netlist but fails because schematic references symbol1 with path
../../symbols/symbol1.sym
, but symbol2 expands just as
symbol2.sym
, ignoring the relative path within symbol1. Is ignoring relative declarations between schematics an expected behaviour? As a solution, we thought in declaring the path to the symbols inside the schematic. Is there a way to append to XSCHEM_SEARCH_PATH inside a schematic? Or is it strictly necessary to have a specific xschemrc file? If creating a new xschemrc file is necessary, it should reference gf180mcuD specific xschemrc file. Is there a way of referencing a xschemrc file inside other xschemrc file? Hope you can help us with this situation. Best regards, Vicente Osorio Rivas
s
You must declare the XSCHEM_LIBRARY_PATH in xschemrc as:
#### pdk install root
set PDK_ROOT /path/to/share/pdk
#### process variant
set PDK gf180mcuD
#### location of spice models/libs
set 180MCU_MODELS ${PDK_ROOT}/$PDK/libs.tech/ngspice
#### location of gf180mcu stdcells
set 180MCU_STDCELLS  ${PDK_ROOT}/$PDK/libs.ref/gf180mcu_fd_sc_mcu7t5v0/spice
#### reset any previous search path definition
set XSCHEM_LIBRARY_PATH {}
#### xschem base symbols, like labels, pins, ideal devices
append XSCHEM_LIBRARY_PATH :${XSCHEM_SHAREDIR}/xschem_library
#### gf180mcu silicon devices
append XSCHEM_LIBRARY_PATH :$PDK_ROOT/$PDK/libs.tech/xschem
#### your design
append XSCHEM_LIBRARY_PATH /path/to/design
where
/path/to/design
is the directory immediately above symbols and testbenches Then load the testbench and if some symbols are missing replace them then do a force save (ctrl-Shift-S). Descend into the sub blocks and do a force save as well. This way xschem removes the ../.. in symbol references, since this kind of referencing is dangerous. For references about library management read this manual page.
In the
testbench1.sch
symbol1.sym
should be referenced as
symbols/symbol1.sym
symbol2.sym
inside
symbol1.sym
should also be referenced as
symbols/symbol2.sym
. The real path on the filesystem is obtained by taking the
/path/to/design
defined in the xschemrc and adding the relative reference:
/path/to/design/symbols/symbol1.sym
similarly for all other components used in the design.
a
Hi @Stefan Schippers, would be possible to define a xschemrc that makes an "include" or a "source" of another one?
s
@aquiles viza yes you can by doing
source /path/to/other/xschemrc
a
Thanks @Stefan Schippers, it worked as expected.