OpenCores
URL https://opencores.org/ocsvn/socgen/socgen/trunk

Subversion Repositories socgen

[/] [socgen/] [trunk/] [tools/] [simulation/] [run_coverage] - Blame information for rev 135

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 119 jt_eaton
eval 'exec `which perl` -S $0 ${1+"$@"}'
2
   if 0;
3 135 jt_eaton
#/****************************************************************************/
4
#/*                                                                          */
5
#/*   SOCGEN Design for Reuse toolset                                        */
6
#/*                                                                          */
7
#/*   Version 1.0.0                                                          */
8
#/*                                                                          */
9
#/*   Author(s):                                                             */
10
#/*      - John Eaton, z3qmtr45@gmail.com                                    */
11
#/*                                                                          */
12
#/****************************************************************************/
13
#/*                                                                          */
14
#/*                                                                          */
15
#/*             Copyright 2016 John T Eaton                                  */
16
#/*                                                                          */
17
#/* Licensed under the Apache License, Version 2.0 (the "License");          */
18
#/* you may not use this file except in compliance with the License.         */
19
#/* You may obtain a copy of the License at                                  */
20
#/*                                                                          */
21
#/*    http://www.apache.org/licenses/LICENSE-2.0                            */
22
#/*                                                                          */
23
#/* Unless required by applicable law or agreed to in writing, software      */
24
#/* distributed under the License is distributed on an "AS IS" BASIS,        */
25
#/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */
26
#/* See the License for the specific language governing permissions and      */
27
#/* limitations under the License.                                           */
28
#/*                                                                          */
29
#/*                                                                          */
30
#/****************************************************************************/
31 119 jt_eaton
 
32
 
33
############################################################################
34
# General PERL config
35
############################################################################
36
use Getopt::Long;
37
use English;
38
use File::Basename;
39
use Cwd;
40
use XML::LibXML;
41
use lib './tools';
42
use sys::lib;
43
use yp::lib;
44
 
45
$OUTPUT_AUTOFLUSH = 1; # set autoflush of stdout to TRUE.
46
 
47
 
48
############################################################################
49
### Process the options
50
############################################################################
51
Getopt::Long::config("require_order", "prefix=-");
52
GetOptions("h","help",
53
) || die "(use '$program_name -h' for help)";
54
 
55
 
56
 
57
 
58
##############################################################################
59
## Help option
60
##############################################################################
61
if ( $opt_h or $opt_help  )
62 131 jt_eaton
  { print "\n run_coverage vendor  library";
63 119 jt_eaton
    print "\n";
64
    exit 1;
65
  }
66
 
67
 
68
#/**********************************************************************/
69 131 jt_eaton
#/*  Process each library by finding any ip-xact file in any component */
70 119 jt_eaton
#/*                                                                    */
71
#/*  Each ip-xact file is parsed and it's filename and the names of any*/
72
#/*  modules that it uses are saved.                                   */
73
#/*                                                                    */
74
#/*                                                                    */
75
#/**********************************************************************/
76
 
77
 
78
my $home              = cwd();
79 128 jt_eaton
my $vendor   ;
80 131 jt_eaton
my $library  ;
81 119 jt_eaton
 
82 131 jt_eaton
 
83
my $prefix = yp::lib::get_workspace();
84
 
85 128 jt_eaton
$_               = $ARGV[0];
86 119 jt_eaton
 
87 128 jt_eaton
 
88 131 jt_eaton
 
89 128 jt_eaton
if(/(\S+)__(\S+)/)
90
     {
91
     $vendor           = $1;
92 131 jt_eaton
     $library          = $2;
93 128 jt_eaton
     }
94
 
95
 
96
 
97
 
98 131 jt_eaton
 
99 119 jt_eaton
my $parser = XML::LibXML->new();
100
 
101
 
102
 
103 131 jt_eaton
my @components   = yp::lib::find_components($vendor,$library);
104 119 jt_eaton
 
