f18m / netlist-viewer

SPICE netlist visualizer
40 stars 4 forks source link

Problem dealing with extra parameters on subcircuits #8

Open ricardoedgarsilva opened 7 months ago

ricardoedgarsilva commented 7 months ago

In my netlist I have the following subcircuit:

.SUBCKT memristor TE BE XSV
.params Ron=893 Roff=1833 D=0.2212 uv=0.0108 p=4.64 xo={xo}

* Biolek Window Function
.func f(V1,I1)={1-pow((V1-stp(-I1)),(2*p))}

* Memristor I-V Relationship
.func IVRel(V1,V2) = V1/(Ron*V2 + Roff*(1-V2))

* Circuit to determine state variable
Gx 0 XSV value={I(Gmem)*Ron*uv*f(V(XSV,0),I(Gmem))/pow(D,2)}
Cx XSV 0 {1}
.ic V(XSV) = xo

* Current source representing memristor
Gmem TE BE value={IVRel(V(TE,BE),V(XSV,0))}

.ENDS memristor

I get an error "Unknown component type for '.params' "

f18m commented 7 months ago

Ho @ricardoedgarsilva , I might be able to work on this shortly, it should be pretty easy to skip all statements that start with a dot. In the meantime can you try to remove all those lines that start with a dot and see if it gets parsed?