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 |
130 |
jt_eaton |
############################################################################
|
54 |
|
|
### Set up Databases
|
55 |
|
|
############################################################################
|
56 |
|
|
|
57 |
|
|
use BerkeleyDB;
|
58 |
|
|
|
59 |
|
|
|
60 |
|
|
my $repo_db = new BerkeleyDB::Hash( -Filename => 'tools/yp/Berkeley/repo.dbm', -Flags => DB_CREATE ) or die "Cannot open file: $!";
|
61 |
|
|
my $component_db = new BerkeleyDB::Hash( -Filename => 'tools/yp/Berkeley/component.dbm', -Flags => DB_CREATE ) or die "Cannot open file: $!";
|
62 |
|
|
my $design_db = new BerkeleyDB::Hash( -Filename => 'tools/yp/Berkeley/design.dbm', -Flags => DB_CREATE ) or die "Cannot open file: $!";
|
63 |
|
|
my $abstractionDefinition_db = new BerkeleyDB::Hash( -Filename => 'tools/yp/Berkeley/abstractionDefinition.dbm', -Flags => DB_CREATE ) or die "Cannot open file: $!";
|
64 |
|
|
my $busDefinition_db = new BerkeleyDB::Hash( -Filename => 'tools/yp/Berkeley/busDefinition.dbm', -Flags => DB_CREATE ) or die "Cannot open file: $!";
|
65 |
|
|
my $libraryConfiguration_db = new BerkeleyDB::Hash( -Filename => 'tools/yp/Berkeley/libraryConfiguration.dbm', -Flags => DB_CREATE ) or die "Cannot open file: $!";
|
66 |
|
|
my $componentConfiguration_db = new BerkeleyDB::Hash( -Filename => 'tools/yp/Berkeley/componentConfiguration.dbm', -Flags => DB_CREATE ) or die "Cannot open file: $!";
|
67 |
|
|
|
68 |
|
|
|
69 |
|
|
|
70 |
|
|
|
71 |
118 |
jt_eaton |
#/***********************************************************************************************/
|
72 |
130 |
jt_eaton |
#/ find_ipxact_component */
|
73 |
118 |
jt_eaton |
#/ */
|
74 |
130 |
jt_eaton |
#/ returns full path name to ip-xact component file */
|
75 |
118 |
jt_eaton |
#/ */
|
76 |
130 |
jt_eaton |
#/ my $spirit_type_file = yp::lib::find_ipxact_component($vendor,$library,$component,$version);*/
|
77 |
118 |
jt_eaton |
#/ */
|
78 |
|
|
#/***********************************************************************************************/
|
79 |
117 |
jt_eaton |
|
80 |
130 |
jt_eaton |
sub find_ipxact_component
|
81 |
117 |
jt_eaton |
{
|
82 |
|
|
my @params = @_;
|
83 |
|
|
my $version = pop(@params);
|
84 |
|
|
my $component = pop(@params);
|
85 |
130 |
jt_eaton |
my $library = pop(@params);
|
86 |
117 |
jt_eaton |
my $vendor = pop(@params);
|
87 |
130 |
jt_eaton |
my $comp_data;
|
88 |
|
|
my $component_version;
|
89 |
|
|
my $component_xml;
|
90 |
|
|
my $comp_xml_sep;
|
91 |
|
|
$component_db->db_get("${vendor}__${library}_${component}_${version}", $comp_data );
|
92 |
|
|
( $component_xml, $comp_xml_sep,$component_version ) = split ':', $comp_data;
|
93 |
|
|
# print "XXXXXX ${vendor}__${library}_${component}_${version} $comp_data \n";
|
94 |
117 |
jt_eaton |
|
95 |
|
|
|
96 |
130 |
jt_eaton |
return("$component_xml");
|
97 |
118 |
jt_eaton |
}
|
98 |
|
|
|
99 |
|
|
|
100 |
|
|
|
101 |
130 |
jt_eaton |
#/***********************************************************************************************/
|
102 |
|
|
#/ find_ipxact_design */
|
103 |
|
|
#/ */
|
104 |
|
|
#/ returns full path name to ip-xact design file */
|
105 |
|
|
#/ */
|
106 |
|
|
#/ my $spirit_type_file = yp::lib::find_ipxact_design($vendor,$library,$component,$version); */
|
107 |
|
|
#/ */
|
108 |
|
|
#/***********************************************************************************************/
|
109 |
118 |
jt_eaton |
|
110 |
130 |
jt_eaton |
sub find_ipxact_design
|
111 |
117 |
jt_eaton |
{
|
112 |
|
|
my @params = @_;
|
113 |
|
|
my $version = pop(@params);
|
114 |
|
|
my $component = pop(@params);
|
115 |
130 |
jt_eaton |
my $library = pop(@params);
|
116 |
117 |
jt_eaton |
my $vendor = pop(@params);
|
117 |
130 |
jt_eaton |
my $data;
|
118 |
|
|
my $design_xml_sep ;
|
119 |
|
|
my $design_xml_file ;
|
120 |
|
|
my $design_version;
|
121 |
117 |
jt_eaton |
|
122 |
130 |
jt_eaton |
$design_db->db_get("${vendor}__${library}_${component}_${version}", $data );
|
123 |
|
|
( $design_xml_file, $design_xml_sep,$design_version ) = split ':', $data;
|
124 |
117 |
jt_eaton |
|
125 |
130 |
jt_eaton |
return("$design_xml_file");
|
126 |
117 |
jt_eaton |
}
|
127 |
|
|
|
128 |
|
|
|
129 |
130 |
jt_eaton |
#/**************************************************************************************************************/
|
130 |
|
|
#/ find_ipxact_abstractionDefinition */
|
131 |
|
|
#/ */
|
132 |
|
|
#/ returns full path name to ip-xact abstractionDefinition file */
|
133 |
|
|
#/ */
|
134 |
|
|
#/ my $spirit_type_file = yp::lib::find_ipxact_abstractionDefinition($vendor,$library,$component,$version); */
|
135 |
|
|
#/ */
|
136 |
|
|
#/**************************************************************************************************************/
|
137 |
117 |
jt_eaton |
|
138 |
130 |
jt_eaton |
sub find_ipxact_abstractionDefinition
|
139 |
117 |
jt_eaton |
{
|
140 |
|
|
my @params = @_;
|
141 |
|
|
my $version = pop(@params);
|
142 |
|
|
my $component = pop(@params);
|
143 |
130 |
jt_eaton |
my $library = pop(@params);
|
144 |
117 |
jt_eaton |
my $vendor = pop(@params);
|
145 |
|
|
|
146 |
130 |
jt_eaton |
my $data;
|
147 |
|
|
my $design_xml_sep ;
|
148 |
|
|
my $design_xml_file ;
|
149 |
|
|
my $design_version;
|
150 |
117 |
jt_eaton |
|
151 |
130 |
jt_eaton |
$abstractionDefinition_db->db_get("${vendor}__${library}_${component}_${version}", $data );
|
152 |
|
|
( $design_xml_file, $design_xml_sep,$design_version ) = split ':', $data;
|
153 |
117 |
jt_eaton |
|
154 |
130 |
jt_eaton |
return("$design_xml_file");
|
155 |
117 |
jt_eaton |
|
156 |
|
|
}
|
157 |
|
|
|
158 |
|
|
|
159 |
|
|
|
160 |
130 |
jt_eaton |
#/**************************************************************************************************************/
|
161 |
|
|
#/ find_ipxact_busDefinition */
|
162 |
|
|
#/ */
|
163 |
|
|
#/ returns full path name to ip-xact busDefinition file */
|
164 |
|
|
#/ */
|
165 |
|
|
#/ my $spirit_type_file = yp::lib::find_ipxact_busDefinition($vendor,$library,$component,$version); */
|
166 |
|
|
#/ */
|
167 |
|
|
#/**************************************************************************************************************/
|
168 |
117 |
jt_eaton |
|
169 |
130 |
jt_eaton |
sub find_ipxact_busDefinition
|
170 |
117 |
jt_eaton |
{
|
171 |
|
|
my @params = @_;
|
172 |
|
|
my $version = pop(@params);
|
173 |
|
|
my $component = pop(@params);
|
174 |
130 |
jt_eaton |
my $library = pop(@params);
|
175 |
117 |
jt_eaton |
my $vendor = pop(@params);
|
176 |
|
|
|
177 |
130 |
jt_eaton |
my $data;
|
178 |
|
|
my $design_xml_sep ;
|
179 |
|
|
my $design_xml_file ;
|
180 |
|
|
my $design_version;
|
181 |
117 |
jt_eaton |
|
182 |
|
|
|
183 |
130 |
jt_eaton |
$busDefinition_db->db_get("${vendor}__${library}_${component}_${version}", $data );
|
184 |
|
|
( $design_xml_file, $design_xml_sep,$design_version ) = split ':', $data;
|
185 |
117 |
jt_eaton |
|
186 |
130 |
jt_eaton |
return("$design_xml_file");
|
187 |
117 |
jt_eaton |
}
|
188 |
|
|
|
189 |
|
|
|
190 |
|
|
|
191 |
130 |
jt_eaton |
#/**************************************************************************************************************/
|
192 |
|
|
#/ find_libraryConfiguration */
|
193 |
|
|
#/ */
|
194 |
|
|
#/ returns full path name to socgen libraryConfiguration xml file */
|
195 |
|
|
#/ */
|
196 |
|
|
#/ my $socgen_file = yp::lib::find_libraryConfiguration($vendor,$library); */
|
197 |
|
|
#/ */
|
198 |
|
|
#/**************************************************************************************************************/
|
199 |
117 |
jt_eaton |
|
200 |
130 |
jt_eaton |
sub find_libraryConfiguration
|
201 |
117 |
jt_eaton |
{
|
202 |
|
|
my @params = @_;
|
203 |
130 |
jt_eaton |
my $library = pop(@params);
|
204 |
117 |
jt_eaton |
my $vendor = pop(@params);
|
205 |
|
|
|
206 |
130 |
jt_eaton |
my $libraryConfiguration_xml;
|
207 |
|
|
$libraryConfiguration_db->db_get("${vendor}__${library}", $libraryConfiguration_xml );
|
208 |
|
|
return("$libraryConfiguration_xml");
|
209 |
117 |
jt_eaton |
}
|
210 |
|
|
|
211 |
|
|
|
212 |
130 |
jt_eaton |
#/**************************************************************************************************************/
|
213 |
|
|
#/ find_componentConfiguration */
|
214 |
|
|
#/ */
|
215 |
|
|
#/ returns full path name to socgen componentConfiguration xml file */
|
216 |
|
|
#/ */
|
217 |
|
|
#/ my $socgen_file = yp::lib::find_componentConfiguration($vendor,$library,$component); */
|
218 |
|
|
#/ */
|
219 |
|
|
#/**************************************************************************************************************/
|
220 |
117 |
jt_eaton |
|
221 |
130 |
jt_eaton |
sub find_componentConfiguration
|
222 |
117 |
jt_eaton |
{
|
223 |
|
|
my @params = @_;
|
224 |
|
|
my $component = pop(@params);
|
225 |
130 |
jt_eaton |
my $library = pop(@params);
|
226 |
117 |
jt_eaton |
my $vendor = pop(@params);
|
227 |
|
|
|
228 |
130 |
jt_eaton |
my $componentConfiguration_xml;
|
229 |
|
|
$componentConfiguration_db->db_get("${vendor}__${library}_${component}", $componentConfiguration_xml );
|
230 |
|
|
return("$componentConfiguration_xml");
|
231 |
117 |
jt_eaton |
}
|
232 |
|
|
|
233 |
|
|
|
234 |
|
|
|
235 |
|
|
|
236 |
130 |
jt_eaton |
#/**************************************************************************************************************/
|
237 |
|
|
#/ find_lib_comp_sep */
|
238 |
|
|
#/ */
|
239 |
|
|
#/ returns libraries path to components */
|
240 |
|
|
#/ */
|
241 |
|
|
#/ my $lib_comp_sep = yp::lib::find_lib_comp_sep($vendor,$library,$component); */
|
242 |
|
|
#/ */
|
243 |
|
|
#/**************************************************************************************************************/
|
244 |
120 |
jt_eaton |
|
245 |
117 |
jt_eaton |
sub find_lib_comp_sep
|
246 |
|
|
{
|
247 |
|
|
my @params = @_;
|
248 |
127 |
jt_eaton |
my $component = pop(@params);
|
249 |
130 |
jt_eaton |
my $library = pop(@params);
|
250 |
117 |
jt_eaton |
my $vendor = pop(@params);
|
251 |
|
|
|
252 |
130 |
jt_eaton |
my $type;
|
253 |
|
|
my $name;
|
254 |
|
|
my $lib_comp_sep;
|
255 |
|
|
my $repo_data;
|
256 |
117 |
jt_eaton |
|
257 |
130 |
jt_eaton |
$repo_db->db_get("${vendor}__${library}_${component}", $repo_data );
|
258 |
|
|
( $type,$name, $lib_comp_sep ) = split ':', $repo_data;
|
259 |
|
|
return("${lib_comp_sep}");
|
260 |
120 |
jt_eaton |
}
|
261 |
117 |
jt_eaton |
|
262 |
120 |
jt_eaton |
|
263 |
|
|
|
264 |
130 |
jt_eaton |
#/***********************************************************************************************/
|
265 |
|
|
#/ find_ipxact_comp_xml_sep */
|
266 |
|
|
#/ */
|
267 |
|
|
#/ */
|
268 |
|
|
#/ */
|
269 |
|
|
#/ my $comp_xml_sep = yp::lib::find_ipxact_component($vendor,$library,$component,$version); */
|
270 |
|
|
#/ */
|
271 |
|
|
#/***********************************************************************************************/
|
272 |
120 |
jt_eaton |
|
273 |
130 |
jt_eaton |
sub find_comp_xml_sep
|
274 |
120 |
jt_eaton |
{
|
275 |
|
|
my @params = @_;
|
276 |
|
|
my $version = pop(@params);
|
277 |
|
|
my $component = pop(@params);
|
278 |
130 |
jt_eaton |
my $library = pop(@params);
|
279 |
120 |
jt_eaton |
my $vendor = pop(@params);
|
280 |
130 |
jt_eaton |
my $comp_data;
|
281 |
|
|
my $comp_version;
|
282 |
|
|
my $comp_xml_sep;
|
283 |
|
|
my $component_xml;
|
284 |
|
|
$component_db->db_get("${vendor}__${library}_${component}_${version}", $comp_data );
|
285 |
|
|
( $component_xml, $comp_xml_sep, $comp_version) = split ':', $comp_data;
|
286 |
|
|
return("$comp_xml_sep");
|
287 |
120 |
jt_eaton |
}
|
288 |
117 |
jt_eaton |
|
289 |
|
|
|
290 |
|
|
|
291 |
|
|
|
292 |
120 |
jt_eaton |
|
293 |
|
|
|
294 |
|
|
#/*********************************************************************************************/
|
295 |
|
|
#/ find_lib_sw_dir */
|
296 |
|
|
#/ */
|
297 |
|
|
#/ returns library sw directory */
|
298 |
|
|
#/ */
|
299 |
|
|
#/ my $file_lib_sw_dir = yp::lib::find_file_lib_sw_dir($vendor,$library); */
|
300 |
|
|
#/ */
|
301 |
|
|
#/*********************************************************************************************/
|
302 |
117 |
jt_eaton |
|
303 |
120 |
jt_eaton |
sub find_lib_sw_dir
|
304 |
|
|
{
|
305 |
|
|
my @params = @_;
|
306 |
130 |
jt_eaton |
my $library = pop(@params);
|
307 |
120 |
jt_eaton |
my $vendor = pop(@params);
|
308 |
130 |
jt_eaton |
my $parser = XML::LibXML->new();
|
309 |
117 |
jt_eaton |
|
310 |
130 |
jt_eaton |
my $lib_sw_dir ;
|
311 |
|
|
if(yp::lib::find_libraryConfiguration($vendor,$library))
|
312 |
|
|
{
|
313 |
|
|
my $socgen_libraryConfiguration= $parser->parse_file(yp::lib::find_libraryConfiguration($vendor,$library));
|
314 |
|
|
$lib_sw_dir = $socgen_libraryConfiguration->findnodes('//socgen:libraryConfiguration/socgen:lib_sw_dir/text()')->to_literal ;
|
315 |
120 |
jt_eaton |
}
|
316 |
|
|
|
317 |
130 |
jt_eaton |
return("/${lib_sw_dir}");
|
318 |
120 |
jt_eaton |
|
319 |
130 |
jt_eaton |
}
|
320 |
120 |
jt_eaton |
|
321 |
|
|
|
322 |
|
|
|
323 |
|
|
|
324 |
117 |
jt_eaton |
#/*********************************************************************************************/
|
325 |
|
|
#/ find_vendors */
|
326 |
|
|
#/ */
|
327 |
|
|
#/ returns array of all vendors */
|
328 |
|
|
#/ */
|
329 |
130 |
jt_eaton |
#/ my @vendors = yp::lib::find_vendors(); */
|
330 |
117 |
jt_eaton |
#/ */
|
331 |
|
|
#/*********************************************************************************************/
|
332 |
|
|
|
333 |
|
|
sub find_vendors
|
334 |
|
|
{
|
335 |
130 |
jt_eaton |
my $key;
|
336 |
|
|
my $value;
|
337 |
|
|
my $type;
|
338 |
|
|
my $name;
|
339 |
|
|
my $path;
|
340 |
117 |
jt_eaton |
my @vendors = ();
|
341 |
|
|
|
342 |
130 |
jt_eaton |
my $cursor = $repo_db->db_cursor() ;
|
343 |
|
|
while ($cursor->c_get($key, $value, DB_NEXT) == 0)
|
344 |
|
|
{
|
345 |
|
|
( $type,$name, $path ) = split ':', $value;
|
346 |
|
|
if($type eq "vendor")
|
347 |
117 |
jt_eaton |
{
|
348 |
130 |
jt_eaton |
push (@vendors,$name );
|
349 |
|
|
}
|
350 |
117 |
jt_eaton |
}
|
351 |
130 |
jt_eaton |
@vendors = trim_sort(@vendors);
|
352 |
|
|
return (@vendors);
|
353 |
|
|
}
|
354 |
117 |
jt_eaton |
|
355 |
|
|
|
356 |
|
|
|
357 |
|
|
#/*********************************************************************************************/
|
358 |
|
|
#/ find_libraries */
|
359 |
|
|
#/ */
|
360 |
|
|
#/ returns array of all libraries from a vendor */
|
361 |
|
|
#/ */
|
362 |
130 |
jt_eaton |
#/ my @libraries = yp::lib::find_libraries($vendor); */
|
363 |
117 |
jt_eaton |
#/ */
|
364 |
|
|
#/*********************************************************************************************/
|
365 |
|
|
|
366 |
|
|
sub find_libraries
|
367 |
|
|
{
|
368 |
|
|
my @params = @_;
|
369 |
|
|
my $vendor = pop(@params);
|
370 |
130 |
jt_eaton |
my $type;
|
371 |
|
|
my $key;
|
372 |
|
|
my $value;
|
373 |
|
|
my $name;
|
374 |
|
|
my $path;
|
375 |
117 |
jt_eaton |
my @libraries = ();
|
376 |
|
|
|
377 |
130 |
jt_eaton |
my $cursor = $repo_db->db_cursor() ;
|
378 |
|
|
while ($cursor->c_get($key, $value, DB_NEXT) == 0)
|
379 |
|
|
{
|
380 |
|
|
( $type,$name, $path ) = split ':', $value;
|
381 |
|
|
|
382 |
|
|
|
383 |
|
|
if(($type eq "library")&& ($key eq "${vendor}__${name}") )
|
384 |
117 |
jt_eaton |
{
|
385 |
130 |
jt_eaton |
push (@libraries,$name );
|
386 |
|
|
}
|
387 |
|
|
}
|
388 |
117 |
jt_eaton |
@libraries = trim_sort(@libraries);
|
389 |
|
|
return (@libraries);
|
390 |
|
|
}
|
391 |
|
|
|
392 |
|
|
|
393 |
|
|
#/*********************************************************************************************/
|
394 |
|
|
#/ find_components */
|
395 |
|
|
#/ */
|
396 |
|
|
#/ returns array of all components from a vendors library */
|
397 |
|
|
#/ */
|
398 |
130 |
jt_eaton |
#/ my @components = yp::lib::find_components($vendor,$library); */
|
399 |
117 |
jt_eaton |
#/ */
|
400 |
|
|
#/*********************************************************************************************/
|
401 |
|
|
|
402 |
|
|
sub find_components
|
403 |
|
|
{
|
404 |
|
|
my @params = @_;
|
405 |
|
|
my $library = pop(@params);
|
406 |
130 |
jt_eaton |
my $vendor = pop(@params);
|
407 |
|
|
my $type;
|
408 |
|
|
my $key;
|
409 |
|
|
my $value;
|
410 |
|
|
my $name;
|
411 |
|
|
my $path;
|
412 |
117 |
jt_eaton |
my @components = ();
|
413 |
130 |
jt_eaton |
my $cursor = $repo_db->db_cursor() ;
|
414 |
|
|
while ($cursor->c_get($key, $value, DB_NEXT) == 0)
|
415 |
|
|
{
|
416 |
|
|
( $type,$name, $path ) = split ':', $value;
|
417 |
|
|
if(($type eq "component")&& ($key eq "${vendor}__${library}_${name}"))
|
418 |
|
|
{ push (@components,$name );}
|
419 |
|
|
}
|
420 |
117 |
jt_eaton |
@components = trim_sort(@components);
|
421 |
|
|
return (@components);
|
422 |
|
|
}
|
423 |
|
|
|
424 |
|
|
|
425 |
|
|
|
426 |
|
|
|
427 |
|
|
#/*********************************************************************************************/
|
428 |
130 |
jt_eaton |
#/ find_component_versions */
|
429 |
117 |
jt_eaton |
#/ */
|
430 |
130 |
jt_eaton |
#/ returns array of all versions os a component */
|
431 |
117 |
jt_eaton |
#/ */
|
432 |
130 |
jt_eaton |
#/ my @components = yp::lib::find_component_versions($vendor,$library,$component); */
|
433 |
117 |
jt_eaton |
#/ */
|
434 |
|
|
#/*********************************************************************************************/
|
435 |
|
|
|
436 |
130 |
jt_eaton |
sub find_component_versions
|
437 |
117 |
jt_eaton |
{
|
438 |
|
|
my @params = @_;
|
439 |
130 |
jt_eaton |
my $component = pop(@params);
|
440 |
117 |
jt_eaton |
my $library = pop(@params);
|
441 |
130 |
jt_eaton |
my $vendor = pop(@params);
|
442 |
117 |
jt_eaton |
|
443 |
130 |
jt_eaton |
my $xml_file;
|
444 |
|
|
my $key;
|
445 |
|
|
my $value;
|
446 |
|
|
my $comp_xml_sep;
|
447 |
|
|
my $version;
|
448 |
|
|
|
449 |
117 |
jt_eaton |
my @versions = ();
|
450 |
130 |
jt_eaton |
my $cursor = $component_db->db_cursor() ;
|
451 |
|
|
while ($cursor->c_get($key, $value, DB_NEXT) == 0)
|
452 |
|
|
{
|
453 |
|
|
( $xml_file,$comp_xml_sep, $version ) = split ':', $value;
|
454 |
|
|
if(($key eq "${vendor}__${library}_${component}_${version}"))
|
455 |
|
|
{
|
456 |
|
|
push (@versions,$version );
|
457 |
|
|
}
|
458 |
|
|
}
|
459 |
|
|
@versions = trim_sort(@versions);
|
460 |
|
|
return (@versions);
|
461 |
|
|
}
|
462 |
117 |
jt_eaton |
|
463 |
|
|
|
464 |
130 |
jt_eaton |
|
465 |
|
|
|
466 |
|
|
|
467 |
|
|
#/************************************************************************************************************************/
|
468 |
|
|
#/ find_abstractionDefinition_versions */
|
469 |
|
|
#/ */
|
470 |
|
|
#/ returns array of all versions os a abstractionDefinition */
|
471 |
|
|
#/ */
|
472 |
|
|
#/ my @abstractionDefinitions = yp::lib::find_abstractionDefinition_versions($vendor,$library,$abstractionDefinition); */
|
473 |
|
|
#/ */
|
474 |
|
|
#/************************************************************************************************************************/
|
475 |
|
|
|
476 |
|
|
sub find_abstractionDefinition_versions
|
477 |
|
|
{
|
478 |
|
|
my @params = @_;
|
479 |
|
|
my $abstractionDefinition = pop(@params);
|
480 |
|
|
my $library = pop(@params);
|
481 |
|
|
my $vendor = pop(@params);
|
482 |
|
|
|
483 |
|
|
my $xml_file;
|
484 |
|
|
my $key;
|
485 |
|
|
my $value;
|
486 |
|
|
my $comp_xml_sep;
|
487 |
|
|
my $version;
|
488 |
|
|
|
489 |
|
|
my @versions = ();
|
490 |
|
|
my $cursor = $abstractionDefinition_db->db_cursor() ;
|
491 |
|
|
while ($cursor->c_get($key, $value, DB_NEXT) == 0)
|
492 |
|
|
{
|
493 |
|
|
( $xml_file,$comp_xml_sep, $version ) = split ':', $value;
|
494 |
|
|
if(($key eq "${vendor}__${library}_${abstractionDefinition}_${version}"))
|
495 |
|
|
{
|
496 |
|
|
push (@versions,$version );
|
497 |
|
|
}
|
498 |
|
|
}
|
499 |
117 |
jt_eaton |
@versions = trim_sort(@versions);
|
500 |
|
|
return (@versions);
|
501 |
|
|
}
|
502 |
|
|
|
503 |
|
|
|
504 |
|
|
|
505 |
|
|
|
506 |
|
|
|
507 |
|
|
|
508 |
130 |
jt_eaton |
#/************************************************************************************************************************/
|
509 |
|
|
#/ find_busDefinition_versions */
|
510 |
|
|
#/ */
|
511 |
|
|
#/ returns array of all versions os a busDefinition */
|
512 |
|
|
#/ */
|
513 |
|
|
#/ my @busDefinitions = yp::lib::find_busDefinition_versions($vendor,$library,$busDefinition); */
|
514 |
|
|
#/ */
|
515 |
|
|
#/************************************************************************************************************************/
|
516 |
117 |
jt_eaton |
|
517 |
130 |
jt_eaton |
sub find_busDefinition_versions
|
518 |
117 |
jt_eaton |
{
|
519 |
|
|
my @params = @_;
|
520 |
130 |
jt_eaton |
my $busDefinition = pop(@params);
|
521 |
|
|
my $library = pop(@params);
|
522 |
117 |
jt_eaton |
my $vendor = pop(@params);
|
523 |
|
|
|
524 |
130 |
jt_eaton |
my $xml_file;
|
525 |
|
|
my $key;
|
526 |
|
|
my $value;
|
527 |
|
|
my $comp_xml_sep;
|
528 |
|
|
my $version;
|
529 |
117 |
jt_eaton |
|
530 |
130 |
jt_eaton |
my @versions = ();
|
531 |
|
|
my $cursor = $busDefinition_db->db_cursor() ;
|
532 |
|
|
while ($cursor->c_get($key, $value, DB_NEXT) == 0)
|
533 |
|
|
{
|
534 |
|
|
( $xml_file,$comp_xml_sep, $version ) = split ':', $value;
|
535 |
|
|
if(($key eq "${vendor}__${library}_${busDefinition}_${version}"))
|
536 |
|
|
{
|
537 |
|
|
push (@versions,$version );
|
538 |
|
|
}
|
539 |
|
|
}
|
540 |
|
|
@versions = trim_sort(@versions);
|
541 |
|
|
return (@versions);
|
542 |
117 |
jt_eaton |
}
|
543 |
|
|
|
544 |
122 |
jt_eaton |
#/*********************************************************************************************/
|
545 |
|
|
#/ get_module_name */
|
546 |
|
|
#/ */
|
547 |
|
|
#/ returns module name for component */
|
548 |
|
|
#/ */
|
549 |
|
|
#/ my $module_name = yp::lib::get_module_name($vendor,$library,$component,$version); */
|
550 |
|
|
#/ */
|
551 |
|
|
#/*********************************************************************************************/
|
552 |
117 |
jt_eaton |
|
553 |
122 |
jt_eaton |
sub get_module_name
|
554 |
|
|
{
|
555 |
|
|
my @params = @_;
|
556 |
|
|
my $version = pop(@params);
|
557 |
|
|
my $component = pop(@params);
|
558 |
125 |
jt_eaton |
my $library = pop(@params);
|
559 |
122 |
jt_eaton |
my $vendor = pop(@params);
|
560 |
|
|
|
561 |
125 |
jt_eaton |
my $name_depth =2;
|
562 |
122 |
jt_eaton |
|
563 |
125 |
jt_eaton |
my $parser = XML::LibXML->new();
|
564 |
|
|
|
565 |
130 |
jt_eaton |
my $socgen_component_file = $parser->parse_file(yp::lib::find_componentConfiguration($vendor,$library,$component));
|
566 |
125 |
jt_eaton |
|
567 |
|
|
foreach my $new_comp ($socgen_component_file->findnodes("//socgen:componentConfiguration"))
|
568 |
|
|
{
|
569 |
|
|
$name_depth = $new_comp->findnodes('./socgen:ip_name_depth/text()')->to_literal ;
|
570 |
|
|
}
|
571 |
127 |
jt_eaton |
if($name_depth eq "0"){ return("${library}");}
|
572 |
125 |
jt_eaton |
if($name_depth eq "1"){ return("${component}");}
|
573 |
|
|
if($name_depth eq "2"){ return("${component}_${version}");}
|
574 |
|
|
if($name_depth eq "3"){ return("${library}_${component}_${version}");}
|
575 |
|
|
if($name_depth eq "4"){ return("${vendor}_${library}_${component}_${version}");}
|
576 |
122 |
jt_eaton |
|
577 |
|
|
}
|
578 |
|
|
|
579 |
|
|
|
580 |
|
|
|
581 |
|
|
|
582 |
130 |
jt_eaton |
|
583 |
|
|
|
584 |
|
|
|
585 |
|
|
|
586 |
|
|
#/*********************************************************************************************/
|
587 |
|
|
#/ find_versions */
|
588 |
|
|
#/ */
|
589 |
|
|
#/ returns array of all versions from a vendors library component */
|
590 |
|
|
#/ */
|
591 |
|
|
#/ my @versions = yp::lib::find_versions($type,$vendor,$library,component); */
|
592 |
|
|
#/ */
|
593 |
|
|
#/*********************************************************************************************/
|
594 |
|
|
|
595 |
|
|
sub find_versions
|
596 |
|
|
{
|
597 |
|
|
my @params = @_;
|
598 |
|
|
my $component = pop(@params);
|
599 |
|
|
my $library = pop(@params);
|
600 |
|
|
my $vendor = pop(@params);
|
601 |
|
|
my $type = pop(@params);
|
602 |
|
|
my $card_type;
|
603 |
|
|
my $card_vendor;
|
604 |
|
|
my $card_library;
|
605 |
|
|
my $card_component;
|
606 |
|
|
my $card_version;
|
607 |
|
|
|
608 |
|
|
my $parser = XML::LibXML->new();
|
609 |
|
|
my $yp_index_file = $parser->parse_file("./tools/yp/index.xml");
|
610 |
|
|
my @versions = ();
|
611 |
|
|
|
612 |
|
|
foreach my $index_card ($yp_index_file->findnodes('//socgen:index_file/index_card/type'))
|
613 |
|
|
{
|
614 |
|
|
$card_type = $index_card->findnodes('./text()')->to_literal ;
|
615 |
|
|
$card_vendor = $index_card->findnodes('../vendor/text()')->to_literal ;
|
616 |
|
|
$card_library = $index_card->findnodes('../library/text()')->to_literal ;
|
617 |
|
|
$card_component = $index_card->findnodes('../name/text()')->to_literal ;
|
618 |
|
|
$card_version = $index_card->findnodes('../version/text()')->to_literal ;
|
619 |
|
|
if(($card_type eq $type) & ($card_vendor eq $vendor) & ($card_library eq $library) & ($card_component eq $component))
|
620 |
|
|
|
621 |
|
|
{
|
622 |
|
|
push (@versions,$card_version);}
|
623 |
|
|
# print "XXXXXG ${vendor}__${library}_${component} $card_version \n";
|
624 |
|
|
|
625 |
|
|
}
|
626 |
|
|
@versions = trim_sort(@versions);
|
627 |
|
|
# print "XXXXXG ++++++++++++++++++++ Old \n";
|
628 |
|
|
return (@versions);
|
629 |
117 |
jt_eaton |
}
|
630 |
|
|
|
631 |
130 |
jt_eaton |
|
632 |
125 |
jt_eaton |
#/*********************************************************************************************/
|
633 |
|
|
#/ parse_component_file */
|
634 |
|
|
#/ */
|
635 |
|
|
#/ returns design names for component */
|
636 |
|
|
#/ */
|
637 |
|
|
#/ my @filelist = yp::lib::parse_component_file($vendor,$library,$component,$version); */
|
638 |
|
|
#/ */
|
639 |
|
|
#/*********************************************************************************************/
|
640 |
117 |
jt_eaton |
|
641 |
|
|
|
642 |
|
|
|
643 |
125 |
jt_eaton |
sub parse_component_file
|
644 |
|
|
{
|
645 |
|
|
my @params = @_;
|
646 |
|
|
my $version = pop(@params);
|
647 |
|
|
my $component = pop(@params);
|
648 |
|
|
my $library = pop(@params);
|
649 |
|
|
my $vendor = pop(@params);
|
650 |
|
|
|
651 |
|
|
my $parser = XML::LibXML->new();
|
652 |
|
|
|
653 |
|
|
|
654 |
130 |
jt_eaton |
my $spirit_cmp_filename =yp::lib::find_ipxact_component($vendor,$library,$component,$version );
|
655 |
125 |
jt_eaton |
|
656 |
|
|
unless($spirit_cmp_filename)
|
657 |
|
|
{
|
658 |
126 |
jt_eaton |
print("spirit:component MISSING $vendor,$library,$component,$version \n");
|
659 |
125 |
jt_eaton |
}
|
660 |
|
|
|
661 |
126 |
jt_eaton |
|
662 |
130 |
jt_eaton |
my $spirit_component_file = $parser->parse_file(yp::lib::find_ipxact_component($vendor,$library,$component,$version ));
|
663 |
125 |
jt_eaton |
|
664 |
|
|
|
665 |
|
|
my $line;
|
666 |
|
|
|
667 |
|
|
my @filelist_acc = ( );
|
668 |
|
|
push(@filelist_acc,"::${vendor}::${library}::${component}::${version}::");
|
669 |
|
|
|
670 |
|
|
foreach my $new_comp ($spirit_component_file->findnodes("//spirit:component/spirit:model/spirit:views/spirit:view/spirit:vendorExtensions/spirit:componentRef"))
|
671 |
|
|
{
|
672 |
|
|
my($new_vendor) = $new_comp->findnodes('./@spirit:vendor')->to_literal ;
|
673 |
|
|
my($new_library) = $new_comp->findnodes('./@spirit:library')->to_literal ;
|
674 |
|
|
my($new_name) = $new_comp->findnodes('./@spirit:name')->to_literal ;
|
675 |
|
|
my($new_version) = $new_comp->findnodes('./@spirit:version')->to_literal ;
|
676 |
128 |
jt_eaton |
my @filelist_sub = parse_component_fileX($new_vendor,$new_library,$new_name,$new_version);
|
677 |
125 |
jt_eaton |
foreach $line (@filelist_sub) { push(@filelist_acc,"$line"); }
|
678 |
|
|
}
|
679 |
|
|
|
680 |
|
|
foreach my $new_comp ($spirit_component_file->findnodes("//spirit:component/spirit:model/spirit:views/spirit:view/spirit:hierarchyRef"))
|
681 |
|
|
{
|
682 |
|
|
my($new_vendor) = $new_comp->findnodes('./@spirit:vendor')->to_literal ;
|
683 |
|
|
my($new_library) = $new_comp->findnodes('./@spirit:library')->to_literal ;
|
684 |
|
|
my($new_name) = $new_comp->findnodes('./@spirit:name')->to_literal ;
|
685 |
|
|
my($new_version) = $new_comp->findnodes('./@spirit:version')->to_literal ;
|
686 |
|
|
|
687 |
130 |
jt_eaton |
if(yp::lib::find_ipxact_design($new_vendor,$new_library,$new_name,$new_version ))
|
688 |
125 |
jt_eaton |
{
|
689 |
130 |
jt_eaton |
my $spirit_design_file = $parser->parse_file(yp::lib::find_ipxact_design($new_vendor,$new_library,$new_name,$new_version ));
|
690 |
125 |
jt_eaton |
foreach my $i_name ($spirit_design_file->findnodes("//spirit:design/spirit:componentInstances/spirit:componentInstance/spirit:componentRef/\@spirit:vendor"))
|
691 |
|
|
{
|
692 |
|
|
my($vendor_name) = $i_name ->to_literal ;
|
693 |
|
|
my($library_name) = $i_name ->findnodes('../@spirit:library')->to_literal ;
|
694 |
|
|
my($component_name) = $i_name ->findnodes('../@spirit:name')->to_literal ;
|
695 |
|
|
my($version_name) = $i_name ->findnodes('../@spirit:version')->to_literal ;
|
696 |
|
|
|
697 |
|
|
push(@filelist_acc,"::${vendor_name}::${library_name}::${component_name}::${version_name}::");
|
698 |
128 |
jt_eaton |
my @filelist_sub = parse_component_fileX($vendor_name,$library_name,$component_name,$version_name);
|
699 |
125 |
jt_eaton |
foreach $line (@filelist_sub) { push(@filelist_acc,"$line"); }
|
700 |
130 |
jt_eaton |
}
|
701 |
|
|
}
|
702 |
125 |
jt_eaton |
}
|
703 |
|
|
|
704 |
|
|
@filelist_acc = sys::lib::trim_sort(@filelist_acc);
|
705 |
|
|
return(@filelist_acc);
|
706 |
|
|
}
|
707 |
|
|
|
708 |
|
|
|
709 |
|
|
|
710 |
|
|
|
711 |
|
|
|
712 |
128 |
jt_eaton |
sub parse_component_fileX
|
713 |
|
|
{
|
714 |
|
|
my @params = @_;
|
715 |
|
|
my $version = pop(@params);
|
716 |
|
|
my $component = pop(@params);
|
717 |
|
|
my $library = pop(@params);
|
718 |
|
|
my $vendor = pop(@params);
|
719 |
125 |
jt_eaton |
|
720 |
128 |
jt_eaton |
my $parser = XML::LibXML->new();
|
721 |
125 |
jt_eaton |
|
722 |
128 |
jt_eaton |
|
723 |
130 |
jt_eaton |
my $spirit_cmp_filename =yp::lib::find_ipxact_component($vendor,$library,$component,$version );
|
724 |
128 |
jt_eaton |
|
725 |
|
|
unless($spirit_cmp_filename)
|
726 |
|
|
{
|
727 |
|
|
print("spirit:component MISSING $vendor,$library,$component,$version \n");
|
728 |
|
|
}
|
729 |
|
|
|
730 |
|
|
|
731 |
130 |
jt_eaton |
my $spirit_component_file = $parser->parse_file(yp::lib::find_ipxact_component($vendor,$library,$component,$version ));
|
732 |
128 |
jt_eaton |
|
733 |
|
|
|
734 |
|
|
my $line;
|
735 |
|
|
|
736 |
|
|
my @filelist_acc = ( );
|
737 |
130 |
jt_eaton |
|
738 |
128 |
jt_eaton |
|
739 |
|
|
foreach my $new_comp ($spirit_component_file->findnodes("//spirit:component/spirit:model/spirit:views/spirit:view/spirit:vendorExtensions/spirit:componentRef"))
|
740 |
|
|
{
|
741 |
|
|
my($new_vendor) = $new_comp->findnodes('./@spirit:vendor')->to_literal ;
|
742 |
|
|
my($new_library) = $new_comp->findnodes('./@spirit:library')->to_literal ;
|
743 |
|
|
my($new_name) = $new_comp->findnodes('./@spirit:name')->to_literal ;
|
744 |
|
|
my($new_version) = $new_comp->findnodes('./@spirit:version')->to_literal ;
|
745 |
|
|
my @filelist_sub = parse_component_fileX($new_vendor,$new_library,$new_name,$new_version);
|
746 |
|
|
foreach $line (@filelist_sub) { push(@filelist_acc,"$line"); }
|
747 |
|
|
}
|
748 |
|
|
|
749 |
|
|
foreach my $new_comp ($spirit_component_file->findnodes("//spirit:component/spirit:model/spirit:views/spirit:view/spirit:hierarchyRef"))
|
750 |
|
|
{
|
751 |
|
|
my($new_vendor) = $new_comp->findnodes('./@spirit:vendor')->to_literal ;
|
752 |
|
|
my($new_library) = $new_comp->findnodes('./@spirit:library')->to_literal ;
|
753 |
|
|
my($new_name) = $new_comp->findnodes('./@spirit:name')->to_literal ;
|
754 |
|
|
my($new_version) = $new_comp->findnodes('./@spirit:version')->to_literal ;
|
755 |
|
|
|
756 |
130 |
jt_eaton |
if(yp::lib::find_ipxact_design($new_vendor,$new_library,$new_name,$new_version ))
|
757 |
|
|
{
|
758 |
|
|
my $spirit_design_file = $parser->parse_file(yp::lib::find_ipxact_design($new_vendor,$new_library,$new_name,$new_version ));
|
759 |
|
|
foreach my $i_name ($spirit_design_file->findnodes("//spirit:design/spirit:componentInstances/spirit:componentInstance/spirit:componentRef/\@spirit:vendor"))
|
760 |
128 |
jt_eaton |
{
|
761 |
|
|
my($vendor_name) = $i_name ->to_literal ;
|
762 |
|
|
my($library_name) = $i_name ->findnodes('../@spirit:library')->to_literal ;
|
763 |
|
|
my($component_name) = $i_name ->findnodes('../@spirit:name')->to_literal ;
|
764 |
|
|
my($version_name) = $i_name ->findnodes('../@spirit:version')->to_literal ;
|
765 |
|
|
|
766 |
|
|
push(@filelist_acc,"::${vendor_name}::${library_name}::${component_name}::${version_name}::");
|
767 |
|
|
my @filelist_sub = parse_component_fileX($vendor_name,$library_name,$component_name,$version_name);
|
768 |
|
|
foreach $line (@filelist_sub) { push(@filelist_acc,"$line"); }
|
769 |
|
|
}
|
770 |
130 |
jt_eaton |
|
771 |
128 |
jt_eaton |
}
|
772 |
|
|
}
|
773 |
|
|
|
774 |
|
|
@filelist_acc = sys::lib::trim_sort(@filelist_acc);
|
775 |
|
|
return(@filelist_acc);
|
776 |
|
|
}
|
777 |
|
|
|
778 |
|
|
|
779 |
|
|
|
780 |
|
|
|
781 |
|
|
|
782 |
|
|
|
783 |
|
|
#/*********************************************************************************************/
|
784 |
|
|
#/ parse_component_brothers */
|
785 |
|
|
#/ */
|
786 |
|
|
#/ returns names for component brothers */
|
787 |
|
|
#/ */
|
788 |
|
|
#/ my @filelist = yp::lib::parse_component_brother($vendor,$library,$component,$version); */
|
789 |
|
|
#/ */
|
790 |
|
|
#/*********************************************************************************************/
|
791 |
|
|
|
792 |
|
|
sub parse_component_brothers
|
793 |
|
|
{
|
794 |
|
|
my @params = @_;
|
795 |
|
|
my $version = pop(@params);
|
796 |
|
|
my $component = pop(@params);
|
797 |
|
|
my $library = pop(@params);
|
798 |
|
|
my $vendor = pop(@params);
|
799 |
|
|
|
800 |
|
|
my $parser = XML::LibXML->new();
|
801 |
130 |
jt_eaton |
unless (yp::lib::find_ipxact_component($vendor,$library,$component,$version)){print "Missing Component $vendor, $library, $component, $version \n"; }
|
802 |
|
|
my $spirit_component_file = $parser->parse_file(yp::lib::find_ipxact_component($vendor,$library,$component,$version ));
|
803 |
128 |
jt_eaton |
|
804 |
|
|
my $line;
|
805 |
|
|
my @filelist_acc = ( );
|
806 |
|
|
push(@filelist_acc,"::${vendor}::${library}::${component}::${version}::");
|
807 |
|
|
|
808 |
|
|
foreach my $new_comp ($spirit_component_file->findnodes("//spirit:component/spirit:model/spirit:views/spirit:view/spirit:vendorExtensions/spirit:componentRef"))
|
809 |
|
|
{
|
810 |
|
|
my($new_vendor) = $new_comp->findnodes('./@spirit:vendor')->to_literal ;
|
811 |
|
|
my($new_library) = $new_comp->findnodes('./@spirit:library')->to_literal ;
|
812 |
|
|
my($new_component) = $new_comp->findnodes('./@spirit:name')->to_literal ;
|
813 |
|
|
my($new_version) = $new_comp->findnodes('./@spirit:version')->to_literal ;
|
814 |
|
|
push(@filelist_acc,"::${new_vendor}::${new_library}::${new_component}::${new_version}::");
|
815 |
|
|
}
|
816 |
|
|
|
817 |
|
|
return(@filelist_acc);
|
818 |
|
|
}
|
819 |
|
|
|
820 |
125 |
jt_eaton |
#/*****************************************************************************************************/
|
821 |
|
|
#/ find_ipxact_design_files */
|
822 |
|
|
#/ */
|
823 |
|
|
#/ returns parser tokens to ip-xact design files referred to by component file vlnv */
|
824 |
|
|
#/ */
|
825 |
|
|
#/ my @spirit_design_files = yp::lib::find_ipxact_design_file($vendor,$library,$component,$version); */
|
826 |
|
|
#/ */
|
827 |
|
|
#/*****************************************************************************************************/
|
828 |
|
|
|
829 |
|
|
sub find_ipxact_design_files
|
830 |
|
|
{
|
831 |
|
|
my @params = @_;
|
832 |
|
|
my $version = pop(@params);
|
833 |
|
|
my $component = pop(@params);
|
834 |
130 |
jt_eaton |
my $library = pop(@params);
|
835 |
125 |
jt_eaton |
my $vendor = pop(@params);
|
836 |
|
|
|
837 |
|
|
|
838 |
|
|
my @design_files = ();
|
839 |
|
|
my $parser = XML::LibXML->new();
|
840 |
130 |
jt_eaton |
unless (yp::lib::find_ipxact_component($vendor,$library,$component,$version)){print "Missing Component $vendor, $library, $component, $version \n"; }
|
841 |
|
|
my $spirit_component_file = $parser->parse_file(yp::lib::find_ipxact_component($vendor,$library,$component,$version));
|
842 |
125 |
jt_eaton |
|
843 |
|
|
foreach my $new_comp ($spirit_component_file->findnodes("//spirit:component/spirit:model/spirit:views/spirit:view/spirit:vendorExtensions/spirit:componentRef"))
|
844 |
|
|
{
|
845 |
|
|
my($new_vendor) = $new_comp->findnodes('./@spirit:vendor')->to_literal ;
|
846 |
|
|
my($new_library) = $new_comp->findnodes('./@spirit:library')->to_literal ;
|
847 |
|
|
my($new_name) = $new_comp->findnodes('./@spirit:name')->to_literal ;
|
848 |
|
|
my($new_version) = $new_comp->findnodes('./@spirit:version')->to_literal ;
|
849 |
|
|
my @filelist_sub = yp::lib::find_ipxact_design_files($new_vendor,$new_library,$new_name,$new_version);
|
850 |
130 |
jt_eaton |
foreach my $line (@filelist_sub) { push(@design_files,"$line"); } }
|
851 |
125 |
jt_eaton |
|
852 |
|
|
foreach my $comp_view ($spirit_component_file->findnodes('//spirit:component/spirit:model/spirit:views/spirit:view'))
|
853 |
|
|
{
|
854 |
|
|
my($hier_ref_vendor) = $comp_view->findnodes('./spirit:hierarchyRef/@spirit:vendor')->to_literal ;
|
855 |
|
|
my($hier_ref_library) = $comp_view->findnodes('./spirit:hierarchyRef/@spirit:library')->to_literal ;
|
856 |
130 |
jt_eaton |
my($hier_ref_design) = $comp_view->findnodes('./spirit:hierarchyRef/@spirit:name')->to_literal ;
|
857 |
125 |
jt_eaton |
my($hier_ref_version) = $comp_view->findnodes('./spirit:hierarchyRef/@spirit:version')->to_literal ;
|
858 |
130 |
jt_eaton |
if(find_ipxact_design($hier_ref_vendor,$hier_ref_library,$hier_ref_design,$hier_ref_version))
|
859 |
|
|
{
|
860 |
|
|
push(@design_files,":::${hier_ref_vendor}:::${hier_ref_library}:::${hier_ref_design}:::${hier_ref_version}:::");
|
861 |
|
|
}
|
862 |
125 |
jt_eaton |
}
|
863 |
130 |
jt_eaton |
return(@design_files);
|
864 |
|
|
}
|
865 |
125 |
jt_eaton |
|
866 |
|
|
|
867 |
|
|
|
868 |
|
|
|
869 |
130 |
jt_eaton |
sub trim_sort {
|
870 |
|
|
my @output_files = @_;
|
871 |
|
|
my %trim = ();
|
872 |
|
|
foreach my $descriptor (@output_files) { $trim{$descriptor} = 1; }
|
873 |
|
|
my @k = keys %trim;
|
874 |
|
|
@output_files = sort(sort @k);
|
875 |
|
|
return(@output_files);
|
876 |
125 |
jt_eaton |
}
|
877 |
|
|
|
878 |
|
|
|
879 |
|
|
|
880 |
|
|
|
881 |
|
|
|
882 |
117 |
jt_eaton |
1;
|