1 |
117 |
jt_eaton |
#/**********************************************************************/
|
2 |
|
|
#/* */
|
3 |
|
|
#/* ------- */
|
4 |
|
|
#/* / SOC \ */
|
5 |
|
|
#/* / GEN \ */
|
6 |
|
|
#/* / TOOL \ */
|
7 |
|
|
#/* ============== */
|
8 |
|
|
#/* | | */
|
9 |
|
|
#/* |____________| */
|
10 |
|
|
#/* */
|
11 |
|
|
#/* */
|
12 |
|
|
#/* */
|
13 |
|
|
#/* Author(s): */
|
14 |
|
|
#/* - John Eaton, jt_eaton@opencores.org */
|
15 |
|
|
#/* */
|
16 |
|
|
#/**********************************************************************/
|
17 |
|
|
#/* */
|
18 |
|
|
#/* Copyright (C) <2010-2011> <Ouabache Design Works> */
|
19 |
|
|
#/* */
|
20 |
|
|
#/* This source file may be used and distributed without */
|
21 |
|
|
#/* restriction provided that this copyright statement is not */
|
22 |
|
|
#/* removed from the file and that any derivative work contains */
|
23 |
|
|
#/* the original copyright notice and the associated disclaimer. */
|
24 |
|
|
#/* */
|
25 |
|
|
#/* This source file is free software; you can redistribute it */
|
26 |
|
|
#/* and/or modify it under the terms of the GNU Lesser General */
|
27 |
|
|
#/* Public License as published by the Free Software Foundation; */
|
28 |
|
|
#/* either version 2.1 of the License, or (at your option) any */
|
29 |
|
|
#/* later version. */
|
30 |
|
|
#/* */
|
31 |
|
|
#/* This source is distributed in the hope that it will be */
|
32 |
|
|
#/* useful, but WITHOUT ANY WARRANTY; without even the implied */
|
33 |
|
|
#/* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR */
|
34 |
|
|
#/* PURPOSE. See the GNU Lesser General Public License for more */
|
35 |
|
|
#/* details. */
|
36 |
|
|
#/* */
|
37 |
|
|
#/* You should have received a copy of the GNU Lesser General */
|
38 |
|
|
#/* Public License along with this source; if not, download it */
|
39 |
|
|
#/* from http://www.opencores.org/lgpl.shtml */
|
40 |
|
|
#/* */
|
41 |
|
|
#/**********************************************************************/
|
42 |
|
|
|
43 |
|
|
|
44 |
|
|
|
45 |
|
|
|
46 |
|
|
|
47 |
|
|
|
48 |
|
|
use strict;
|
49 |
|
|
|
50 |
|
|
package yp::lib;
|
51 |
|
|
|
52 |
|
|
|
53 |
118 |
jt_eaton |
#/***********************************************************************************************/
|
54 |
|
|
#/ find_ipxact */
|
55 |
|
|
#/ */
|
56 |
|
|
#/ returns full path name to ip-xact file */
|
57 |
|
|
#/ */
|
58 |
|
|
#/ my $spirit_type_file = yp::lib::find_ipxact($type,$vendor,$library,$component,$version); */
|
59 |
|
|
#/ */
|
60 |
|
|
#/***********************************************************************************************/
|
61 |
117 |
jt_eaton |
|
62 |
118 |
jt_eaton |
sub find_ipxact
|
63 |
117 |
jt_eaton |
{
|
64 |
|
|
my @params = @_;
|
65 |
|
|
my $version = pop(@params);
|
66 |
|
|
my $component = pop(@params);
|
67 |
|
|
my $project = pop(@params);
|
68 |
|
|
my $vendor = pop(@params);
|
69 |
|
|
my $type = pop(@params);
|
70 |
|
|
|
71 |
|
|
|
72 |
118 |
jt_eaton |
my $card_file_name;
|
73 |
|
|
my $card_dir_name;
|
74 |
|
|
|
75 |
|
|
my $parser = XML::LibXML->new();
|
76 |
|
|
my $yp_index_file = $parser->parse_file("./tools/yp/hier_index.xml");
|
77 |
|
|
|
78 |
|
|
foreach my $i_vendor ($yp_index_file->findnodes("//socgen:file_types/socgen:file_type[socgen:name/text() = '$type']/socgen:vendors/socgen:vendor[socgen:name/text() = '$vendor']/socgen:libraries/socgen:library[socgen:name/text() = '$project']/socgen:components/socgen:component[socgen:name/text() = '$component']/socgen:versions/socgen:version[socgen:name/text() = '$version']"))
|
79 |
|
|
{
|
80 |
|
|
$card_file_name = $i_vendor->findnodes('./socgen:file_name/text()')->to_literal ;
|
81 |
|
|
$card_dir_name = $i_vendor->findnodes('./socgen:dir_name/text()')->to_literal ;
|
82 |
|
|
return("./${card_dir_name}/${card_file_name}");
|
83 |
|
|
}
|
84 |
|
|
return("");
|
85 |
|
|
|
86 |
|
|
}
|
87 |
|
|
|
88 |
|
|
|
89 |
|
|
|
90 |
|
|
|
91 |
|
|
|
92 |
|
|
|
93 |
|
|
|
94 |
120 |
jt_eaton |
|
95 |
|
|
|
96 |
117 |
jt_eaton |
#/*********************************************************************************************/
|
97 |
|
|
#/ find_ipxact_file */
|
98 |
|
|
#/ */
|
99 |
|
|
#/ returns local name of the ip-xact file */
|
100 |
|
|
#/ */
|
101 |
118 |
jt_eaton |
#/ my $file_name = yp::lib::find_ipxact_file($type,$vendor,$library,$component,$version); */
|
102 |
117 |
jt_eaton |
#/ */
|
103 |
|
|
#/*********************************************************************************************/
|
104 |
|
|
|
105 |
|
|
sub find_ipxact_file
|
106 |
|
|
{
|
107 |
|
|
my @params = @_;
|
108 |
|
|
my $version = pop(@params);
|
109 |
|
|
my $component = pop(@params);
|
110 |
|
|
my $project = pop(@params);
|
111 |
|
|
my $vendor = pop(@params);
|
112 |
|
|
my $type = pop(@params);
|
113 |
|
|
|
114 |
|
|
|
115 |
|
|
my $card_type;
|
116 |
|
|
my $card_file_name;
|
117 |
|
|
my $card_dir_name;
|
118 |
|
|
my $card_vendor;
|
119 |
|
|
my $card_library;
|
120 |
|
|
my $card_component;
|
121 |
|
|
my $card_version;
|
122 |
|
|
|
123 |
|
|
my $parser = XML::LibXML->new();
|
124 |
|
|
my $yp_index_file = $parser->parse_file("./tools/yp/index.xml");
|
125 |
|
|
|
126 |
|
|
|
127 |
|
|
|
128 |
|
|
|
129 |
|
|
foreach my $index_card ($yp_index_file->findnodes('//socgen:index_file/index_card/type'))
|
130 |
|
|
{
|
131 |
|
|
$card_type = $index_card->findnodes('./text()')->to_literal ;
|
132 |
|
|
$card_file_name = $index_card->findnodes('../file_name/text()')->to_literal ;
|
133 |
|
|
$card_dir_name = $index_card->findnodes('../dir_name/text()')->to_literal ;
|
134 |
|
|
$card_vendor = $index_card->findnodes('../vendor/text()')->to_literal ;
|
135 |
|
|
$card_library = $index_card->findnodes('../library/text()')->to_literal ;
|
136 |
|
|
$card_component = $index_card->findnodes('../name/text()')->to_literal ;
|
137 |
|
|
$card_version = $index_card->findnodes('../version/text()')->to_literal ;
|
138 |
|
|
if(( $card_type eq "${type}" ) &
|
139 |
|
|
( $card_vendor eq "${vendor}" ) &
|
140 |
|
|
( $card_library eq "${project}" ) &
|
141 |
|
|
( $card_component eq "${component}" ) &
|
142 |
|
|
( $card_version eq "${version}" )
|
143 |
|
|
) {return("${card_file_name}"); }
|
144 |
|
|
}
|
145 |
|
|
}
|
146 |
|
|
|
147 |
|
|
|
148 |
|
|
|
149 |
|
|
#/*********************************************************************************************/
|
150 |
118 |
jt_eaton |
#/ find_ipxact_dir_name */
|
151 |
117 |
jt_eaton |
#/ */
|
152 |
|
|
#/ returns path to ip-xact directory from top level */
|
153 |
118 |
jt_eaton |
#/ my $dir_name = yp::lib::find_ipxact_dir_name($type,$vendor,$library,$component,$version); */
|
154 |
117 |
jt_eaton |
#/ */
|
155 |
|
|
#/*********************************************************************************************/
|
156 |
|
|
|
157 |
118 |
jt_eaton |
sub find_ipxact_dir_name
|
158 |
117 |
jt_eaton |
{
|
159 |
|
|
my @params = @_;
|
160 |
|
|
my $version = pop(@params);
|
161 |
|
|
my $component = pop(@params);
|
162 |
|
|
my $project = pop(@params);
|
163 |
|
|
my $vendor = pop(@params);
|
164 |
|
|
my $type = pop(@params);
|
165 |
|
|
|
166 |
|
|
|
167 |
|
|
my $card_type;
|
168 |
|
|
my $card_file_name;
|
169 |
|
|
my $card_dir_name;
|
170 |
|
|
my $card_vendor_path;
|
171 |
|
|
my $card_library_path;
|
172 |
|
|
my $card_component_path;
|
173 |
|
|
my $card_vendor;
|
174 |
|
|
my $card_library;
|
175 |
|
|
my $card_component;
|
176 |
|
|
my $card_version;
|
177 |
|
|
|
178 |
|
|
my $parser = XML::LibXML->new();
|
179 |
|
|
my $yp_index_file = $parser->parse_file("./tools/yp/index.xml");
|
180 |
|
|
|
181 |
|
|
foreach my $index_card ($yp_index_file->findnodes('//socgen:index_file/index_card/type'))
|
182 |
|
|
{
|
183 |
|
|
$card_type = $index_card->findnodes('./text()')->to_literal ;
|
184 |
|
|
$card_file_name = $index_card->findnodes('../file_name/text()')->to_literal ;
|
185 |
|
|
$card_dir_name = $index_card->findnodes('../dir_name/text()')->to_literal ;
|
186 |
|
|
$card_vendor_path = $index_card->findnodes('../vendor_path/text()')->to_literal ;
|
187 |
|
|
$card_component_path= $index_card->findnodes('../component_path/text()')->to_literal ;
|
188 |
|
|
$card_library_path = $index_card->findnodes('../library_path/text()')->to_literal ;
|
189 |
|
|
$card_vendor = $index_card->findnodes('../vendor/text()')->to_literal ;
|
190 |
|
|
$card_library = $index_card->findnodes('../library/text()')->to_literal ;
|
191 |
|
|
$card_component = $index_card->findnodes('../name/text()')->to_literal ;
|
192 |
|
|
$card_version = $index_card->findnodes('../version/text()')->to_literal ;
|
193 |
|
|
if(( $card_type eq "${type}" ) &
|
194 |
|
|
( $card_vendor eq "${vendor}" ) &
|
195 |
|
|
( $card_library eq "${project}" ) &
|
196 |
|
|
( $card_component eq "${component}" ) &
|
197 |
|
|
( $card_version eq "${version}" )
|
198 |
|
|
)
|
199 |
|
|
|
200 |
|
|
{return("${card_dir_name}"); }
|
201 |
|
|
}
|
202 |
|
|
}
|
203 |
|
|
|
204 |
|
|
|
205 |
|
|
|
206 |
|
|
|
207 |
|
|
|
208 |
|
|
|
209 |
|
|
|
210 |
|
|
|
211 |
|
|
#/*********************************************************************************************/
|
212 |
|
|
#/ find_ipxact_vendor_path */
|
213 |
|
|
#/ */
|
214 |
|
|
#/ returns path to ip-xact directory from vendor level */
|
215 |
|
|
#/ The ip-xact file MUST be stored under a subdirectory that matches the vendor name */
|
216 |
118 |
jt_eaton |
#/ my $vendor_path = yp::lib::find_ipxact_vendor_path($type,$vendor,$library,$component,$version); */
|
217 |
117 |
jt_eaton |
#/ */
|
218 |
|
|
#/*********************************************************************************************/
|
219 |
|
|
|
220 |
|
|
sub find_ipxact_vendor_path
|
221 |
|
|
{
|
222 |
|
|
my @params = @_;
|
223 |
|
|
my $version = pop(@params);
|
224 |
|
|
my $component = pop(@params);
|
225 |
|
|
my $project = pop(@params);
|
226 |
|
|
my $vendor = pop(@params);
|
227 |
|
|
my $type = pop(@params);
|
228 |
|
|
|
229 |
|
|
|
230 |
|
|
my $card_type;
|
231 |
|
|
my $card_file_name;
|
232 |
|
|
my $card_dir_name;
|
233 |
|
|
my $card_vendor_path;
|
234 |
|
|
my $card_library_path;
|
235 |
|
|
my $card_component_path;
|
236 |
|
|
my $card_vendor;
|
237 |
|
|
my $card_library;
|
238 |
|
|
my $card_component;
|
239 |
|
|
my $card_version;
|
240 |
|
|
|
241 |
|
|
my $parser = XML::LibXML->new();
|
242 |
|
|
my $yp_index_file = $parser->parse_file("./tools/yp/index.xml");
|
243 |
|
|
|
244 |
|
|
foreach my $index_card ($yp_index_file->findnodes('//socgen:index_file/index_card/type'))
|
245 |
|
|
{
|
246 |
|
|
$card_type = $index_card->findnodes('./text()')->to_literal ;
|
247 |
|
|
$card_file_name = $index_card->findnodes('../file_name/text()')->to_literal ;
|
248 |
|
|
$card_dir_name = $index_card->findnodes('../dir_name/text()')->to_literal ;
|
249 |
|
|
$card_vendor_path = $index_card->findnodes('../vendor_path/text()')->to_literal ;
|
250 |
|
|
$card_component_path= $index_card->findnodes('../component_path/text()')->to_literal ;
|
251 |
|
|
$card_library_path = $index_card->findnodes('../library_path/text()')->to_literal ;
|
252 |
|
|
$card_vendor = $index_card->findnodes('../vendor/text()')->to_literal ;
|
253 |
|
|
$card_library = $index_card->findnodes('../library/text()')->to_literal ;
|
254 |
|
|
$card_component = $index_card->findnodes('../name/text()')->to_literal ;
|
255 |
|
|
$card_version = $index_card->findnodes('../version/text()')->to_literal ;
|
256 |
|
|
if(( $card_type eq "${type}" ) &
|
257 |
|
|
( $card_vendor eq "${vendor}" ) &
|
258 |
|
|
( $card_library eq "${project}" ) &
|
259 |
|
|
( $card_component eq "${component}" ) &
|
260 |
|
|
( $card_version eq "${version}" )
|
261 |
|
|
)
|
262 |
|
|
|
263 |
|
|
{return("/${card_vendor_path}"); }
|
264 |
|
|
}
|
265 |
|
|
}
|
266 |
|
|
|
267 |
|
|
|
268 |
|
|
|
269 |
|
|
|
270 |
|
|
#/*********************************************************************************************/
|
271 |
|
|
#/ find_ipxact_library_path */
|
272 |
|
|
#/ */
|
273 |
|
|
#/ returns path to ip-xact directory from library level */
|
274 |
|
|
#/ The ip-xact file MUST be stored under a subdirectory that matches the library name */
|
275 |
118 |
jt_eaton |
#/ my $library_path = yp::lib::find_ipxact_library_path($type,$vendor,$library,$component,$version); */
|
276 |
117 |
jt_eaton |
#/ */
|
277 |
|
|
#/*********************************************************************************************/
|
278 |
|
|
|
279 |
|
|
sub find_ipxact_library_path
|
280 |
|
|
{
|
281 |
|
|
my @params = @_;
|
282 |
|
|
my $version = pop(@params);
|
283 |
|
|
my $component = pop(@params);
|
284 |
|
|
my $project = pop(@params);
|
285 |
|
|
my $vendor = pop(@params);
|
286 |
|
|
my $type = pop(@params);
|
287 |
|
|
|
288 |
|
|
|
289 |
|
|
my $card_type;
|
290 |
|
|
my $card_file_name;
|
291 |
|
|
my $card_dir_name;
|
292 |
|
|
my $card_vendor_path;
|
293 |
|
|
my $card_library_path;
|
294 |
|
|
my $card_component_path;
|
295 |
|
|
my $card_vendor;
|
296 |
|
|
my $card_library;
|
297 |
|
|
my $card_component;
|
298 |
|
|
my $card_version;
|
299 |
|
|
|
300 |
|
|
my $parser = XML::LibXML->new();
|
301 |
|
|
my $yp_index_file = $parser->parse_file("./tools/yp/index.xml");
|
302 |
|
|
|
303 |
|
|
foreach my $index_card ($yp_index_file->findnodes('//socgen:index_file/index_card/type'))
|
304 |
|
|
{
|
305 |
|
|
$card_type = $index_card->findnodes('./text()')->to_literal ;
|
306 |
|
|
$card_file_name = $index_card->findnodes('../file_name/text()')->to_literal ;
|
307 |
|
|
$card_dir_name = $index_card->findnodes('../dir_name/text()')->to_literal ;
|
308 |
|
|
$card_vendor_path = $index_card->findnodes('../vendor_path/text()')->to_literal ;
|
309 |
|
|
$card_component_path= $index_card->findnodes('../component_path/text()')->to_literal ;
|
310 |
|
|
$card_library_path = $index_card->findnodes('../library_path/text()')->to_literal ;
|
311 |
|
|
$card_vendor = $index_card->findnodes('../vendor/text()')->to_literal ;
|
312 |
|
|
$card_library = $index_card->findnodes('../library/text()')->to_literal ;
|
313 |
|
|
$card_component = $index_card->findnodes('../name/text()')->to_literal ;
|
314 |
|
|
$card_version = $index_card->findnodes('../version/text()')->to_literal ;
|
315 |
|
|
if(( $card_type eq "${type}" ) &
|
316 |
|
|
( $card_vendor eq "${vendor}" ) &
|
317 |
|
|
( $card_library eq "${project}" ) &
|
318 |
|
|
( $card_component eq "${component}" ) &
|
319 |
|
|
( $card_version eq "${version}" )
|
320 |
|
|
)
|
321 |
|
|
|
322 |
|
|
{return("/${card_library_path}"); }
|
323 |
|
|
}
|
324 |
|
|
}
|
325 |
|
|
|
326 |
|
|
|
327 |
|
|
#/*********************************************************************************************/
|
328 |
|
|
#/ find_ipxact_component_path */
|
329 |
|
|
#/ */
|
330 |
|
|
#/ returns path to ip-xact directory from component level */
|
331 |
|
|
#/ The ip-xact file MUST be stored under a subdirectory that matches the component name */
|
332 |
118 |
jt_eaton |
#/ my $component_path = yp::lib::find_ipxact_component_path($type,$vendor,$library,$component,$version); */
|
333 |
117 |
jt_eaton |
#/ */
|
334 |
|
|
#/*********************************************************************************************/
|
335 |
|
|
|
336 |
|
|
sub find_ipxact_component_path
|
337 |
|
|
{
|
338 |
|
|
my @params = @_;
|
339 |
|
|
my $version = pop(@params);
|
340 |
|
|
my $component = pop(@params);
|
341 |
|
|
my $project = pop(@params);
|
342 |
|
|
my $vendor = pop(@params);
|
343 |
|
|
my $type = pop(@params);
|
344 |
|
|
|
345 |
|
|
|
346 |
|
|
my $card_type;
|
347 |
|
|
my $card_file_name;
|
348 |
|
|
my $card_dir_name;
|
349 |
|
|
my $card_vendor_path;
|
350 |
|
|
my $card_library_path;
|
351 |
|
|
my $card_component_path;
|
352 |
|
|
my $card_vendor;
|
353 |
|
|
my $card_library;
|
354 |
|
|
my $card_component;
|
355 |
|
|
my $card_version;
|
356 |
|
|
|
357 |
|
|
my $parser = XML::LibXML->new();
|
358 |
|
|
my $yp_index_file = $parser->parse_file("./tools/yp/index.xml");
|
359 |
|
|
|
360 |
|
|
foreach my $index_card ($yp_index_file->findnodes('//socgen:index_file/index_card/type'))
|
361 |
|
|
{
|
362 |
|
|
$card_type = $index_card->findnodes('./text()')->to_literal ;
|
363 |
|
|
$card_file_name = $index_card->findnodes('../file_name/text()')->to_literal ;
|
364 |
|
|
$card_dir_name = $index_card->findnodes('../dir_name/text()')->to_literal ;
|
365 |
|
|
$card_vendor_path = $index_card->findnodes('../vendor_path/text()')->to_literal ;
|
366 |
|
|
$card_component_path= $index_card->findnodes('../component_path/text()')->to_literal ;
|
367 |
|
|
$card_library_path = $index_card->findnodes('../library_path/text()')->to_literal ;
|
368 |
|
|
$card_vendor = $index_card->findnodes('../vendor/text()')->to_literal ;
|
369 |
|
|
$card_library = $index_card->findnodes('../library/text()')->to_literal ;
|
370 |
|
|
$card_component = $index_card->findnodes('../name/text()')->to_literal ;
|
371 |
|
|
$card_version = $index_card->findnodes('../version/text()')->to_literal ;
|
372 |
|
|
if(( $card_type eq "${type}" ) &
|
373 |
|
|
( $card_vendor eq "${vendor}" ) &
|
374 |
|
|
( $card_library eq "${project}" ) &
|
375 |
|
|
( $card_component eq "${component}" ) &
|
376 |
|
|
( $card_version eq "${version}" )
|
377 |
|
|
)
|
378 |
|
|
|
379 |
|
|
{return("/${card_component_path}"); }
|
380 |
|
|
}
|
381 |
|
|
}
|
382 |
|
|
|
383 |
|
|
|
384 |
|
|
|
385 |
|
|
|
386 |
120 |
jt_eaton |
|
387 |
117 |
jt_eaton |
#/*********************************************************************************************/
|
388 |
|
|
#/ find_lib_comp_sep */
|
389 |
|
|
#/ */
|
390 |
|
|
#/ returns path to the component from library level */
|
391 |
|
|
#/ The file MUST be stored under a subdirectory that matches the component name */
|
392 |
118 |
jt_eaton |
#/ my $lib_comp_sep = yp::lib::find_lib_comp_sep($vendor,$library); */
|
393 |
117 |
jt_eaton |
#/ */
|
394 |
|
|
#/*********************************************************************************************/
|
395 |
|
|
|
396 |
|
|
sub find_lib_comp_sep
|
397 |
|
|
{
|
398 |
|
|
my @params = @_;
|
399 |
|
|
my $project = pop(@params);
|
400 |
|
|
my $vendor = pop(@params);
|
401 |
|
|
|
402 |
|
|
|
403 |
|
|
|
404 |
|
|
my $card_type;
|
405 |
|
|
my $card_file_name;
|
406 |
|
|
my $card_dir_name;
|
407 |
|
|
my $card_vendor_path;
|
408 |
|
|
my $card_library_path;
|
409 |
|
|
my $card_component_path;
|
410 |
|
|
my $card_lib_comp_sep;
|
411 |
120 |
jt_eaton |
my $card_lib_ip_dir;
|
412 |
117 |
jt_eaton |
my $card_vendor;
|
413 |
|
|
my $card_library;
|
414 |
|
|
my $card_component;
|
415 |
|
|
my $card_version;
|
416 |
|
|
|
417 |
|
|
my $parser = XML::LibXML->new();
|
418 |
|
|
my $yp_index_file = $parser->parse_file("./tools/yp/index.xml");
|
419 |
|
|
|
420 |
|
|
foreach my $index_card ($yp_index_file->findnodes('//socgen:index_file/index_card/type'))
|
421 |
|
|
{
|
422 |
|
|
$card_type = $index_card->findnodes('./text()')->to_literal ;
|
423 |
|
|
$card_file_name = $index_card->findnodes('../file_name/text()')->to_literal ;
|
424 |
|
|
$card_dir_name = $index_card->findnodes('../dir_name/text()')->to_literal ;
|
425 |
|
|
$card_vendor_path = $index_card->findnodes('../vendor_path/text()')->to_literal ;
|
426 |
|
|
$card_component_path= $index_card->findnodes('../component_path/text()')->to_literal ;
|
427 |
|
|
$card_library_path = $index_card->findnodes('../library_path/text()')->to_literal ;
|
428 |
|
|
$card_lib_comp_sep = $index_card->findnodes('../lib_comp_sep/text()')->to_literal ;
|
429 |
120 |
jt_eaton |
$card_lib_ip_dir = $index_card->findnodes('../lib_ip_dir/text()')->to_literal ;
|
430 |
117 |
jt_eaton |
$card_vendor = $index_card->findnodes('../vendor/text()')->to_literal ;
|
431 |
|
|
$card_library = $index_card->findnodes('../library/text()')->to_literal ;
|
432 |
|
|
$card_component = $index_card->findnodes('../name/text()')->to_literal ;
|
433 |
|
|
$card_version = $index_card->findnodes('../version/text()')->to_literal ;
|
434 |
|
|
if(( $card_vendor eq "${vendor}" ) &
|
435 |
120 |
jt_eaton |
( $card_library eq "${project}" ) &
|
436 |
124 |
jt_eaton |
( $card_type eq "socgen:libraryConfiguration" )
|
437 |
117 |
jt_eaton |
)
|
438 |
|
|
{
|
439 |
120 |
jt_eaton |
if($card_lib_ip_dir) {return("/${card_lib_ip_dir}");}
|
440 |
117 |
jt_eaton |
else {return("");}
|
441 |
120 |
jt_eaton |
}
|
442 |
|
|
}
|
443 |
|
|
}
|
444 |
117 |
jt_eaton |
|
445 |
120 |
jt_eaton |
|
446 |
|
|
|
447 |
|
|
|
448 |
|
|
|
449 |
|
|
|
450 |
|
|
|
451 |
|
|
|
452 |
|
|
#/*********************************************************************************************/
|
453 |
|
|
#/ find_file_type */
|
454 |
|
|
#/ */
|
455 |
|
|
#/ returns file_type */
|
456 |
|
|
#/ The file MUST be stored under a subdirectory that matches the component name */
|
457 |
|
|
#/ my $file_type = yp::lib::find_file_type($vendor,$library,$component,$version); */
|
458 |
|
|
#/ */
|
459 |
|
|
#/*********************************************************************************************/
|
460 |
|
|
|
461 |
|
|
sub find_file_type
|
462 |
|
|
{
|
463 |
|
|
my @params = @_;
|
464 |
|
|
my $version = pop(@params);
|
465 |
|
|
my $component = pop(@params);
|
466 |
|
|
my $project = pop(@params);
|
467 |
|
|
my $vendor = pop(@params);
|
468 |
|
|
|
469 |
|
|
|
470 |
|
|
|
471 |
|
|
my $card_type;
|
472 |
|
|
my $card_file_name;
|
473 |
|
|
my $card_dir_name;
|
474 |
|
|
my $card_vendor_path;
|
475 |
|
|
my $card_library_path;
|
476 |
|
|
my $card_component_path;
|
477 |
|
|
my $card_lib_comp_sep;
|
478 |
|
|
my $card_vendor;
|
479 |
|
|
my $card_library;
|
480 |
|
|
my $card_component;
|
481 |
|
|
my $card_version;
|
482 |
|
|
|
483 |
|
|
my $parser = XML::LibXML->new();
|
484 |
|
|
my $yp_index_file = $parser->parse_file("./tools/yp/index.xml");
|
485 |
|
|
|
486 |
|
|
foreach my $index_card ($yp_index_file->findnodes('//socgen:index_file/index_card/type'))
|
487 |
|
|
{
|
488 |
|
|
$card_type = $index_card->findnodes('./text()')->to_literal ;
|
489 |
|
|
$card_file_name = $index_card->findnodes('../file_name/text()')->to_literal ;
|
490 |
|
|
$card_dir_name = $index_card->findnodes('../dir_name/text()')->to_literal ;
|
491 |
|
|
$card_vendor_path = $index_card->findnodes('../vendor_path/text()')->to_literal ;
|
492 |
|
|
$card_component_path= $index_card->findnodes('../component_path/text()')->to_literal ;
|
493 |
|
|
$card_library_path = $index_card->findnodes('../library_path/text()')->to_literal ;
|
494 |
|
|
$card_lib_comp_sep = $index_card->findnodes('../lib_comp_sep/text()')->to_literal ;
|
495 |
|
|
$card_vendor = $index_card->findnodes('../vendor/text()')->to_literal ;
|
496 |
|
|
$card_library = $index_card->findnodes('../library/text()')->to_literal ;
|
497 |
|
|
$card_component = $index_card->findnodes('../name/text()')->to_literal ;
|
498 |
|
|
$card_version = $index_card->findnodes('../version/text()')->to_literal ;
|
499 |
|
|
if(( $card_vendor eq "${vendor}" ) &
|
500 |
|
|
( $card_library eq "${project}" ) &
|
501 |
|
|
( $card_component eq "${component}" ) &
|
502 |
|
|
( $card_version eq "${version}" )
|
503 |
|
|
)
|
504 |
|
|
{
|
505 |
|
|
if($card_type) {return("${card_type}");}
|
506 |
|
|
else {return("xxxx");}
|
507 |
117 |
jt_eaton |
}
|
508 |
120 |
jt_eaton |
}
|
509 |
|
|
}
|
510 |
117 |
jt_eaton |
|
511 |
|
|
|
512 |
|
|
|
513 |
|
|
|
514 |
120 |
jt_eaton |
#/*********************************************************************************************/
|
515 |
|
|
#/ find_lib_ip_dir */
|
516 |
|
|
#/ */
|
517 |
|
|
#/ returns library ip directory */
|
518 |
|
|
#/ */
|
519 |
|
|
#/ my $file_lib_ip_dir = yp::lib::find_file_lib_ip_dir($vendor,$library); */
|
520 |
|
|
#/ */
|
521 |
|
|
#/*********************************************************************************************/
|
522 |
|
|
|
523 |
|
|
sub find_lib_ip_dir
|
524 |
|
|
{
|
525 |
|
|
my @params = @_;
|
526 |
|
|
my $project = pop(@params);
|
527 |
|
|
my $vendor = pop(@params);
|
528 |
|
|
|
529 |
|
|
my $card_type;
|
530 |
|
|
my $card_file_name;
|
531 |
|
|
my $card_dir_name;
|
532 |
|
|
my $card_vendor_path;
|
533 |
|
|
my $card_library_path;
|
534 |
|
|
my $card_component_path;
|
535 |
|
|
my $card_lib_comp_sep;
|
536 |
|
|
my $card_vendor;
|
537 |
|
|
my $card_library;
|
538 |
|
|
my $card_component;
|
539 |
|
|
my $card_version;
|
540 |
|
|
my $card_lib_ip_dir;
|
541 |
|
|
my $card_lib_sw_dir;
|
542 |
|
|
|
543 |
|
|
my $parser = XML::LibXML->new();
|
544 |
|
|
my $yp_index_file = $parser->parse_file("./tools/yp/index.xml");
|
545 |
|
|
|
546 |
|
|
foreach my $index_card ($yp_index_file->findnodes('//socgen:index_file/index_card/type'))
|
547 |
|
|
{
|
548 |
|
|
$card_type = $index_card->findnodes('./text()')->to_literal ;
|
549 |
|
|
$card_file_name = $index_card->findnodes('../file_name/text()')->to_literal ;
|
550 |
|
|
$card_dir_name = $index_card->findnodes('../dir_name/text()')->to_literal ;
|
551 |
|
|
$card_vendor_path = $index_card->findnodes('../vendor_path/text()')->to_literal ;
|
552 |
|
|
$card_component_path= $index_card->findnodes('../component_path/text()')->to_literal ;
|
553 |
|
|
$card_library_path = $index_card->findnodes('../library_path/text()')->to_literal ;
|
554 |
|
|
$card_lib_comp_sep = $index_card->findnodes('../lib_comp_sep/text()')->to_literal ;
|
555 |
|
|
$card_vendor = $index_card->findnodes('../vendor/text()')->to_literal ;
|
556 |
|
|
$card_library = $index_card->findnodes('../library/text()')->to_literal ;
|
557 |
|
|
$card_component = $index_card->findnodes('../name/text()')->to_literal ;
|
558 |
|
|
$card_version = $index_card->findnodes('../version/text()')->to_literal ;
|
559 |
|
|
$card_lib_ip_dir = $index_card->findnodes('../lib_ip_dir/text()')->to_literal ;
|
560 |
|
|
$card_lib_sw_dir = $index_card->findnodes('../lib_sw_dir/text()')->to_literal ;
|
561 |
|
|
if(( $card_vendor eq "${vendor}" ) &
|
562 |
|
|
( $card_library eq "${project}" )
|
563 |
|
|
)
|
564 |
|
|
{
|
565 |
|
|
return("${card_lib_ip_dir}");
|
566 |
|
|
|
567 |
|
|
}
|
568 |
117 |
jt_eaton |
}
|
569 |
|
|
}
|
570 |
|
|
|
571 |
|
|
|
572 |
|
|
|
573 |
120 |
jt_eaton |
#/*********************************************************************************************/
|
574 |
|
|
#/ find_lib_sw_dir */
|
575 |
|
|
#/ */
|
576 |
|
|
#/ returns library sw directory */
|
577 |
|
|
#/ */
|
578 |
|
|
#/ my $file_lib_sw_dir = yp::lib::find_file_lib_sw_dir($vendor,$library); */
|
579 |
|
|
#/ */
|
580 |
|
|
#/*********************************************************************************************/
|
581 |
117 |
jt_eaton |
|
582 |
120 |
jt_eaton |
sub find_lib_sw_dir
|
583 |
|
|
{
|
584 |
|
|
my @params = @_;
|
585 |
|
|
my $project = pop(@params);
|
586 |
|
|
my $vendor = pop(@params);
|
587 |
117 |
jt_eaton |
|
588 |
120 |
jt_eaton |
my $card_type;
|
589 |
|
|
my $card_file_name;
|
590 |
|
|
my $card_dir_name;
|
591 |
|
|
my $card_vendor_path;
|
592 |
|
|
my $card_library_path;
|
593 |
|
|
my $card_component_path;
|
594 |
|
|
my $card_lib_comp_sep;
|
595 |
|
|
my $card_vendor;
|
596 |
|
|
my $card_library;
|
597 |
|
|
my $card_component;
|
598 |
|
|
my $card_version;
|
599 |
|
|
my $card_lib_ip_dir;
|
600 |
|
|
my $card_lib_sw_dir;
|
601 |
|
|
|
602 |
|
|
my $parser = XML::LibXML->new();
|
603 |
|
|
my $yp_index_file = $parser->parse_file("./tools/yp/index.xml");
|
604 |
118 |
jt_eaton |
|
605 |
120 |
jt_eaton |
foreach my $index_card ($yp_index_file->findnodes('//socgen:index_file/index_card/type'))
|
606 |
|
|
{
|
607 |
|
|
$card_type = $index_card->findnodes('./text()')->to_literal ;
|
608 |
|
|
$card_file_name = $index_card->findnodes('../file_name/text()')->to_literal ;
|
609 |
|
|
$card_dir_name = $index_card->findnodes('../dir_name/text()')->to_literal ;
|
610 |
|
|
$card_vendor_path = $index_card->findnodes('../vendor_path/text()')->to_literal ;
|
611 |
|
|
$card_component_path= $index_card->findnodes('../component_path/text()')->to_literal ;
|
612 |
|
|
$card_library_path = $index_card->findnodes('../library_path/text()')->to_literal ;
|
613 |
|
|
$card_lib_comp_sep = $index_card->findnodes('../lib_comp_sep/text()')->to_literal ;
|
614 |
|
|
$card_vendor = $index_card->findnodes('../vendor/text()')->to_literal ;
|
615 |
|
|
$card_library = $index_card->findnodes('../library/text()')->to_literal ;
|
616 |
|
|
$card_component = $index_card->findnodes('../name/text()')->to_literal ;
|
617 |
|
|
$card_version = $index_card->findnodes('../version/text()')->to_literal ;
|
618 |
|
|
$card_lib_ip_dir = $index_card->findnodes('../lib_ip_dir/text()')->to_literal ;
|
619 |
|
|
$card_lib_sw_dir = $index_card->findnodes('../lib_sw_dir/text()')->to_literal ;
|
620 |
|
|
if(( $card_vendor eq "${vendor}" ) &
|
621 |
|
|
( $card_library eq "${project}" ) &
|
622 |
124 |
jt_eaton |
( $card_type eq "socgen:libraryConfiguration" )
|
623 |
120 |
jt_eaton |
)
|
624 |
|
|
{
|
625 |
|
|
if($card_lib_sw_dir){return("/${card_lib_sw_dir}");}
|
626 |
|
|
}
|
627 |
|
|
}
|
628 |
|
|
}
|
629 |
|
|
|
630 |
|
|
|
631 |
|
|
|
632 |
|
|
|
633 |
|
|
|
634 |
|
|
|
635 |
|
|
|
636 |
|
|
|
637 |
|
|
|
638 |
117 |
jt_eaton |
#/*********************************************************************************************/
|
639 |
|
|
#/ find_vendors */
|
640 |
|
|
#/ */
|
641 |
|
|
#/ returns array of all vendors */
|
642 |
|
|
#/ */
|
643 |
118 |
jt_eaton |
#/ my @vendors = yp::lib::find_vendors($type); */
|
644 |
117 |
jt_eaton |
#/ */
|
645 |
|
|
#/*********************************************************************************************/
|
646 |
|
|
|
647 |
|
|
sub find_vendors
|
648 |
|
|
{
|
649 |
|
|
my @params = @_;
|
650 |
|
|
my $type = pop(@params);
|
651 |
|
|
my $card_type;
|
652 |
|
|
my $card_file_name;
|
653 |
|
|
my $card_dir_name;
|
654 |
|
|
my $card_vendor_path;
|
655 |
|
|
my $card_library_path;
|
656 |
|
|
my $card_component_path;
|
657 |
|
|
my $card_lib_comp_sep;
|
658 |
|
|
my $card_vendor;
|
659 |
|
|
my $card_library;
|
660 |
|
|
my $card_component;
|
661 |
|
|
my $card_version;
|
662 |
|
|
|
663 |
|
|
my $parser = XML::LibXML->new();
|
664 |
|
|
my $yp_index_file = $parser->parse_file("./tools/yp/index.xml");
|
665 |
|
|
my @vendors = ();
|
666 |
|
|
|
667 |
|
|
foreach my $index_card ($yp_index_file->findnodes('//socgen:index_file/index_card/type'))
|
668 |
|
|
{
|
669 |
|
|
$card_type = $index_card->findnodes('./text()')->to_literal ;
|
670 |
|
|
$card_file_name = $index_card->findnodes('../file_name/text()')->to_literal ;
|
671 |
|
|
$card_dir_name = $index_card->findnodes('../dir_name/text()')->to_literal ;
|
672 |
|
|
$card_vendor_path = $index_card->findnodes('../vendor_path/text()')->to_literal ;
|
673 |
|
|
$card_component_path= $index_card->findnodes('../component_path/text()')->to_literal ;
|
674 |
|
|
$card_library_path = $index_card->findnodes('../library_path/text()')->to_literal ;
|
675 |
|
|
$card_lib_comp_sep = $index_card->findnodes('../lib_comp_sep/text()')->to_literal ;
|
676 |
|
|
$card_vendor = $index_card->findnodes('../vendor/text()')->to_literal ;
|
677 |
|
|
$card_library = $index_card->findnodes('../library/text()')->to_literal ;
|
678 |
|
|
$card_component = $index_card->findnodes('../name/text()')->to_literal ;
|
679 |
|
|
$card_version = $index_card->findnodes('../version/text()')->to_literal ;
|
680 |
|
|
|
681 |
|
|
if($card_type eq $type){
|
682 |
|
|
push (@vendors,$card_vendor );
|
683 |
|
|
}
|
684 |
|
|
|
685 |
|
|
}
|
686 |
|
|
@vendors = trim_sort(@vendors);
|
687 |
|
|
return (@vendors);
|
688 |
|
|
}
|
689 |
|
|
|
690 |
|
|
|
691 |
|
|
|
692 |
|
|
#/*********************************************************************************************/
|
693 |
|
|
#/ find_libraries */
|
694 |
|
|
#/ */
|
695 |
|
|
#/ returns array of all libraries from a vendor */
|
696 |
|
|
#/ */
|
697 |
118 |
jt_eaton |
#/ my @libraries = yp::lib::find_libraries($type,$vendor); */
|
698 |
117 |
jt_eaton |
#/ */
|
699 |
|
|
#/*********************************************************************************************/
|
700 |
|
|
|
701 |
|
|
sub find_libraries
|
702 |
|
|
{
|
703 |
|
|
my @params = @_;
|
704 |
|
|
my $vendor = pop(@params);
|
705 |
|
|
my $type = pop(@params);
|
706 |
|
|
my $card_type;
|
707 |
|
|
my $card_file_name;
|
708 |
|
|
my $card_dir_name;
|
709 |
|
|
my $card_vendor_path;
|
710 |
|
|
my $card_library_path;
|
711 |
|
|
my $card_component_path;
|
712 |
|
|
my $card_lib_comp_sep;
|
713 |
|
|
my $card_vendor;
|
714 |
|
|
my $card_library;
|
715 |
|
|
my $card_component;
|
716 |
|
|
my $card_version;
|
717 |
|
|
|
718 |
|
|
my $parser = XML::LibXML->new();
|
719 |
|
|
my $yp_index_file = $parser->parse_file("./tools/yp/index.xml");
|
720 |
|
|
my @libraries = ();
|
721 |
|
|
|
722 |
|
|
foreach my $index_card ($yp_index_file->findnodes('//socgen:index_file/index_card/type'))
|
723 |
|
|
{
|
724 |
|
|
$card_type = $index_card->findnodes('./text()')->to_literal ;
|
725 |
|
|
$card_file_name = $index_card->findnodes('../file_name/text()')->to_literal ;
|
726 |
|
|
$card_dir_name = $index_card->findnodes('../dir_name/text()')->to_literal ;
|
727 |
|
|
$card_vendor_path = $index_card->findnodes('../vendor_path/text()')->to_literal ;
|
728 |
|
|
$card_component_path= $index_card->findnodes('../component_path/text()')->to_literal ;
|
729 |
|
|
$card_library_path = $index_card->findnodes('../library_path/text()')->to_literal ;
|
730 |
|
|
$card_lib_comp_sep = $index_card->findnodes('../lib_comp_sep/text()')->to_literal ;
|
731 |
|
|
$card_vendor = $index_card->findnodes('../vendor/text()')->to_literal ;
|
732 |
|
|
$card_library = $index_card->findnodes('../library/text()')->to_literal ;
|
733 |
|
|
$card_component = $index_card->findnodes('../name/text()')->to_literal ;
|
734 |
|
|
$card_version = $index_card->findnodes('../version/text()')->to_literal ;
|
735 |
|
|
if(($card_type eq $type)& ($card_vendor eq $vendor)) {
|
736 |
|
|
push (@libraries,$card_library );}
|
737 |
|
|
}
|
738 |
|
|
@libraries = trim_sort(@libraries);
|
739 |
|
|
return (@libraries);
|
740 |
|
|
}
|
741 |
|
|
|
742 |
|
|
|
743 |
|
|
#/*********************************************************************************************/
|
744 |
|
|
#/ find_components */
|
745 |
|
|
#/ */
|
746 |
|
|
#/ returns array of all components from a vendors library */
|
747 |
|
|
#/ */
|
748 |
118 |
jt_eaton |
#/ my @components = yp::lib::find_components($type,$vendor,$library); */
|
749 |
117 |
jt_eaton |
#/ */
|
750 |
|
|
#/*********************************************************************************************/
|
751 |
|
|
|
752 |
|
|
sub find_components
|
753 |
|
|
{
|
754 |
|
|
my @params = @_;
|
755 |
|
|
my $library = pop(@params);
|
756 |
|
|
my $vendor = pop(@params);
|
757 |
|
|
my $type = pop(@params);
|
758 |
|
|
|
759 |
|
|
my $card_type;
|
760 |
|
|
my $card_file_name;
|
761 |
|
|
my $card_dir_name;
|
762 |
|
|
my $card_vendor_path;
|
763 |
|
|
my $card_library_path;
|
764 |
|
|
my $card_component_path;
|
765 |
|
|
my $card_lib_comp_sep;
|
766 |
|
|
my $card_vendor;
|
767 |
|
|
my $card_library;
|
768 |
|
|
my $card_component;
|
769 |
|
|
my $card_version;
|
770 |
|
|
|
771 |
|
|
my $parser = XML::LibXML->new();
|
772 |
|
|
my $yp_index_file = $parser->parse_file("./tools/yp/index.xml");
|
773 |
|
|
my @components = ();
|
774 |
|
|
|
775 |
|
|
foreach my $index_card ($yp_index_file->findnodes('//socgen:index_file/index_card/type'))
|
776 |
|
|
{
|
777 |
|
|
$card_type = $index_card->findnodes('./text()')->to_literal ;
|
778 |
|
|
$card_file_name = $index_card->findnodes('../file_name/text()')->to_literal ;
|
779 |
|
|
$card_dir_name = $index_card->findnodes('../dir_name/text()')->to_literal ;
|
780 |
|
|
$card_vendor_path = $index_card->findnodes('../vendor_path/text()')->to_literal ;
|
781 |
|
|
$card_component_path= $index_card->findnodes('../component_path/text()')->to_literal ;
|
782 |
|
|
$card_library_path = $index_card->findnodes('../library_path/text()')->to_literal ;
|
783 |
|
|
$card_lib_comp_sep = $index_card->findnodes('../lib_comp_sep/text()')->to_literal ;
|
784 |
|
|
$card_vendor = $index_card->findnodes('../vendor/text()')->to_literal ;
|
785 |
|
|
$card_library = $index_card->findnodes('../library/text()')->to_literal ;
|
786 |
|
|
$card_component = $index_card->findnodes('../name/text()')->to_literal ;
|
787 |
|
|
$card_version = $index_card->findnodes('../version/text()')->to_literal ;
|
788 |
|
|
if(($card_type eq $type) & ($card_vendor eq $vendor) & ($card_library eq $library))
|
789 |
|
|
|
790 |
|
|
{
|
791 |
|
|
push (@components,$card_component);}
|
792 |
|
|
}
|
793 |
|
|
@components = trim_sort(@components);
|
794 |
|
|
return (@components);
|
795 |
|
|
}
|
796 |
|
|
|
797 |
|
|
|
798 |
|
|
|
799 |
|
|
|
800 |
|
|
#/*********************************************************************************************/
|
801 |
|
|
#/ find_versions */
|
802 |
|
|
#/ */
|
803 |
|
|
#/ returns array of all versions from a vendors library component */
|
804 |
|
|
#/ */
|
805 |
118 |
jt_eaton |
#/ my @versions = yp::lib::find_versions($type,$vendor,$library,component); */
|
806 |
117 |
jt_eaton |
#/ */
|
807 |
|
|
#/*********************************************************************************************/
|
808 |
|
|
|
809 |
|
|
sub find_versions
|
810 |
|
|
{
|
811 |
|
|
my @params = @_;
|
812 |
|
|
my $component = pop(@params);
|
813 |
|
|
my $library = pop(@params);
|
814 |
|
|
my $vendor = pop(@params);
|
815 |
|
|
my $type = pop(@params);
|
816 |
|
|
|
817 |
|
|
my $card_type;
|
818 |
|
|
my $card_file_name;
|
819 |
|
|
my $card_dir_name;
|
820 |
|
|
my $card_vendor_path;
|
821 |
|
|
my $card_library_path;
|
822 |
|
|
my $card_component_path;
|
823 |
|
|
my $card_lib_comp_sep;
|
824 |
|
|
my $card_vendor;
|
825 |
|
|
my $card_library;
|
826 |
|
|
my $card_component;
|
827 |
|
|
my $card_version;
|
828 |
|
|
|
829 |
|
|
my $parser = XML::LibXML->new();
|
830 |
|
|
my $yp_index_file = $parser->parse_file("./tools/yp/index.xml");
|
831 |
|
|
my @versions = ();
|
832 |
|
|
|
833 |
|
|
foreach my $index_card ($yp_index_file->findnodes('//socgen:index_file/index_card/type'))
|
834 |
|
|
{
|
835 |
|
|
$card_type = $index_card->findnodes('./text()')->to_literal ;
|
836 |
|
|
$card_file_name = $index_card->findnodes('../file_name/text()')->to_literal ;
|
837 |
|
|
$card_dir_name = $index_card->findnodes('../dir_name/text()')->to_literal ;
|
838 |
|
|
$card_vendor_path = $index_card->findnodes('../vendor_path/text()')->to_literal ;
|
839 |
|
|
$card_component_path= $index_card->findnodes('../component_path/text()')->to_literal ;
|
840 |
|
|
$card_library_path = $index_card->findnodes('../library_path/text()')->to_literal ;
|
841 |
|
|
$card_lib_comp_sep = $index_card->findnodes('../lib_comp_sep/text()')->to_literal ;
|
842 |
|
|
$card_vendor = $index_card->findnodes('../vendor/text()')->to_literal ;
|
843 |
|
|
$card_library = $index_card->findnodes('../library/text()')->to_literal ;
|
844 |
|
|
$card_component = $index_card->findnodes('../name/text()')->to_literal ;
|
845 |
|
|
$card_version = $index_card->findnodes('../version/text()')->to_literal ;
|
846 |
|
|
if(($card_type eq $type) & ($card_vendor eq $vendor) & ($card_library eq $library) & ($card_component eq $component))
|
847 |
|
|
|
848 |
|
|
{
|
849 |
|
|
push (@versions,$card_version);}
|
850 |
|
|
}
|
851 |
|
|
@versions = trim_sort(@versions);
|
852 |
|
|
return (@versions);
|
853 |
|
|
}
|
854 |
|
|
|
855 |
|
|
|
856 |
|
|
|
857 |
|
|
|
858 |
|
|
|
859 |
|
|
|
860 |
|
|
|
861 |
|
|
|
862 |
|
|
#/*********************************************************************************************/
|
863 |
|
|
#/ find_socgen */
|
864 |
|
|
#/ */
|
865 |
|
|
#/ returns full path name to socgen file */
|
866 |
|
|
#/ */
|
867 |
125 |
jt_eaton |
#/ my $socgen_ip_file = yp::lib::find_socgen($type,$vendor,$library,$component); */
|
868 |
117 |
jt_eaton |
#/ */
|
869 |
|
|
#/*********************************************************************************************/
|
870 |
|
|
|
871 |
|
|
sub find_socgen
|
872 |
|
|
{
|
873 |
|
|
my @params = @_;
|
874 |
|
|
my $component = pop(@params);
|
875 |
|
|
my $project = pop(@params);
|
876 |
|
|
my $vendor = pop(@params);
|
877 |
|
|
my $type = pop(@params);
|
878 |
|
|
|
879 |
|
|
|
880 |
|
|
my $card_type;
|
881 |
|
|
my $card_file_name;
|
882 |
|
|
my $card_dir_name;
|
883 |
|
|
my $card_vendor;
|
884 |
|
|
my $card_library;
|
885 |
|
|
my $card_component;
|
886 |
|
|
|
887 |
|
|
my $parser = XML::LibXML->new();
|
888 |
|
|
my $yp_index_file = $parser->parse_file("./tools/yp/index.xml");
|
889 |
|
|
|
890 |
|
|
|
891 |
|
|
foreach my $index_card ($yp_index_file->findnodes('//socgen:index_file/index_card/type'))
|
892 |
|
|
{
|
893 |
|
|
$card_type = $index_card->findnodes('./text()')->to_literal ;
|
894 |
|
|
$card_file_name = $index_card->findnodes('../file_name/text()')->to_literal ;
|
895 |
|
|
$card_dir_name = $index_card->findnodes('../dir_name/text()')->to_literal ;
|
896 |
|
|
$card_vendor = $index_card->findnodes('../vendor/text()')->to_literal ;
|
897 |
|
|
$card_library = $index_card->findnodes('../library/text()')->to_literal ;
|
898 |
|
|
$card_component = $index_card->findnodes('../name/text()')->to_literal ;
|
899 |
|
|
if(( $card_type eq "${type}" ) &
|
900 |
|
|
( $card_vendor eq "${vendor}" ) &
|
901 |
|
|
( $card_library eq "${project}" ) &
|
902 |
|
|
( $card_component eq "${component}" )
|
903 |
|
|
) {return("./${card_dir_name}/${card_file_name}"); }
|
904 |
|
|
}
|
905 |
|
|
}
|
906 |
|
|
|
907 |
|
|
|
908 |
|
|
|
909 |
122 |
jt_eaton |
#/*********************************************************************************************/
|
910 |
|
|
#/ get_module_name */
|
911 |
|
|
#/ */
|
912 |
|
|
#/ returns module name for component */
|
913 |
|
|
#/ */
|
914 |
|
|
#/ my $module_name = yp::lib::get_module_name($vendor,$library,$component,$version); */
|
915 |
|
|
#/ */
|
916 |
|
|
#/*********************************************************************************************/
|
917 |
117 |
jt_eaton |
|
918 |
122 |
jt_eaton |
sub get_module_name
|
919 |
|
|
{
|
920 |
|
|
my @params = @_;
|
921 |
|
|
my $version = pop(@params);
|
922 |
|
|
my $component = pop(@params);
|
923 |
125 |
jt_eaton |
my $library = pop(@params);
|
924 |
122 |
jt_eaton |
my $vendor = pop(@params);
|
925 |
|
|
|
926 |
125 |
jt_eaton |
my $name_depth =2;
|
927 |
122 |
jt_eaton |
|
928 |
125 |
jt_eaton |
|
929 |
|
|
|
930 |
|
|
my $parser = XML::LibXML->new();
|
931 |
|
|
|
932 |
|
|
my $socgen_component_file = $parser->parse_file(yp::lib::find_socgen("socgen:componentConfiguration",$vendor,$library,$component));
|
933 |
|
|
|
934 |
|
|
foreach my $new_comp ($socgen_component_file->findnodes("//socgen:componentConfiguration"))
|
935 |
|
|
{
|
936 |
|
|
|
937 |
|
|
$name_depth = $new_comp->findnodes('./socgen:ip_name_depth/text()')->to_literal ;
|
938 |
|
|
|
939 |
|
|
}
|
940 |
|
|
if($name_depth eq "1"){ return("${component}");}
|
941 |
|
|
if($name_depth eq "2"){ return("${component}_${version}");}
|
942 |
|
|
if($name_depth eq "3"){ return("${library}_${component}_${version}");}
|
943 |
|
|
if($name_depth eq "4"){ return("${vendor}_${library}_${component}_${version}");}
|
944 |
122 |
jt_eaton |
|
945 |
|
|
}
|
946 |
|
|
|
947 |
|
|
|
948 |
|
|
|
949 |
|
|
|
950 |
117 |
jt_eaton |
sub trim_sort {
|
951 |
|
|
my @output_files = @_;
|
952 |
|
|
my %trim = ();
|
953 |
|
|
foreach my $descriptor (@output_files) { $trim{$descriptor} = 1; }
|
954 |
|
|
my @k = keys %trim;
|
955 |
|
|
@output_files = sort(sort @k);
|
956 |
|
|
return(@output_files);
|
957 |
|
|
}
|
958 |
|
|
|
959 |
125 |
jt_eaton |
#/*********************************************************************************************/
|
960 |
|
|
#/ parse_component_file */
|
961 |
|
|
#/ */
|
962 |
|
|
#/ returns design names for component */
|
963 |
|
|
#/ */
|
964 |
|
|
#/ my @filelist = yp::lib::parse_component_file($vendor,$library,$component,$version); */
|
965 |
|
|
#/ */
|
966 |
|
|
#/*********************************************************************************************/
|
967 |
117 |
jt_eaton |
|
968 |
|
|
|
969 |
|
|
|
970 |
125 |
jt_eaton |
sub parse_component_file
|
971 |
|
|
{
|
972 |
|
|
my @params = @_;
|
973 |
|
|
my $version = pop(@params);
|
974 |
|
|
my $component = pop(@params);
|
975 |
|
|
my $library = pop(@params);
|
976 |
|
|
my $vendor = pop(@params);
|
977 |
|
|
|
978 |
|
|
my $parser = XML::LibXML->new();
|
979 |
|
|
|
980 |
|
|
|
981 |
|
|
my $spirit_cmp_filename =yp::lib::find_ipxact("spirit:component",$vendor,$library,$component,$version );
|
982 |
|
|
|
983 |
|
|
unless($spirit_cmp_filename)
|
984 |
|
|
{
|
985 |
|
|
print("spirit:component $vendor,$library,$component,$version \n");
|
986 |
|
|
}
|
987 |
|
|
|
988 |
|
|
my $spirit_component_file = $parser->parse_file(yp::lib::find_ipxact("spirit:component",$vendor,$library,$component,$version ));
|
989 |
|
|
|
990 |
|
|
|
991 |
|
|
my $line;
|
992 |
|
|
|
993 |
|
|
my @filelist_acc = ( );
|
994 |
|
|
push(@filelist_acc,"::${vendor}::${library}::${component}::${version}::");
|
995 |
|
|
|
996 |
|
|
foreach my $new_comp ($spirit_component_file->findnodes("//spirit:component/spirit:model/spirit:views/spirit:view/spirit:vendorExtensions/spirit:componentRef"))
|
997 |
|
|
{
|
998 |
|
|
my($new_vendor) = $new_comp->findnodes('./@spirit:vendor')->to_literal ;
|
999 |
|
|
my($new_library) = $new_comp->findnodes('./@spirit:library')->to_literal ;
|
1000 |
|
|
my($new_name) = $new_comp->findnodes('./@spirit:name')->to_literal ;
|
1001 |
|
|
my($new_version) = $new_comp->findnodes('./@spirit:version')->to_literal ;
|
1002 |
|
|
my $hier_ref_type = yp::lib::find_file_type($new_vendor,$new_library,$new_name,$new_version) ;
|
1003 |
|
|
my @filelist_sub = parse_component_file($new_vendor,$new_library,$new_name,$new_version);
|
1004 |
|
|
foreach $line (@filelist_sub) { push(@filelist_acc,"$line"); }
|
1005 |
|
|
}
|
1006 |
|
|
|
1007 |
|
|
foreach my $new_comp ($spirit_component_file->findnodes("//spirit:component/spirit:model/spirit:views/spirit:view/spirit:hierarchyRef"))
|
1008 |
|
|
{
|
1009 |
|
|
my($new_vendor) = $new_comp->findnodes('./@spirit:vendor')->to_literal ;
|
1010 |
|
|
my($new_library) = $new_comp->findnodes('./@spirit:library')->to_literal ;
|
1011 |
|
|
my($new_name) = $new_comp->findnodes('./@spirit:name')->to_literal ;
|
1012 |
|
|
my($new_version) = $new_comp->findnodes('./@spirit:version')->to_literal ;
|
1013 |
|
|
my $hier_ref_type = yp::lib::find_file_type($new_vendor,$new_library,$new_name,$new_version) ;
|
1014 |
|
|
|
1015 |
|
|
if($hier_ref_type eq "spirit:designConfiguration")
|
1016 |
|
|
{
|
1017 |
|
|
my $spirit_designCfg_file
|
1018 |
|
|
= $parser->parse_file(yp::lib::find_ipxact("spirit:designConfiguration",$new_vendor,$new_library,$new_name,$new_version ));
|
1019 |
|
|
|
1020 |
|
|
foreach my $design_ref_view ($spirit_designCfg_file->findnodes('//spirit:designConfiguration'))
|
1021 |
|
|
{
|
1022 |
|
|
$new_vendor = $design_ref_view->findnodes('./spirit:designRef/@spirit:vendor')->to_literal ;
|
1023 |
|
|
$new_library = $design_ref_view->findnodes('./spirit:designRef/@spirit:library')->to_literal ;
|
1024 |
|
|
$new_name = $design_ref_view->findnodes('./spirit:designRef/@spirit:name')->to_literal ;
|
1025 |
|
|
$new_version = $design_ref_view->findnodes('./spirit:designRef/@spirit:version')->to_literal ;
|
1026 |
|
|
$hier_ref_type ="spirit:design";
|
1027 |
|
|
}
|
1028 |
|
|
}
|
1029 |
|
|
|
1030 |
|
|
if($hier_ref_type eq "spirit:design")
|
1031 |
|
|
{
|
1032 |
|
|
my $spirit_design_file = $parser->parse_file(yp::lib::find_ipxact("spirit:design",$new_vendor,$new_library,$new_name,$new_version ));
|
1033 |
|
|
if($spirit_design_file)
|
1034 |
|
|
{
|
1035 |
|
|
foreach my $i_name ($spirit_design_file->findnodes("//spirit:design/spirit:componentInstances/spirit:componentInstance/spirit:componentRef/\@spirit:vendor"))
|
1036 |
|
|
{
|
1037 |
|
|
my($vendor_name) = $i_name ->to_literal ;
|
1038 |
|
|
my($library_name) = $i_name ->findnodes('../@spirit:library')->to_literal ;
|
1039 |
|
|
my($component_name) = $i_name ->findnodes('../@spirit:name')->to_literal ;
|
1040 |
|
|
my($version_name) = $i_name ->findnodes('../@spirit:version')->to_literal ;
|
1041 |
|
|
|
1042 |
|
|
push(@filelist_acc,"::${vendor_name}::${library_name}::${component_name}::${version_name}::");
|
1043 |
|
|
my @filelist_sub = parse_component_file($vendor_name,$library_name,$component_name,$version_name);
|
1044 |
|
|
foreach $line (@filelist_sub) { push(@filelist_acc,"$line"); }
|
1045 |
|
|
}
|
1046 |
|
|
}
|
1047 |
|
|
}
|
1048 |
|
|
}
|
1049 |
|
|
|
1050 |
|
|
@filelist_acc = sys::lib::trim_sort(@filelist_acc);
|
1051 |
|
|
return(@filelist_acc);
|
1052 |
|
|
}
|
1053 |
|
|
|
1054 |
|
|
|
1055 |
|
|
|
1056 |
|
|
|
1057 |
|
|
|
1058 |
|
|
|
1059 |
|
|
|
1060 |
|
|
#/*****************************************************************************************************/
|
1061 |
|
|
#/ find_ipxact_design_files */
|
1062 |
|
|
#/ */
|
1063 |
|
|
#/ returns parser tokens to ip-xact design files referred to by component file vlnv */
|
1064 |
|
|
#/ */
|
1065 |
|
|
#/ my @spirit_design_files = yp::lib::find_ipxact_design_file($vendor,$library,$component,$version); */
|
1066 |
|
|
#/ */
|
1067 |
|
|
#/*****************************************************************************************************/
|
1068 |
|
|
|
1069 |
|
|
sub find_ipxact_design_files
|
1070 |
|
|
{
|
1071 |
|
|
my @params = @_;
|
1072 |
|
|
my $version = pop(@params);
|
1073 |
|
|
my $component = pop(@params);
|
1074 |
|
|
my $project = pop(@params);
|
1075 |
|
|
my $vendor = pop(@params);
|
1076 |
|
|
|
1077 |
|
|
|
1078 |
|
|
my $card_type;
|
1079 |
|
|
my $card_file_name;
|
1080 |
|
|
my $card_dir_name;
|
1081 |
|
|
my $card_vendor;
|
1082 |
|
|
my $card_library;
|
1083 |
|
|
my $card_component;
|
1084 |
|
|
my $card_version;
|
1085 |
|
|
|
1086 |
|
|
my @design_files = ();
|
1087 |
|
|
|
1088 |
|
|
my $parser = XML::LibXML->new();
|
1089 |
|
|
my $yp_index_file = $parser->parse_file("./tools/yp/hier_index.xml");
|
1090 |
|
|
|
1091 |
|
|
unless (yp::lib::find_ipxact("spirit:component",$vendor,$project,$component,$version)){print "Missing Component $vendor, $project, $component, $version \n"; }
|
1092 |
|
|
|
1093 |
|
|
my $spirit_component_file = $parser->parse_file(yp::lib::find_ipxact("spirit:component",$vendor,$project,$component,$version));
|
1094 |
|
|
|
1095 |
|
|
|
1096 |
|
|
foreach my $new_comp ($spirit_component_file->findnodes("//spirit:component/spirit:model/spirit:views/spirit:view/spirit:vendorExtensions/spirit:componentRef"))
|
1097 |
|
|
{
|
1098 |
|
|
my($new_vendor) = $new_comp->findnodes('./@spirit:vendor')->to_literal ;
|
1099 |
|
|
my($new_library) = $new_comp->findnodes('./@spirit:library')->to_literal ;
|
1100 |
|
|
my($new_name) = $new_comp->findnodes('./@spirit:name')->to_literal ;
|
1101 |
|
|
my($new_version) = $new_comp->findnodes('./@spirit:version')->to_literal ;
|
1102 |
|
|
my @filelist_sub = yp::lib::find_ipxact_design_files($new_vendor,$new_library,$new_name,$new_version);
|
1103 |
|
|
foreach my $line (@filelist_sub) { push(@design_files,"$line"); }
|
1104 |
|
|
}
|
1105 |
|
|
|
1106 |
|
|
|
1107 |
|
|
|
1108 |
|
|
|
1109 |
|
|
foreach my $comp_view ($spirit_component_file->findnodes('//spirit:component/spirit:model/spirit:views/spirit:view'))
|
1110 |
|
|
{
|
1111 |
|
|
my($hier_ref_vendor) = $comp_view->findnodes('./spirit:hierarchyRef/@spirit:vendor')->to_literal ;
|
1112 |
|
|
my($hier_ref_library) = $comp_view->findnodes('./spirit:hierarchyRef/@spirit:library')->to_literal ;
|
1113 |
|
|
my($hier_ref_component) = $comp_view->findnodes('./spirit:hierarchyRef/@spirit:name')->to_literal ;
|
1114 |
|
|
my($hier_ref_version) = $comp_view->findnodes('./spirit:hierarchyRef/@spirit:version')->to_literal ;
|
1115 |
|
|
|
1116 |
|
|
|
1117 |
|
|
|
1118 |
|
|
if(yp::lib::find_ipxact("spirit:designConfiguration",$hier_ref_vendor,$hier_ref_library,$hier_ref_component,$hier_ref_version ))
|
1119 |
|
|
{
|
1120 |
|
|
|
1121 |
|
|
my $spirit_designCfg_file
|
1122 |
|
|
= $parser->parse_file(yp::lib::find_ipxact("spirit:designConfiguration",$hier_ref_vendor,$hier_ref_library,$hier_ref_component,$hier_ref_version ));
|
1123 |
|
|
|
1124 |
|
|
foreach my $design_ref_view ($spirit_designCfg_file->findnodes('//spirit:designConfiguration'))
|
1125 |
|
|
{
|
1126 |
|
|
($hier_ref_vendor) = $design_ref_view->findnodes('./spirit:designRef/@spirit:vendor')->to_literal ;
|
1127 |
|
|
($hier_ref_library) = $design_ref_view->findnodes('./spirit:designRef/@spirit:library')->to_literal ;
|
1128 |
|
|
($hier_ref_component) = $design_ref_view->findnodes('./spirit:designRef/@spirit:name')->to_literal ;
|
1129 |
|
|
($hier_ref_version) = $design_ref_view->findnodes('./spirit:designRef/@spirit:version')->to_literal ;
|
1130 |
|
|
}
|
1131 |
|
|
}
|
1132 |
|
|
|
1133 |
|
|
|
1134 |
|
|
|
1135 |
|
|
|
1136 |
|
|
foreach my $index_card ($yp_index_file->findnodes("//socgen:file_types/socgen:file_type[socgen:name/text() = 'spirit:design']/socgen:vendors/socgen:vendor[socgen:name/text() = '$hier_ref_vendor']/socgen:libraries/socgen:library[socgen:name/text() = '$hier_ref_library']/socgen:components/socgen:component[socgen:name/text() = '$hier_ref_component']/socgen:versions/socgen:version[socgen:name/text() = '$hier_ref_version']"))
|
1137 |
|
|
{
|
1138 |
|
|
push(@design_files,":::${hier_ref_vendor}:::${hier_ref_library}:::${hier_ref_component}:::${hier_ref_version}:::");
|
1139 |
|
|
};
|
1140 |
|
|
|
1141 |
|
|
|
1142 |
|
|
}
|
1143 |
|
|
return(@design_files);
|
1144 |
|
|
}
|
1145 |
|
|
|
1146 |
|
|
|
1147 |
|
|
|
1148 |
|
|
|
1149 |
|
|
|
1150 |
|
|
|
1151 |
|
|
|
1152 |
117 |
jt_eaton |
1;
|