Allwan S Anand
04/12/2024, 9:49 AMMitch Bailey
04/12/2024, 10:43 AMtype=primitive
.
Make sure the pins on the symbol are in the same order as the ports in verilog - you can open the sym file and rearrange the pins or add the sim_pinnumber
property to each pin.
When you create the spice netlist, it will have a digital macro instance but no subcircuit.
Create a script
for running netgen.
set layout [readnet spice <extracted_spice>]
set source [readnet spice <spice_netlist_from_xschem>]
readnet verilog <verilog_gL_macro> $source
lvs "$layout user_analog_project_wrapper" "$source user_analog_project_wrapper" $env(PDK_ROOT)/$env(PDK)/libs.tech/netgen/$env(PDK)_setup.tcl lvs.report
Run netgen with netgen -batch source script
Stefan Schippers
04/12/2024, 3:52 PMAllwan S Anand
04/16/2024, 2:23 PMMitch Bailey
04/16/2024, 3:12 PMVGND
and VPWR
pins to your pmw_generator
symbol.
2. Don’t use global VGND
or VPWR
symbols. Use named wires instead.
3. When you export your netlist from xschem, set Simulation
-> LVS netlist: top level is a .subckt
4. Use the actual file names in your script, surrounded by ” if necessary.
set layout [readnet spice "user_analog_project_wrapper_layout.spice"]
5. The lvs command should contain the top cell names, not the file names
lvs "$layout user_analog_project_wrapper" "$source user_analog_project_wrapper"
6. The instance name for the pwm_generator
symbol should begin with an X
7. The pwm_generator
symbol pins are in this order
wb_clk_i wbs_dat_i[0] wbs_dat_i[1] wbs_dat_i[2] wbs_dat_i[3] wbs_dat_i[4] wbs_dat_i[5]
+ wbs_dat_i[6] wbs_dat_i[7] net1 wb_rst_i
The verilog pins are in this order
VGND,
VPWR,
clk,
pwm_out,
rst,
duty_cycle
with the duty_cycle
bus indexes in reverse order.
They need to be in the same order. I find it easiest to open the pwm_generator.sym
file and rearrange them.
8. You can create the layout netlist without parasitic capacitors. Use
ext2spice lvs
ext2spice -o user_analog_project_wrapper_layout.spice
Robin Tsang
04/17/2024, 3:44 AMnetgen -batch source runlvs
If anyone has a working example or knows how to get it to work, please help. @Tim Edwards has given me some helpful pointers after the Chipalooza layout review but I still can't get it to work.
Layout netlist:
*This is the extracted netlist from layout
.subckt sky130_ajc_ip__overvoltage dvdd dvss otrip otrip_decoded
*Digital route extracted from layout
xIdig dvdd dvss otrip otrip_decoded overvoltage_dig
.ends
.subckt overvoltage_dig VPWR VGND otrip otrip_decoded
xbuf2 otrip VGND VGND VPWR VPWR otrip_decoded sky130_fd_sc_hd__buf_2
.ends
.subckt sky130_fd_sc_hd__buf_2 A VGND VNB VPB VPWR X
X0 X a_27_47# VGND VNB sky130_fd_pr__nfet_01v8 w=650000u l=150000u
X1 a_27_47# A VPWR VPB sky130_fd_pr__pfet_01v8_hvt w=640000u l=150000u
X2 VGND a_27_47# X VNB sky130_fd_pr__nfet_01v8 w=650000u l=150000u
X3 X a_27_47# VPWR VPB sky130_fd_pr__pfet_01v8_hvt w=1e+06u l=150000u
X4 VPWR a_27_47# X VPB sky130_fd_pr__pfet_01v8_hvt w=1e+06u l=150000u
X5 a_27_47# A VGND VNB sky130_fd_pr__nfet_01v8 w=420000u l=150000u
.ends
Schematic netlist:
*This is the netlist that initiates Verilog Gate-Level netlist
.subckt sky130_ajc_ip__overvoltage dvdd dvss otrip otrip_decoded
*Verilog Gate-Level netlist
xIdig dvdd dvss otrip otrip_decoded overvoltage_dig
.ends
.subckt sky130_fd_sc_hd__buf_2 A VGND VNB VPB VPWR X
X0 X a_27_47# VGND VNB sky130_fd_pr__nfet_01v8 w=650000u l=150000u
X1 a_27_47# A VPWR VPB sky130_fd_pr__pfet_01v8_hvt w=640000u l=150000u
X2 VGND a_27_47# X VNB sky130_fd_pr__nfet_01v8 w=650000u l=150000u
X3 X a_27_47# VPWR VPB sky130_fd_pr__pfet_01v8_hvt w=1e+06u l=150000u
X4 VPWR a_27_47# X VPB sky130_fd_pr__pfet_01v8_hvt w=1e+06u l=150000u
X5 a_27_47# A VGND VNB sky130_fd_pr__nfet_01v8 w=420000u l=150000u
.ends
Verilog netlist:
module overvoltage_dig (
input VPWR,
input VGND,
input otrip,
output otrip_decoded
);
wire VPWR;
wire VGND;
wire otrip;
wire otrip_decoded;
sky130_fd_sc_hd__buf_2 output0 (.A(otrip),
.VGND(VGND),
.VNB(VGND),
.VPB(VPWR),
.VPWR(VPWR),
.X(otrip_decoded));
endmodule
LVS report:
Circuit 1 cell sky130_fd_pr__nfet_01v8 and Circuit 2 cell sky130_fd_pr__nfet_01v8 are black boxes.
Warning: Equate pins: cell sky130_fd_pr__nfet_01v8 is a placeholder, treated as a black box.
Warning: Equate pins: cell sky130_fd_pr__nfet_01v8 is a placeholder, treated as a black box.
Subcircuit pins:
Circuit 1: sky130_fd_pr__nfet_01v8 |Circuit 2: sky130_fd_pr__nfet_01v8
-------------------------------------------|-------------------------------------------
1 |1
2 |2
3 |3
4 |4
---------------------------------------------------------------------------------------
Cell pin lists are equivalent.
Device classes sky130_fd_pr__nfet_01v8 and sky130_fd_pr__nfet_01v8 are equivalent.
Circuit 1 cell sky130_fd_pr__pfet_01v8_hvt and Circuit 2 cell sky130_fd_pr__pfet_01v8_hvt are black boxes.
Warning: Equate pins: cell sky130_fd_pr__pfet_01v8_hvt is a placeholder, treated as a black box.
Warning: Equate pins: cell sky130_fd_pr__pfet_01v8_hvt is a placeholder, treated as a black box.
Subcircuit pins:
Circuit 1: sky130_fd_pr__pfet_01v8_hvt |Circuit 2: sky130_fd_pr__pfet_01v8_hvt
-------------------------------------------|-------------------------------------------
1 |1
2 |2
3 |3
4 |4
---------------------------------------------------------------------------------------
Cell pin lists are equivalent.
Device classes sky130_fd_pr__pfet_01v8_hvt and sky130_fd_pr__pfet_01v8_hvt are equivalent.
Class sky130_fd_sc_hd__buf_2 (0): Merged 2 parallel devices.
Class sky130_fd_sc_hd__buf_2 (1): Merged 2 parallel devices.
Subcircuit summary:
Circuit 1: sky130_fd_sc_hd__buf_2 |Circuit 2: sky130_fd_sc_hd__buf_2
-------------------------------------------|-------------------------------------------
sky130_fd_pr__nfet_01v8 (3->2) |sky130_fd_pr__nfet_01v8 (3->2)
sky130_fd_pr__pfet_01v8_hvt (3->2) |sky130_fd_pr__pfet_01v8_hvt (3->2)
Number of devices: 4 |Number of devices: 4
Number of nets: 7 |Number of nets: 7
---------------------------------------------------------------------------------------
Netlists match uniquely.
Subcircuit pins:
Circuit 1: sky130_fd_sc_hd__buf_2 |Circuit 2: sky130_fd_sc_hd__buf_2
-------------------------------------------|-------------------------------------------
X |X
VGND |VGND
VNB |VNB
A |A
VPWR |VPWR
VPB |VPB
---------------------------------------------------------------------------------------
Cell pin lists are equivalent.
Device classes sky130_fd_sc_hd__buf_2 and sky130_fd_sc_hd__buf_2 are equivalent.
Subcircuit summary:
Circuit 1: overvoltage_dig |Circuit 2: overvoltage_dig
-------------------------------------------|-------------------------------------------
sky130_fd_sc_hd__buf_2 (1) |sky130_fd_sc_hd__buf_2 (1)
Number of devices: 1 |Number of devices: 1
Number of nets: 4 |Number of nets: 4
---------------------------------------------------------------------------------------
Netlists match uniquely with port errors.
Subcircuit pins:
Circuit 1: overvoltage_dig |Circuit 2: overvoltage_dig
-------------------------------------------|-------------------------------------------
VGND |VGND
VPWR |VPWR
otrip |otrip
otrip_decoded |otrip_decoded
(no matching pin) |proxy1
(no matching pin) |proxy2
(no matching pin) |proxy3
(no matching pin) |proxy4
---------------------------------------------------------------------------------------
Cell pin lists are equivalent.
Device classes overvoltage_dig and overvoltage_dig are equivalent.
Flattening non-matched subcircuits overvoltage_dig overvoltage_dig
Subcircuit summary:
Circuit 1: sky130_ajc_ip__overvoltage |Circuit 2: sky130_ajc_ip__overvoltage
-------------------------------------------|-------------------------------------------
sky130_fd_sc_hd__buf_2 (1) |sky130_fd_sc_hd__buf_2 (1)
Number of devices: 1 |Number of devices: 1
Number of nets: 4 |Number of nets: 4
---------------------------------------------------------------------------------------
Netlists match uniquely with port errors.
Subcircuit pins:
Circuit 1: sky130_ajc_ip__overvoltage |Circuit 2: sky130_ajc_ip__overvoltage
-------------------------------------------|-------------------------------------------
otrip |(no matching pin)
otrip_decoded |(no matching pin)
dvdd |(no matching pin)
dvss |(no matching pin)
(no matching pin) |dvdd
(no matching pin) |dvss
(no matching pin) |otrip
(no matching pin) |otrip_decoded
dvdd |(no matching pin)
dvss |(no matching pin)
otrip |(no matching pin)
otrip_decoded |(no matching pin)
---------------------------------------------------------------------------------------
Cell pin lists for sky130_ajc_ip__overvoltage and sky130_ajc_ip__overvoltage altered to match.
Device classes sky130_ajc_ip__overvoltage and sky130_ajc_ip__overvoltage are equivalent.
Final result: Top level cell failed pin matching.
Run script:
set layout [readnet spice "sky130_ajc_ip__overvoltage.spice"]
set source [readnet spice "sky130_ajc_ip__overvoltage_lvs.xschem"]
readnet verilog overvoltage_dig.v $source
lvs "$layout sky130_ajc_ip__overvoltage" "$source sky130_ajc_ip__overvoltage" /usr/local/share/pdk/sky130A/libs.tech/netgen/sky130A_setup.tcl lvs.report
Mitch Bailey
04/17/2024, 4:43 AM1.5.269
. Might have something to do with the changes in bf67d3c2754a6cdcd6cc5fe7e69ea1fddd855dd2
.
Not in the lvs.result file, but the script generates this message.
Subcircuit pins:
Circuit 1: _PLACEHOLDER_ |Circuit 2: overvoltage_dig
-------------------------------------------|-------------------------------------------
(no matching pin) |1
(no matching pin) |2
(no matching pin) |3
(no matching pin) |4
VPWR |(no matching pin)
VGND |(no matching pin)
otrip |(no matching pin)
otrip_decoded |(no matching pin)
---------------------------------------------------------------------------------------
which is probably where all the proxy
ports originate.
@Robin Tsang thanks for the test case. Can you log an issue on the netgen
repo?Mitch Bailey
04/17/2024, 4:52 AMsky130_ajc_ip__overvoltage_lvs.xschem
(it’s not part of the schematic, is it?) and use this script which seems to work with the current netgen version.
set layout [readnet spice "sky130_ajc_ip__overvoltage.spice"]
set source [readnet spice "$env(PDK_ROOT)/$env(PDK)/libs.ref/sky130_fd_sc_hd/spice/sky130_fd_sc_hd.spice"]
#readnet spice /usr/local/share/pdk/sky130A/libs.ref/sky130_fd_sc_hd/spice/sky130_fd_sc_hd.spice $source
readnet verilog overvoltage_dig.v $source
readnet spice "sky130_ajc_ip__overvoltage_lvs.xschem" $source
lvs "$layout sky130_ajc_ip__overvoltage" "$source sky130_ajc_ip__overvoltage" $env(PDK_ROOT)/$env(PDK)/libs.tech/netgen/$env(PDK)_setup.tcl lvs.report
Mitch Bailey
04/17/2024, 4:56 AMError: SPICE subcircuit overvoltage_dig redefines a verilog module!
Robin Tsang
04/17/2024, 1:56 PMRobin Tsang
04/17/2024, 1:59 PMRobin Tsang
04/17/2024, 4:05 PMTim Edwards
04/17/2024, 4:23 PMRobin Tsang
04/17/2024, 4:53 PMAllwan S Anand
04/18/2024, 1:48 PMMitch Bailey
04/18/2024, 2:24 PMload
the fill_1
, fill_2
, and tapvpwrvgnd_1
cells and set property LEFview true
for each one.
That should keep them around after extraction.Allwan S Anand
04/18/2024, 7:36 PMextract all
ext2spice lvs
ext2spice -o pwm_generator_layout.spice
Can you please elaborate how can i load fill_1
, fill_2
, and tapvpwrvgnd_1
cells and set property LEFview true
for each one.?Mitch Bailey
04/18/2024, 9:54 PMCan you share your commands to extract the layout including reading the gds?The gds for for digital macro should have a
GDS_FILE
property. This causes magic to use the gds file data for the macro instead of reconverting macro magic layers to gds when creating the integrated gds. You should avoid saving any modified cells of gds files read into magic because this GDS_FILE
pointer will be lost.
For LVS, I suggest you create a gds file of your top design that will include the gds for the digital macro.
I think this will work.
load pwm_generator_layout
gds write pwm_generator_layout.gds
You should then quit magic and restart.
gds read pwm_generator_layout.gds
load sky130_fd_sc_hd__fill_1
property LEFview true
load sky130_fd_sc_hd__fill_2
property LEFview true
load sky130_fd_sc_hd__tapvpwrvgnd_1
property LEFview true
load pwm_generator_layout
extract all
ext2spice lvs
ext2spice -o pwm_generator_layout.spice
and then close magic without saving.
Good luck.Allwan S Anand
04/19/2024, 4:46 AMMitch Bailey
04/19/2024, 11:54 AMAllwan S Anand
04/19/2024, 11:56 AMMitch Bailey
04/19/2024, 3:28 PMAllwan S Anand
04/19/2024, 3:47 PMset layout [readnet spice "pwm_generator_layout.spice"]
set source [readnet spice "pwm_generator.spice"]
readnet verilog pwm_generator.v $source
lvs "$layout pwm_generator" "$source pwm_generator" $env(PDK_ROOT)/$env(PDK)/libs.tech/netgen/$env(PDK)_setup.tcl lvs.report
I am using Netgen version 1.5.133.
what my thought was, the netlists order are not matching (i mean pins are connected differently) when comparing lvs of (extraction of spice from mag file of digital macro) and (extraction of spice form xschem symbol of digital macro(including generated verilog netlist)). Devices and pins are same but its just connected order is different (As shown in below figure). Even during hardening process itself, flow checks lvs pass with pin matching. flow itself correctly extracting spice file in pin order. But when we manually extract spice from mag, the pin order seems different results in lvs netlist do not match. My concern is does it affect during running precheck in caravan analog process while integrating digital macro in analog design ? Expecting your comments about it?Mitch Bailey
04/19/2024, 4:00 PM1.5.272
. Can you update?
The pin order in net lvs report are pretty random in my experience. With netgen, the input order to logic gates matters. How much of this design was done by hand?Robin Tsang
04/19/2024, 4:07 PMMitch Bailey
04/19/2024, 5:24 PMset layout [readnet spice "pwm_generator_layout.spice"]
set source [readnet spice "pwm_generator.spice"]
readnet spice $env(PDK_ROOT)/$env(PDK)/libs.ref/sky130_fd_sc_hd/spice/sky130_fd_sc_hd.spice $source
readnet verilog pwm_generator.v $source
lvs "$layout pwm_generator" "$source pwm_generator" $env(PDK_ROOT)/$env(PDK)/libs.tech/netgen/$env(PDK)_setup.tcl lvs.report
Allwan S Anand
04/20/2024, 7:21 AM{
"STD_CELL_LIBRARY": [
"sky130_fd_sc_hvl",
"sky130_fd_sc_hd",
"sky130_df_pr"
],
"INCLUDE_CONFIGS": [
"$LVS_ROOT/tech/$PDK/lvs_config.base.json"
],
"TOP_SOURCE": "user_analog_project_wrapper",
"TOP_LAYOUT": "user_analog_project_wrapper",
"EXTRACT_FLATGLOB": [
""
],
"EXTRACT_ABSTRACT": [
""
],
"LVS_FLATTEN": [
""
],
"LVS_NOFLATTEN": [
""
],
"LVS_IGNORE": [
""
],
"LVS_SPICE_FILES_TO_FIX": [
"$UPRJ_ROOT/xschem/user_analog_project_wrapper.spice"
],
"LVS_SPICE_FILES": [
""
],
"LVS_VERILOG_FILES": [
"$UPRJ_ROOT/verilog/rtl/pwm_generator.v"
],
"LAYOUT_FILE": "$UPRJ_ROOT/gds/user_analog_project_wrapper.gds"
}
here i included my generated verilog netlist file of digital macro, the xschem spice files includes my schematic analog design + digital macro symbol, and gds file of wrapper contains both mixed designs.
do i need to put any spice file in netgen folder in caravel_user_project_analog in order to pass consistency check?
Is this way correct or do i need to change anything?Mitch Bailey
04/20/2024, 8:22 AMLVS_SPICE_FILES_TO_FIX
to LVS_SPICE_FILES
. and yes, you’ll need to copy a spice file to netgen
to get precheck to pass.
Unforunately, STD_CELL_LIBRARY
is not a list variable. If you’re using both sky130_fd_sc_hvl
and sky130_fd_sc_hd
then I suggest these settings.
"STD_CELL_LIBRARY": "sky130_fd_sc_hd",
"LVS_SPICE_FILES": [
"$PDK_ROOT/$PDK/libs.ref/sky130_fd_sc_hvl/spice/*spice",
"$UPRJ_ROOT/xschem/user_analog_project_wrapper.spice"
],
Allwan S Anand
04/20/2024, 8:50 AMMitch Bailey
04/20/2024, 9:02 AMAllwan S Anand
04/24/2024, 7:29 AMMitch Bailey
04/24/2024, 7:46 AMsky130_fd_pr__nfet_g5v0d10v5
.
Can you share your source schematic?Mitch Bailey
04/24/2024, 3:55 PMM
instead of the expected X
devices. It this is xschem output, there may be a option.Allwan S Anand
04/24/2024, 4:16 PMMitch Bailey
04/24/2024, 4:29 PMCan you share your source schematic?