Jon Ho
02/25/2023, 7:36 PMTim Edwards
02/25/2023, 8:35 PMJon Ho
02/25/2023, 8:37 PMJon Ho
02/25/2023, 8:37 PMJon Ho
02/25/2023, 8:38 PMJon Ho
02/25/2023, 8:39 PMTim Edwards
02/25/2023, 8:42 PMuser_analog_project_wrapper.sym
.
You are matching the pin order in both the extracted layout and the schematic?Jon Ho
02/25/2023, 8:43 PMTim Edwards
02/25/2023, 8:46 PMJon Ho
02/25/2023, 8:48 PMTim Edwards
02/25/2023, 8:49 PMJon Ho
02/25/2023, 8:50 PMJon Ho
02/25/2023, 8:51 PMJon Ho
02/25/2023, 8:51 PMTim Edwards
02/25/2023, 8:55 PMmag/user_analog_project_wrapper.mag
. These two files (the .mag and .sym) have to agree on the port order.
If you don't want to redo ~700 lines, there's a simpler way to do it, which is to read the SPICE file from xschem into magic using File->Import SPICE
readspice <netlist>
while you are editing the layout. That will cause magic to renumber all of the ports to match the SPICE file.Tim Edwards
02/25/2023, 8:56 PMJon Ho
02/25/2023, 8:56 PMTim Edwards
02/25/2023, 8:57 PMJon Ho
02/25/2023, 8:58 PMTim Edwards
02/25/2023, 8:59 PMuser_analog_project_wrapper
.Tim Edwards
02/25/2023, 9:01 PMFile->Import SPICE
that you want. It's just the readspice
command from the command line.Jon Ho
02/25/2023, 9:01 PMTim Edwards
02/25/2023, 9:02 PMTim Edwards
02/25/2023, 9:03 PMJon Ho
02/25/2023, 9:17 PMTim Edwards
02/25/2023, 9:18 PMuser_analog_project_wrapper
, because that's the one that needs to be annotated.Tim Edwards
02/25/2023, 9:19 PMreadspice
on the flattened layout, as long as you had deleted the original cell and renamed the flattened cell to same name as the original, so the subcircuit names still match.Tim Edwards
02/25/2023, 9:20 PMJon Ho
02/25/2023, 9:38 PMJon Ho
02/25/2023, 9:39 PMJon Ho
02/25/2023, 9:39 PMJon Ho
02/25/2023, 9:40 PMTim Edwards
02/25/2023, 9:40 PMJon Ho
02/25/2023, 9:47 PMTim Edwards
02/25/2023, 9:49 PM.option RSHUNT=1E20
to your extracted_const_gm_test_022523.spice
netlist. There are "singular matrix" warnings that come from magic's tendency to write out capacitors that are floating, which ngspice does not like.Thomas Figura
02/25/2023, 9:51 PMJon Ho
02/25/2023, 9:55 PMTim Edwards
02/25/2023, 9:58 PMJon Ho
02/25/2023, 9:59 PMTim Edwards
02/25/2023, 10:01 PMextresist
.Stefan Schippers
02/25/2023, 10:02 PMsim_pinnumber
attribute attached to pins. this sim_pinnumber is used as a sort key when producing the netlist (lowest first).
3. In the symbol global attributes explicitly specify the order of pins. Usualy the format attrinute (the netlist rule) is: format="@name @pinlist @symname"
, however you can use something like: `format="@name @@GND @@TRIG @@OUT @@RESETB @@CTRL @@THRES @@DIS @@VCC @symname`", that is replacing @pinlist with the explicit order of pins.
The relevant man page is here.Tim Edwards
02/25/2023, 10:12 PMTim Edwards
02/25/2023, 10:15 PMJon Ho
02/25/2023, 10:16 PMTim Edwards
02/25/2023, 10:17 PMJon Ho
02/25/2023, 10:17 PMJon Ho
02/25/2023, 10:19 PMStefan Schippers
02/25/2023, 10:20 PMDATA[31:0],
which expands as DATA[31],DATA[30], ...., DATA[0]
, or DATA[31..0]
expanding to DATA31,DATA30,...,DATA0
vectored ports in xschem symbols are handled like a single pin. in spice netlist these pins are unrolled to individual bits. This is not necessary for VHDL and Verilog netlist backends.Tim Edwards
02/25/2023, 10:23 PMformat=@name @@vector1 @@vector2 @@vector3 ... @symname
? In that case it might not be too painful for them to just edit the symbol to match what's in the layout port definition.Stefan Schippers
02/25/2023, 10:26 PMformat="@name @@vss @@LDWL[511:0] @@LDBL[255:0] @symname"
I just did a live test to ensure it does fine.Stefan Schippers
02/25/2023, 10:28 PMXarr vss LDWL[511] LDWL[510] LDBL[255] LDBL[254] LDWL[509] ....
Tim Edwards
02/25/2023, 10:30 PMTim Edwards
02/25/2023, 10:32 PMextracted_const_gm_test_022523
.Jon Ho
02/25/2023, 10:39 PMJon Ho
02/25/2023, 10:40 PMStefan Schippers
02/25/2023, 10:41 PMTim Edwards
02/25/2023, 10:42 PMTim Edwards
02/25/2023, 10:43 PMStefan Schippers
02/25/2023, 10:43 PMTim Edwards
02/25/2023, 10:44 PMcaravel_user_project_analog
repository, which is where Jon got it from. Seems to be my fault for not making sure that the pin list of the xschem symbol matches the layout port numbering.Tim Edwards
02/25/2023, 10:47 PMTim Edwards
02/25/2023, 10:48 PMStefan Schippers
02/25/2023, 10:49 PMTim Edwards
02/25/2023, 10:50 PMStefan Schippers
02/25/2023, 10:52 PMlsort
consider the -dictionary
option to fix numbered vectorsTim Edwards
02/25/2023, 10:52 PMStefan Schippers
02/25/2023, 10:53 PMtclsh8.6 [~] lsort {a5 a12 a6 a14}
a12 a14 a5 a6
tclsh8.6 [~] lsort -dictionary {a5 a12 a6 a14}
a5 a6 a12 a14
Tim Edwards
02/25/2023, 11:23 PMuser_analog_project_wrapper.spice
to annotate the magic layout. Otherwise, do it just like you did before. I found that the pins are ordered differently in the .sch and .sym files, and that seems to produce a different subcircuit port order depending on whether you netlist the project as the top level or the wrapper as the top level. I changed the order of lines in the sym file to match the sch file, and I could then get it to netlist with the same pin order. I will go patch up the repository itself, but I think this should get you going.Jon Ho
02/25/2023, 11:34 PMJon Ho
02/26/2023, 12:06 AMJon Ho
02/26/2023, 12:06 AMTim Edwards
02/26/2023, 3:17 AMJon Ho
03/24/2023, 7:36 PMTim Edwards
03/24/2023, 11:39 PM