Is it possible to have a vector parameter as a top level design variable and then pick out elements from that inside of a subckt based on an index parameter? The following shows what tried and hopefully it is clear what the desired result would be.
simulator lang=spectre
global 0
parameters MYTOP=[3.3 2.7 1.8 5.0]
subckt my_subcell VOUT
parameters MYINDEX=0
// this one gives an error:
V0 (VOUT 0) vsource dc=MYTOP[MYINDEX] type=dc
// no error on this, but of course that isn't what I was looking for.
//V0 (VOUT 0) vsource dc=MYINDEX type=dc
ends my_subcell
I7 (OUT3) my_subcell MYINDEX=3
I6 (OUT2) my_subcell MYINDEX=2
I5 (OUT1) my_subcell MYINDEX=1
I4 (OUT0) my_subcell MYINDEX=0
R3 (OUT3 0) resistor r=1K
R2 (OUT2 0) resistor r=1K
R1 (OUT1 0) resistor r=1K
R0 (OUT0 0) resistor r=1K
dcOp dc write="spectre.dc" oppoint=screen
The above trial gives
Cannot run the simulation because syntax error `Unexpected identifier "MYINDEX". Expected integer or operator' was encountered at line 17, column 33. Correct the syntax error and rerun the simulation.
Thanks so much
-Dan