Matt Venn
03/07/2024, 5:32 PMMatt Venn
03/07/2024, 5:32 PMMatt Venn
03/07/2024, 5:33 PMMatt Venn
03/07/2024, 5:33 PMMatt Venn
03/07/2024, 5:34 PMMatt Venn
03/07/2024, 5:34 PMMatt Venn
03/07/2024, 5:35 PMMatt Venn
03/07/2024, 5:35 PMMatt Venn
03/07/2024, 5:35 PMMatt Venn
03/07/2024, 5:37 PMMatt Venn
03/07/2024, 5:37 PMMatt Venn
03/07/2024, 5:37 PMMatt Venn
03/07/2024, 5:37 PMStefan Schippers
03/07/2024, 5:58 PMspice_sym_def=".include ../../mag/r2r.sim.spice"
but the ../../mag
directory is wrong (should be ../mag) and the file r2r.sim.spice
does not existsStefan Schippers
03/07/2024, 6:00 PMr2r.sim.spice
spice netlist created by magic so I don't need to run the layout flow?Stefan Schippers
03/07/2024, 6:03 PMMitch Bailey
03/07/2024, 6:12 PMreadspice
in magic before extraction to get the layout ports in the same order. See https://open-source-silicon.slack.com/archives/C016HUV935L/p1677358505708119?thread_ts=1677353770.126889&cid=C016HUV935LStefan Schippers
03/07/2024, 6:19 PM.subckt
port list of the pex netlist (following the .include
statement or directly looking for a matching .subckt line in the spice_sym_def attribute) ) to ensure the port order is the same in the instance call (the X1 net1 net2 net3 ... symbol_ref
line in the xschem netlist) and the subckt line ( .subckt symbol_ref port1 port2 port3 ...
) from the PEX netlist.
This works if the symbol has a format attribute that uses the @pinlist
for the list of nets (format="@name @pinlist @symname"
)
If you specify the list pin by pin (format="@name @@CLK @@D @@RST @@Q @symname"
) then it's up to you to ensure port order correctness.Matt Venn
03/08/2024, 11:55 AMMatt Venn
03/08/2024, 11:55 AMMatt Venn
03/08/2024, 11:56 AMMatt Venn
03/08/2024, 11:57 AMMatt Venn
03/08/2024, 11:58 AMMatt Venn
03/08/2024, 11:59 AMMitch Bailey
03/08/2024, 12:13 PMMatt Venn
03/08/2024, 12:23 PMMatt Venn
03/08/2024, 12:49 PMMatt Venn
03/08/2024, 12:50 PMMatt Venn
03/08/2024, 1:03 PMStefan Schippers
03/08/2024, 1:11 PMStefan Schippers
03/08/2024, 1:13 PM-schematic=r2r.sim
-spice_sym_def=".include ../../mag/r2r.sim.spice"
+schematic=r2r_pex
+spice_sym_def="tcleval(.include [file normalize ../mag/r2r.sim.spice])"
I have then edited r2r.sim.spice
changing the .subckt name from r2r
to r2r_pex
.
The file normalize
command creates the absolute path for the file, this is needed since xschem runs in ./xschem and ngspice runs in ./xschem/simulationMatt Venn
03/08/2024, 1:19 PMMatt Venn
03/08/2024, 1:19 PMMatt Venn
03/08/2024, 1:20 PMMatt Venn
03/08/2024, 1:20 PMnormalize
- it seems to work for me without thatMatt Venn
03/08/2024, 1:22 PMStefan Schippers
03/08/2024, 1:33 PM.include [file normalize ../mag/r2r.sim.spice]
is needed so that xschem does see the file and also ngspice does see the file. If you specify .include ../../r2r.sim.spice
xschem will not find the file and can not adjust the pin order of the xschem instance (the bottom r2r symbol) with the order in the r2r.sim.spice
file. recent xschem versions show a warning if the file can not be looked up during netlist creation.
This is just a warning saying "I can not inspect the .include file to make port order match". The netlist will be generated anyway, but it's your task to ensure the port order in the symbol matches with the port order in r2r.sim.spice
. If you have a rather old xschem this function was not implemented.
commit d2c6566030f8936bd7fee76d76880be7d67163de
Author: stefan schippers <stefan.schippers@gmail.com>
Date: Mon Jan 8 03:24:59 2024 +0100
when doing spice netlist, if a symbol has the spice_sym_def attribute set and is using @pinlist in format string for port order, get the port order from the subckt given in spice_sym_def, either directly or through a .include line
Matt Venn
03/08/2024, 1:36 PMMatt Venn
03/08/2024, 1:36 PMMatt Venn
03/19/2024, 4:34 PMMatt Venn
03/19/2024, 4:35 PMMatt Venn
03/19/2024, 5:01 PMMatt Venn
03/19/2024, 5:04 PM