gautam_buddha has asked for the wisdom of the Perl Monks concerning the following question:
sub readDRC ( ) { my ( $file , $flag ) = @_ ; $drc::tmpFile1 = "${file}.tmp" if ($file) ; my $moduleName = "" ; my $netName ; my @gateInst ; my $gate ; my $netCap ; my $violation ; my @maxTrans ; my $worstTrans ; open ( TMPDRC, "<$drc::tmpFile1" ) ; my $line ; my $i; my $j = 0 ; @drc::file1 = <TMPDRC> ; for ( $i = 0 ; $i <= $#drc::file1 - 1 ; $i++ ){ if ( $drc::file1[$i] =~ m/^\s*\Module:/i ) { $moduleName = getModuleName ( $drc::file1[$i] ) ; } # End of IF Statement if ( $drc::file1[$i] =~ /Net:/ ) { $netName = getNetName ( $drc::file1[$i] ) ; } # End of IF Statement if ( $drc::file1[$i] =~ /Max Capacitance/ ) { @gateInst = getMaxCapacitance ( $drc::file1[$i] ) ; $gate = $gateInst[5].$gateInst[6] ; } # End of IF Statement if ( $drc::file1[$i] =~ /Net Capacitance/ ) { $netCap = getNetCapacitance ( $drc::file1[$i] ) ; } # End of IF Statement if ( $drc::file1[$i] =~ /VIOLATION/ ) { $violation = getViolation ( $drc::file1[$i] ) ; if ( $drc::flag ) { $drc::rpt1{$moduleName}{$netName}{$gate}{"Cap +acitance"} = $violation; } else { $drc::rpt2{$moduleName}{$netName}{$gate}{"Capaci +tance"} = $violation; } } # End of IF Statement if ( $drc::file1[$i] =~ /Max Transition/ ) { @maxTrans = getMaxTransition ( $drc::file1[$i] ) ; $gate = $maxTrans[5].$maxTrans[6] ; } # End of IF Statement if ( $drc::file1[$i] =~ /Pin Worst Transition/ ) { $worstTrans = getWorstTransition ( $drc::file1[$i] ) ; } # End of IF Statement if ( $drc::file1[$i] =~ /VIOLATION/ ) { $violation = getViolation ( $drc::file1[$i] ) ; if ( $drc::flag ) { $drc::rpt1{$moduleName}{$netName}{$gate}{"Tra +nsition"} = $violation } else { $drc::rpt2{$moduleName}{$netName}{$gate}{"Tran +sition"} = $violation } } # End of IF Statement # } # End of FOR Loop # if ($flag) {compareFiles(\@drc::rpt1 , \@drc::rpt2 , \$drc::tmpFile +1 ) } # Calling The Function to Compare Values # only if both Hashes are +assigned printValues(\@drc::rpt1) ; # my $caps = "Capacitance" ; # my $tran = "Transition"; # if ( $drc::rpt1{$moduleName}{$netName}{$gate}{$tran} != $drc::rp +t2{$moduleName}{$netName}{$gate}{$tran}) { # print " Module = $moduleName \n" ; # print " Net = $netName \n" ; # print " Gate = $gate \n" ; # print " Transition Violation Value = $drc::rpt1{$modu +leName}{$netName}{$gate}{$tran} \n" ; # print " Capacitance Violation Value = $drc::rpt1{$mod +uleName}{$netName}{$gate}{$caps} \n" ; # print " Transition Violation NEW Value = $drc::rpt2{$ +moduleName}{$netName}{$gate}{$tran} \n" ; # } # End of IF } # End of FOR Loop close TMPDRC ; $drc::flag = 1 ; # unlink ( $drc::tmpFile1 ) if ( -f $drc::tmpFile1 ) ; return 0 ; # mission successful :=) }
Edited by Chady -- added code tags.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Hash Data Structure
by dave_the_m (Monsignor) on May 11, 2004 at 10:27 UTC | |
|
Re: Hash Data Structure
by ambrus (Abbot) on May 11, 2004 at 14:48 UTC | |
|
Re: Hash Data Structure
by duff (Parson) on May 11, 2004 at 15:28 UTC | |
|
Re: Hash Data Structure
by TomDLux (Vicar) on May 11, 2004 at 18:26 UTC |