2022-04-14 17:05:16 -05:00
|
|
|
#!/bin/bash
|
|
|
|
#---------------------------------------------------------------------------
|
|
|
|
#
|
2022-04-19 21:05:27 -05:00
|
|
|
# Run full LVS on caravan: This does not include verification of underlying
|
|
|
|
# library components such as the I/O cells, standard cells, and SRAM, but
|
|
|
|
# does include all sub-blocks of caravan.
|
2022-04-14 17:05:16 -05:00
|
|
|
#
|
|
|
|
#---------------------------------------------------------------------------
|
|
|
|
echo ${PDK_ROOT:=/usr/share/pdk} > /dev/null
|
|
|
|
echo ${PDK:=sky130A} > /dev/null
|
|
|
|
|
|
|
|
# Extract full layout netlist
|
2022-04-19 21:05:27 -05:00
|
|
|
cd ../mag
|
2022-04-14 17:05:16 -05:00
|
|
|
magic -dnull -noconsole -rcfile $PDK_ROOT/$PDK/libs.tech/magic/$PDK.magicrc << EOF
|
|
|
|
drc off
|
|
|
|
crashbackups stop
|
|
|
|
load caravan
|
2022-04-19 21:05:27 -05:00
|
|
|
# Replace the management core wrapper abstract view with the full view
|
|
|
|
cellname filepath mgmt_core_wrapper ../../caravel_mgmt_soc_litex/mag
|
|
|
|
flush mgmt_core_wrapper
|
2022-04-14 17:05:16 -05:00
|
|
|
select top cell
|
|
|
|
expand
|
2022-04-19 21:05:27 -05:00
|
|
|
# Replace the SRAM full view with the abstract view.
|
|
|
|
cellname filepath sky130_sram_2kbyte_1rw1r_32x512_8 $PDK_ROOT/$PDK/libs.ref/sky130_sram_macros/maglef
|
|
|
|
flush sky130_sram_2kbyte_1rw1r_32x512_8
|
2022-04-14 17:05:16 -05:00
|
|
|
extract do local
|
|
|
|
extract all
|
|
|
|
ext2spice lvs
|
|
|
|
ext2spice
|
|
|
|
EOF
|
|
|
|
rm -f *.ext
|
|
|
|
|
|
|
|
# Generate black-box verilog entry for the conb cell. Otherwise, the verilog tends to
|
|
|
|
# have only one of the pins listed which will result in an incorrect pin match.
|
2022-04-19 21:05:27 -05:00
|
|
|
# Also set the USE_POWER_PINS definition, which is not set anywhere else.
|
2022-04-14 17:05:16 -05:00
|
|
|
cat > conb.v << EOF
|
2022-04-19 21:05:27 -05:00
|
|
|
\`define USE_POWER_PINS 1
|
|
|
|
|
2022-04-14 17:05:16 -05:00
|
|
|
/* Black-box entry for conb_1 module */
|
|
|
|
module sky130_fd_sc_hd__conb_1 (HI, LO, VPWR, VGND, VPB, VNB);
|
|
|
|
output HI;
|
|
|
|
output LO;
|
|
|
|
input VPWR;
|
|
|
|
input VGND;
|
|
|
|
input VPB;
|
|
|
|
input VNB;
|
|
|
|
endmodule
|
2022-04-19 21:05:27 -05:00
|
|
|
|
|
|
|
/* Black-box entry for conb_1 module */
|
|
|
|
module sky130_fd_sc_hvl__conb_1 (HI, LO, VPWR, VGND, VPB, VNB);
|
|
|
|
output HI;
|
|
|
|
output LO;
|
|
|
|
input VPWR;
|
|
|
|
input VGND;
|
|
|
|
input VPB;
|
|
|
|
input VNB;
|
|
|
|
endmodule
|
2022-04-14 17:05:16 -05:00
|
|
|
EOF
|
|
|
|
|
|
|
|
# Generate script for netgen
|
|
|
|
cat > netgen.tcl << EOF
|
|
|
|
# Load top level netlists
|
|
|
|
puts stdout "Reading netlist caravan.spice"
|
|
|
|
set circuit1 [readnet spice caravan.spice]
|
|
|
|
puts stdout "Reading gate-level netlist caravan.v"
|
2022-04-19 21:05:27 -05:00
|
|
|
set circuit2 [readnet verilog ../verilog/rtl/defines.v]
|
2022-04-14 17:05:16 -05:00
|
|
|
# Read additional subcircuits into the netlist of circuit2
|
|
|
|
puts stdout "Reading black-box modules"
|
|
|
|
readnet verilog conb.v \$circuit2
|
|
|
|
puts stdout "Reading all gate-level verilog modules"
|
2022-04-19 21:05:27 -05:00
|
|
|
#
|
|
|
|
# NOTE: Cannot use __user_analog_project_wrapper module because it does
|
|
|
|
# not correspond to the empty analog wrapper layout.
|
|
|
|
# readnet verilog ../verilog/gl/__user_analog_project_wrapper.v \$circuit2
|
2022-04-14 17:05:16 -05:00
|
|
|
readnet verilog ../verilog/gl/caravel_clocking.v \$circuit2
|
|
|
|
readnet verilog ../verilog/gl/chip_io_alt.v \$circuit2
|
|
|
|
readnet verilog ../verilog/gl/digital_pll.v \$circuit2
|
|
|
|
readnet verilog ../verilog/gl/gpio_control_block.v \$circuit2
|
|
|
|
readnet verilog ../verilog/gl/gpio_defaults_block.v \$circuit2
|
|
|
|
readnet verilog ../verilog/gl/gpio_defaults_block_1803.v \$circuit2
|
2022-10-05 09:02:24 -05:00
|
|
|
readnet verilog ../verilog/gl/gpio_defaults_block_0801.v \$circuit2
|
2022-04-14 17:05:16 -05:00
|
|
|
readnet verilog ../verilog/gl/gpio_defaults_block_0403.v \$circuit2
|
|
|
|
readnet verilog ../verilog/gl/gpio_logic_high.v \$circuit2
|
|
|
|
readnet verilog ../verilog/gl/housekeeping.v \$circuit2
|
|
|
|
readnet verilog ../verilog/gl/mgmt_protect_hv.v \$circuit2
|
2022-04-19 21:05:27 -05:00
|
|
|
readnet verilog ../verilog/gl/mgmt_protect.v \$circuit2
|
2022-04-14 17:05:16 -05:00
|
|
|
readnet verilog ../verilog/gl/mprj2_logic_high.v \$circuit2
|
|
|
|
readnet verilog ../verilog/gl/mprj_logic_high.v \$circuit2
|
|
|
|
readnet verilog ../verilog/gl/spare_logic_block.v \$circuit2
|
|
|
|
readnet verilog ../verilog/gl/user_id_programming.v \$circuit2
|
|
|
|
readnet verilog ../verilog/gl/xres_buf.v \$circuit2
|
2022-04-19 21:05:27 -05:00
|
|
|
readnet verilog ../../caravel_mgmt_soc_litex/verilog/gl/DFFRAM.v \$circuit2
|
|
|
|
readnet verilog ../../caravel_mgmt_soc_litex/verilog/gl/mgmt_core.v \$circuit2
|
|
|
|
readnet verilog ../../caravel_mgmt_soc_litex/verilog/gl/mgmt_core_wrapper.v \$circuit2
|
|
|
|
readnet verilog ../verilog/gl/caravan.v \$circuit2
|
2022-04-14 17:05:16 -05:00
|
|
|
|
|
|
|
# Run LVS
|
2022-04-19 21:05:27 -05:00
|
|
|
lvs "\$circuit1 caravan" "\$circuit2 caravan" $PDK_ROOT/$PDK/libs.tech/netgen/${PDK}_setup.tcl caravan_full_comp.out
|
2022-04-14 17:05:16 -05:00
|
|
|
EOF
|
|
|
|
|
|
|
|
export NETGEN_COLUMNS=60
|
|
|
|
export MAGIC_EXT_USE_GDS=1
|
|
|
|
netgen -batch source netgen.tcl
|
2022-04-19 21:05:27 -05:00
|
|
|
rm conb.v
|
|
|
|
rm netgen.tcl
|
|
|
|
|
|
|
|
mv caravan.spice ../spi/lvs/caraven_lvs_full.spice
|
|
|
|
mv caravan_full_comp.out ../signoff/
|
|
|
|
exit 0
|