# Staring of perl code attr_update.pl my $ref_lib = $ARGV[0]; my $org_lib = $ARGV[1]; my $cell_flag = 0; my $lkg_flag = 0; my $attr_org; my $cell_name_ref; my $cell_name_org; system "rm -rf final_lib"; system "mkdir final_lib"; if ($#ARGV !=1) { print STDERR "Usage of script: perl attr_update.pl \n" ; } open (REFLIB,"<","$ref_lib") || die "Can not open REF_LIB" ; open (ORGLIB,"<","$org_lib") || die "Can not open ORG_LIB" ; open (FINALLIB,">","final_lib/$org_lib") || die "Can not open ORG_LIB" ; while (my $line = ) { chomp($line); #print "$line \n"; if ($line=~m/^\s*cell\(.*/g){ $cell_flag = 1; $lkg_flag = 0; $cell_name_ref = $line; #print "OK 1\n"; } # if ($line=~m/^\s*leakage_power\(\)/g){ $cell_flag = 0; $lkg_flag = 1; } if (($cell_flag ==1) && ($lkg_flag == 0)){ $attr_org = $line; #print "$attr_org \n"; } while (my $line_2 = ){ chomp ($line_2); if ($line_2=~m/^\s*cell\(.*/g){ $cell_name_org = $line_2; } if ($cell_name_ref == $cell_name_org){ print FINALLIB "$attr_org \n"; } else { print FINALLIB "$line_2 \n"; } } }