Using KLayout as a spice parser for lctime we noticed some difficulties with include paths starting with "~".
This example with two minimal SPICE files demonstrates the problem:
top.sp:
$HOME/include.sp: (empty file)
Minimal code for triggering the problem:
import klayout.db as db
n = db.Netlist()
n.read("top.sp", db.NetlistSpiceReader())
Yields:
Traceback (most recent call last):
File "/home/user/lctime_issue4/lctime_issue4.py", line 4, in <module>
n.read("top.sp", db.NetlistSpiceReader())
RuntimeError: Unable to open file: ./~/include.sp (errno=2) in top.sp, line 2 in Netlist.read
However, ngspice seems to be able to handle such include paths.
ngspice top.sp runs without error.
It looks like include paths in quotes are not expanded (the ~ should expand to the home directory) but instead treated as relative paths.
Using KLayout as a spice parser for lctime we noticed some difficulties with include paths starting with "~".
This example with two minimal SPICE files demonstrates the problem:
top.sp:$HOME/include.sp: (empty file)Minimal code for triggering the problem:
Yields:
However, ngspice seems to be able to handle such include paths.
ngspice top.spruns without error.It looks like include paths in quotes are not expanded (the
~should expand to the home directory) but instead treated as relative paths.