use strict; use warnings; my $inputfile = $ARGV[0]; # input FILE my $opt_cond; my $iline; if ($#ARGV!=0){ print "USAGE :: perl default_operating_condition_update.pl <> \n\n" ; exit(1); } my $cmd = "mkdir finallib;"; system ($cmd); my @operating_cond; open (INFILE,"<","$inputfile") || die "Can not open Input LIB File"; open (my $OPFILE,">","finallib/$inputfile") || die "Can not open Input Text File"; while ($iline = ) { chomp $iline; print $OPFILE "$iline\n"; if ($iline =~m/^\s*operating_conditions/g) { @operating_cond=split (operating_conditions,$iline); @operating_cond=split ("{",$operating_cond[1]); @operating_cond=split (/\(/,$operating_cond[0]); @operating_cond=split (/\)/,$operating_cond[1]); $opt_cond = $operating_cond[0]; print $OPFILE " default_operating_conditions : $operating_cond[0] ;\n" ; } } #### library(and_gate) { delay_model : table_lookup ; date : "Fri Mar 15 03:44:39 " ; time_unit : 1ms ; voltage_unit : 1V ; current_unit : 1A ; operating_conditions ("AB0.5v45c") { process : 1 ; temperature : 45 ; voltage : 0.5 ; } input_voltage(default) { vi : 0 ; vh : 0.5 ; vim : 0 ; vin : 0.5 ; } } #### library(and_gate) { delay_model : table_lookup ; date : "Fri Mar 15 03:44:39 " ; time_unit : 1ms ; voltage_unit : 1V ; current_unit : 1A ; operating_conditions ("AB0.5v45c") { process : 1 ; temperature : 45 ; voltage : 0.5 ; } default_operating_conditions : "AB0.5v45c" ; input_voltage(default) { vi : 0 ; vh : 0.5 ; vim : 0 ; vin : 0.5 ; } }