5
8
Fork
You've already forked lctime
5

relative pathes for spice include files #4

Open
opened 2023年03月20日 07:06:36 +01:00 by Sourcerer · 2 comments

When I tried to use the following .lib statement:

  • .include ~/.volare/sky130A/libs.tech/ngspice/sky130.lib.spice tt

it worked fine in ngspice, but when I run it with lctime, I got an error that it cannot find the file ./~/.volare/sky130A/libs.tech/ngspice/sky130.lib.spice

I had to replace it like this, but then I would have my username in the path, which makes it unportable to other users:

.include "../../../../home/username/.volare/sky130A/libs.tech/ngspice/sky130.lib.spice" tt

I guess this should also be fixed inside KLayout?

When I tried to use the following .lib statement: * .include ~/.volare/sky130A/libs.tech/ngspice/sky130.lib.spice tt it worked fine in ngspice, but when I run it with lctime, I got an error that it cannot find the file ./~/.volare/sky130A/libs.tech/ngspice/sky130.lib.spice I had to replace it like this, but then I would have my username in the path, which makes it unportable to other users: .include "../../../../home/username/.volare/sky130A/libs.tech/ngspice/sky130.lib.spice" tt I guess this should also be fixed inside KLayout?
Owner
Copy link

This is most likely an issue in KLayout because lctime does not process the includes itself.

When trying myself I notice that the path needs to be quoted with "" as soon as it starts with a ~. Then I get the same error as you with a minimal example:

top.sp:


.include "~/include.sp"

~/include.sp: (empty file)

Minimal example 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

ngspice top.sp does not have a problem with that.

This is most likely an issue in KLayout because lctime does not process the includes itself. When trying myself I notice that the path needs to be quoted with `""` as soon as it starts with a `~`. Then I get the same error as you with a minimal example: `top.sp`: ``` .include "~/include.sp" ``` `~/include.sp`: (empty file) Minimal example for triggering the problem: ```python 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 ``` `ngspice top.sp` does not have a problem with that.
Owner
Copy link

I created an issue for KLayout: https://github.com/KLayout/klayout/issues/1321

I created an issue for KLayout: https://github.com/KLayout/klayout/issues/1321
Sign in to join this conversation.
No Branch/Tag specified
main
dev-dff-inverted-outputs
dev
0.0.28
0.0.27
0.0.26
0.0.25
0.0.24
0.0.23
0.0.22
0.0.21
0.0.20
0.0.19
0.0.18
Labels
Clear labels
No items
No labels
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
librecell/lctime#4
Reference in a new issue
librecell/lctime
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?