布局布线和时序分析
笔记本


2020-07-01 17:08:43把pt eco输出的icc2tcl转换为innovus的脚本走来走去116.236.47.26

PT eco输出的脚本对INNOVUS并不友好,很多命令不支持。PT做完eco后先输出icc2tcl和text格式的eco change脚本,再用如下脚本转化为适合于INNOVUS的eco脚本:

#!/usr/bin/tclsh

set f [open [lindex $argv 0 ]_text.tcl r ]
set f2 [open [lindex $argv 0]_for_innovus.tcl w ]
set f3 [open [lindex $argv 0]_tmp.tcl w ]

while { [gets $f line ] != -1 } {
	if { [regexp {size_cell in ([\w|\/]+): '(\w+)' sized to '(\w+)'} $line j_all j_hinst j_inst j_cell ] } {
		puts $f2 "ecoChangeCell -inst $j_hinst/$j_inst -cell $j_cell"
	}
	if { [regexp {insert_buffer in ([\w|\/]+): added one '(\w+)'.* on pin (.*) named '(\w+)' '(\w+)'} $line j_all j_hinst j_cell j_all_pins j_net j_inst ] } {
		set j_all_pins_list [lsort -unique [regexp -all -inline {('[\w|\/|\[|\]]+')} $j_all_pins ] ]
		regsub -all {'} $j_all_pins_list {} j_all_pins_list
		set j_all_pins_list_full ""
		foreach j_obj $j_all_pins_list {
			append j_all_pins_list_full "$j_hinst/$j_obj "
		}
		if { [llength $j_all_pins_list_full]  > 1 } {
			puts $f2 "ecoAddRepeater -cell $j_cell -hinstGuide $j_hinst -name $j_inst -newNetName $j_net -term { $j_all_pins_list_full }"
		} else {
			puts $f2 "ecoAddRepeater -relativeDistToSink 0.01 -cell $j_cell -hinstGuide $j_hinst -name $j_inst -newNetName $j_net -term { $j_all_pins_list_full }"
		}
	}
	if { [regexp {remove_buffer in ([\w|\/]+): cells '(\w+)'} $line j_all j_hinst j_inst ] } {
		puts $f3 "ecoDeleteRepeater -inst $j_hinst/$j_inst"
	}
}

close $f
close $f3

set f [open [lindex $argv 0 ]_icc2.tcl r ]

while { [gets $f line ] != -1 } {
	if { [regexp {current_instance \{([\w|\/]+)\}} $line j_all j_hinst ] } {
#		puts $f2 "# current_instance $j_hinst"
	}
	if { [regexp {set_cell_location -coordinates \{(.*)\} -orientation (\w+) \[get_cells \{(\w+)\} -hier\]} $line j_all j_coord j_ori j_inst ] } {
		if { $j_ori == "FS" } {
			set j_ori "MX"
		} else {
			set j_ori "R0"
		}
		puts $f2 "placeInstance $j_hinst/$j_inst $j_coord $j_ori -placed"
	}
}

set f3 [open [lindex $argv 0]_tmp.tcl r ]
while { [gets $f3 line ] != -1 } {
	puts $f2 $line
}

close $f
close $f2
close $f3



回到首页时钟 , 联系信箱:yzbox#163.com(把#换成@) 粤ICP备18155639号