Pat Deegan
10/08/2024, 6:41 PMtnt
10/08/2024, 6:50 PMPat Deegan
10/08/2024, 6:53 PMVPWR = 114 | VPWR = 4
Pat Deegan
10/08/2024, 6:53 PMPat Deegan
10/08/2024, 6:57 PMCircuit 1 contains 58 devices, Circuit 2 contains 58 devices.
Circuit 1 contains 60 nets, Circuit 2 contains 65 nets. *** MISMATCH ***
in the terminal.Pat Deegan
10/08/2024, 6:59 PMtnt
10/08/2024, 7:00 PMPat Deegan
10/08/2024, 7:02 PMtnt
10/08/2024, 7:03 PMtnt
10/08/2024, 7:03 PMtnt
10/08/2024, 7:04 PMPat Deegan
10/08/2024, 7:05 PMtnt
10/08/2024, 7:06 PMPat Deegan
10/08/2024, 7:06 PMPat Deegan
10/08/2024, 7:06 PMtnt
10/08/2024, 7:07 PMVPWR
with a bunch of stuff on one side and much less on the other.tnt
10/08/2024, 7:08 PMdummy_22
tnt
10/08/2024, 7:12 PMTim Edwards
10/08/2024, 8:15 PMringtest
contains a handful of subcells (ring
, driver
, and mux4onehot_b
) which have power and ground properly connected, and a bunch of standard cells, which seem to all have power and ground connected together (on unnamed net that have been named dummy_*
), but apparently disconnected from the power and ground for the subcells and pins.
Side note: If you're running netgen locally and can update, I suggest using the most recent version (1.5.282) because I found a bug a few days ago that causes netgen, under some circumstances, to dump more output than necessary, making the output harder to read. There is a debug on
command that you can add to the script, but that outputs a huge amount of information, so not recommended unless you just cannot see the error in the output (and it's likely that previous times I had to resort to debug on
were probably caused by the bug that I just mentioned and just fixed). That is probably not relevant in this case.tnt
10/08/2024, 9:56 PMMitch Bailey
10/09/2024, 12:03 AM1.5.270
does not work when you have spice that calls verilog modules.
The terminal log is showing
Subcircuit pins:
Circuit 1: _PLACEHOLDER_ |Circuit 2: simplecounter
-------------------------------------------|-------------------------------------------
(no matching pin) |1
(no matching pin) |2
(no matching pin) |3
(no matching pin) |4
(no matching pin) |5
(no matching pin) |6
(no matching pin) |7
(no matching pin) |8
(no matching pin) |9
(no matching pin) |10
(no matching pin) |11
(no matching pin) |12
(no matching pin) |13
(no matching pin) |14
VGND |(no matching pin)
VPWR |(no matching pin)
clk |(no matching pin)
enable |(no matching pin)
counter[9] |(no matching pin)
counter[8] |(no matching pin)
counter[7] |(no matching pin)
counter[6] |(no matching pin)
counter[5] |(no matching pin)
counter[4] |(no matching pin)
counter[3] |(no matching pin)
counter[2] |(no matching pin)
counter[1] |(no matching pin)
counter[0] |(no matching pin)
---------------------------------------------------------------------------------------
Treating empty subcircuits as black-box cells
You’ll probably have better luck with the latest version 1.5.282
or the last known version that worked with spice calling verilog modules 1.5.269
.
When you do call verilog modules from spice, there are a couple things that need to be considered.
1. Since spice calls are by position, the verilog symbols should be created with the ports in the same order as the the verilog module. This may be a manual process. I find it easiest to open the *.sym
file in an editor and rearrange the physical order of the pins there (if there is no schematic). I also add a type=primitive
property to the symbol to prevent the creation of an empty subckt. If you do have an empty subcircuit, the symbol pins will be output in the order of the pins in the schematic (with a recent version of xschem).
2. Spice is case insensitive, verilog is case sensitive. The default for netgen is to follow what ever is read first.
You might consider using the LVS system in the caravel_user_project/Makefile
.
For any lvs/<cellname>/lvs_config.json
file, you can simply run make lvs-cellname
.
All the extraction and LVS parameters are in the lvs_config.json
file and you can include the lower level config files in the upper level hierarchy. The lvs_config.json
options are explained here.Pat Deegan
10/16/2024, 2:45 PM---------------------------------------------------------------------------------------
Instance: simplecounter:x4 |Instance: simplecounter:4
VPWR = 5 | 2 = 5
clk = 3 | 3 = 3
enable = 1 | 4 = 1
counter[0] = 1 | 14 = 1
counter[1] = 1 | 13 = 1
counter[2] = 1 | 12 = 2
counter[3] = 2 | 11 = 1
counter[4] = 1 | 10 = 1
counter[5] = 1 | 9 = 1
counter[6] = 1 | 8 = 2
counter[7] = 2 | 7 = 1
counter[8] = 1 | 6 = 1
counter[9] = 1 | 5 = 1
VGND = 4 | 1 = 4
---------------------------------------------------------------------------------------
Netlists do not match.
Port matching may fail to disambiguate symmetries.
which, but for the ordering, looks like a match to me (full report attached here). I've played with the ordering of ports a good deal to no avail, but will give Mitch's lvs_config system a try. If you see anything obvious in the report, please let me know.tnt
10/16/2024, 3:00 PMPat Deegan
10/16/2024, 3:09 PMTim Edwards
10/16/2024, 3:12 PMsimplecounter
module is being treated as a black box, so netgen has not seen the module definition.Pat Deegan
10/16/2024, 3:17 PMreadnet verilog ../verilog/gl/simplecounter.v $source
line, which barfs if I change the path to something invalid, and outputs
Verilog placeholder module simplecounter replaced by module definition
when running (log attached).Tim Edwards
10/16/2024, 3:21 PMsimplecounter.v
before you read the top level verilog. And keep the existing files because I may need to use them to debug.Pat Deegan
10/16/2024, 3:22 PMPat Deegan
10/16/2024, 3:30 PMcd mag; PROJECT_NAME=ringtest make clean lvs
and it's all up (and a bit messy) at https://github.com/psychogenic/tt09-analogmuxPat Deegan
10/16/2024, 3:32 PMPat Deegan
10/16/2024, 3:34 PMMitch Bailey
10/16/2024, 3:52 PMcounter[0] = 1 | 14 = 1
counter[1] = 1 | 13 = 1
counter[2] = 1 | 12 = 2
counter[3] = 2 | 11 = 1
counter[4] = 1 | 10 = 1
counter[5] = 1 | 9 = 1
counter[6] = 1 | 8 = 2
counter[7] = 2 | 7 = 1
counter[8] = 1 | 6 = 1
counter[9] = 1 | 5 = 1
So the verilog has descending bus indices
module simplecounter (VGND,
VPWR,
clk,
enable,
counter);
inout VGND;
inout VPWR;
input clk;
input enable;
output [9:0] counter;
While the spice has
x4 VSS VDD drv_out enable_counter net2 net3 net4 counter3 net5 net6 net7 counter7 net8 net9 simplecounter
which looks like the ports are in ascending order.
From the xschem/simplecounter.sym
file
B 5 17.5 -32.5 22.5 -27.5 {name=VGND dir=in}
B 5 17.5 -62.5 22.5 -57.5 {name=VPWR dir=in}
B 5 17.5 -202.5 22.5 -197.5 {name=clk dir=in}
B 5 17.5 -182.5 22.5 -177.5 {name=enable dir=in}
B 5 177.5 -202.5 182.5 -197.5 {name=counter[0] dir=out}
B 5 177.5 -182.5 182.5 -177.5 {name=counter[1] dir=out}
B 5 177.5 -162.5 182.5 -157.5 {name=counter[2] dir=out}
B 5 177.5 -142.5 182.5 -137.5 {name=counter[3] dir=out}
B 5 177.5 -122.5 182.5 -117.5 {name=counter[4] dir=out}
B 5 177.5 -102.5 182.5 -97.5 {name=counter[5] dir=out}
B 5 177.5 -82.5 182.5 -77.5 {name=counter[6] dir=out}
B 5 177.5 -62.5 182.5 -57.5 {name=counter[7] dir=out}
B 5 177.5 -42.5 182.5 -37.5 {name=counter[8] dir=out}
B 5 177.5 -22.5 182.5 -17.5 {name=counter[9] dir=out}
You should be ok with just changing the order of the lines in this file (not just the indices!).
B 5 17.5 -32.5 22.5 -27.5 {name=VGND dir=in}
B 5 17.5 -62.5 22.5 -57.5 {name=VPWR dir=in}
B 5 17.5 -202.5 22.5 -197.5 {name=clk dir=in}
B 5 17.5 -182.5 22.5 -177.5 {name=enable dir=in}
B 5 177.5 -22.5 182.5 -17.5 {name=counter[9] dir=out}
B 5 177.5 -42.5 182.5 -37.5 {name=counter[8] dir=out}
B 5 177.5 -62.5 182.5 -57.5 {name=counter[7] dir=out}
B 5 177.5 -82.5 182.5 -77.5 {name=counter[6] dir=out}
B 5 177.5 -102.5 182.5 -97.5 {name=counter[5] dir=out}
B 5 177.5 -122.5 182.5 -117.5 {name=counter[4] dir=out}
B 5 177.5 -142.5 182.5 -137.5 {name=counter[3] dir=out}
B 5 177.5 -162.5 182.5 -157.5 {name=counter[2] dir=out}
B 5 177.5 -182.5 182.5 -177.5 {name=counter[1] dir=out}
B 5 177.5 -202.5 182.5 -197.5 {name=counter[0] dir=out}
tnt
10/16/2024, 3:55 PMPat Deegan
10/16/2024, 3:57 PMPat Deegan
10/16/2024, 3:58 PMMitch Bailey
10/16/2024, 4:49 PMWeirdly, when I run extraction/lvs on just the simplecounter, the extracted spice matches the “correct” port order from xschem, but not when I get it from top level.The port order between the schematic and extracted layout is irrelevant. It’s the port order between the schematic and verilog that’s important.
Mitch Bailey
10/16/2024, 5:30 PMContents of circuit 1: Circuit: 'ringtest'
Circuit ringtest contains 4 device instances.
Class: driver instances: 1
Class: mux4onehot_b instances: 1
Class: ring instances: 1
Class: simplecounter instances: 1
Circuit contains 20 nets.
Contents of circuit 2: Circuit: 'ringtest'
Circuit ringtest contains 4 device instances.
Class: driver instances: 1
Class: mux4onehot_b instances: 1
Class: ring instances: 1
Class: simplecounter instances: 1
Circuit contains 20 nets.
Circuit 1 contains 4 devices, Circuit 2 contains 4 devices.
Circuit 1 contains 20 nets, Circuit 2 contains 20 nets.
Final result:
Circuits match uniquely.
.
Logging to file "lvs.report" disabled
LVS Done.
Pat Deegan
10/16/2024, 5:31 PMMitch Bailey
10/16/2024, 5:34 PMvi
and changed the order of the lines.Mitch Bailey
10/16/2024, 5:35 PMMitch Bailey
10/16/2024, 5:39 PMputs "Reading layout mag/ringtest.lvs.spice..."
set layout [readnet spice mag/ringtest.lvs.spice]
set source [readnet spice /dev/null]
puts "Reading source $env(PDK_ROOT)/sky130A/libs.ref/sky130_fd_sc_hd/spice/sky130_ef_sc_hd__decap_12.spice..."
readnet spice $env(PDK_ROOT)/sky130A/libs.ref/sky130_fd_sc_hd/spice/sky130_ef_sc_hd__decap_12.spice $source
puts "Reading source $env(PDK_ROOT)/sky130A/libs.ref/sky130_fd_sc_hd/spice/sky130_ef_sc_hd__fill_12.spice..."
readnet spice $env(PDK_ROOT)/sky130A/libs.ref/sky130_fd_sc_hd/spice/sky130_ef_sc_hd__fill_12.spice $source
puts "Reading source $env(PDK_ROOT)/sky130A/libs.ref/sky130_fd_sc_hd/spice/sky130_ef_sc_hd__fill_4.spice..."
readnet spice $env(PDK_ROOT)/sky130A/libs.ref/sky130_fd_sc_hd/spice/sky130_ef_sc_hd__fill_4.spice $source
puts "Reading source $env(PDK_ROOT)/sky130A/libs.ref/sky130_fd_sc_hd/spice/sky130_ef_sc_hd__fill_8.spice..."
readnet spice $env(PDK_ROOT)/sky130A/libs.ref/sky130_fd_sc_hd/spice/sky130_ef_sc_hd__fill_8.spice $source
puts "Reading source $env(PDK_ROOT)/sky130A/libs.ref/sky130_fd_sc_hd/spice/sky130_fd_sc_hd.spice..."
readnet spice $env(PDK_ROOT)/sky130A/libs.ref/sky130_fd_sc_hd/spice/sky130_fd_sc_hd.spice $source
puts "Reading source xschem/simulation/driver.spice..."
readnet spice xschem/simulation/driver.spice $source
puts "Reading source xschem/simulation/ring.spice..."
readnet spice xschem/simulation/ring.spice $source
puts "Reading source xschem/simulation/ringtest.spice..."
readnet spice xschem/simulation/ringtest.spice $source
puts "Reading source verilog/gl/simplecounter.v..."
readnet verilog verilog/gl/simplecounter.v $source
lvs "$layout ringtest" "$source ringtest" $env(PDK_ROOT)/sky130A/libs.tech/netgen/sky130A_setup.tcl lvs.report -blackbox -json
Mitch Bailey
10/16/2024, 5:41 PMv {xschem version=3.4.5 file_version=1.2
}
G {}
K {type=primitive
format="@name @pinlist @symname"
booya="VGND VPWR clk enable counter[0] counter[1] counter[2] counter[3] counter[4] counter[5] counter[6] counter[7] counter[8] counter[9] "
template="name=x1"
}
V {}
S {}
E {}
L 4 20 -180 40 -180 {}
L 4 20 -200 40 -200 {}
L 4 160 -200 180 -200 {}
L 4 160 -180 180 -180 {}
L 4 160 -160 180 -160 {}
L 4 160 -140 180 -140 {}
L 4 160 -120 180 -120 {}
L 4 160 -100 180 -100 {}
L 4 160 -80 180 -80 {}
L 4 160 -60 180 -60 {}
L 4 160 -40 180 -40 {}
L 4 160 -20 180 -20 {}
L 4 40 -210 40 -10 {}
L 4 40 -10 160 -10 {}
L 4 160 -210 160 -10 {}
L 4 40 -210 160 -210 {}
L 4 20 -60 40 -60 {}
L 4 20 -30 40 -30 {}
B 5 17.5 -32.5 22.5 -27.5 {name=VGND dir=in}
B 5 17.5 -62.5 22.5 -57.5 {name=VPWR dir=in}
B 5 17.5 -202.5 22.5 -197.5 {name=clk dir=in}
B 5 17.5 -182.5 22.5 -177.5 {name=enable dir=in}
B 5 177.5 -22.5 182.5 -17.5 {name=counter[9] dir=out}
B 5 177.5 -42.5 182.5 -37.5 {name=counter[8] dir=out}
B 5 177.5 -62.5 182.5 -57.5 {name=counter[7] dir=out}
B 5 177.5 -82.5 182.5 -77.5 {name=counter[6] dir=out}
B 5 177.5 -102.5 182.5 -97.5 {name=counter[5] dir=out}
B 5 177.5 -122.5 182.5 -117.5 {name=counter[4] dir=out}
B 5 177.5 -142.5 182.5 -137.5 {name=counter[3] dir=out}
B 5 177.5 -162.5 182.5 -157.5 {name=counter[2] dir=out}
B 5 177.5 -182.5 182.5 -177.5 {name=counter[1] dir=out}
B 5 177.5 -202.5 182.5 -197.5 {name=counter[0] dir=out}
T {enable} 45 -184 0 0 0.2 0.2 {}
T {clk} 45 -204 0 0 0.2 0.2 {}
T {counter[0]} 155 -204 0 1 0.2 0.2 {}
T {counter[1]} 155 -184 0 1 0.2 0.2 {}
T {counter[2]} 155 -164 0 1 0.2 0.2 {}
T {counter[3]} 155 -144 0 1 0.2 0.2 {}
T {counter[4]} 155 -124 0 1 0.2 0.2 {}
T {counter[5]} 155 -104 0 1 0.2 0.2 {}
T {counter[6]} 155 -84 0 1 0.2 0.2 {}
T {counter[7]} 155 -64 0 1 0.2 0.2 {}
T {counter[8]} 155 -44 0 1 0.2 0.2 {}
T {counter[9]} 155 -24 0 1 0.2 0.2 {}
T {@name} 40 -230 0 0 0.2 0.2 {}
T {@symname} 90 -120 1 0 0.2 0.2 {}
T {VPWR} 45 -64 0 0 0.2 0.2 {}
T {VGND} 45 -34 0 0 0.2 0.2 {}
Pat Deegan
10/16/2024, 5:45 PMPat Deegan
10/16/2024, 5:45 PMMitch Bailey
10/16/2024, 5:54 PMwill not flatten
in the lvs.report
and the strings Matching pins
and contains no devices
in the lvs.log
(stdout). These will flag all the primitive devices, so those are filtered out. Anything else causes LVS to fail even if the Circuits match uniquely
.Pat Deegan
10/16/2024, 5:55 PMMitch Bailey
10/16/2024, 5:55 PMsky130_ef_sc_hd
cells may not be necessary.Mitch Bailey
10/16/2024, 5:56 PMdecap_12
.Pat Deegan
10/16/2024, 5:57 PMPat Deegan
10/16/2024, 6:01 PMtnt
10/16/2024, 6:01 PMPat Deegan
10/16/2024, 6:02 PMPat Deegan
10/16/2024, 6:02 PMMitch Bailey
10/16/2024, 6:03 PMdecap_12
cell being blackboxed in the original log file.
Creating placeholder cell definition for module sky130_ef_sc_hd__decap_12.
...
Circuit sky130_ef_sc_hd__decap_12 contains no devices.
and the original report file
Circuit 2 cell sky130_ef_sc_hd__decap_12 is a black box; will not flatten Circuit 1
Subcircuit pins:
Circuit 1: sky130_ef_sc_hd__decap_12 |Circuit 2: sky130_ef_sc_hd__decap_12
-------------------------------------------|-------------------------------------------
VGND |VGND
VPWR |VPWR
VPB |VPB
VNB |VNB
---------------------------------------------------------------------------------------
Cell pin lists are equivalent.
Device classes sky130_ef_sc_hd__decap_12 and sky130_ef_sc_hd__decap_12 are equivalent.
Mitch Bailey
10/16/2024, 6:05 PMringtest.spice
simplecounter.sym
change.
5c5
< x4 VSS VDD drv_out enable_counter net2 net3 counter7 net4 net5 net6 counter3 net7 net8 net9 simplecounter
---
> x4 VSS VDD drv_out enable_counter net2 net3 net4 counter3 net5 net6 net7 counter7 net8 net9 simplecounter
Pat Deegan
10/16/2024, 6:06 PMMitch Bailey
10/16/2024, 6:08 PMPat Deegan
10/16/2024, 6:09 PMPat Deegan
10/16/2024, 6:10 PMPat Deegan
10/16/2024, 6:14 PMCircuit 1 contains 4 devices, Circuit 2 contains 4 devices.
Circuit 1 contains 20 nets, Circuit 2 contains 20 nets.
Final result:
Circuits match uniquely.
.
Logging to file "lvs.report" disabled
LVS Done.
LVS OK
oof! Thanks, can finally move on!tnt
10/16/2024, 6:17 PMMitch Bailey
10/16/2024, 6:19 PMPat Deegan
10/16/2024, 6:22 PMPat Deegan
10/16/2024, 6:25 PMtnt
10/16/2024, 6:26 PMmet4
power strips, you see the defined pas area as a small cyan outline on them in the upper part with the label written on it.Pat Deegan
10/16/2024, 6:28 PM