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

Subversion Repositories socgen

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

Go to most recent revision | 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
 
4
#/**********************************************************************/
5
#/*                                                                    */
6
#/*             -------                                                */
7
#/*            /   SOC  \                                              */
8
#/*           /    GEN   \                                             */
9
#/*          /    TOOL    \                                            */
10
#/*          ==============                                            */
11
#/*          |            |                                            */
12
#/*          |____________|                                            */
13
#/*                                                                    */
14
#/*                                                                    */
15
#/*                                                                    */
16
#/*  Author(s):                                                        */
17
#/*      - John Eaton, jt_eaton@opencores.org                          */
18
#/*                                                                    */
19
#/**********************************************************************/
20
#/*                                                                    */
21
#/*    Copyright (C) <2010-2011>                */
22
#/*                                                                    */
23
#/*  This source file may be used and distributed without              */
24
#/*  restriction provided that this copyright statement is not         */
25
#/*  removed from the file and that any derivative work contains       */
26
#/*  the original copyright notice and the associated disclaimer.      */
27
#/*                                                                    */
28
#/*  This source file is free software; you can redistribute it        */
29
#/*  and/or modify it under the terms of the GNU Lesser General        */
30
#/*  Public License as published by the Free Software Foundation;      */
31
#/*  either version 2.1 of the License, or (at your option) any        */
32
#/*  later version.                                                    */
33
#/*                                                                    */
34
#/*  This source is distributed in the hope that it will be            */
35
#/*  useful, but WITHOUT ANY WARRANTY; without even the implied        */
36
#/*  warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR           */
37
#/*  PURPOSE.  See the GNU Lesser General Public License for more      */
38
#/*  details.                                                          */
39
#/*                                                                    */
40
#/*  You should have received a copy of the GNU Lesser General         */
41
#/*  Public License along with this source; if not, download it        */
42
#/*  from http://www.opencores.org/lgpl.shtml                          */
43
#/*                                                                    */
44
#/**********************************************************************/
45
 
46
 
47
############################################################################
48
# General PERL config
49
############################################################################
50
use Getopt::Long;
51
use English;
52
use File::Basename;
53
use Cwd;
54
use XML::LibXML;
55
use lib './tools';
56
use sys::lib;
57
use yp::lib;
58
 
59
$OUTPUT_AUTOFLUSH = 1; # set autoflush of stdout to TRUE.
60
 
61
 
62
############################################################################
63
### Process the options
64
############################################################################
65
Getopt::Long::config("require_order", "prefix=-");
66
GetOptions("h","help",
67
) || die "(use '$program_name -h' for help)";
68
 
69
 
70
 
71
 
72
##############################################################################
73
## Help option
74
##############################################################################
75
if ( $opt_h or $opt_help  )
76
  { print "\n run_coverage project_name  project_vendor";
77
    print "\n";
78
    exit 1;
79
  }
80
 
81
 
82
#/**********************************************************************/
83
#/*  Process each project by finding any ip-xact file in any component */
84
#/*                                                                    */
85
#/*  Each ip-xact file is parsed and it's filename and the names of any*/
86
#/*  modules that it uses are saved.                                   */
87
#/*                                                                    */
88
#/*                                                                    */
89
#/**********************************************************************/
90
 
91
 
92
my $home              = cwd();
93 128 jt_eaton
my $vendor   ;
94
my $project  ;
95 119 jt_eaton
 
96 128 jt_eaton
$_               = $ARGV[0];
97
my $work_site    = $ARGV[1];
98 119 jt_eaton
 
99 128 jt_eaton
 
100
if(/(\S+)__(\S+)/)
101
     {
102
     $vendor           = $1;
103
     $project          = $2;
104
     }
105
 
106
 
107
print "$work_site   $vendor $project \n";
108
 
109
 
110 119 jt_eaton
my $parser = XML::LibXML->new();
111
 
112
 
113
 
114 130 jt_eaton
my @components   = yp::lib::find_components($vendor,$project);
115 119 jt_eaton
 
116
foreach my $component (@components)
117
   {
118 130 jt_eaton
   my $socgen_file              = $parser->parse_file(yp::lib::find_componentConfiguration($vendor,$project,$component));
119
   my $sim_library_path ;
120
   my $lib_comp_sep             = yp::lib::find_lib_comp_sep($vendor,$project,$component);
121
   my $sim_comp_path            = $socgen_file->findnodes("//socgen:componentConfiguration/socgen:sim/socgen:comp_path/text()")->to_literal;
122 119 jt_eaton
 
123 130 jt_eaton
   if ($sim_comp_path)
124
      {
125
      $sim_library_path            ="${lib_comp_sep}${sim_comp_path}";
126
      }
127
   else
128
      {
129
      $sim_library_path            = $socgen_file->findnodes("//socgen:componentConfiguration/socgen:sim/socgen:library_path/text()")->to_literal;
130
      }
131 128 jt_eaton
 
132 130 jt_eaton
   print "XXXX-   $vendor $project $component  $sim_library_path   \n";
133
 
134 119 jt_eaton
   #/*********************************************************************************************/
135 128 jt_eaton
   #/   create coverage database .cdd file                                                       */
136 119 jt_eaton
   #/                                                                                            */
137
   #/*********************************************************************************************/
138
 
139 130 jt_eaton
   foreach  my   $i_name ($socgen_file->findnodes("//socgen:componentConfiguration/socgen:sim/socgen:testbenches/socgen:testbench/socgen:tools/socgen:tool"))
140 119 jt_eaton
      {
141 128 jt_eaton
      my($tb_tool)     = $i_name ->findnodes('./text()')->to_literal ;
142
      my($tb_variant)  = $i_name ->findnodes('../../socgen:variant/text()')->to_literal ;
143
      my($tb_version)  = $i_name ->findnodes('../../socgen:version/text()')->to_literal ;
144 119 jt_eaton
 
145 128 jt_eaton
      if($tb_tool eq "coverage")
146
          {
147
          print "  COVERAGEs   $tb_tool          $tb_variant  $tb_version \n";
148
          chdir  ".${work_site}/${vendor}__${project}${sim_library_path}/cov/${tb_variant}";
149 119 jt_eaton
 
150 128 jt_eaton
          $cmd ="make build_cdd \n";
151
          if (system($cmd)) {}
152 119 jt_eaton
 
153
 
154
 
155 128 jt_eaton
 
156 130 jt_eaton
          foreach  my   $i_name ($socgen_file->findnodes("//socgen:test/socgen:variant"))
157 128 jt_eaton
              {
158
              my($test_variant)     = $i_name ->findnodes('./text()')->to_literal ;
159
              my($test_name)        = $i_name ->findnodes('../socgen:name/text()')->to_literal ;
160
 
161
              if($tb_variant eq $test_variant  )
162
                {
163
                print "  $tb_variant  $test_variant $test_name \n";
164
                $cmd ="make score_cov TEST=${test_name} \n";
165
                if (system($cmd)) {}
166
                }
167
 
168
              }
169
 
170
              $cmd ="make report_cov  \n";
171
              if (system($cmd)) {}
172
 
173
          }
174
 
175
 
176
 
177
 
178
 
179
          chdir $home;
180
 
181 119 jt_eaton
      }
182
 
183 128 jt_eaton
 
184
 
185
 
186
 
187
 
188
 
189
 
190 119 jt_eaton
   }
191
 
192
 
193
 

powered by: WebSVN 2.1.0

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