1 |
131 |
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-2013> */
|
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 build_master";
|
77 |
|
|
print "\n";
|
78 |
|
|
exit 1;
|
79 |
|
|
}
|
80 |
|
|
|
81 |
|
|
|
82 |
|
|
my $parser = XML::LibXML->new();
|
83 |
|
|
|
84 |
|
|
|
85 |
|
|
|
86 |
|
|
|
87 |
|
|
#/**********************************************************************/
|
88 |
|
|
#/* Process each library by finding any ip-xact file in any component */
|
89 |
|
|
#/* */
|
90 |
|
|
#/* Each ip-xact file is parsed and it's filename and the names of any*/
|
91 |
|
|
#/* modules that it uses are saved. */
|
92 |
|
|
#/* */
|
93 |
|
|
#/* */
|
94 |
|
|
#/**********************************************************************/
|
95 |
|
|
|
96 |
|
|
my $home = cwd();
|
97 |
|
|
|
98 |
|
|
my $prefix = yp::lib::get_workspace();
|
99 |
|
|
$prefix = "/${prefix}";
|
100 |
|
|
|
101 |
|
|
my @vendors = yp::lib::find_vendors();
|
102 |
|
|
|
103 |
|
|
foreach my $vendor (@vendors)
|
104 |
|
|
{
|
105 |
|
|
print "$vendor \n ";
|
106 |
|
|
my $vendor_status = yp::lib::get_vendor_status($vendor);
|
107 |
|
|
if($vendor_status eq "active")
|
108 |
|
|
{
|
109 |
|
|
my @libraries = yp::lib::find_libraries($vendor);
|
110 |
|
|
foreach my $library (@libraries)
|
111 |
|
|
{
|
112 |
|
|
print "$vendor $library \n ";
|
113 |
|
|
my $library_status = yp::lib::get_library_status($vendor,$library);
|
114 |
|
|
if($library_status eq "active")
|
115 |
|
|
{
|
116 |
|
|
print "$vendor $library \n ";
|
117 |
|
|
run_vendor_library ( $vendor , $library)
|
118 |
|
|
}
|
119 |
|
|
}
|
120 |
|
|
}
|
121 |
|
|
}
|
122 |
|
|
|
123 |
|
|
|
124 |
|
|
|
125 |
|
|
|
126 |
|
|
sub run_vendor_library
|
127 |
|
|
{
|
128 |
|
|
my @params = @_;
|
129 |
|
|
my $library = pop(@params);
|
130 |
|
|
my $vendor = pop(@params);
|
131 |
|
|
|
132 |
|
|
|
133 |
|
|
my @components = yp::lib::find_components($vendor,$library);
|
134 |
|
|
|
135 |
|
|
foreach my $component (@components)
|
136 |
|
|
{
|
137 |
|
|
my $socgen_filename = yp::lib::find_componentConfiguration($vendor,$library,$component);
|
138 |
|
|
if($socgen_filename)
|
139 |
|
|
{
|
140 |
|
|
my $socgen_file = $parser->parse_file($socgen_filename);
|
141 |
|
|
|
142 |
|
|
#/*********************************************************************************************/
|
143 |
|
|
#/ files for simulation */
|
144 |
|
|
#/ */
|
145 |
|
|
#/*********************************************************************************************/
|
146 |
|
|
|
147 |
|
|
foreach my $i_name ($socgen_file->findnodes("//socgen:codeSets/socgen:codeSet/socgen:name"))
|
148 |
|
|
{
|
149 |
|
|
my $codeSet_name = $i_name ->findnodes('./text()')->to_literal ;
|
150 |
|
|
my $codeSet_vendor = $i_name ->findnodes('../socgen:vendor/text()')->to_literal ;
|
151 |
|
|
my $codeSet_library = $i_name ->findnodes('../socgen:library/text()')->to_literal ;
|
152 |
|
|
my $codeSet_component = $i_name ->findnodes('../socgen:component/text()')->to_literal ;
|
153 |
|
|
my $codeSet_version = $i_name ->findnodes('../socgen:version/text()')->to_literal ;
|
154 |
|
|
|
155 |
|
|
print "$codeSet_name $codeSet_vendor $codeSet_library $codeSet_component $codeSet_version \n ";
|
156 |
|
|
|
157 |
|
|
$cmd ="./tools/sys/build_generate -prefix ${prefix}/${vendor}__${library}/children -vendor ${codeSet_vendor} -library ${codeSet_library} -component ${codeSet_component} -version ${codeSet_version} \n";
|
158 |
|
|
if (system($cmd)) {}
|
159 |
|
|
|
160 |
|
|
}
|
161 |
|
|
|
162 |
|
|
}
|
163 |
|
|
|
164 |
|
|
}
|
165 |
|
|
|
166 |
|
|
|
167 |
|
|
|
168 |
|
|
return(0);
|
169 |
|
|
}
|
170 |
|
|
|