lin-win-share/DA4008_V1.3/syn/scripts/setup.utility.tcl

126 lines
6.9 KiB
Tcl
Raw Normal View History

###############################################################################################
#### Utilities List :
#### set_all_high_fanout_nets_as_ideal
#### get_design_info
#### set_user_defined_clock_uncertainty
#### write_post_syn_sdc
#### remove wand
#### ... ...
###############################################################################################
################################################################################################################################################################################
### 2012.02.25
### set all high fanout nets as ideal network
################################################################################################################################################################################
proc set_all_high_fanout_nets_as_ideal {} {
foreach_in_collection hfn_nets [all_high_fanout -nets -threshold 1000] {
set hfn_latency 0.1
set hfn_transition 0.2
set_ideal_network -no_propagate [all_fanin -flat -level 0 -to [get_nets $hfn_nets]]
set_ideal_latency $hfn_latency [all_fanin -flat -level 0 -to [get_nets $hfn_nets]]
set_ideal_transition $hfn_transition [all_fanin -flat -level 0 -to [get_nets $hfn_nets]]
}
}
################################################################################################################################################################################
### 2012.03.05
### Get the Detail Design Information
################################################################################################################################################################################
proc get_design_info {args} {
catch {report_units} units_rpt
catch {report_qor -summary} qor_sum
append design_info_pattern "=================================================================\n"
append design_info_pattern "the number of clocks : [sizeof_collection [all_clocks]]\n"
append design_info_pattern "the number of registers : [sizeof_collection [all_registers -edge_triggered]]\n"
append design_info_pattern "the number of clock gates : [sizeof_collection [all_clock_gates]]\n"
append design_info_pattern "=================================================================\n"
return $design_info_pattern
}
################################################################################################################################################################################
### 2012.03.05
### Set User Defined clock_uncertainty
################################################################################################################################################################################
proc set_user_defined_clock_uncertainty {} {
update_timing
set uncertainty_rate 0.30
set clock_margin 0.00
set library_setup 0.40
set n1 0
set n2 0
foreach_in_collection each_clock [all_clocks] {
if {[get_attribute -quiet $each_clock period] != ""} {
set user_defined_margin [format "%.2f" [expr ${uncertainty_rate}*[expr [get_attribute ${each_clock} period] - ${library_setup}] + ${clock_margin}]]
set user_defined_margin_rf2fr [format "%.2f" [expr [expr ${uncertainty_rate}*[expr [get_attribute ${each_clock} period] - ${library_setup}] + ${clock_margin}]/2] ]
set_clock_uncertainty $user_defined_margin -rise_from ${each_clock} -rise_to ${each_clock}
set_clock_uncertainty $user_defined_margin -fall_from ${each_clock} -fall_to ${each_clock}
set_clock_uncertainty $user_defined_margin_rf2fr -fall_from ${each_clock} -rise_to ${each_clock}
set_clock_uncertainty $user_defined_margin_rf2fr -rise_from ${each_clock} -fall_to ${each_clock}
puts "SJD-INFO : Set [format "%-5s" $user_defined_margin] margin for inner clock [get_attribute $each_clock full_name] ..."
incr n1
} else {
puts "SJD-WARN : The clock [get_attribute $each_clock full_name] does not have period attribute ...\n\t The clock definition must be wrong, Please check your SDC files."
incr n2
}
}
puts "\n$n1 clocks were specified uncertainty sucssessfully\n$n2 clock have a wrong definition\n"
}
################################################################################################################################################################################
### 2012.05.29
### fixing write_sdc command
################################################################################################################################################################################
proc write_post_syn_sdc {args} {
parse_proc_arguments -args $args pargs
set file $pargs(-output)
set num [sizeof_collection [get_cells -hierarchical * -filter "dont_touch == true"]]
echo " Adding User Defined constraits into sdc ..."
echo "------------------------------------------------------"
echo " Total $num cells are defined as the dont_touch cell "
echo "******************************************************"
echo "###############################################" >> $file
echo "###" >> $file
echo "### User Defined dont_touch cell" >> $file
echo "###############################################" >> $file
foreach dont_touch_cell [get_object_name [get_cells -hierarchical * -filter "dont_touch == true" -quiet]] {
echo "set_dont_touch $dont_touch_cell" >> $file
}
set num [sizeof_collection [get_nets -hierarchical * -filter "dont_touch == true"]]
echo "------------------------------------------------------"
echo " Total $num nets are defined as the dont_touch nets "
echo "******************************************************"
echo "###############################################" >> $file
echo "###" >> $file
echo "### User Defined dont_touch net" >> $file
echo "###############################################" >> $file
foreach dont_touch_net [get_object_name [get_nets -hierarchical * -filter "dont_touch == true" -quiet]] {
echo "set_dont_touch $dont_touch_net" >> $file
}
}
define_proc_attributes write_post_syn_sdc -info "write sdc file for icc. " \
-define_args \
{
{-output "specify the file path and file name. " string string required}
}
################################################################################################################################################################################
### 2012.07.11
### remove wand command
################################################################################################################################################################################
proc remove_wand_attr {} \
{
global wand_nets
foreach_in_collection wand_nets [ filter_collection [ get_nets \
-hier * ] "wired_and == true" ] \
{
puts "wired_and: $wand_nets"
remove_attribute $wand_nets wired_and
}
}