Skip to content

Subcircuit questions #81

@grahamrow

Description

@grahamrow

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.

  1. Subcircuit input Node labels cannot be referenced in .print statements, 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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions