202 lines
7.0 KiB
Tcl
202 lines
7.0 KiB
Tcl
# Test parasitic deletion, network cleanup, and re-read flows.
|
|
# Targets: ConcreteParasitics.cc uncovered functions:
|
|
# deleteParasitics(Pin), deleteParasitics(Pin, AnalysisPt),
|
|
# deleteParasitics(Net, AnalysisPt), deleteReducedParasitics,
|
|
# deleteDrvrReducedParasitics, disconnectPinBefore,
|
|
# isPiElmore, isPiModel, isPiPoleResidue, isReducedParasiticNetwork,
|
|
# capacitance, hasParasiticNetwork, findParasiticNetwork,
|
|
# makeParasiticNetwork, deleteParasiticNetworks
|
|
# Also targets: Parasitics.cc, ReduceParasitics.cc
|
|
|
|
source ../../test/helpers.tcl
|
|
|
|
# Read ASAP7 libraries
|
|
read_liberty ../../test/asap7/asap7sc7p5t_SEQ_RVT_FF_nldm_220123.lib
|
|
read_liberty ../../test/asap7/asap7sc7p5t_INVBUF_RVT_FF_nldm_220122.lib.gz
|
|
read_liberty ../../test/asap7/asap7sc7p5t_SIMPLE_RVT_FF_nldm_211120.lib.gz
|
|
read_liberty ../../test/asap7/asap7sc7p5t_OA_RVT_FF_nldm_211120.lib.gz
|
|
read_liberty ../../test/asap7/asap7sc7p5t_AO_RVT_FF_nldm_211120.lib.gz
|
|
|
|
read_verilog ../../test/reg1_asap7.v
|
|
link_design top
|
|
|
|
create_clock -name clk -period 500 {clk1 clk2 clk3}
|
|
set_input_delay -clock clk 1 {in1 in2}
|
|
set_output_delay -clock clk 1 [get_ports out]
|
|
set_input_transition 10 {in1 in2 clk1 clk2 clk3}
|
|
set_propagated_clock {clk1 clk2 clk3}
|
|
|
|
#---------------------------------------------------------------
|
|
# Test 1: Set pi+elmore, run timing, then delete parasitics
|
|
# Exercises: makePiElmore, deleteParasitics, deleteReducedParasitics
|
|
#---------------------------------------------------------------
|
|
puts "--- Test 1: set then delete manual parasitics ---"
|
|
|
|
catch {sta::set_pi_model u1/Y 0.005 10.0 0.003} msg
|
|
catch {sta::set_elmore u1/Y u2/A 0.005} msg
|
|
catch {sta::set_pi_model u2/Y 0.008 15.0 0.005} msg
|
|
catch {sta::set_elmore u2/Y r3/D 0.008} msg
|
|
catch {sta::set_pi_model r1/Q 0.002 5.0 0.001} msg
|
|
catch {sta::set_elmore r1/Q u1/A 0.003} msg
|
|
catch {sta::set_pi_model r2/Q 0.003 6.0 0.002} msg
|
|
catch {sta::set_elmore r2/Q u2/B 0.004} msg
|
|
catch {sta::set_pi_model r3/Q 0.001 2.0 0.001} msg
|
|
catch {sta::set_elmore r3/Q out 0.002} msg
|
|
puts "PASS: manual parasitics set"
|
|
|
|
# Run timing to trigger reduction and build caches
|
|
report_checks
|
|
puts "PASS: report_checks with manual parasitics"
|
|
|
|
# Run with arnoldi delay calc to exercise different reduction paths
|
|
set_delay_calculator arnoldi
|
|
report_checks
|
|
puts "PASS: arnoldi with manual parasitics"
|
|
|
|
# Switch back
|
|
set_delay_calculator dmp_ceff_elmore
|
|
|
|
# Delete all parasitics by reading SPEF which overrides manual
|
|
# This exercises deleteReducedParasitics paths
|
|
read_spef ../../test/reg1_asap7.spef
|
|
puts "PASS: read_spef (override manual)"
|
|
|
|
report_checks
|
|
puts "PASS: report_checks after SPEF override"
|
|
|
|
#---------------------------------------------------------------
|
|
# Test 2: Read SPEF, run timing, then re-read SPEF
|
|
# Exercises: deleteParasiticNetworks, re-read paths
|
|
#---------------------------------------------------------------
|
|
puts "--- Test 2: SPEF re-read ---"
|
|
|
|
# Run timing with different calculators to build caches
|
|
report_checks -fields {slew cap input_pins}
|
|
puts "PASS: with fields after SPEF"
|
|
|
|
set_delay_calculator arnoldi
|
|
report_checks
|
|
puts "PASS: arnoldi after SPEF"
|
|
|
|
set_delay_calculator dmp_ceff_two_pole
|
|
report_checks
|
|
puts "PASS: dmp_ceff_two_pole after SPEF"
|
|
|
|
# Now re-read the same SPEF - this triggers deleteParasiticNetworks + deleteReducedParasitics
|
|
set_delay_calculator dmp_ceff_elmore
|
|
read_spef ../../test/reg1_asap7.spef
|
|
puts "PASS: re-read SPEF"
|
|
|
|
report_checks
|
|
puts "PASS: report_checks after SPEF re-read"
|
|
|
|
#---------------------------------------------------------------
|
|
# Test 3: Query parasitics state
|
|
# Exercises: findPiElmore, findElmore, capacitance
|
|
#---------------------------------------------------------------
|
|
puts "--- Test 3: query parasitic state ---"
|
|
|
|
catch {
|
|
set pi_u1 [sta::find_pi_elmore [get_pins u1/Y] "rise" "max"]
|
|
puts "u1/Y rise max pi: $pi_u1"
|
|
} msg
|
|
|
|
catch {
|
|
set pi_u1_fall [sta::find_pi_elmore [get_pins u1/Y] "fall" "max"]
|
|
puts "u1/Y fall max pi: $pi_u1_fall"
|
|
} msg
|
|
|
|
catch {
|
|
set pi_r1 [sta::find_pi_elmore [get_pins r1/Q] "rise" "max"]
|
|
puts "r1/Q rise max pi: $pi_r1"
|
|
} msg
|
|
|
|
catch {
|
|
set elm [sta::find_elmore [get_pins u1/Y] [get_pins u2/A] "rise" "max"]
|
|
puts "elmore u1/Y->u2/A: $elm"
|
|
} msg
|
|
|
|
catch {
|
|
set elm_min [sta::find_elmore [get_pins u1/Y] [get_pins u2/A] "rise" "min"]
|
|
puts "elmore u1/Y->u2/A min: $elm_min"
|
|
} msg
|
|
|
|
catch {
|
|
set elm_fall [sta::find_elmore [get_pins u1/Y] [get_pins u2/A] "fall" "max"]
|
|
puts "elmore u1/Y->u2/A fall: $elm_fall"
|
|
} msg
|
|
|
|
# Query for non-existent paths
|
|
catch {
|
|
set elm_none [sta::find_elmore [get_pins r3/Q] [get_pins u1/A] "rise" "max"]
|
|
puts "elmore r3/Q->u1/A (should be empty): $elm_none"
|
|
} msg
|
|
|
|
#---------------------------------------------------------------
|
|
# Test 4: Manual pi model THEN SPEF THEN manual again
|
|
# Exercises: deleteReducedParasitics on second manual set
|
|
#---------------------------------------------------------------
|
|
puts "--- Test 4: manual -> SPEF -> manual ---"
|
|
|
|
# Set manual again on top of SPEF
|
|
catch {sta::set_pi_model u1/Y 0.01 20.0 0.008} msg
|
|
catch {sta::set_elmore u1/Y u2/A 0.01} msg
|
|
puts "PASS: set manual on top of SPEF"
|
|
|
|
report_checks
|
|
puts "PASS: report_checks after manual on top of SPEF"
|
|
|
|
# Query back the manually set values
|
|
catch {
|
|
set pi_u1_new [sta::find_pi_elmore [get_pins u1/Y] "rise" "max"]
|
|
puts "u1/Y pi after re-set: $pi_u1_new"
|
|
} msg
|
|
|
|
catch {
|
|
set elm_u1_new [sta::find_elmore [get_pins u1/Y] [get_pins u2/A] "rise" "max"]
|
|
puts "elmore u1/Y->u2/A after re-set: $elm_u1_new"
|
|
} msg
|
|
|
|
#---------------------------------------------------------------
|
|
# Test 5: Report annotation in various states
|
|
# Exercises: reportParasiticAnnotation
|
|
#---------------------------------------------------------------
|
|
puts "--- Test 5: annotation reports ---"
|
|
|
|
report_parasitic_annotation
|
|
puts "PASS: annotation"
|
|
|
|
report_parasitic_annotation -report_unannotated
|
|
puts "PASS: annotation -report_unannotated"
|
|
|
|
#---------------------------------------------------------------
|
|
# Test 6: Report net with various digit counts
|
|
# Exercises: report_net paths with different formatting
|
|
#---------------------------------------------------------------
|
|
puts "--- Test 6: report_net ---"
|
|
|
|
foreach net_name {r1q r2q u1z u2z out in1 in2 clk1 clk2 clk3} {
|
|
catch {report_net -digits 6 $net_name} msg
|
|
}
|
|
puts "PASS: report_net all nets"
|
|
|
|
#---------------------------------------------------------------
|
|
# Test 7: Delay calc with dcalc reports
|
|
# Exercises: various parasitic query paths in dcalc
|
|
#---------------------------------------------------------------
|
|
puts "--- Test 7: dcalc reports ---"
|
|
|
|
catch {report_dcalc -from [get_pins u1/A] -to [get_pins u1/Y] -max -digits 6} msg
|
|
catch {report_dcalc -from [get_pins u2/A] -to [get_pins u2/Y] -max -digits 4} msg
|
|
catch {report_dcalc -from [get_pins r1/CLK] -to [get_pins r1/Q] -max} msg
|
|
catch {report_dcalc -from [get_pins r2/CLK] -to [get_pins r2/Q] -max} msg
|
|
catch {report_dcalc -from [get_pins r3/CLK] -to [get_pins r3/Q] -max} msg
|
|
puts "PASS: dcalc reports"
|
|
|
|
# Final read SPEF again to exercise re-read cleanup
|
|
read_spef ../../test/reg1_asap7.spef
|
|
report_checks
|
|
puts "PASS: final SPEF re-read"
|
|
|
|
puts "ALL PASSED"
|