<@U01819B63HP> is there any option to modify netli...
# xschem
k
@Stefan Schippers is there any option to modify netlist generation. When I try to simulate this circuit I got ngspice errors
Copy code
Warning from checkvalid: vector y_2_1 is not available or has zero length.
Error: RHS "1/(2*pi*frequency*imag(1/y_2_1))" invalid
Warning from checkvalid: vector y_2_1 is not available or has zero length.
Error: RHS "-real(1/y_2_1)" invalid
binary raw file "sp_mim_cap.raw"
it can be fixed by eliminating the .SAVE I(V1) and .SAVE I(V2) lines in the following code, but I was wondering if there is some switch to prevent generating this commands.
Copy code
** SP_MIM_CAP flat netlist                                                                                                                                                                           
   1 R1 IN GND 1MEG M=1                                                                                                                                                                                   
   2 V1 IN GND DC 0 AC 1 PORTNUM 1 Z0 50                                                                                                                                                                  
   3 .SAVE I(V1)                                                                                                                                                                                          
   4 R2 OUT GND 1MEG M=1                                                                                                                                                                                  
   5 V2 OUT GND DC 0 AC 0 PORTNUM 2 Z0 50                                                                                                                                                                 
   6 .SAVE I(V2)                                                                                                                                                                                          
   7 *--------BEGIN_XC1->CAP_CMIM                                                                                                                                                                         
   8 XC1 OUT IN  CAP_CMIM W=1.0E-6 L=1.0E-6 MF=1                                                                                                                                                          
   9 *--------END___XC1->CAP_CMIM                                                                                                                                                                         
  10 **** BEGIN USER ARCHITECTURE CODE
s
Zero length vectors can be eliminated before the
write
command with
remzerovec
, so in your ngspice commands:
Copy code
...
remzerovec
write sp_mim_cap.raw
...
k
Thank you for quick response, unfortunately it does not work, the error still appears
s
ok then the error is there due to an error in the expressions, looks like Y_2_1 is not existing.
Ok, this is the good one. It gives all the Y / S / Z parameters and does not print errors about the expressions and I can plot
Rseries
and
Cseries
Copy code
.control
  save all
  sp lin 500 1e8 10e9 0
  let Cseries = 1 / (2 * PI * frequency * imag(1/Y_2_1))
  let Rseries = -real(1/Y_2_1)
  write test_sp_analysis.raw
.endc
Updated xschem to be able to load SP analyses. data format is identical to an AC analysis)
k
great !