Hi <@U01819B63HP>, one question. I am trying to se...
# xschem
k
Hi @Stefan Schippers, one question. I am trying to set up all the xschem testcases we already provided in IHP-Open-PDK using Xyce simulator. Since our mosfets use PSP103 Verilog-A model it have to be compiled to either to
osdi
(for ngspice) file or
so
library (for Xyce). In the case of ngspice is simple because you can inform it using
.spiceinit
where the actual
osdi
file is. Xyce does not have it so you have to run the netlist calling
Xyce -plugin ../../../admslibs/Xyce_Plugin_PSP103_VA.so nmos_id_vg_vb.cir
My question is if it is possible to define it on schematic and then pass to xyce this
-plugin path_to_file/plugin.so
s
It is possible to change the simulation command. Go to Simulation->Configure simulators and tools-> locate the Xyce batch line and change the command, adding the required -plugin options. You can do this programmatically:
Copy code
# Setup the default simulation commands if not already set up
set_sim_defaults
# Check the name of the 4th (0,1,2,3) spice simulation command:
puts $sim(spice,3,name)
# --> Xyce batch
# get the command
puts $sim(spice,3,cmd)
# --> Xyce "$N"
# Change the command
set sim(spice,3,cmd) {Xyce  -plugin /.../.../... \"$N\"} 
# Change the simulator to be used (Xyce)
set sim(spice,default) 3
# run netlist and simulation
xschem netlist
simulate
You can place a launcher (launcher.sym) in the schematic and trigger the above commands by ctrl-clicking it (Left button click on the launcher by holding down the Ctrl key). The attributes in the image are copied here:
Copy code
name=h8
descr="Simulate with Xyce" 
tclcommand="
# Setup the default simulation commands if not already set up
# for example by already launched simulations.
set_sim_defaults

# Change the Xyce command. In the spice category there are currently
# 5 commands (0, 1, 2, 3, 4). Command 3 is the Xyce batch
# you can get the number by querying $sim(spice,n)
set sim(spice,3,cmd) {Xyce -plugin /.../.../... \"$N\"}

# change the simulator to be used (Xyce)
set sim(spice,default) 3

# run netlist and simulation
xschem netlist
simulate
"
This launcher changes the simulator to Xyce, changes the command by adding the -plugin, runs the netlist and runs the simulator with modified command line. This means you should not use the Netlist and Simulate buttons. The launcher does all the work. After triggering the launcher once you can (if you prefer) run following simulations by just pressing
Netlist
and
Simulate
buttons, since the modified command will not be cleared in the running session.
Xschem has also the
simulator_commands.sym
symbol that gets netlisted only if the selected simulator matches the
simulator
attribute of this component. This can be used to put Xyce / ngspice specific commands in different simulator_commands.sym code blocks.
It would be nice if the -plugin command line could be specified inside the netlist (as we already specify models with .lib and / or .include). This could be a feature request to the Xyce team. May be this is not possible as the runtime libs may need to be loaded at the program startup, thus before having a chance to parse the netlist.