105
foreach my $component (@components)
106
   {
107 131 jt_eaton
 
108
   my $socgen_filename              = yp::lib::find_componentConfiguration($vendor,$library,$component);
109
   if($socgen_filename)
110
   {
111
 
112
   my $socgen_file              = $parser->parse_file($socgen_filename);
113 130 jt_eaton
   my $sim_library_path ;
114 131 jt_eaton
   my $lib_comp_sep             = yp::lib::find_lib_comp_sep($vendor,$library,$component);
115 130 jt_eaton
   my $sim_comp_path            = $socgen_file->findnodes("//socgen:componentConfiguration/socgen:sim/socgen:comp_path/text()")->to_literal;
116 119 jt_eaton
 
117 130 jt_eaton
   if ($sim_comp_path)
118
      {
119
      $sim_library_path            ="${lib_comp_sep}${sim_comp_path}";
120
      }
121
   else
122
      {
123
      $sim_library_path            = $socgen_file->findnodes("//socgen:componentConfiguration/socgen:sim/socgen:library_path/text()")->to_literal;
124
      }
125 128 jt_eaton
 
126 131 jt_eaton
   print "XXXX-   $vendor $library $component  $sim_library_path   \n";
127 130 jt_eaton
 
128 119 jt_eaton
   #/*********************************************************************************************/
129 128 jt_eaton
   #/   create coverage database .cdd file                                                       */
130 119 jt_eaton
   #/                                                                                            */
131
   #/*********************************************************************************************/
132
 
133 130 jt_eaton
   foreach  my   $i_name ($socgen_file->findnodes("//socgen:componentConfiguration/socgen:sim/socgen:testbenches/socgen:testbench/socgen:tools/socgen:tool"))
134 119 jt_eaton
      {
135 128 jt_eaton
      my($tb_tool)     = $i_name ->findnodes('./text()')->to_literal ;
136
      my($tb_variant)  = $i_name ->findnodes('../../socgen:variant/text()')->to_literal ;
137
      my($tb_version)  = $i_name ->findnodes('../../socgen:version/text()')->to_literal ;
138 119 jt_eaton
 
139 128 jt_eaton
      if($tb_tool eq "coverage")
140
          {
141
          print "  COVERAGEs   $tb_tool          $tb_variant  $tb_version \n";
142 131 jt_eaton
          chdir  "./${prefix}/${vendor}__${library}${sim_library_path}/cov/${tb_variant}";
143 119 jt_eaton
 
144 128 jt_eaton
          $cmd ="make build_cdd \n";
145
          if (system($cmd)) {}
146 119 jt_eaton
 
147
 
148
 
149 128 jt_eaton
 
150 130 jt_eaton
          foreach  my   $i_name ($socgen_file->findnodes("//socgen:test/socgen:variant"))
151 128 jt_eaton
              {
152
              my($test_variant)     = $i_name ->findnodes('./text()')->to_literal ;
153
              my($test_name)        = $i_name ->findnodes('../socgen:name/text()')->to_literal ;
154
 
155
              if($tb_variant eq $test_variant  )
156
                {
157
                print "  $tb_variant  $test_variant $test_name \n";
158
                $cmd ="make score_cov TEST=${test_name} \n";
159
                if (system($cmd)) {}
160
                }
161
 
162
              }
163
 
164
              $cmd ="make report_cov  \n";
165
              if (system($cmd)) {}
166
 
167
          }
168
 
169
 
170
 
171
 
172
 
173
          chdir $home;
174
 
175 119 jt_eaton
      }
176
 
177 128 jt_eaton
 
178
 
179
 
180
 
181
 
182
 
183
 
184 119 jt_eaton
   }
185
 
186 131 jt_eaton
}
187 119 jt_eaton
 
188
 
189 131 jt_eaton
 

powered by: WebSVN 2.1.0

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