用来抓取不同transition和capcitance的rpt中的endpoint点,并唯一的输出在一个文件中。
use 5.010;
#use warnings;
#########traverse every file########
my @DIR_PATH = qw"/proj/hawk1/wa/hpiaopiao/Model_PCA_RTL_Freeze/hawk_pca_brg_macro/top_DRV/cap /proj/hawk1/wa/hpiaopiao/Model_PCA_RTL_Freeze/hawk_pca_brg_macro/top_DRV/tran";
#print $DIR_PATH[0],"\n";
#print $DIR_PATH[1],"\n"; for train
foreach $PATH (@DIR_PATH) {
opendir DIR,$PATH or die "Can not open $PATH \n";
@filelist = readdir DIR;
my $pin;
foreach $lfile (@filelist) {
my $file = $PATH."/".$lfile;
if ($file =~ /.*cap.*rpt/) {
open DATA1, '<', $file;
while(<DATA1>) {
my $a = "c"; my $line1;
if(/(.*Z hawk.*_\d* )/) {$line1 = $_; $pin = $1;}
open DATA2, '<', './mergecap_mid1';
while(<DATA2>) {if(/(.*Z hawk.*_\d* )/) { if($1 eq $pin) {$a = "a"; }}} close(DATA2);
open DATA3, '>>', './mergecap_mid1';
if( $a eq "c" ){ print DATA3 $line1;} close(DATA3);
}
}
if ($file =~ /.*tran.*rpt/) {
open DATA4, '<', $file;
while(<DATA4>) {
my $a = "c"; my $line1;
if(/(.*I hawk.*_\d* )/) {$line1 = $_; $pin = $1;}
open DATA5, '<', './mergetran_mid1';
while(<DATA5>) {if(/(.*I hawk.*_\d* )/) { if($1 eq $pin) {$a = "a"; }}} close(DATA5);
open DATA6, '>>', './mergetran_mid1';
if( $a eq "c" ){ print DATA6 $line1;} close(DATA6);
}
}
}
}
close(DATA1);
close(DATA2);
close(DATA3);
close(DATA4);
close(DATA5);
close(DATA6);