tnt
05/30/2024, 5:41 PMsim_pinnumber
stuff has no effect if you just have a schematic ? Unless I create a .sym
, when generating the LVS netlist, the pins won't have the right order, it ignores the attribute in the .sch
.Stefan Schippers
05/30/2024, 6:17 PMtnt
05/30/2024, 6:31 PMtnt
05/30/2024, 6:33 PMxxx/dev.sym
in the .sch
and xxx
is a symlink in the same directory as the .sch
)Stefan Schippers
05/30/2024, 10:21 PMxxx/dev.sym
is found in a schematic xschem tries to append this reference to all search paths defined in XSCHEM_LIBRARY_PATH
, in the order they are listed. The first existing file is used, so if I have:
set XSCHEM_LIBRARY_PATH /a/b/c:/a/b:/c
and /a/b/xxx/dev.sym
is an existing file this symbol will be loaded. If no matching file is found the component reference is assumed to be in the same directory of the parent schematic. This is a last resort and not recommended way. Always provide the list of component libraries to search for in XSCHEM_LIBRARY_PATH.
If you want to include the current dir into XSCHEM_LIBRARY_PATH use [pwd]
(and not .
) : set XSCHEM_LIBRARY_PATH ...:...:[pwd]:...:...
That said I don't understand well your case, what is the directory layout what are the symlinks there? Can you please elaborate?
https://xschem.sourceforge.io/stefan/xschem_man/tutorial_xschem_libraries.htmltnt
06/02/2024, 8:28 AMXSCHEM_LIBRARY_PATH
but the use case is for project specific symbols, I don't really want to put them in my global xschemrc
and have them everywhere.
So instead I just assumed it would look into current dir which it did as a fallback. But then for a bigger project I wanted some "local" symbols that happened to be maintained in another git repo so I just tried symlinking.
So say in a directory I have main.sch
and next to it, a symlink sub
to a directory somewhere completely different. And that directory has a xxx.sym
in it.
And in main.sch
I try to use sub/xxx.sym
that doesn't work properly.
When loading it the first time it works fine and everything is there. But then when I click "netlist" button, it will print l_s_d(): Symbol not found: sub/xxx.sym
and then it won't work anymore.tnt
06/02/2024, 8:47 AMstrace
I see at the beginning (initial load):
access("/opt/asic/share/xschem/xschem_library/usb/digital.sym", F_OK) = -1 ENOENT (No such file or directory)
access("/home/tnt/.local/share/xschem/library/usb/digital.sym", F_OK) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/tnt/projects/asic/tinytapeout/tt07-diff-rx/xschem/usb/digital.sym", O_RDONLY) = 8
But then after I get :
access("/opt/asic/share/xschem/xschem_library/usb/digital.sym", F_OK) = -1 ENOENT (No such file or directory)
access("/home/tnt/.local/share/xschem/library/usb/digital.sym", F_OK) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/tnt/projects/asic/tinytapeout/tt07-diff-rx/xschem/usb/usb/digital.sym", O_RDONLY) = -1 ENOENT (No such file or directory)
write(2, "l_s_d(): Symbol not found: usb/d"..., 43l_s_d(): Symbol not found: usb/digital.sym
See how the usb
(which is the symlinked dir) is repeated twice in the path above.Stefan Schippers
06/04/2024, 4:03 PMputs $XSCHEM_LIBRARY_PATH
in the session that has problems.Stefan Schippers
06/04/2024, 4:10 PMabs_sym_path usb/digital.sym
it will return the assumed absolute path of the symbol.tnt
06/04/2024, 6:47 PMabs_sym_path usb/digital.sym
returns the right path when typed in the console, I tried it when I was looking at how thing worked. But at somepoint it's almost like $curr_dirname
ends up pointing to /home/tnt/projects/asic/tinytapeout/tt07-diff-rx/xschem/usb/
instead of /home/tnt/projects/asic/tinytapeout/tt07-diff-rx/xschem/
tnt@rei ~/projects/asic/tinytapeout/tt07-diff-rx/xschem $ xschem tt_um_tnt_diff_rx.sch
open_pdks installation: using /home/tnt/projects/asic/pdk/
SKYWATER_MODELS: /home/tnt/projects/asic/pdk//sky130A/libs.tech/combined
SKYWATER_STDCELLS: /home/tnt/projects/asic/pdk//sky130A/libs.ref/sky130_fd_sc_hd/spice
setup_tcp_bespice: success : listening to TCP port: 2022
% puts $XSCHEM_LIBRARY_PATH
/opt/asic/share/xschem/xschem_library:~/.local/share/xschem/library
% abs_sym_path usb/digital.sym
/home/tnt/projects/asic/tinytapeout/tt07-diff-rx/xschem/usb/digital.sym
% l_s_d(): Symbol not found: usb/digital.sym
l_s_d(): Symbol not found: usb/bias_gen.sym
l_s_d(): Symbol not found: usb/diff_rx.sym
% abs_sym_path usb/digital.sym
/home/tnt/projects/asic/tinytapeout/tt07-diff-rx/xschem/usb/digital.sym
%
tnt@rei ~/projects/asic/tinytapeout/tt07-diff-rx/xschem $ ls /home/tnt/projects/asic/tinytapeout/tt07-diff-rx/xschem/usb/digital.sym -l
-rw-r--r-- 1 tnt tnt 1032 May 28 15:48 /home/tnt/projects/asic/tinytapeout/tt07-diff-rx/xschem/usb/digital.sym
tnt
06/04/2024, 6:48 PMStefan Schippers
06/10/2024, 3:07 PMtnt
06/10/2024, 3:29 PM% puts $XSCHEM_LIBRARY_PATH
/opt/asic/share/xschem/xschem_library:~/.local/share/xschem/library
Stefan Schippers
06/10/2024, 3:45 PM/home/tnt/projects/asic/tinytapeout/tt07-diff-rx/xschem
% puts $XSCHEM_LIBRARY_PATH
/opt/asic/share/xschem/xschem_library:~/.local/share/xschem/library:/home/tnt/projects/asic/tinytapeout/tt07-diff-rx/xschem
you can easily do this in the xschemrc file:
append XSCHEM_LIBRARY_PATH :[pwd]
tnt
06/10/2024, 3:51 PMStefan Schippers
06/10/2024, 3:55 PMtnt
06/10/2024, 4:03 PMcurr_dirname
and doesn't properly put it back or something ...Stefan Schippers
06/10/2024, 4:24 PMuse_pwd_instead_of_current_dirname
will use (if set to 1) [pwd]
as the base path of referenced symbols (if not found in any of the XSCHEM_LIBRARY_PATH
paths) instead of the directory of currently loaded schematic (which changes depending on the hierarchy level you are in and will mess up if using a hierarchic netlist command).
Update xschem and add this:
set use_pwd_instead_of_current_dirname 1
to your xschemrc file.
The default value for this variable is 0
, after some time may be I will flip to 1
as default (if no design breaks as a consequence of this).Stefan Schippers
06/10/2024, 4:33 PMStefan Schippers
06/10/2024, 4:34 PMusb/digital.sym
used only in the top level schematic or also (or only) in some sub schematic?tnt
06/10/2024, 4:48 PMStefan Schippers
06/10/2024, 10:45 PMappend XSCHEM_LIBRARY_PATH :[file dirname [info script]]
it will add the path of the directory where the xschemrc file is read from. This works also if you call xschem from a different directory.
PS: no more need to set the use_pwd_instead_of_current_dirname
variable in xschemrc. I have made the switch and a . in search path is a synonim of [pwd] so this setting is no more needed.