xschem-viewer
xschem-viewer copied to clipboard
Hierarchical Schematics and Design Libraries
Thanks for the great work!
How do I include schematic and symbol libraries? Could the web viewer understand the directory hierarchy when providing a schematic from GitHub using the ?file selection in the URL? i.e. Add directories above the schematic to XSCHEM_LIBRARY_PATH for it.
Example: https://xschem-viewer.com/?file=https://github.com/cascode-labs/bandgaps/blob/main/bandgaps/bandgap_sky130_v1/bandgap_1v_v01/bandgap_1v_v01.sch
Problem
You can see in the screenshot below from the web viewer that I am missing the amplifier symbol that is shown in the second screenshot using the desktop executable version of xschem.
Desktop Implementation
In the desktop version I just have to make sure the XSCHEM_LIBRARY_PATH is set in the xschemrc according to how I organize my design library files as explained in the xschem docs.
In order to define this more portably across projects without having seperate xschemrc file for each project, I add the following Tcl code to the end of my xschemrc. This then allows me to define an environment variable using one of the file structures in the xschem docs. In my case option 3 makes the most sense.
# allow a user-specific path add-on (https://github.com/iic-jku/iic-osic-tools/issues/7)
if { [info exists ::env(XSCHEM_USER_LIBRARY_PATH) ] } {
append XSCHEM_LIBRARY_PATH :$env(XSCHEM_USER_LIBRARY_PATH)
}
A Possible Solution
Could we have the web viewer understand the file structure from github so that it can capture the schematics and symbols up to 2 levels above the provided schematic. This would allow us to include the library from the same repo assuming you folllow a similar library structure.
Here's the library file structure in my example:
Issue in the web viewer
Here is the schematic from one of my github projects: https://xschem-viewer.com/?file=https://github.com/cascode-labs/bandgaps/blob/main/bandgaps/bandgap_sky130_v1/bandgap_1v_v01/bandgap_1v_v01.sch
Expected Result
Here is the same schematic in the desktop app:
@urish, @StefanSchippers, @barakhoffer