change_icctcl_to_innovstcl
############################################
# edit by wangnengxue 20200911 #
# Email : nengxuew@cadence.com #
###########################################
proc write_eco_change {args} {
set output ""
parse_proc_arguments -args $args results
foreach argname [array names results] {
if {[regexp -nocase {\-output} $argname ]} { set output $results($argname) }
}
write_change -format icctcl -output ${output}_icctcl
set in_icctcl_file [open ${output}_icctcl r+]
set out_innovus_file [open ${output} w]
while {[gets $in_icctcl_file line]>=0} {
if {[regexp {current_instance$} $line ]} {
set hier_inst ""
set hier_inst1 ""
puts $out_innovus_file "#$line"
continue
}
if {[regexp {current_instance\s*(\S+)} $line uselessvar_a hier_inst]} {
set hier_inst1 $hier_inst
set hier_inst $hier_inst/
puts $out_innovus_file "#$line"
continue
}
switch -regexp $line {
{size_cell} {
regexp {size_cell\s*\{(\S+)\}\s*\{(\S+)\}} $line uselessvar_a inst cell_type
puts $out_innovus_file "#$line"
puts $out_innovus_file "ecoChangeCell -inst $hier_inst$inst -cell $cell_type \n"
}
{remove_buffer} {
regexp {remove_buffer\s*\[get_cells\s*\{(\S+)\}\]} $line uselessvar_a inst
puts $out_innovus_file "#$line"
puts $out_innovus_file "ecoDeleteRepeater -inst $hier_inst$inst -nonPhysical \n"
}
{insert_buffer} {
regexp {insert_buffer\s*\[get_pins\s*\{(\S+)\}\]\s*(\S+)\s*-new_net_name\s*\{(\S+)\}\s*-new_cell_name\s*\{(\S+)\}} $line uselessvar_a term cell_type new_netname new_cellname
puts $out_innovus_file "#$line"
puts $out_innovus_file "ecoAddRepeater -term $hier_inst$term -cell $cell_type -new_net_name $new_netname -name $new_cellname -hinstGuide $hier_inst1 \n"
}
}
}
close $in_icctcl_file
close $out_innovus_file
}
define_proc_arguments write_eco_change -info "User change pt_script format to innovus script format \nExamble: write_eco_change -output ./wangnengxue.innovus.tcl" \
-define_args {\
{-output "Specifies the output script filenane and path"}
}
posted on 2020-09-11 16:07 learnsure 阅读(1595) 评论(2) 编辑 收藏 举报