sub Parse_Constraint_File { croak("Parse_Constraint_File ") unless(my $filename = shift); my $setup_hash_ref = shift; my $open_command = ($filename =~ /\.gz$/) ? "gzip -dc $filename|" : $filename; my $rec={}; my @path_details=[]; my $i=0; open(CONST,"$open_command") || croak("Can't open $filename"); while(){ # find out the important info: if(/Startpoint: ([\w\/]+)$/) { $rec->{'startpoint'} = $1 }; if(/Endpoint: ([\w\/]+)$/) { $rec->{'endpoint'} = $1 }; if(/Path Group: (\w+)$/) { $rec->{'path_group'}= $1 }; if(/Path Type: (\w+)$/) { $rec->{'path_type'}= $1 }; if(/^\s+Point/.../^\s+slack/ && $setup_hash_ref->{'detail'}){ push @path_details,$_; } if(/^\s+slack [\w\(\)]+\s+(-?[\d\.]+)$/) { #last field is reached $rec->{'slack'} = $1; $rec->{'path_details'} = [ @path_details ]; # if we set a startpoint the only pick those paths if (defined($setup_hash_ref->{'startpoint'}) && defined($setup_hash_ref->{'endpoint'})){ if($rec->{'startpoint'} =~ /$setup_hash_ref->{'startpoint'}/ && $rec->{'endpoint'} =~ /$setup_hash_ref->{'endpoint'}/){ $timing_paths[$i++] = $rec; print @path_details; } }else{ # otherwise take all points $timing_paths[$i++] = $rec; } @path_details=[]; $rec={}; } } return @timing_paths; close CONST;