Hi I am having trouble getting the following script to work. This is a script that I have inherited and am hacking to get it work.
In this code, the following check is failing: # Enter Foreach Loop foreach $net (keys %nets) { print "Inside Foreach Loop\n"; print "The value of \$net is : $net"; print "The value of \$clk_nets\{\$net\} is : $clk_nets{$net}"; if( $clk_nets{$net} ) I am not able to figure out why this check is failing. What exactly is the check looling for ? How do I debug this ? Thanks in Advance PN ----------- Script information ------------- The code has three distinct parts: 1) This is the variable DECLARATION portion of the code: $max_attr_file = "$WD/$block.max.attr"; $min_attr_file = "$WD/$block.min.attr"; $clk_file = "$WD/$block.max.clock_nodes.rpt"; $max_cap="$WD/$block.max.cap"; $sdc_file = "$WD/$block.sdc"; &make_dir ("$WD/clknet"); $nodeinf_file = "$WD/clknet/$block.nodeinf.filtered"; $filtered_min_max_clk_file = "$WD/clknet/$block.clk.filtered"; $log_file="$WD/clknet/$block.clknet.log"; $spf_file="$WD/clknet/$block.nonspf"; open(LOG,">$log_file"); $lb_ps0="/library/max.lib"; $lb_ps0clk="/library/clock.sdb"; open(PS0,"<$lb_ps0") || die "Cannot read $lib_ps0\n"; @ps0_lib=<PS0>; close(PS0); open(PS0,"<$lb_ps0clk") || die "Cannot read $lib_ps0clk\n"; @ps0clk_lib=<PS0>; close(PS0); $fatal_error=0; my($index)=0; $endheader=0; my(%cells); get_cells($lb_ps0clk); get_cells($lb_ps0); foreach $cell (keys %cells){print "CELL: $cell\n";} T2) his is the section for reading in an ATTRIBUTE file and storing the data: $index=0; foreach $line (@attr){ $line=~tr/A-Z/a-z/; if($line=~/(\S+)\s+(\S+)\s+(\S+)\s+\S+\s+\S+\s+(\(\((.*)\)|no_value)\s+(\(\((.*)\)|no_value)\s+(\(\((.*)\)|no_value)\s+(\(\((.*)\)|no_value)\s+\{\s*(\S+)\s*\}$/) { $net1=$1;$mx_slp_U=$2;$mx_slp_D=$3;$VdLd_Up=$4;$VdLd_Dn=$6;$ValidTrailDn=$8;$VdTl_Up=$10;$cell=$12; $net1->{VdLd_Up}=$VdLd_Up if (! ($VdLd_Up=~/no_value/)); $net1->{VdLd_Dn}=$VdLd_Dn if (! ($VdLd_Dn=~/no_value/)); $net1->{mx_slp_U}=$mx_slp_U/0.1;$net1->{mx_slp_D}=$mx_slp_D/0.1; $net1->{cell}=$cell; push(@pins,$net1); } elsif($line=~/(\S+)\s+(\S+)\s+(\S+)\s+\S+\s+\S+\s+(\(\((.*)\)|no_value)\s+(\(\((.*)\)|no_value)\s+(\(\((.*)\)|no_value)\s+(\(\((.*)\)|no_value)\s*$/){ $net=$1;$mx_slp_U=$2;$mx_slp_D=$3;$VdLd_Up=$4;$VdLd_Dn=$6;$ValidTrailDn=$8;$ValidTrailUp=$10; $net1=$1;$mx_slp_U=$4;$mx_slp_D=$5;$VdLd_Up=$6;$VdLd_Dn=$7;$ValidTrailDn=$8;$ValidTrailUp=$9;$cell=$10; $nets{$net}{VdLd_Up}=$VdLd_Up if (! ($VdLd_Up=~/no_value/)); $nets{$net}{VdLd_Dn}=$VdLd_Dn if (! ($VdLd_Dn=~/no_value/)); $nets{$net}{mx_slp_U}=$mx_slp_U/0.1;$nets{$net}{mx_slp_D}=$mx_slp_D/0.1; $net->{mx_slp_U}=$mx_slp_U/0.1;$net->{mx_slp_D}=$mx_slp_D/0.1; push(@{$nets{$net}{pins}},@pins); @pins=(); $index++; elsif { $fatal_error=1; print LOG "Fatal error, the Net $net has wrong format\n"; } } 3) Process and data and generate output from the attribute file: # Start generating output files &header; # header for output files foreach $net (keys %nets) { print "Inside Foreach Loop\n"; print "The value of \$net is : $net"; print "The value of \$clk_nets\{\$net\} is : $clk_nets{$net}"; if( $clk_nets{$net} ) { print "Clk Net= $net\n"; print "VdLd_Up: $nets{$net}{VdLd_Up}\n"; print "VdLd_Dn: $nets{$net}{VdLd_Dn}\n"; ...... additional code } } The format of the input ATTRIBUTE file is as follows: !P main/sub_1%a 0.0076 0.0069 0.0076 0.0069 ((xy ck_m) := 0.0123) ((xy ck_m) := 0.0456) ((xy ck_m) := 0.0345) ((xy ck_m) := 0.0234) {seq_cell_a} !P main/sub_2%a 0.0076 0.0069 0.0076 0.0069 ((xy ck_m) := 0.0123) ((xy ck_m) := 0.0456) ((xy ck_m) := 0.0345) ((xy ck_m) := 0.0234) {seq_cell_b} !P main/sub_3%a 0.0076 0.0069 0.0076 0.0069 ((xy ck_m) := 0.0123) ((xy ck_m) := 0.0456) ((xy ck_m) := 0.0345) ((xy ck_m) := 0.0234) {seq_cell_c} __________________________________________________ Do You Yahoo!? HotJobs - Search Thousands of New Jobs http://www.hotjobs.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]