OpenSTA/sdf/test/sdf_write_interconnect.tcl

147 lines
5.1 KiB
Tcl

# Test SDF write with interconnect delays from SPEF, various write options,
# and large design coverage.
# Targets: SdfWriter.cc (writeInterconnects, writeInstInterconnects,
# writeInterconnectFromPin, writeArcDelays, writeSdfTriple,
# writeSdfDelay, sdfPortName, sdfPathName, sdfName, sdfEdge,
# writeWidthCheck, writePeriodCheck, writeTimingChecks,
# writeCheck variations, writeIopaths)
# SdfReader.cc (re-read from written SDF)
# ReportAnnotation.cc (annotation with interconnect data)
source ../../test/helpers.tcl
set test_name sdf_write_interconnect
read_liberty ../../test/nangate45/Nangate45_typ.lib
read_verilog ../../examples/example1.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}
#---------------------------------------------------------------
# Read SPEF to get interconnect delays
#---------------------------------------------------------------
puts "--- read SPEF for interconnect ---"
read_spef ../../examples/example1.dspef
report_checks
#---------------------------------------------------------------
# Write SDF with interconnect from SPEF
#---------------------------------------------------------------
puts "--- write_sdf with interconnect ---"
set sdf_out1 [make_result_file "${test_name}_default.sdf"]
write_sdf $sdf_out1
#---------------------------------------------------------------
# Write SDF with -include_typ (triple values)
#---------------------------------------------------------------
puts "--- write_sdf -include_typ ---"
set sdf_out2 [make_result_file "${test_name}_typ.sdf"]
write_sdf -include_typ $sdf_out2
#---------------------------------------------------------------
# Write SDF with -divider .
#---------------------------------------------------------------
puts "--- write_sdf -divider . ---"
set sdf_out3 [make_result_file "${test_name}_dot.sdf"]
write_sdf -divider . $sdf_out3
#---------------------------------------------------------------
# Write SDF with various digit counts
#---------------------------------------------------------------
puts "--- write_sdf -digits ---"
foreach digits {2 4 6 8} {
set sdf_d [make_result_file "${test_name}_d${digits}.sdf"]
write_sdf -digits $digits $sdf_d
}
#---------------------------------------------------------------
# Write SDF with -no_timestamp and -no_version
#---------------------------------------------------------------
puts "--- write_sdf -no_timestamp -no_version ---"
set sdf_out4 [make_result_file "${test_name}_clean.sdf"]
write_sdf -no_timestamp -no_version $sdf_out4
#---------------------------------------------------------------
# Write SDF gzip
#---------------------------------------------------------------
puts "--- write_sdf -gzip ---"
set sdf_out5 [make_result_file "${test_name}_gz.sdf.gz"]
write_sdf -gzip $sdf_out5
#---------------------------------------------------------------
# Write SDF with all options combined
#---------------------------------------------------------------
puts "--- write_sdf all options ---"
set sdf_out6 [make_result_file "${test_name}_all.sdf"]
write_sdf -digits 4 -include_typ -no_timestamp -no_version -divider . $sdf_out6
#---------------------------------------------------------------
# Read SDF back and annotate (roundtrip test)
#---------------------------------------------------------------
puts "--- read back SDF ---"
read_sdf $sdf_out4
report_checks
#---------------------------------------------------------------
# Report annotated delay with interconnect
#---------------------------------------------------------------
puts "--- annotated delay with interconnect ---"
report_annotated_delay -cell
report_annotated_delay -net
report_annotated_delay -cell -net
report_annotated_delay -from_in_ports -to_out_ports
report_annotated_delay -report_annotated
report_annotated_delay -report_unannotated
report_annotated_delay -constant_arcs
report_annotated_delay -max_lines 5
#---------------------------------------------------------------
# Report annotated check
#---------------------------------------------------------------
puts "--- annotated check with interconnect ---"
report_annotated_check
report_annotated_check -setup
report_annotated_check -hold
report_annotated_check -setup -hold
report_annotated_check -report_annotated
report_annotated_check -report_unannotated
report_annotated_check -max_lines 3
#---------------------------------------------------------------
# Read original example SDF to verify reading with different format
#---------------------------------------------------------------
puts "--- read original example SDF ---"
read_sdf ../../examples/example1.sdf
report_checks
report_annotated_delay -cell -net
report_annotated_check -setup -hold
#---------------------------------------------------------------
# Write SDF after SDF annotation (exercises annotated delay write)
#---------------------------------------------------------------
puts "--- write SDF after SDF annotation ---"
set sdf_out7 [make_result_file "${test_name}_annotated.sdf"]
write_sdf -no_timestamp -no_version $sdf_out7