OpenCores
URL https://opencores.org/ocsvn/an-fpga-implementation-of-low-latency-noc-based-mpsoc/an-fpga-implementation-of-low-latency-noc-based-mpsoc/trunk

Subversion Repositories an-fpga-implementation-of-low-latency-noc-based-mpsoc

[/] [an-fpga-implementation-of-low-latency-noc-based-mpsoc/] [trunk/] [mpsoc/] [Integration_test/] [Altera/] [src/] [extract.prl] - Blame information for rev 56

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 56 alirezamon
#!/usr/bin/perl -w
2
use Cwd qw(getcwd);
3
use IPC::Run qw( run start pump finish timeout );
4
 
5
 
6
 
7
my @HWs = (
8
"; Logic utilization                                                                 ;",
9
";     Combinational ALUTs           ;",
10
";     Memory ALUTs                  ;",
11
";     Dedicated logic registers     ;",
12
"; Total block memory bits           ;",
13
"; ALMs:  partially or completely used                                               ;",
14
"; M9K blocks                                                                        ;"
15
 
16
);
17
 
18
 
19
 
20
my $csv="";
21
my %freq;
22
my %results;
23
 
24
sub extract_results {
25
        my ($dir,$parent) =@_;
26
        my @cat = qw( bash  );
27
        chdir "$dir";
28
        print getcwd()."\n";
29
 
30
        my ($in, $out, $err);
31
        #Fmax
32
        $in ='grep -R "; clk        ;      ;$" | sort';
33
    run \@cat, \$in, \$out, \$err, timeout( 10 ) or die "grep: $?";
34
 
35
 
36
        my @lines = split("\n",$out);
37
        foreach my $l (@lines)  {
38
 
39
                my @f=split ('/',$l);
40
                my $name= "${parent}_$f[0]";
41
 
42
                @f=split (':',$l);
43
                @f=split (';',$f[1]);
44
                $f[1] =~ s/MHz//;
45
 
46
                if(!defined $freq{$name}){
47
                        $freq{$name}=$f[1];
48
                }else{#get the minum reported max frequency
49
                        $freq{$name}=$f[1] if($f[1]< $freq{$name});
50
                }
51
 
52
        }
53
 
54
 
55
 
56
 
57
        foreach my $hw (@HWs){
58
 
59
 
60
 
61
                my @cat = qw( bash  );
62
                my $in ="grep -R \"$hw\" | sort";
63
                $hw =~ s/[\;]//g;
64
 
65
                #$csv.="-,$hw\n";
66
                $out=undef;
67
                run \@cat, \$in, \$out, \$err, timeout( 10 ) or die "grep: $?";
68
                @lines = split("\n",$out);
69
 
70
                foreach my $l (@lines)  {
71
                        unless ( index($l,".fit.rpt") >= 0){ next;}
72
 
73
                        my @f=split ('/',$l);
74
 
75
                        my $name= "${parent}_$f[0]";
76
                        my @ff = split (/\; /,$l);
77
                        my $val=$ff[2];
78
                        $val =~ s/,//g;
79
                        my @vv = split ("/",$val);
80
                        my $t =join(',',@vv);
81
                        #$csv.= "$name, $t  \n" if (defined $val) ;
82
                        $results{$hw}{$name}=$t if (defined $val) ;
83
                }
84
        }
85
 
86
}
87
 
88
 
89
 
90
print "extract_results($ARGV[0],$ARGV[1]);\n";
91
 
92
extract_results($ARGV[0],$ARGV[1]);
93
 
94
 
95
 
96
 
97
$csv.=" , Fr_max\n";
98
foreach my $p (sort keys  %freq){
99
                $csv.= "$p, $freq{$p},  Fmax = $freq{$p} Mhz\n";
100
}
101
 
102
 
103
foreach my $p (sort keys  %results){
104
        my $ref = $results{$p};
105
        my %r = %{$results{$p}} if (defined $ref) ;
106
        $csv.= "\n\n\n\n" ;
107
        $csv.="-,$p\n";
108
        foreach my $p (sort keys  %r){
109
                $csv.= "$p, $r{$p}  \n";
110
        }
111
 
112
}
113
 
114
print "***************** results *****************\n";
115
        print $csv;
116
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.