-
-
Notifications
You must be signed in to change notification settings - Fork 40
Subcircuit questions #81
Description
Hi all, hope you're doing well. Was testing Josim (like the cmake build system!) and found some issues with subcircuits regarding input nodes labels and parameters.
- Subcircuit input Node labels cannot be referenced in
.printstatements, e.g.:
X1 TEST 1 0
I1 0 1 1.0
.subckt TEST IN GND
R1 IN GND 10.0
.ends
.tran 0.25p 5n 0 1.0p
.print v(IN.X1)
.end
yields
W: Controls
Unknown device/node IN|X1
Cannot store results for this device/node.
Ignoring this store request.
Expected behavior would be to look up the proper node label based on the input mapping. To be fair this is easy to work around, but is expected behavior for those coming from WRspice (IIRC).
2. Subcircuit parameters appear to be broken (unless I'm the broken one!), e.g.:
X1 TEST 1 0 RES=10.0
I1 0 1 1.0
.subckt TEST IN GND
R1 IN GND RES
.ends
.tran 0.25p 5n 0 1.0p
.print v(1)
.end
yields
E: Parsing
The following variables were not found/defined.
Please ensure that these variables exist within the netlist.
Variables:
RES
Another attempt, trying to interpret the manual's instructions for declarations:
X1 TEST 1 0 RES=5.0
I1 0 1 1.0
.subckt TEST IN GND RES=10
R1 IN GND RES
.ends
.tran 0.25p 5n 0 1.0p
.print v(1)
.end
which yields
E: Input
The IO of line "X1" does not match the subcircuit IO.
Please check the line and ensure correct IO and that parameters do not contain spaces.
Expected behavior is to substitute the indicated LABEL=VALUE pairs into the subcircuit instantiation, as indicated in the manual and by custom. I'll try to dig through the source a bit, but wanted to bring this up. Thanks for pushing this project forwards!