| 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 |
131 |
jt_eaton |
# General PERL config
|
| 55 |
130 |
jt_eaton |
############################################################################
|
| 56 |
131 |
jt_eaton |
use Getopt::Long;
|
| 57 |
|
|
use English;
|
| 58 |
|
|
use File::Basename;
|
| 59 |
|
|
use Cwd;
|
| 60 |
|
|
use XML::LibXML;
|
| 61 |
|
|
use lib './tools';
|
| 62 |
|
|
use sys::lib;
|
| 63 |
130 |
jt_eaton |
use BerkeleyDB;
|
| 64 |
|
|
|
| 65 |
|
|
|
| 66 |
131 |
jt_eaton |
$OUTPUT_AUTOFLUSH = 1; # set autoflush of stdout to TRUE.
|
| 67 |
130 |
jt_eaton |
|
| 68 |
|
|
|
| 69 |
|
|
|
| 70 |
|
|
|
| 71 |
131 |
jt_eaton |
|
| 72 |
|
|
|
| 73 |
|
|
my $home = cwd();
|
| 74 |
|
|
|
| 75 |
|
|
|
| 76 |
|
|
my $parser = XML::LibXML->new();
|
| 77 |
|
|
|
| 78 |
|
|
|
| 79 |
|
|
|
| 80 |
|
|
my $workspace_xml = $parser->parse_file("${home}/workspace.xml");
|
| 81 |
|
|
my @repos =();
|
| 82 |
|
|
my $repo;
|
| 83 |
|
|
|
| 84 |
|
|
|
| 85 |
|
|
foreach my $repo ($workspace_xml->findnodes('//socgen:workspace/socgen:repos/socgen:repo'))
|
| 86 |
|
|
{
|
| 87 |
|
|
my $repo_name = $repo->findnodes('./socgen:name/text()')->to_literal ;
|
| 88 |
|
|
push @repos,$repo_name;
|
| 89 |
|
|
}
|
| 90 |
|
|
|
| 91 |
|
|
|
| 92 |
|
|
|
| 93 |
|
|
|
| 94 |
|
|
|
| 95 |
|
|
|
| 96 |
|
|
|
| 97 |
|
|
my $number_of_cpus;
|
| 98 |
|
|
my $workspace;
|
| 99 |
135 |
jt_eaton |
my $child;
|
| 100 |
|
|
my $code;
|
| 101 |
|
|
my $data;
|
| 102 |
131 |
jt_eaton |
my $yellow_pages;
|
| 103 |
|
|
my $io_ports;
|
| 104 |
|
|
my $doc_dir;
|
| 105 |
|
|
|
| 106 |
|
|
|
| 107 |
|
|
foreach my $repo ($workspace_xml->findnodes('//socgen:workspace'))
|
| 108 |
|
|
{
|
| 109 |
|
|
$number_of_cpus = $repo->findnodes('./socgen:number_of_cpus/text()')->to_literal ;
|
| 110 |
|
|
$workspace = $repo->findnodes('./socgen:build_dir/text()')->to_literal ;
|
| 111 |
135 |
jt_eaton |
$child = $repo->findnodes('./socgen:child_dir/text()')->to_literal ;
|
| 112 |
|
|
$code = $repo->findnodes('./socgen:code_dir/text()')->to_literal ;
|
| 113 |
|
|
$data = $repo->findnodes('./socgen:data_dir/text()')->to_literal ;
|
| 114 |
131 |
jt_eaton |
$yellow_pages = $repo->findnodes('./socgen:yp_dir/text()')->to_literal ;
|
| 115 |
|
|
$io_ports = $repo->findnodes('./socgen:ports_dir/text()')->to_literal ;
|
| 116 |
|
|
$doc_dir = $repo->findnodes('./socgen:doc_dir/text()')->to_literal ;
|
| 117 |
|
|
}
|
| 118 |
|
|
|
| 119 |
|
|
|
| 120 |
135 |
jt_eaton |
|
| 121 |
|
|
unless(defined $number_of_cpus) { $number_of_cpus = 1; }
|
| 122 |
|
|
unless(defined $workspace ) { $workspace = "work"; }
|
| 123 |
|
|
unless(defined $child ) { $child = "children"; }
|
| 124 |
|
|
unless(defined $code ) { $code = "code"; }
|
| 125 |
|
|
unless(defined $data ) { $data = "dbs"; }
|
| 126 |
|
|
unless(defined $yellow_pages ) { $yellow_pages = "yp"; }
|
| 127 |
|
|
unless(defined $io_ports ) { $io_ports = "io_ports"; }
|
| 128 |
|
|
unless(defined $doc_dir ) { $doc_dir = "doc_dir"; }
|
| 129 |
|
|
|
| 130 |
131 |
jt_eaton |
#print "number_of_cpus $number_of_cpus \n";
|
| 131 |
|
|
#print "workspace $workspace \n";
|
| 132 |
|
|
#print "yellow_pages $yellow_pages \n";
|
| 133 |
|
|
#print "io_ports $io_ports \n";
|
| 134 |
|
|
|
| 135 |
|
|
my $path = "${home}/${yellow_pages}";
|
| 136 |
|
|
|
| 137 |
|
|
unless( -e $path )
|
| 138 |
|
|
{
|
| 139 |
135 |
jt_eaton |
print "Creating Yellow Pages \n";
|
| 140 |
131 |
jt_eaton |
my $cmd = "./tools/yp/create_yp $path \n";
|
| 141 |
|
|
if(system($cmd)){};
|
| 142 |
|
|
}
|
| 143 |
|
|
|
| 144 |
|
|
my $repo_db = new BerkeleyDB::Hash( -Filename => "${yellow_pages}/repo.dbm", -Flags => DB_CREATE ) or die "Cannot open file: $!";
|
| 145 |
|
|
my $component_db = new BerkeleyDB::Hash( -Filename => "${yellow_pages}/component.dbm", -Flags => DB_CREATE ) or die "Cannot open file: $!";
|
| 146 |
|
|
my $design_db = new BerkeleyDB::Hash( -Filename => "${yellow_pages}/design.dbm", -Flags => DB_CREATE ) or die "Cannot open file: $!";
|
| 147 |
|
|
my $abstractionDefinition_db = new BerkeleyDB::Hash( -Filename => "${yellow_pages}/abstractionDefinition.dbm", -Flags => DB_CREATE ) or die "Cannot open file: $!";
|
| 148 |
|
|
my $busDefinition_db = new BerkeleyDB::Hash( -Filename => "${yellow_pages}/busDefinition.dbm", -Flags => DB_CREATE ) or die "Cannot open file: $!";
|
| 149 |
|
|
my $libraryConfiguration_db = new BerkeleyDB::Hash( -Filename => "${yellow_pages}/libraryConfiguration.dbm", -Flags => DB_CREATE ) or die "Cannot open file: $!";
|
| 150 |
|
|
my $componentConfiguration_db = new BerkeleyDB::Hash( -Filename => "${yellow_pages}/componentConfiguration.dbm", -Flags => DB_CREATE ) or die "Cannot open file: $!";
|
| 151 |
|
|
|
| 152 |
|
|
|
| 153 |
118 |
jt_eaton |
#/***********************************************************************************************/
|
| 154 |
131 |
jt_eaton |
#/ get_workspace */
|
| 155 |
|
|
#/ */
|
| 156 |
|
|
#/ returns name for the workspace subdirectory under ${home} */
|
| 157 |
|
|
#/ */
|
| 158 |
|
|
#/ my $workspace = yp::lib::get_workspace(); */
|
| 159 |
|
|
#/ */
|
| 160 |
|
|
#/***********************************************************************************************/
|
| 161 |
|
|
|
| 162 |
|
|
sub get_workspace
|
| 163 |
|
|
{
|
| 164 |
|
|
return("${workspace}");
|
| 165 |
|
|
}
|
| 166 |
|
|
|
| 167 |
|
|
|
| 168 |
|
|
|
| 169 |
|
|
#/***********************************************************************************************/
|
| 170 |
|
|
#/ get_yp */
|
| 171 |
|
|
#/ */
|
| 172 |
|
|
#/ returns name for the yellow_pages subdirectory under ${home} */
|
| 173 |
|
|
#/ */
|
| 174 |
|
|
#/ my $workspace = yp::lib::get_yp(); */
|
| 175 |
|
|
#/ */
|
| 176 |
|
|
#/***********************************************************************************************/
|
| 177 |
|
|
|
| 178 |
|
|
sub get_yp
|
| 179 |
|
|
{
|
| 180 |
|
|
return("${yellow_pages}");
|
| 181 |
|
|
}
|
| 182 |
|
|
|
| 183 |
|
|
|
| 184 |
|
|
|
| 185 |
|
|
|
| 186 |
|
|
|
| 187 |
|
|
#/***********************************************************************************************/
|
| 188 |
|
|
#/ get_io_ports */
|
| 189 |
|
|
#/ */
|
| 190 |
|
|
#/ returns name for the io_ports subdirectory under ${home} */
|
| 191 |
|
|
#/ */
|
| 192 |
|
|
#/ my $workspace = yp::lib::get_io_ports(); */
|
| 193 |
|
|
#/ */
|
| 194 |
|
|
#/***********************************************************************************************/
|
| 195 |
|
|
|
| 196 |
|
|
sub get_io_ports
|
| 197 |
|
|
{
|
| 198 |
|
|
return("${io_ports}");
|
| 199 |
|
|
}
|
| 200 |
|
|
|
| 201 |
|
|
#/***********************************************************************************************/
|
| 202 |
|
|
#/ get_doc_dir */
|
| 203 |
|
|
#/ */
|
| 204 |
|
|
#/ returns name for the documentation subdirectory under ${home} */
|
| 205 |
|
|
#/ */
|
| 206 |
|
|
#/ my $workspace = yp::lib::get_doc_dir (); */
|
| 207 |
|
|
#/ */
|
| 208 |
|
|
#/***********************************************************************************************/
|
| 209 |
|
|
|
| 210 |
|
|
sub get_doc_dir
|
| 211 |
|
|
{
|
| 212 |
|
|
return("${doc_dir}");
|
| 213 |
|
|
}
|
| 214 |
|
|
|
| 215 |
|
|
|
| 216 |
|
|
|
| 217 |
133 |
jt_eaton |
#/***********************************************************************************************/
|
| 218 |
|
|
#/ get_number_of_cpus */
|
| 219 |
|
|
#/ */
|
| 220 |
|
|
#/ returns number of cpus available for tool usage */
|
| 221 |
|
|
#/ */
|
| 222 |
|
|
#/ my $number_of_cpus = yp::lib::get_number_of_cpus (); */
|
| 223 |
|
|
#/ */
|
| 224 |
|
|
#/***********************************************************************************************/
|
| 225 |
131 |
jt_eaton |
|
| 226 |
133 |
jt_eaton |
sub get_number_of_cpus
|
| 227 |
|
|
{
|
| 228 |
|
|
return("${number_of_cpus}");
|
| 229 |
|
|
}
|
| 230 |
|
|
|
| 231 |
|
|
|
| 232 |
|
|
|
| 233 |
135 |
jt_eaton |
#/***********************************************************************************************/
|
| 234 |
|
|
#/ get_child_dir */
|
| 235 |
|
|
#/ */
|
| 236 |
|
|
#/ returns name of child directory */
|
| 237 |
|
|
#/ */
|
| 238 |
|
|
#/ my $child_dir = yp::lib::get_child_dir (); */
|
| 239 |
|
|
#/ */
|
| 240 |
|
|
#/***********************************************************************************************/
|
| 241 |
133 |
jt_eaton |
|
| 242 |
135 |
jt_eaton |
sub get_child_dir
|
| 243 |
|
|
{
|
| 244 |
|
|
return("${child}");
|
| 245 |
|
|
}
|
| 246 |
|
|
|
| 247 |
|
|
|
| 248 |
|
|
|
| 249 |
|
|
|
| 250 |
|
|
|
| 251 |
|
|
|
| 252 |
|
|
|
| 253 |
|
|
|
| 254 |
131 |
jt_eaton |
#/***************************************************************************************************/
|
| 255 |
|
|
#/ get_io_ports_db_filename */
|
| 256 |
|
|
#/ */
|
| 257 |
|
|
#/ returns full path name to io_ports database filename */
|
| 258 |
|
|
#/ */
|
| 259 |
|
|
#/ my $io_ports_filename = yp::lib::get_io_ports_db_filename($vendor,$library,$component,$version);*/
|
| 260 |
|
|
#/ */
|
| 261 |
|
|
#/***************************************************************************************************/
|
| 262 |
|
|
|
| 263 |
|
|
sub get_io_ports_db_filename
|
| 264 |
|
|
{
|
| 265 |
|
|
my @params = @_;
|
| 266 |
|
|
my $version = pop(@params);
|
| 267 |
|
|
my $component = pop(@params);
|
| 268 |
|
|
my $library = pop(@params);
|
| 269 |
|
|
my $vendor = pop(@params);
|
| 270 |
|
|
my $main_module_name = yp::lib::get_module_name($vendor,$library,$component,$version) ;
|
| 271 |
133 |
jt_eaton |
my $io_ports_db_filename = "${home}/${io_ports}/${vendor}__${library}/${component}/${main_module_name}/PORTS.dbm";
|
| 272 |
131 |
jt_eaton |
|
| 273 |
|
|
if(-e ${io_ports_db_filename } )
|
| 274 |
|
|
{
|
| 275 |
|
|
return("${io_ports_db_filename}");
|
| 276 |
|
|
}
|
| 277 |
|
|
my $cmd = "./tools/verilog/gen_ports -vendor $vendor -library $library -component $component -version $version ";
|
| 278 |
|
|
if (system($cmd)) {}
|
| 279 |
|
|
return("${io_ports_db_filename}");
|
| 280 |
|
|
}
|
| 281 |
|
|
|
| 282 |
|
|
|
| 283 |
|
|
|
| 284 |
|
|
|
| 285 |
|
|
|
| 286 |
134 |
jt_eaton |
#/*************************************************************************************************************/
|
| 287 |
|
|
#/ get_io_busses_db_filename */
|
| 288 |
|
|
#/ */
|
| 289 |
|
|
#/ returns full path name to io_busses database filename */
|
| 290 |
|
|
#/ */
|
| 291 |
|
|
#/ my $io_busses_filename = yp::lib::get_io_busses_db_filename($vendor,$library,$component,$version,config); */
|
| 292 |
|
|
#/ */
|
| 293 |
|
|
#/*************************************************************************************************************/
|
| 294 |
|
|
|
| 295 |
|
|
sub get_io_busses_db_filename
|
| 296 |
|
|
{
|
| 297 |
|
|
my @params = @_;
|
| 298 |
|
|
my $config = pop(@params);
|
| 299 |
|
|
my $version = pop(@params);
|
| 300 |
|
|
my $component = pop(@params);
|
| 301 |
|
|
my $library = pop(@params);
|
| 302 |
|
|
my $vendor = pop(@params);
|
| 303 |
|
|
my $main_module_name = yp::lib::get_module_name($vendor,$library,$component,$version) ;
|
| 304 |
|
|
my $io_busses_db_filename;
|
| 305 |
|
|
|
| 306 |
|
|
if(defined $config && length $config > 0)
|
| 307 |
|
|
{
|
| 308 |
|
|
$io_busses_db_filename = "${home}/${io_ports}/${vendor}__${library}/${component}/${main_module_name}/BUSSES.dbm";
|
| 309 |
|
|
}
|
| 310 |
|
|
else
|
| 311 |
|
|
{
|
| 312 |
|
|
$io_busses_db_filename = "${home}/${io_ports}/${vendor}__${library}/${component}/${main_module_name}/${config}/BUSSES.dbm";
|
| 313 |
|
|
}
|
| 314 |
|
|
|
| 315 |
|
|
|
| 316 |
|
|
if(-e ${io_busses_db_filename } )
|
| 317 |
|
|
{
|
| 318 |
|
|
return("${io_busses_db_filename}");
|
| 319 |
|
|
}
|
| 320 |
|
|
my $cmd = "./tools/verilog/gen_ports -vendor $vendor -library $library -component $component -version $version ";
|
| 321 |
|
|
if (system($cmd)) {}
|
| 322 |
|
|
return("${io_busses_db_filename}");
|
| 323 |
|
|
}
|
| 324 |
|
|
|
| 325 |
|
|
|
| 326 |
|
|
|
| 327 |
133 |
jt_eaton |
#/******************************************************************************************************/
|
| 328 |
134 |
jt_eaton |
#/ get_io_busses_name_db_filename */
|
| 329 |
133 |
jt_eaton |
#/ */
|
| 330 |
134 |
jt_eaton |
#/ returns full path name to io_busses database named filename */
|
| 331 |
133 |
jt_eaton |
#/ */
|
| 332 |
134 |
jt_eaton |
#/ my $io_busses_filename = yp::lib::get_io_busses_name_db_filename($vendor,$library,$component,$version); */
|
| 333 |
133 |
jt_eaton |
#/ */
|
| 334 |
|
|
#/******************************************************************************************************/
|
| 335 |
131 |
jt_eaton |
|
| 336 |
134 |
jt_eaton |
sub get_io_busses_named_db_filename
|
| 337 |
131 |
jt_eaton |
{
|
| 338 |
|
|
my @params = @_;
|
| 339 |
134 |
jt_eaton |
my $name = pop(@params);
|
| 340 |
131 |
jt_eaton |
my $version = pop(@params);
|
| 341 |
|
|
my $component = pop(@params);
|
| 342 |
|
|
my $library = pop(@params);
|
| 343 |
|
|
my $vendor = pop(@params);
|
| 344 |
|
|
my $main_module_name = yp::lib::get_module_name($vendor,$library,$component,$version) ;
|
| 345 |
134 |
jt_eaton |
my $io_busses_db_filename = "${home}/${io_ports}/${vendor}__${library}/${component}/${main_module_name}_${name}/BUSSES.dbm";
|
| 346 |
131 |
jt_eaton |
|
| 347 |
|
|
if(-e ${io_busses_db_filename } )
|
| 348 |
|
|
{
|
| 349 |
|
|
return("${io_busses_db_filename}");
|
| 350 |
|
|
}
|
| 351 |
|
|
my $cmd = "./tools/verilog/gen_ports -vendor $vendor -library $library -component $component -version $version ";
|
| 352 |
|
|
if (system($cmd)) {}
|
| 353 |
|
|
return("${io_busses_db_filename}");
|
| 354 |
|
|
}
|
| 355 |
|
|
|
| 356 |
|
|
|
| 357 |
|
|
|
| 358 |
|
|
|
| 359 |
|
|
|
| 360 |
133 |
jt_eaton |
#/***********************************************************************************************************/
|
| 361 |
|
|
#/ get_elab_db_filename */
|
| 362 |
|
|
#/ */
|
| 363 |
|
|
#/ returns full path name to elab database filename */
|
| 364 |
|
|
#/ */
|
| 365 |
|
|
#/ my $elab_filename = yp::lib::get_elab_db_filename($vendor,$library,$component,$version,$configuration); */
|
| 366 |
|
|
#/ */
|
| 367 |
|
|
#/***********************************************************************************************************/
|
| 368 |
131 |
jt_eaton |
|
| 369 |
133 |
jt_eaton |
sub get_elab_db_filename
|
| 370 |
|
|
{
|
| 371 |
|
|
my @params = @_;
|
| 372 |
|
|
my $configuration = pop(@params);
|
| 373 |
|
|
my $version = pop(@params);
|
| 374 |
|
|
my $component = pop(@params);
|
| 375 |
|
|
my $library = pop(@params);
|
| 376 |
|
|
my $vendor = pop(@params);
|
| 377 |
|
|
|
| 378 |
|
|
my $elab_db_filename;
|
| 379 |
131 |
jt_eaton |
|
| 380 |
135 |
jt_eaton |
mkdir "${home}/${data}",0755 unless (-e "${home}/${data}" );
|
| 381 |
134 |
jt_eaton |
|
| 382 |
|
|
if($configuration eq "xxxxxx")
|
| 383 |
133 |
jt_eaton |
{
|
| 384 |
135 |
jt_eaton |
$elab_db_filename = "${home}/${data}/${vendor}_${library}_${component}_${version}.db";
|
| 385 |
133 |
jt_eaton |
}
|
| 386 |
|
|
else
|
| 387 |
|
|
{
|
| 388 |
135 |
jt_eaton |
$elab_db_filename = "${home}/${data}/${vendor}_${library}_${component}_${version}_${configuration}.db";
|
| 389 |
133 |
jt_eaton |
}
|
| 390 |
|
|
|
| 391 |
|
|
return("${elab_db_filename}");
|
| 392 |
|
|
}
|
| 393 |
|
|
|
| 394 |
|
|
|
| 395 |
|
|
|
| 396 |
|
|
|
| 397 |
134 |
jt_eaton |
#/***********************************************************************************************************/
|
| 398 |
|
|
#/ get_design_db_file */
|
| 399 |
|
|
#/ */
|
| 400 |
|
|
#/ returns full path name to design database filename */
|
| 401 |
|
|
#/ */
|
| 402 |
|
|
#/ my $design_db_file = yp::lib::get_design_db_file; */
|
| 403 |
|
|
#/ */
|
| 404 |
|
|
#/***********************************************************************************************************/
|
| 405 |
133 |
jt_eaton |
|
| 406 |
134 |
jt_eaton |
sub get_design_db_file
|
| 407 |
|
|
{
|
| 408 |
133 |
jt_eaton |
|
| 409 |
135 |
jt_eaton |
mkdir "${home}/${data}",0755 unless (-e "${home}/${data}" );
|
| 410 |
|
|
return("${home}/${data}/design.dbm");
|
| 411 |
134 |
jt_eaton |
}
|
| 412 |
133 |
jt_eaton |
|
| 413 |
134 |
jt_eaton |
|
| 414 |
|
|
|
| 415 |
|
|
|
| 416 |
|
|
|
| 417 |
|
|
|
| 418 |
131 |
jt_eaton |
#/***************************************************************************************************/
|
| 419 |
134 |
jt_eaton |
#/ get_component configs */
|
| 420 |
|
|
#/ */
|
| 421 |
|
|
#/ returns array of config_n's for component */
|
| 422 |
|
|
#/ */
|
| 423 |
|
|
#/ my @configs = yp::lib::get_component_configs($vendor,$library,$component,$version); */
|
| 424 |
|
|
#/ */
|
| 425 |
|
|
#/***************************************************************************************************/
|
| 426 |
|
|
|
| 427 |
|
|
sub get_component_configs
|
| 428 |
|
|
{
|
| 429 |
|
|
my @params = @_;
|
| 430 |
|
|
my $version = pop(@params);
|
| 431 |
|
|
my $component = pop(@params);
|
| 432 |
|
|
my $library = pop(@params);
|
| 433 |
|
|
my $vendor = pop(@params);
|
| 434 |
|
|
|
| 435 |
|
|
my $main_module_name = yp::lib::get_module_name($vendor,$library,$component,$version) ;
|
| 436 |
|
|
my $Config_db_file = "${io_ports}/${vendor}__${library}/${component}/${main_module_name}/Config.db";
|
| 437 |
|
|
|
| 438 |
|
|
unless(-e $Config_db_file ){return();}
|
| 439 |
|
|
|
| 440 |
|
|
my $config_db = new BerkeleyDB::Hash( -Filename => $Config_db_file, -Flags => DB_CREATE ) or die "Cannot open ${Config_db_file}: $!";
|
| 441 |
|
|
my @configs = ();
|
| 442 |
|
|
my $key;
|
| 443 |
|
|
my $value;
|
| 444 |
|
|
my $port_cursor = $config_db->db_cursor() ;
|
| 445 |
|
|
while ($port_cursor->c_get($key, $value, DB_NEXT) == 0)
|
| 446 |
|
|
{
|
| 447 |
|
|
push (@configs, $key);
|
| 448 |
|
|
}
|
| 449 |
|
|
my $status = $port_cursor->c_close() ;
|
| 450 |
|
|
$config_db -> db_close();
|
| 451 |
|
|
return(@configs);
|
| 452 |
|
|
|
| 453 |
|
|
}
|
| 454 |
|
|
|
| 455 |
|
|
|
| 456 |
|
|
|
| 457 |
|
|
|
| 458 |
|
|
|
| 459 |
|
|
|
| 460 |
|
|
|
| 461 |
|
|
|
| 462 |
|
|
#/***************************************************************************************************/
|
| 463 |
131 |
jt_eaton |
#/ get_signals */
|
| 464 |
|
|
#/ */
|
| 465 |
|
|
#/ returns array of all signals in a component */
|
| 466 |
|
|
#/ */
|
| 467 |
|
|
#/ my @signals = yp::lib::get_signals($vendor,$library,$component,$version); */
|
| 468 |
|
|
#/ */
|
| 469 |
|
|
#/***************************************************************************************************/
|
| 470 |
|
|
|
| 471 |
|
|
sub get_signals
|
| 472 |
|
|
{
|
| 473 |
|
|
my @params = @_;
|
| 474 |
|
|
my $version = pop(@params);
|
| 475 |
|
|
my $component = pop(@params);
|
| 476 |
|
|
my $library = pop(@params);
|
| 477 |
|
|
my $vendor = pop(@params);
|
| 478 |
|
|
|
| 479 |
133 |
jt_eaton |
my $io_ports_db_filename = yp::lib::get_io_ports_db_filename($vendor,$library,$component,$version);
|
| 480 |
131 |
jt_eaton |
unless (-e ${io_ports_db_filename } )
|
| 481 |
|
|
{
|
| 482 |
|
|
|
| 483 |
|
|
my $cmd = "./tools/verilog/gen_ports -vendor $vendor -library $library -component $component -version $version ";
|
| 484 |
|
|
if (system($cmd)) {}
|
| 485 |
|
|
$cmd = "./tools/verilog/gen_signals -vendor $vendor -library $library -component $component -version $version ";
|
| 486 |
|
|
if (system($cmd)) {}
|
| 487 |
|
|
}
|
| 488 |
|
|
|
| 489 |
|
|
|
| 490 |
|
|
|
| 491 |
|
|
my $ports_db = new BerkeleyDB::Hash( -Filename => $io_ports_db_filename, -Flags => DB_CREATE ) or die "Cannot open ${io_ports_db_filename}: $!";
|
| 492 |
|
|
my @signals = ();
|
| 493 |
|
|
my $key;
|
| 494 |
|
|
my $value;
|
| 495 |
|
|
my $port_cursor = $ports_db->db_cursor() ;
|
| 496 |
|
|
while ($port_cursor->c_get($key, $value, DB_NEXT) == 0)
|
| 497 |
|
|
{
|
| 498 |
|
|
|
| 499 |
|
|
push (@signals, $value);
|
| 500 |
|
|
}
|
| 501 |
|
|
my $status = $port_cursor->c_close() ;
|
| 502 |
|
|
|
| 503 |
|
|
@signals = sys::lib::trim_sort(@signals);
|
| 504 |
134 |
jt_eaton |
|
| 505 |
|
|
$ports_db -> db_close();
|
| 506 |
131 |
jt_eaton |
return(@signals);
|
| 507 |
|
|
}
|
| 508 |
|
|
|
| 509 |
|
|
|
| 510 |
|
|
|
| 511 |
|
|
|
| 512 |
|
|
|
| 513 |
133 |
jt_eaton |
|
| 514 |
|
|
|
| 515 |
131 |
jt_eaton |
#/***************************************************************************************************/
|
| 516 |
133 |
jt_eaton |
#/ get_Parameters */
|
| 517 |
|
|
#/ */
|
| 518 |
|
|
#/ returns array of all instance parameters in a component */
|
| 519 |
|
|
#/ */
|
| 520 |
|
|
#/ my @parameters = yp::lib::get_Parameters($vendor,$library,$component,$version,$instance,$configuration); */
|
| 521 |
|
|
#/ */
|
| 522 |
|
|
#/***************************************************************************************************/
|
| 523 |
|
|
|
| 524 |
|
|
sub get_Parameters
|
| 525 |
|
|
{
|
| 526 |
|
|
my @params = @_;
|
| 527 |
|
|
my $configuration = pop(@params);
|
| 528 |
|
|
my $instance = pop(@params);
|
| 529 |
|
|
my $version = pop(@params);
|
| 530 |
|
|
my $component = pop(@params);
|
| 531 |
|
|
my $library = pop(@params);
|
| 532 |
|
|
my $vendor = pop(@params);
|
| 533 |
|
|
my $elab_db_filename = yp::lib::get_elab_db_filename($vendor,$library,$component,$version,$configuration);
|
| 534 |
|
|
my $ports_db = new BerkeleyDB::Hash( -Filename => $elab_db_filename, -Flags => DB_CREATE ) or die "Cannot open ${elab_db_filename}: $!";
|
| 535 |
|
|
my @parameters = ();
|
| 536 |
|
|
my $key;
|
| 537 |
|
|
my $value;
|
| 538 |
|
|
my $port_cursor = $ports_db->db_cursor() ;
|
| 539 |
|
|
while ($port_cursor->c_get($key, $value, DB_NEXT) == 0)
|
| 540 |
|
|
{
|
| 541 |
|
|
my $parameter_root;
|
| 542 |
|
|
my $parameter;
|
| 543 |
|
|
( $parameter_root,$parameter) = split( /\__/ , $key);
|
| 544 |
|
|
if($parameter_root eq "Parameter_${instance}")
|
| 545 |
|
|
{
|
| 546 |
|
|
push (@parameters, "${parameter}::${value}");
|
| 547 |
|
|
}
|
| 548 |
|
|
}
|
| 549 |
|
|
|
| 550 |
|
|
my $status = $port_cursor->c_close() ;
|
| 551 |
134 |
jt_eaton |
$ports_db -> db_close();
|
| 552 |
133 |
jt_eaton |
@parameters = sys::lib::trim_sort(@parameters);
|
| 553 |
|
|
return(@parameters);
|
| 554 |
|
|
}
|
| 555 |
|
|
|
| 556 |
|
|
|
| 557 |
|
|
|
| 558 |
|
|
|
| 559 |
|
|
#/***************************************************************************************************/
|
| 560 |
|
|
#/ get_parameters */
|
| 561 |
|
|
#/ */
|
| 562 |
|
|
#/ returns array of all parameters in a component */
|
| 563 |
|
|
#/ */
|
| 564 |
|
|
#/ my @parameters = yp::lib::get_parameters($vendor,$library,$component,$version,$configuration); */
|
| 565 |
|
|
#/ */
|
| 566 |
|
|
#/***************************************************************************************************/
|
| 567 |
|
|
|
| 568 |
|
|
sub get_parameters
|
| 569 |
|
|
{
|
| 570 |
|
|
my @params = @_;
|
| 571 |
|
|
my $configuration = pop(@params);
|
| 572 |
|
|
my $version = pop(@params);
|
| 573 |
|
|
my $component = pop(@params);
|
| 574 |
|
|
my $library = pop(@params);
|
| 575 |
|
|
my $vendor = pop(@params);
|
| 576 |
|
|
my $elab_db_filename = yp::lib::get_elab_db_filename($vendor,$library,$component,$version,$configuration);
|
| 577 |
|
|
my $ports_db = new BerkeleyDB::Hash( -Filename => $elab_db_filename, -Flags => DB_CREATE ) or die "Cannot open ${elab_db_filename}: $!";
|
| 578 |
|
|
my @parameters = ();
|
| 579 |
|
|
my $key;
|
| 580 |
|
|
my $value;
|
| 581 |
|
|
my $port_cursor = $ports_db->db_cursor() ;
|
| 582 |
|
|
while ($port_cursor->c_get($key, $value, DB_NEXT) == 0)
|
| 583 |
|
|
{
|
| 584 |
|
|
my $parameter_root;
|
| 585 |
|
|
my $parameter;
|
| 586 |
|
|
( $parameter_root,$parameter) = split( /\__/ , $key);
|
| 587 |
|
|
if($parameter_root eq "parameter_root")
|
| 588 |
|
|
{
|
| 589 |
|
|
push (@parameters, "${parameter}::${value}");
|
| 590 |
|
|
}
|
| 591 |
|
|
}
|
| 592 |
|
|
|
| 593 |
|
|
my $status = $port_cursor->c_close() ;
|
| 594 |
134 |
jt_eaton |
$ports_db -> db_close();
|
| 595 |
133 |
jt_eaton |
@parameters = sys::lib::trim_sort(@parameters);
|
| 596 |
|
|
return(@parameters);
|
| 597 |
|
|
}
|
| 598 |
|
|
|
| 599 |
|
|
|
| 600 |
|
|
|
| 601 |
|
|
|
| 602 |
|
|
|
| 603 |
|
|
|
| 604 |
|
|
#/***************************************************************************************************/
|
| 605 |
|
|
#/ get_instance_names */
|
| 606 |
|
|
#/ */
|
| 607 |
|
|
#/ returns array of all instance_names in a component */
|
| 608 |
|
|
#/ */
|
| 609 |
|
|
#/ my @instance_names = yp::lib::get_instance_names($vendor,$library,$component,$version,$configuration); */
|
| 610 |
|
|
#/ */
|
| 611 |
|
|
#/***************************************************************************************************/
|
| 612 |
|
|
|
| 613 |
|
|
sub get_instance_names
|
| 614 |
|
|
{
|
| 615 |
|
|
my @params = @_;
|
| 616 |
|
|
my $configuration = pop(@params);
|
| 617 |
|
|
my $version = pop(@params);
|
| 618 |
|
|
my $component = pop(@params);
|
| 619 |
|
|
my $library = pop(@params);
|
| 620 |
|
|
my $vendor = pop(@params);
|
| 621 |
|
|
my $elab_db_filename = yp::lib::get_elab_db_filename($vendor,$library,$component,$version,$configuration);
|
| 622 |
|
|
my $ports_db = new BerkeleyDB::Hash( -Filename => $elab_db_filename, -Flags => DB_CREATE ) or die "Cannot open ${elab_db_filename}: $!";
|
| 623 |
|
|
my @instance_names = ();
|
| 624 |
|
|
my $field1;
|
| 625 |
|
|
my $field2;
|
| 626 |
|
|
my $key;
|
| 627 |
|
|
my $value;
|
| 628 |
|
|
|
| 629 |
134 |
jt_eaton |
|
| 630 |
133 |
jt_eaton |
my $port_cursor = $ports_db->db_cursor() ;
|
| 631 |
|
|
while ($port_cursor->c_get($key, $value, DB_NEXT) == 0)
|
| 632 |
|
|
{
|
| 633 |
|
|
( $field1,$field2) = split( /\./ , $key);
|
| 634 |
|
|
|
| 635 |
|
|
|
| 636 |
|
|
if(($field1 eq "component___root")&& ($key eq "${field1}.${field2}" ) )
|
| 637 |
|
|
{
|
| 638 |
|
|
|
| 639 |
|
|
push (@instance_names, "${field2}");
|
| 640 |
|
|
}
|
| 641 |
|
|
}
|
| 642 |
|
|
|
| 643 |
|
|
my $status = $port_cursor->c_close() ;
|
| 644 |
134 |
jt_eaton |
$ports_db -> db_close();
|
| 645 |
133 |
jt_eaton |
@instance_names = sys::lib::trim_sort(@instance_names);
|
| 646 |
|
|
return(@instance_names);
|
| 647 |
|
|
}
|
| 648 |
|
|
|
| 649 |
|
|
|
| 650 |
|
|
|
| 651 |
|
|
#/***********************************************************************************************************/
|
| 652 |
|
|
#/ get_instance_module_name */
|
| 653 |
|
|
#/ */
|
| 654 |
134 |
jt_eaton |
#/ returns the module name of an instance */
|
| 655 |
133 |
jt_eaton |
#/ */
|
| 656 |
|
|
#/ my $module_name = yp::lib::get_instance_module_name($vendor,$library,$component,$version,$instance,$configuration ); */
|
| 657 |
|
|
#/ */
|
| 658 |
|
|
#/***********************************************************************************************************/
|
| 659 |
|
|
|
| 660 |
|
|
sub get_instance_module_name
|
| 661 |
|
|
{
|
| 662 |
|
|
my @params = @_;
|
| 663 |
|
|
my $configuration = pop(@params);
|
| 664 |
|
|
my $instance = pop(@params);
|
| 665 |
|
|
my $version = pop(@params);
|
| 666 |
|
|
my $component = pop(@params);
|
| 667 |
|
|
my $library = pop(@params);
|
| 668 |
|
|
my $vendor = pop(@params);
|
| 669 |
|
|
my $elab_db_filename = yp::lib::get_elab_db_filename($vendor,$library,$component,$version,$configuration);
|
| 670 |
|
|
my $elab_db = new BerkeleyDB::Hash( -Filename => $elab_db_filename, -Flags => DB_CREATE ) or die "Cannot open ${elab_db_filename}: $!";
|
| 671 |
|
|
my $module_name;
|
| 672 |
|
|
my $module_vlnv;
|
| 673 |
|
|
my $module_vendor;
|
| 674 |
|
|
my $module_library;
|
| 675 |
|
|
my $module_component;
|
| 676 |
|
|
my $module_version;
|
| 677 |
|
|
$elab_db->db_get("component___root.${instance}", $module_vlnv );
|
| 678 |
|
|
( $module_vendor,$module_library,$module_component,$module_version) = split( /\:/ , $module_vlnv);
|
| 679 |
|
|
$module_name = yp::lib::get_module_name($module_vendor,$module_library,$module_component,$module_version) ;
|
| 680 |
134 |
jt_eaton |
$elab_db -> db_close();
|
| 681 |
133 |
jt_eaton |
return($module_name);
|
| 682 |
|
|
}
|
| 683 |
|
|
|
| 684 |
|
|
|
| 685 |
|
|
|
| 686 |
|
|
|
| 687 |
134 |
jt_eaton |
#/*************************************************************************************************************/
|
| 688 |
|
|
#/ get_instance_vlnvc */
|
| 689 |
|
|
#/ */
|
| 690 |
|
|
#/ returns the ven,lib,cmp,ver,cfg name for a components instance */
|
| 691 |
|
|
#/ */
|
| 692 |
|
|
#/ my $vlnvc = yp::lib::get_instance_vlnvc($vendor,$library,$component,$version,$instance,$configuration ); */
|
| 693 |
|
|
#/ */
|
| 694 |
|
|
#/*************************************************************************************************************/
|
| 695 |
133 |
jt_eaton |
|
| 696 |
134 |
jt_eaton |
sub get_instance_vlnvc
|
| 697 |
|
|
{
|
| 698 |
|
|
my @params = @_;
|
| 699 |
|
|
my $configuration = pop(@params);
|
| 700 |
|
|
my $instance = pop(@params);
|
| 701 |
|
|
my $version = pop(@params);
|
| 702 |
|
|
my $component = pop(@params);
|
| 703 |
|
|
my $library = pop(@params);
|
| 704 |
|
|
my $vendor = pop(@params);
|
| 705 |
|
|
my $elab_db_filename = yp::lib::get_elab_db_filename($vendor,$library,$component,$version,$configuration);
|
| 706 |
|
|
my $elab_db = new BerkeleyDB::Hash( -Filename => $elab_db_filename, -Flags => DB_CREATE ) or die "Cannot open ${elab_db_filename}: $!";
|
| 707 |
133 |
jt_eaton |
|
| 708 |
134 |
jt_eaton |
my $module_vlnv;
|
| 709 |
|
|
|
| 710 |
|
|
$elab_db->db_get("component___root.${instance}", $module_vlnv );
|
| 711 |
|
|
$elab_db -> db_close();
|
| 712 |
|
|
return($module_vlnv);
|
| 713 |
|
|
}
|
| 714 |
|
|
|
| 715 |
|
|
|
| 716 |
|
|
|
| 717 |
|
|
|
| 718 |
|
|
|
| 719 |
|
|
|
| 720 |
133 |
jt_eaton |
#/*********************************************************************************************************/
|
| 721 |
|
|
#/ get_instance_conns */
|
| 722 |
|
|
#/ */
|
| 723 |
|
|
#/ returns array of all connections to an instance */
|
| 724 |
|
|
#/ */
|
| 725 |
|
|
#/ my @inst_conns = yp::lib::get_instance_conns($vendor,$library,$component,$version,$instance); */
|
| 726 |
|
|
#/ */
|
| 727 |
|
|
#/*********************************************************************************************************/
|
| 728 |
|
|
|
| 729 |
|
|
sub get_instance_conns
|
| 730 |
|
|
{
|
| 731 |
|
|
my @params = @_;
|
| 732 |
|
|
my $instance = pop(@params);
|
| 733 |
|
|
my $version = pop(@params);
|
| 734 |
|
|
my $component = pop(@params);
|
| 735 |
|
|
my $library = pop(@params);
|
| 736 |
|
|
my $vendor = pop(@params);
|
| 737 |
|
|
|
| 738 |
134 |
jt_eaton |
my $io_busses_db_filename = yp::lib::get_io_busses_db_filename($vendor,$library,$component,$version,"default");
|
| 739 |
133 |
jt_eaton |
|
| 740 |
|
|
|
| 741 |
|
|
|
| 742 |
|
|
|
| 743 |
|
|
unless (-e ${io_busses_db_filename } )
|
| 744 |
|
|
{
|
| 745 |
|
|
|
| 746 |
|
|
my $cmd = "./tools/verilog/gen_ports -vendor $vendor -library $library -component $component -version $version ";
|
| 747 |
|
|
if (system($cmd)) {}
|
| 748 |
|
|
$cmd = "./tools/verilog/gen_signals -vendor $vendor -library $library -component $component -version $version ";
|
| 749 |
|
|
if (system($cmd)) {}
|
| 750 |
|
|
}
|
| 751 |
|
|
|
| 752 |
|
|
|
| 753 |
|
|
|
| 754 |
|
|
my $ports_db = new BerkeleyDB::Hash( -Filename => $io_busses_db_filename, -Flags => DB_CREATE ) or die "Cannot open ${io_busses_db_filename}: $!";
|
| 755 |
|
|
my @inst_conns = ();
|
| 756 |
|
|
my $key;
|
| 757 |
|
|
my $value;
|
| 758 |
|
|
my $port_cursor = $ports_db->db_cursor() ;
|
| 759 |
|
|
while ($port_cursor->c_get($key, $value, DB_NEXT) == 0)
|
| 760 |
|
|
{
|
| 761 |
|
|
my $Instance;
|
| 762 |
|
|
my $instance_name;
|
| 763 |
|
|
my $instance_busref;
|
| 764 |
|
|
( $Instance,$instance_name,$instance_busref) = split( /\./ , $key);
|
| 765 |
|
|
if(($Instance eq "Instance")&& ($instance eq $instance_name))
|
| 766 |
|
|
{
|
| 767 |
|
|
my $new_key;
|
| 768 |
|
|
my $new_value;
|
| 769 |
|
|
my $bus_cursor = $ports_db->db_cursor() ;
|
| 770 |
|
|
while ($bus_cursor->c_get($new_key, $new_value, DB_NEXT) == 0)
|
| 771 |
|
|
{
|
| 772 |
|
|
my $IXstance;
|
| 773 |
|
|
my $IX_inst;
|
| 774 |
|
|
my $IX_busref;
|
| 775 |
|
|
my $IX_port;
|
| 776 |
|
|
( $IXstance,$IX_inst,$IX_busref,$IX_port) = split( /\./ , $new_key);
|
| 777 |
|
|
if(($IXstance eq "IXstance") && ($IX_inst eq $instance_name) &&($IX_busref eq $instance_busref) )
|
| 778 |
|
|
{
|
| 779 |
|
|
my $logname;
|
| 780 |
|
|
my $direction;
|
| 781 |
|
|
my $wire;
|
| 782 |
|
|
my $vector;
|
| 783 |
|
|
my $left;
|
| 784 |
|
|
my $right;
|
| 785 |
|
|
my $port;
|
| 786 |
|
|
($logname,$direction,$wire,$vector,$left,$right,$port ) = split( /\:/ , $new_value);
|
| 787 |
|
|
my $type;
|
| 788 |
|
|
my $signal;
|
| 789 |
|
|
|
| 790 |
|
|
$ports_db->db_get("BusRef.${value}.${IX_port}", $new_value );
|
| 791 |
|
|
|
| 792 |
|
|
|
| 793 |
|
|
($logname,$type,$wire,$vector,$left,$right,$signal ) = split( /\:/ , $new_value);
|
| 794 |
|
|
|
| 795 |
|
|
|
| 796 |
|
|
if($vector eq "vector")
|
| 797 |
|
|
{
|
| 798 |
|
|
push (@inst_conns, ".${port} ( ${signal}[${left}:${right}] )");
|
| 799 |
|
|
}
|
| 800 |
|
|
else
|
| 801 |
|
|
{
|
| 802 |
|
|
push (@inst_conns, ".${port} ( ${signal} )");
|
| 803 |
|
|
}
|
| 804 |
|
|
}
|
| 805 |
|
|
}
|
| 806 |
|
|
my $status = $bus_cursor->c_close() ;
|
| 807 |
|
|
|
| 808 |
|
|
|
| 809 |
|
|
|
| 810 |
|
|
|
| 811 |
|
|
|
| 812 |
|
|
|
| 813 |
|
|
}
|
| 814 |
|
|
}
|
| 815 |
|
|
my $status = $port_cursor->c_close() ;
|
| 816 |
134 |
jt_eaton |
$ports_db -> db_close();
|
| 817 |
133 |
jt_eaton |
@inst_conns = sys::lib::trim_sort(@inst_conns);
|
| 818 |
|
|
return(@inst_conns);
|
| 819 |
|
|
}
|
| 820 |
|
|
|
| 821 |
|
|
|
| 822 |
|
|
|
| 823 |
|
|
|
| 824 |
|
|
#/*********************************************************************************************************/
|
| 825 |
|
|
#/ get_instance_adhoc_conns */
|
| 826 |
|
|
#/ */
|
| 827 |
|
|
#/ returns array of all connections to an instance */
|
| 828 |
|
|
#/ */
|
| 829 |
|
|
#/ my @inst_conns = yp::lib::get_instance_adhoc_conns($vendor,$library,$component,$version,$instance); */
|
| 830 |
|
|
#/ */
|
| 831 |
|
|
#/*********************************************************************************************************/
|
| 832 |
|
|
|
| 833 |
|
|
sub get_instance_adhoc_conns
|
| 834 |
|
|
{
|
| 835 |
|
|
my @params = @_;
|
| 836 |
|
|
my $instance = pop(@params);
|
| 837 |
|
|
my $version = pop(@params);
|
| 838 |
|
|
my $component = pop(@params);
|
| 839 |
|
|
my $library = pop(@params);
|
| 840 |
|
|
my $vendor = pop(@params);
|
| 841 |
|
|
|
| 842 |
134 |
jt_eaton |
my $io_busses_db_filename = yp::lib::get_io_busses_db_filename($vendor,$library,$component,$version,"default");
|
| 843 |
133 |
jt_eaton |
|
| 844 |
|
|
unless (-e ${io_busses_db_filename } )
|
| 845 |
|
|
{
|
| 846 |
|
|
|
| 847 |
|
|
my $cmd = "./tools/verilog/gen_ports -vendor $vendor -library $library -component $component -version $version ";
|
| 848 |
|
|
if (system($cmd)) {}
|
| 849 |
|
|
$cmd = "./tools/verilog/gen_signals -vendor $vendor -library $library -component $component -version $version ";
|
| 850 |
|
|
if (system($cmd)) {}
|
| 851 |
|
|
}
|
| 852 |
|
|
|
| 853 |
|
|
|
| 854 |
|
|
|
| 855 |
|
|
my $ports_db = new BerkeleyDB::Hash( -Filename => $io_busses_db_filename, -Flags => DB_CREATE ) or die "Cannot open ${io_busses_db_filename}: $!";
|
| 856 |
|
|
my @inst_conns = ();
|
| 857 |
|
|
my $key;
|
| 858 |
|
|
my $value;
|
| 859 |
|
|
my $port_cursor = $ports_db->db_cursor() ;
|
| 860 |
|
|
while ($port_cursor->c_get($key, $value, DB_NEXT) == 0)
|
| 861 |
|
|
{
|
| 862 |
|
|
|
| 863 |
|
|
my $adhoc_inst;
|
| 864 |
|
|
my $port;
|
| 865 |
|
|
( $adhoc_inst,$port) = split( /\__/ , $key);
|
| 866 |
|
|
if($adhoc_inst eq "AdHoc_${instance}")
|
| 867 |
|
|
{
|
| 868 |
|
|
my $sig1;
|
| 869 |
|
|
my $sig2;
|
| 870 |
|
|
my $wire;
|
| 871 |
|
|
my $vector;
|
| 872 |
|
|
my $left;
|
| 873 |
|
|
my $right;
|
| 874 |
|
|
|
| 875 |
|
|
|
| 876 |
|
|
|
| 877 |
|
|
( $sig1,$sig2,$wire,$vector,$left,$right) = split( /\:/ , $value);
|
| 878 |
|
|
|
| 879 |
|
|
if($sig1 eq "***") {$sig1 = " ";}
|
| 880 |
|
|
if($vector eq "vector")
|
| 881 |
|
|
{
|
| 882 |
|
|
push (@inst_conns, " .${port} ( ${sig1}[${left}:${right}] )");
|
| 883 |
|
|
}
|
| 884 |
|
|
else
|
| 885 |
|
|
{
|
| 886 |
|
|
push (@inst_conns, " .${port} ( ${sig1} )");
|
| 887 |
|
|
}
|
| 888 |
|
|
|
| 889 |
|
|
}
|
| 890 |
|
|
|
| 891 |
|
|
}
|
| 892 |
|
|
my $status = $port_cursor->c_close() ;
|
| 893 |
134 |
jt_eaton |
$ports_db -> db_close();
|
| 894 |
133 |
jt_eaton |
@inst_conns = sys::lib::trim_sort(@inst_conns);
|
| 895 |
|
|
return(@inst_conns);
|
| 896 |
|
|
}
|
| 897 |
|
|
|
| 898 |
|
|
|
| 899 |
|
|
|
| 900 |
|
|
|
| 901 |
|
|
|
| 902 |
|
|
|
| 903 |
|
|
|
| 904 |
|
|
|
| 905 |
|
|
#/***************************************************************************************************/
|
| 906 |
131 |
jt_eaton |
#/ get_busses */
|
| 907 |
|
|
#/ */
|
| 908 |
|
|
#/ returns array of all busses in a component */
|
| 909 |
|
|
#/ */
|
| 910 |
|
|
#/ my @signals = yp::lib::get_busses($vendor,$library,$component,$version); */
|
| 911 |
|
|
#/ */
|
| 912 |
|
|
#/***************************************************************************************************/
|
| 913 |
|
|
|
| 914 |
|
|
sub get_busses
|
| 915 |
|
|
{
|
| 916 |
|
|
my @params = @_;
|
| 917 |
|
|
my $version = pop(@params);
|
| 918 |
|
|
my $component = pop(@params);
|
| 919 |
|
|
my $library = pop(@params);
|
| 920 |
|
|
my $vendor = pop(@params);
|
| 921 |
|
|
|
| 922 |
|
|
|
| 923 |
134 |
jt_eaton |
my $io_busses_db_filename = yp::lib::get_io_busses_db_filename($vendor,$library,$component,$version,"default");
|
| 924 |
133 |
jt_eaton |
|
| 925 |
131 |
jt_eaton |
unless (-e ${io_busses_db_filename } )
|
| 926 |
|
|
{
|
| 927 |
|
|
|
| 928 |
|
|
my $cmd = "./tools/verilog/gen_ports -vendor $vendor -library $library -component $component -version $version ";
|
| 929 |
|
|
if (system($cmd)) {}
|
| 930 |
|
|
}
|
| 931 |
|
|
|
| 932 |
|
|
my $ports_db = new BerkeleyDB::Hash( -Filename => $io_busses_db_filename, -Flags => DB_CREATE ) or die "Cannot open ${io_busses_db_filename}: $!";
|
| 933 |
|
|
my @busses = ();
|
| 934 |
|
|
my $key;
|
| 935 |
|
|
my $value;
|
| 936 |
|
|
my ${key_type};
|
| 937 |
|
|
my ${busref};
|
| 938 |
|
|
my ${conn};
|
| 939 |
|
|
my ${log_name};
|
| 940 |
|
|
my ${direction};
|
| 941 |
|
|
my ${type};
|
| 942 |
|
|
my ${vector};
|
| 943 |
|
|
my ${left};
|
| 944 |
|
|
my ${right};
|
| 945 |
|
|
my ${phy_name};
|
| 946 |
|
|
my $port_cursor = $ports_db->db_cursor() ;
|
| 947 |
|
|
while ($port_cursor->c_get($key, $value, DB_NEXT) == 0)
|
| 948 |
|
|
{
|
| 949 |
|
|
( ${key_type},${busref},${conn}) = split( /\./ , $key);
|
| 950 |
|
|
( ${log_name},${direction},${type},${vector},${left},${right},${phy_name}) = split ':', $value;
|
| 951 |
|
|
|
| 952 |
|
|
if(($key_type eq "BusRef"))
|
| 953 |
|
|
{
|
| 954 |
|
|
push (@busses, "${busref}:::${conn}:::${phy_name}:::${log_name}:::${direction}:::${type}:::${vector}:::${left}:::${right}");
|
| 955 |
|
|
}
|
| 956 |
|
|
}
|
| 957 |
|
|
my $status = $port_cursor->c_close() ;
|
| 958 |
134 |
jt_eaton |
$ports_db -> db_close();
|
| 959 |
131 |
jt_eaton |
@busses = sys::lib::trim_sort(@busses);
|
| 960 |
|
|
return(@busses);
|
| 961 |
|
|
}
|
| 962 |
|
|
|
| 963 |
|
|
|
| 964 |
134 |
jt_eaton |
|
| 965 |
135 |
jt_eaton |
#/********************************************************************************************************/
|
| 966 |
|
|
#/ get_files */
|
| 967 |
|
|
#/ */
|
| 968 |
|
|
#/ returns array of all verilog usertypes in a component */
|
| 969 |
|
|
#/ */
|
| 970 |
|
|
#/ my @fragments = yp::lib::get_files($vendor,$library,$component,$version,$fileSet_name,"fragment"); */
|
| 971 |
|
|
#/ */
|
| 972 |
|
|
#/********************************************************************************************************/
|
| 973 |
134 |
jt_eaton |
|
| 974 |
|
|
sub get_files
|
| 975 |
|
|
{
|
| 976 |
|
|
my @params = @_;
|
| 977 |
|
|
my $userType = pop(@params);
|
| 978 |
|
|
my $fileSet_name = pop(@params);
|
| 979 |
|
|
my $version = pop(@params);
|
| 980 |
|
|
my $component = pop(@params);
|
| 981 |
|
|
my $library = pop(@params);
|
| 982 |
|
|
my $vendor = pop(@params);
|
| 983 |
|
|
my $elab_db_filename = yp::lib::get_elab_db_filename($vendor,$library,$component,$version,"default");
|
| 984 |
135 |
jt_eaton |
my $elab_db = new BerkeleyDB::Hash( -Filename => $elab_db_filename, -Flags => DB_CREATE ) or die "Cannot open ${elab_db_filename}: $!";
|
| 985 |
134 |
jt_eaton |
my @files = ();
|
| 986 |
|
|
my $key;
|
| 987 |
|
|
my $value;
|
| 988 |
|
|
my $port_cursor = $elab_db->db_cursor() ;
|
| 989 |
|
|
while ($port_cursor->c_get($key, $value, DB_NEXT) == 0)
|
| 990 |
|
|
{
|
| 991 |
|
|
my $FILE_root;
|
| 992 |
|
|
my $fragment;
|
| 993 |
|
|
( $FILE_root,$fragment) = split( /\__/ , $key);
|
| 994 |
|
|
if($FILE_root eq "FILE_verilogSource_${fileSet_name}_${userType}")
|
| 995 |
|
|
{
|
| 996 |
|
|
push (@files, "${value}");
|
| 997 |
|
|
}
|
| 998 |
|
|
}
|
| 999 |
|
|
|
| 1000 |
|
|
my $status = $port_cursor->c_close() ;
|
| 1001 |
|
|
$elab_db -> db_close();
|
| 1002 |
|
|
@files = sys::lib::trim_sort(@files);
|
| 1003 |
|
|
return(@files);
|
| 1004 |
|
|
}
|
| 1005 |
|
|
|
| 1006 |
|
|
|
| 1007 |
|
|
|
| 1008 |
|
|
|
| 1009 |
|
|
|
| 1010 |
|
|
|
| 1011 |
|
|
|
| 1012 |
|
|
#/***************************************************************************************************/
|
| 1013 |
131 |
jt_eaton |
#/ get_absDef_db_filename */
|
| 1014 |
|
|
#/ */
|
| 1015 |
|
|
#/ returns full path name to abstractionDefinition database filename */
|
| 1016 |
|
|
#/ */
|
| 1017 |
|
|
#/ my $absDef_filename = yp::lib::get_absDef_db_filename($vendor,$library,$component,$version); */
|
| 1018 |
|
|
#/ */
|
| 1019 |
|
|
#/***************************************************************************************************/
|
| 1020 |
|
|
|
| 1021 |
|
|
sub get_absDef_db_filename
|
| 1022 |
|
|
{
|
| 1023 |
|
|
my @params = @_;
|
| 1024 |
|
|
my $version = pop(@params);
|
| 1025 |
|
|
my $component = pop(@params);
|
| 1026 |
|
|
my $library = pop(@params);
|
| 1027 |
|
|
my $vendor = pop(@params);
|
| 1028 |
|
|
my $absDef_db_filename = "${io_ports}/${vendor}__${library}/${component}/${component}_${version}_ABSDEF.dbm";
|
| 1029 |
|
|
|
| 1030 |
|
|
if(-e ${absDef_db_filename } )
|
| 1031 |
|
|
{
|
| 1032 |
|
|
return("${absDef_db_filename}");
|
| 1033 |
|
|
}
|
| 1034 |
|
|
my $cmd = "./tools/busdefs/gen_busdef -vendor $vendor -library $library -component $component -version $version ";
|
| 1035 |
|
|
if (system($cmd)) {}
|
| 1036 |
|
|
|
| 1037 |
|
|
return("${absDef_db_filename}");
|
| 1038 |
|
|
}
|
| 1039 |
|
|
|
| 1040 |
|
|
|
| 1041 |
|
|
|
| 1042 |
|
|
|
| 1043 |
|
|
|
| 1044 |
|
|
|
| 1045 |
|
|
|
| 1046 |
|
|
|
| 1047 |
|
|
|
| 1048 |
|
|
#/***********************************************************************************************/
|
| 1049 |
130 |
jt_eaton |
#/ find_ipxact_component */
|
| 1050 |
118 |
jt_eaton |
#/ */
|
| 1051 |
130 |
jt_eaton |
#/ returns full path name to ip-xact component file */
|
| 1052 |
118 |
jt_eaton |
#/ */
|
| 1053 |
130 |
jt_eaton |
#/ my $spirit_type_file = yp::lib::find_ipxact_component($vendor,$library,$component,$version);*/
|
| 1054 |
118 |
jt_eaton |
#/ */
|
| 1055 |
|
|
#/***********************************************************************************************/
|
| 1056 |
117 |
jt_eaton |
|
| 1057 |
130 |
jt_eaton |
sub find_ipxact_component
|
| 1058 |
117 |
jt_eaton |
{
|
| 1059 |
|
|
my @params = @_;
|
| 1060 |
|
|
my $version = pop(@params);
|
| 1061 |
|
|
my $component = pop(@params);
|
| 1062 |
130 |
jt_eaton |
my $library = pop(@params);
|
| 1063 |
117 |
jt_eaton |
my $vendor = pop(@params);
|
| 1064 |
130 |
jt_eaton |
my $comp_data;
|
| 1065 |
|
|
my $component_version;
|
| 1066 |
|
|
my $component_xml;
|
| 1067 |
|
|
my $comp_xml_sep;
|
| 1068 |
|
|
$component_db->db_get("${vendor}__${library}_${component}_${version}", $comp_data );
|
| 1069 |
|
|
( $component_xml, $comp_xml_sep,$component_version ) = split ':', $comp_data;
|
| 1070 |
117 |
jt_eaton |
|
| 1071 |
130 |
jt_eaton |
return("$component_xml");
|
| 1072 |
118 |
jt_eaton |
}
|
| 1073 |
|
|
|
| 1074 |
|
|
|
| 1075 |
|
|
|
| 1076 |
130 |
jt_eaton |
#/***********************************************************************************************/
|
| 1077 |
|
|
#/ find_ipxact_design */
|
| 1078 |
|
|
#/ */
|
| 1079 |
|
|
#/ returns full path name to ip-xact design file */
|
| 1080 |
|
|
#/ */
|
| 1081 |
|
|
#/ my $spirit_type_file = yp::lib::find_ipxact_design($vendor,$library,$component,$version); */
|
| 1082 |
|
|
#/ */
|
| 1083 |
|
|
#/***********************************************************************************************/
|
| 1084 |
118 |
jt_eaton |
|
| 1085 |
130 |
jt_eaton |
sub find_ipxact_design
|
| 1086 |
117 |
jt_eaton |
{
|
| 1087 |
|
|
my @params = @_;
|
| 1088 |
|
|
my $version = pop(@params);
|
| 1089 |
|
|
my $component = pop(@params);
|
| 1090 |
130 |
jt_eaton |
my $library = pop(@params);
|
| 1091 |
117 |
jt_eaton |
my $vendor = pop(@params);
|
| 1092 |
135 |
jt_eaton |
my $design_data;
|
| 1093 |
130 |
jt_eaton |
my $design_xml_sep ;
|
| 1094 |
|
|
my $design_xml_file ;
|
| 1095 |
|
|
my $design_version;
|
| 1096 |
117 |
jt_eaton |
|
| 1097 |
135 |
jt_eaton |
$design_db->db_get("${vendor}__${library}_${component}_${version}", $design_data );
|
| 1098 |
|
|
( $design_xml_file, $design_xml_sep,$design_version ) = split ':', $design_data;
|
| 1099 |
117 |
jt_eaton |
|
| 1100 |
130 |
jt_eaton |
return("$design_xml_file");
|
| 1101 |
117 |
jt_eaton |
}
|
| 1102 |
|
|
|
| 1103 |
|
|
|
| 1104 |
130 |
jt_eaton |
#/**************************************************************************************************************/
|
| 1105 |
|
|
#/ find_ipxact_abstractionDefinition */
|
| 1106 |
|
|
#/ */
|
| 1107 |
|
|
#/ returns full path name to ip-xact abstractionDefinition file */
|
| 1108 |
|
|
#/ */
|
| 1109 |
|
|
#/ my $spirit_type_file = yp::lib::find_ipxact_abstractionDefinition($vendor,$library,$component,$version); */
|
| 1110 |
|
|
#/ */
|
| 1111 |
|
|
#/**************************************************************************************************************/
|
| 1112 |
117 |
jt_eaton |
|
| 1113 |
130 |
jt_eaton |
sub find_ipxact_abstractionDefinition
|
| 1114 |
117 |
jt_eaton |
{
|
| 1115 |
|
|
my @params = @_;
|
| 1116 |
|
|
my $version = pop(@params);
|
| 1117 |
|
|
my $component = pop(@params);
|
| 1118 |
130 |
jt_eaton |
my $library = pop(@params);
|
| 1119 |
117 |
jt_eaton |
my $vendor = pop(@params);
|
| 1120 |
|
|
|
| 1121 |
135 |
jt_eaton |
my $design_data;
|
| 1122 |
130 |
jt_eaton |
my $design_xml_sep ;
|
| 1123 |
|
|
my $design_xml_file ;
|
| 1124 |
|
|
my $design_version;
|
| 1125 |
131 |
jt_eaton |
my $design_name;
|
| 1126 |
|
|
my $design_library;
|
| 1127 |
|
|
my $design_vendor;
|
| 1128 |
117 |
jt_eaton |
|
| 1129 |
131 |
jt_eaton |
|
| 1130 |
135 |
jt_eaton |
$abstractionDefinition_db->db_get("${vendor}__${library}_${component}_${version}", $design_data );
|
| 1131 |
|
|
( $design_xml_file, $design_xml_sep,$design_version,$design_name,$design_library,$design_vendor ) = split ':', $design_data;
|
| 1132 |
117 |
jt_eaton |
|
| 1133 |
130 |
jt_eaton |
return("$design_xml_file");
|
| 1134 |
117 |
jt_eaton |
|
| 1135 |
|
|
}
|
| 1136 |
|
|
|
| 1137 |
|
|
|
| 1138 |
|
|
|
| 1139 |
130 |
jt_eaton |
#/**************************************************************************************************************/
|
| 1140 |
|
|
#/ find_ipxact_busDefinition */
|
| 1141 |
|
|
#/ */
|
| 1142 |
|
|
#/ returns full path name to ip-xact busDefinition file */
|
| 1143 |
|
|
#/ */
|
| 1144 |
|
|
#/ my $spirit_type_file = yp::lib::find_ipxact_busDefinition($vendor,$library,$component,$version); */
|
| 1145 |
|
|
#/ */
|
| 1146 |
|
|
#/**************************************************************************************************************/
|
| 1147 |
117 |
jt_eaton |
|
| 1148 |
130 |
jt_eaton |
sub find_ipxact_busDefinition
|
| 1149 |
117 |
jt_eaton |
{
|
| 1150 |
|
|
my @params = @_;
|
| 1151 |
|
|
my $version = pop(@params);
|
| 1152 |
|
|
my $component = pop(@params);
|
| 1153 |
130 |
jt_eaton |
my $library = pop(@params);
|
| 1154 |
117 |
jt_eaton |
my $vendor = pop(@params);
|
| 1155 |
|
|
|
| 1156 |
135 |
jt_eaton |
my $design_data;
|
| 1157 |
130 |
jt_eaton |
my $design_xml_sep ;
|
| 1158 |
|
|
my $design_xml_file ;
|
| 1159 |
|
|
my $design_version;
|
| 1160 |
117 |
jt_eaton |
|
| 1161 |
|
|
|
| 1162 |
135 |
jt_eaton |
$busDefinition_db->db_get("${vendor}__${library}_${component}_${version}", $design_data );
|
| 1163 |
|
|
( $design_xml_file, $design_xml_sep,$design_version ) = split ':', $design_data;
|
| 1164 |
117 |
jt_eaton |
|
| 1165 |
130 |
jt_eaton |
return("$design_xml_file");
|
| 1166 |
117 |
jt_eaton |
}
|
| 1167 |
|
|
|
| 1168 |
|
|
|
| 1169 |
|
|
|
| 1170 |
130 |
jt_eaton |
#/**************************************************************************************************************/
|
| 1171 |
|
|
#/ find_libraryConfiguration */
|
| 1172 |
|
|
#/ */
|
| 1173 |
|
|
#/ returns full path name to socgen libraryConfiguration xml file */
|
| 1174 |
|
|
#/ */
|
| 1175 |
|
|
#/ my $socgen_file = yp::lib::find_libraryConfiguration($vendor,$library); */
|
| 1176 |
|
|
#/ */
|
| 1177 |
|
|
#/**************************************************************************************************************/
|
| 1178 |
117 |
jt_eaton |
|
| 1179 |
130 |
jt_eaton |
sub find_libraryConfiguration
|
| 1180 |
117 |
jt_eaton |
{
|
| 1181 |
|
|
my @params = @_;
|
| 1182 |
130 |
jt_eaton |
my $library = pop(@params);
|
| 1183 |
117 |
jt_eaton |
my $vendor = pop(@params);
|
| 1184 |
|
|
|
| 1185 |
130 |
jt_eaton |
my $libraryConfiguration_xml;
|
| 1186 |
|
|
$libraryConfiguration_db->db_get("${vendor}__${library}", $libraryConfiguration_xml );
|
| 1187 |
|
|
return("$libraryConfiguration_xml");
|
| 1188 |
117 |
jt_eaton |
}
|
| 1189 |
|
|
|
| 1190 |
|
|
|
| 1191 |
130 |
jt_eaton |
#/**************************************************************************************************************/
|
| 1192 |
|
|
#/ find_componentConfiguration */
|
| 1193 |
|
|
#/ */
|
| 1194 |
|
|
#/ returns full path name to socgen componentConfiguration xml file */
|
| 1195 |
|
|
#/ */
|
| 1196 |
|
|
#/ my $socgen_file = yp::lib::find_componentConfiguration($vendor,$library,$component); */
|
| 1197 |
|
|
#/ */
|
| 1198 |
|
|
#/**************************************************************************************************************/
|
| 1199 |
117 |
jt_eaton |
|
| 1200 |
130 |
jt_eaton |
sub find_componentConfiguration
|
| 1201 |
117 |
jt_eaton |
{
|
| 1202 |
|
|
my @params = @_;
|
| 1203 |
|
|
my $component = pop(@params);
|
| 1204 |
130 |
jt_eaton |
my $library = pop(@params);
|
| 1205 |
117 |
jt_eaton |
my $vendor = pop(@params);
|
| 1206 |
|
|
|
| 1207 |
130 |
jt_eaton |
my $componentConfiguration_xml;
|
| 1208 |
|
|
$componentConfiguration_db->db_get("${vendor}__${library}_${component}", $componentConfiguration_xml );
|
| 1209 |
|
|
return("$componentConfiguration_xml");
|
| 1210 |
117 |
jt_eaton |
}
|
| 1211 |
|
|
|
| 1212 |
|
|
|
| 1213 |
|
|
|
| 1214 |
|
|
|
| 1215 |
130 |
jt_eaton |
#/**************************************************************************************************************/
|
| 1216 |
131 |
jt_eaton |
#/ find_component_repo */
|
| 1217 |
|
|
#/ */
|
| 1218 |
|
|
#/ returns repository that containing component */
|
| 1219 |
|
|
#/ */
|
| 1220 |
|
|
#/ my $repo_name = yp::lib::find_component_repo($vendor,$library,$component); */
|
| 1221 |
|
|
#/ */
|
| 1222 |
|
|
#/**************************************************************************************************************/
|
| 1223 |
|
|
|
| 1224 |
|
|
sub find_component_repo {
|
| 1225 |
|
|
my @params = @_;
|
| 1226 |
|
|
my $component = pop(@params);
|
| 1227 |
|
|
my $library = pop(@params);
|
| 1228 |
|
|
my $vendor = pop(@params);
|
| 1229 |
|
|
|
| 1230 |
|
|
my $type;
|
| 1231 |
|
|
my $name;
|
| 1232 |
|
|
my $lib_comp_sep;
|
| 1233 |
|
|
my $repo_dir;
|
| 1234 |
|
|
my $repo_data;
|
| 1235 |
|
|
|
| 1236 |
|
|
$repo_db->db_get("${vendor}__${library}_${component}", $repo_data );
|
| 1237 |
|
|
( $type,$name, $lib_comp_sep, $repo_dir ) = split ':', $repo_data;
|
| 1238 |
|
|
return("${repo_dir}");
|
| 1239 |
|
|
}
|
| 1240 |
|
|
|
| 1241 |
|
|
|
| 1242 |
|
|
|
| 1243 |
|
|
|
| 1244 |
|
|
#/**************************************************************************************************************/
|
| 1245 |
|
|
#/ find_library_repo */
|
| 1246 |
|
|
#/ */
|
| 1247 |
|
|
#/ returns repository containing library */
|
| 1248 |
|
|
#/ */
|
| 1249 |
|
|
#/ my $repo_name = yp::lib::find_library_repo($vendor,$library); */
|
| 1250 |
|
|
#/ */
|
| 1251 |
|
|
#/**************************************************************************************************************/
|
| 1252 |
|
|
|
| 1253 |
|
|
sub find_library_repo {
|
| 1254 |
|
|
my @params = @_;
|
| 1255 |
|
|
my $library = pop(@params);
|
| 1256 |
|
|
my $vendor = pop(@params);
|
| 1257 |
|
|
|
| 1258 |
|
|
my $type;
|
| 1259 |
|
|
my $name;
|
| 1260 |
|
|
my $status;
|
| 1261 |
|
|
my $library_path;
|
| 1262 |
|
|
my $repo_dir;
|
| 1263 |
|
|
my $repo_data;
|
| 1264 |
|
|
|
| 1265 |
|
|
$repo_db->db_get("${vendor}__${library}", $repo_data );
|
| 1266 |
|
|
( $type,$name, $library_path,$status, $repo_dir ) = split ':', $repo_data;
|
| 1267 |
|
|
return("${repo_dir}");
|
| 1268 |
|
|
}
|
| 1269 |
|
|
|
| 1270 |
|
|
|
| 1271 |
|
|
|
| 1272 |
|
|
|
| 1273 |
|
|
#/**************************************************************************************************************/
|
| 1274 |
130 |
jt_eaton |
#/ find_lib_comp_sep */
|
| 1275 |
|
|
#/ */
|
| 1276 |
|
|
#/ returns libraries path to components */
|
| 1277 |
|
|
#/ */
|
| 1278 |
|
|
#/ my $lib_comp_sep = yp::lib::find_lib_comp_sep($vendor,$library,$component); */
|
| 1279 |
|
|
#/ */
|
| 1280 |
|
|
#/**************************************************************************************************************/
|
| 1281 |
120 |
jt_eaton |
|
| 1282 |
117 |
jt_eaton |
sub find_lib_comp_sep
|
| 1283 |
|
|
{
|
| 1284 |
|
|
my @params = @_;
|
| 1285 |
127 |
jt_eaton |
my $component = pop(@params);
|
| 1286 |
130 |
jt_eaton |
my $library = pop(@params);
|
| 1287 |
117 |
jt_eaton |
my $vendor = pop(@params);
|
| 1288 |
|
|
|
| 1289 |
130 |
jt_eaton |
my $type;
|
| 1290 |
|
|
my $name;
|
| 1291 |
|
|
my $lib_comp_sep;
|
| 1292 |
131 |
jt_eaton |
my $repo_dir;
|
| 1293 |
130 |
jt_eaton |
my $repo_data;
|
| 1294 |
117 |
jt_eaton |
|
| 1295 |
130 |
jt_eaton |
$repo_db->db_get("${vendor}__${library}_${component}", $repo_data );
|
| 1296 |
131 |
jt_eaton |
( $type,$name, $lib_comp_sep, $repo_dir ) = split ':', $repo_data;
|
| 1297 |
130 |
jt_eaton |
return("${lib_comp_sep}");
|
| 1298 |
120 |
jt_eaton |
}
|
| 1299 |
117 |
jt_eaton |
|
| 1300 |
120 |
jt_eaton |
|
| 1301 |
131 |
jt_eaton |
|
| 1302 |
130 |
jt_eaton |
#/***********************************************************************************************/
|
| 1303 |
|
|
#/ find_ipxact_comp_xml_sep */
|
| 1304 |
|
|
#/ */
|
| 1305 |
|
|
#/ */
|
| 1306 |
|
|
#/ */
|
| 1307 |
|
|
#/ my $comp_xml_sep = yp::lib::find_ipxact_component($vendor,$library,$component,$version); */
|
| 1308 |
|
|
#/ */
|
| 1309 |
|
|
#/***********************************************************************************************/
|
| 1310 |
120 |
jt_eaton |
|
| 1311 |
130 |
jt_eaton |
sub find_comp_xml_sep
|
| 1312 |
120 |
jt_eaton |
{
|
| 1313 |
|
|
my @params = @_;
|
| 1314 |
|
|
my $version = pop(@params);
|
| 1315 |
|
|
my $component = pop(@params);
|
| 1316 |
130 |
jt_eaton |
my $library = pop(@params);
|
| 1317 |
120 |
jt_eaton |
my $vendor = pop(@params);
|
| 1318 |
130 |
jt_eaton |
my $comp_data;
|
| 1319 |
|
|
my $comp_version;
|
| 1320 |
|
|
my $comp_xml_sep;
|
| 1321 |
|
|
my $component_xml;
|
| 1322 |
|
|
$component_db->db_get("${vendor}__${library}_${component}_${version}", $comp_data );
|
| 1323 |
|
|
( $component_xml, $comp_xml_sep, $comp_version) = split ':', $comp_data;
|
| 1324 |
|
|
return("$comp_xml_sep");
|
| 1325 |
120 |
jt_eaton |
}
|
| 1326 |
117 |
jt_eaton |
|
| 1327 |
|
|
|
| 1328 |
|
|
|
| 1329 |
|
|
|
| 1330 |
120 |
jt_eaton |
|
| 1331 |
|
|
|
| 1332 |
|
|
#/*********************************************************************************************/
|
| 1333 |
|
|
#/ find_lib_sw_dir */
|
| 1334 |
|
|
#/ */
|
| 1335 |
|
|
#/ returns library sw directory */
|
| 1336 |
|
|
#/ */
|
| 1337 |
|
|
#/ my $file_lib_sw_dir = yp::lib::find_file_lib_sw_dir($vendor,$library); */
|
| 1338 |
|
|
#/ */
|
| 1339 |
|
|
#/*********************************************************************************************/
|
| 1340 |
117 |
jt_eaton |
|
| 1341 |
120 |
jt_eaton |
sub find_lib_sw_dir
|
| 1342 |
|
|
{
|
| 1343 |
|
|
my @params = @_;
|
| 1344 |
130 |
jt_eaton |
my $library = pop(@params);
|
| 1345 |
120 |
jt_eaton |
my $vendor = pop(@params);
|
| 1346 |
130 |
jt_eaton |
my $parser = XML::LibXML->new();
|
| 1347 |
117 |
jt_eaton |
|
| 1348 |
130 |
jt_eaton |
my $lib_sw_dir ;
|
| 1349 |
|
|
if(yp::lib::find_libraryConfiguration($vendor,$library))
|
| 1350 |
|
|
{
|
| 1351 |
|
|
my $socgen_libraryConfiguration= $parser->parse_file(yp::lib::find_libraryConfiguration($vendor,$library));
|
| 1352 |
|
|
$lib_sw_dir = $socgen_libraryConfiguration->findnodes('//socgen:libraryConfiguration/socgen:lib_sw_dir/text()')->to_literal ;
|
| 1353 |
120 |
jt_eaton |
}
|
| 1354 |
|
|
|
| 1355 |
135 |
jt_eaton |
return("${lib_sw_dir}");
|
| 1356 |
120 |
jt_eaton |
|
| 1357 |
130 |
jt_eaton |
}
|
| 1358 |
120 |
jt_eaton |
|
| 1359 |
|
|
|
| 1360 |
|
|
|
| 1361 |
|
|
|
| 1362 |
131 |
jt_eaton |
|
| 1363 |
|
|
|
| 1364 |
|
|
#/**************************************************************************************************************/
|
| 1365 |
|
|
#/ get_vendor_status */
|
| 1366 |
|
|
#/ */
|
| 1367 |
|
|
#/ returns vendor status */
|
| 1368 |
|
|
#/ */
|
| 1369 |
|
|
#/ my $vendor_status = yp::lib::get_vendor_status($vendor); */
|
| 1370 |
|
|
#/ */
|
| 1371 |
|
|
#/**************************************************************************************************************/
|
| 1372 |
|
|
|
| 1373 |
|
|
sub get_vendor_status {
|
| 1374 |
|
|
my @params = @_;
|
| 1375 |
|
|
my $vendor = pop(@params);
|
| 1376 |
|
|
|
| 1377 |
|
|
my $type;
|
| 1378 |
|
|
my $name;
|
| 1379 |
|
|
my $status;
|
| 1380 |
|
|
my $repo_dir;
|
| 1381 |
|
|
my $repo_data;
|
| 1382 |
|
|
|
| 1383 |
|
|
$repo_db->db_get("${vendor}", $repo_data );
|
| 1384 |
|
|
( $type,$name, $status, $repo_dir ) = split ':', $repo_data;
|
| 1385 |
|
|
return("${status}");
|
| 1386 |
|
|
}
|
| 1387 |
|
|
|
| 1388 |
|
|
|
| 1389 |
|
|
|
| 1390 |
|
|
|
| 1391 |
|
|
#/**************************************************************************************************************/
|
| 1392 |
|
|
#/ set_vendor_status */
|
| 1393 |
|
|
#/ */
|
| 1394 |
|
|
#/ sets vendor status */
|
| 1395 |
|
|
#/ */
|
| 1396 |
|
|
#/ my $vendor_status = yp::lib::set_vendor_status($vendor,$status); */
|
| 1397 |
|
|
#/ */
|
| 1398 |
|
|
#/**************************************************************************************************************/
|
| 1399 |
|
|
|
| 1400 |
|
|
sub set_vendor_status {
|
| 1401 |
|
|
my @params = @_;
|
| 1402 |
|
|
my $status = pop(@params);
|
| 1403 |
|
|
my $vendor = pop(@params);
|
| 1404 |
|
|
|
| 1405 |
|
|
my $type;
|
| 1406 |
|
|
my $name;
|
| 1407 |
|
|
my $old_status;
|
| 1408 |
|
|
my $repo_dir;
|
| 1409 |
|
|
my $repo_data;
|
| 1410 |
|
|
my @repo_info;
|
| 1411 |
|
|
|
| 1412 |
|
|
$repo_db->db_get("${vendor}", $repo_data );
|
| 1413 |
|
|
( $type,$name, $old_status, $repo_dir ) = split ':', $repo_data;
|
| 1414 |
|
|
|
| 1415 |
|
|
my @repo_info = ("vendor","$vendor","$status","$repo_dir" );
|
| 1416 |
|
|
$repo_db->db_put( $vendor, join(':', @repo_info) );
|
| 1417 |
|
|
|
| 1418 |
|
|
return("${status}");
|
| 1419 |
|
|
}
|
| 1420 |
|
|
|
| 1421 |
|
|
|
| 1422 |
|
|
|
| 1423 |
|
|
|
| 1424 |
|
|
#/**************************************************************************************************************/
|
| 1425 |
|
|
#/ get_library_status */
|
| 1426 |
|
|
#/ */
|
| 1427 |
|
|
#/ returns library status */
|
| 1428 |
|
|
#/ */
|
| 1429 |
|
|
#/ my $library_status = yp::lib::get_library_status($vendor); */
|
| 1430 |
|
|
#/ */
|
| 1431 |
|
|
#/**************************************************************************************************************/
|
| 1432 |
|
|
|
| 1433 |
|
|
sub get_library_status {
|
| 1434 |
|
|
my @params = @_;
|
| 1435 |
|
|
my $library = pop(@params);
|
| 1436 |
|
|
my $vendor = pop(@params);
|
| 1437 |
|
|
|
| 1438 |
|
|
my $type;
|
| 1439 |
|
|
my $name;
|
| 1440 |
|
|
my $library_path;
|
| 1441 |
|
|
my $status;
|
| 1442 |
|
|
my $repo_dir;
|
| 1443 |
|
|
my $repo_data;
|
| 1444 |
|
|
|
| 1445 |
|
|
$repo_db->db_get("${vendor}_${library}", $repo_data );
|
| 1446 |
|
|
( $type,$name,$library_path, $status, $repo_dir ) = split ':', $repo_data;
|
| 1447 |
|
|
return("${status}");
|
| 1448 |
|
|
}
|
| 1449 |
|
|
|
| 1450 |
|
|
|
| 1451 |
|
|
|
| 1452 |
|
|
|
| 1453 |
|
|
#/**************************************************************************************************************/
|
| 1454 |
|
|
#/ set_library_status */
|
| 1455 |
|
|
#/ */
|
| 1456 |
|
|
#/ sets library status */
|
| 1457 |
|
|
#/ */
|
| 1458 |
|
|
#/ my $library_status = yp::lib::set_library_status($vendor,$library,$status); */
|
| 1459 |
|
|
#/ */
|
| 1460 |
|
|
#/**************************************************************************************************************/
|
| 1461 |
|
|
|
| 1462 |
|
|
sub set_library_status {
|
| 1463 |
|
|
my @params = @_;
|
| 1464 |
|
|
my $status = pop(@params);
|
| 1465 |
|
|
my $library = pop(@params);
|
| 1466 |
|
|
my $vendor = pop(@params);
|
| 1467 |
|
|
|
| 1468 |
|
|
my $type;
|
| 1469 |
|
|
my $name;
|
| 1470 |
|
|
my $old_status;
|
| 1471 |
|
|
my $library_path;
|
| 1472 |
|
|
my $repo_dir;
|
| 1473 |
|
|
my $repo_data;
|
| 1474 |
|
|
my @repo_info;
|
| 1475 |
|
|
|
| 1476 |
|
|
$repo_db->db_get("${vendor}_${library}", $repo_data );
|
| 1477 |
|
|
( $type,$name,$library_path, $old_status, $repo_dir ) = split ':', $repo_data;
|
| 1478 |
|
|
|
| 1479 |
|
|
my @repo_info = ("library","$library","$library_path","$status","$repo_dir" );
|
| 1480 |
|
|
$repo_db->db_put( "${vendor}_${library}", join(':', @repo_info) );
|
| 1481 |
|
|
|
| 1482 |
|
|
return("${status}");
|
| 1483 |
|
|
}
|
| 1484 |
|
|
|
| 1485 |
|
|
|
| 1486 |
|
|
|
| 1487 |
|
|
|
| 1488 |
|
|
|
| 1489 |
|
|
|
| 1490 |
|
|
|
| 1491 |
|
|
|
| 1492 |
|
|
|
| 1493 |
|
|
|
| 1494 |
|
|
|
| 1495 |
|
|
|
| 1496 |
|
|
|
| 1497 |
117 |
jt_eaton |
#/*********************************************************************************************/
|
| 1498 |
|
|
#/ find_vendors */
|
| 1499 |
|
|
#/ */
|
| 1500 |
|
|
#/ returns array of all vendors */
|
| 1501 |
|
|
#/ */
|
| 1502 |
130 |
jt_eaton |
#/ my @vendors = yp::lib::find_vendors(); */
|
| 1503 |
117 |
jt_eaton |
#/ */
|
| 1504 |
|
|
#/*********************************************************************************************/
|
| 1505 |
|
|
|
| 1506 |
|
|
sub find_vendors
|
| 1507 |
|
|
{
|
| 1508 |
130 |
jt_eaton |
my $key;
|
| 1509 |
|
|
my $value;
|
| 1510 |
|
|
my $type;
|
| 1511 |
|
|
my $name;
|
| 1512 |
|
|
my $path;
|
| 1513 |
131 |
jt_eaton |
my $repo_dir;
|
| 1514 |
117 |
jt_eaton |
my @vendors = ();
|
| 1515 |
|
|
|
| 1516 |
130 |
jt_eaton |
my $cursor = $repo_db->db_cursor() ;
|
| 1517 |
|
|
while ($cursor->c_get($key, $value, DB_NEXT) == 0)
|
| 1518 |
|
|
{
|
| 1519 |
131 |
jt_eaton |
( $type,$name, $path,$repo_dir ) = split ':', $value;
|
| 1520 |
130 |
jt_eaton |
if($type eq "vendor")
|
| 1521 |
117 |
jt_eaton |
{
|
| 1522 |
130 |
jt_eaton |
push (@vendors,$name );
|
| 1523 |
|
|
}
|
| 1524 |
117 |
jt_eaton |
}
|
| 1525 |
130 |
jt_eaton |
@vendors = trim_sort(@vendors);
|
| 1526 |
|
|
return (@vendors);
|
| 1527 |
|
|
}
|
| 1528 |
117 |
jt_eaton |
|
| 1529 |
|
|
|
| 1530 |
|
|
|
| 1531 |
|
|
#/*********************************************************************************************/
|
| 1532 |
|
|
#/ find_libraries */
|
| 1533 |
|
|
#/ */
|
| 1534 |
|
|
#/ returns array of all libraries from a vendor */
|
| 1535 |
|
|
#/ */
|
| 1536 |
130 |
jt_eaton |
#/ my @libraries = yp::lib::find_libraries($vendor); */
|
| 1537 |
117 |
jt_eaton |
#/ */
|
| 1538 |
|
|
#/*********************************************************************************************/
|
| 1539 |
|
|
|
| 1540 |
|
|
sub find_libraries
|
| 1541 |
|
|
{
|
| 1542 |
|
|
my @params = @_;
|
| 1543 |
|
|
my $vendor = pop(@params);
|
| 1544 |
130 |
jt_eaton |
my $type;
|
| 1545 |
|
|
my $key;
|
| 1546 |
|
|
my $value;
|
| 1547 |
|
|
my $name;
|
| 1548 |
131 |
jt_eaton |
my $status;
|
| 1549 |
130 |
jt_eaton |
my $path;
|
| 1550 |
131 |
jt_eaton |
my $repo_dir;
|
| 1551 |
117 |
jt_eaton |
my @libraries = ();
|
| 1552 |
|
|
|
| 1553 |
130 |
jt_eaton |
my $cursor = $repo_db->db_cursor() ;
|
| 1554 |
|
|
while ($cursor->c_get($key, $value, DB_NEXT) == 0)
|
| 1555 |
|
|
{
|
| 1556 |
131 |
jt_eaton |
( $type,$name, $path,$status, $repo_dir) = split ':', $value;
|
| 1557 |
130 |
jt_eaton |
|
| 1558 |
|
|
|
| 1559 |
|
|
if(($type eq "library")&& ($key eq "${vendor}__${name}") )
|
| 1560 |
117 |
jt_eaton |
{
|
| 1561 |
130 |
jt_eaton |
push (@libraries,$name );
|
| 1562 |
|
|
}
|
| 1563 |
|
|
}
|
| 1564 |
117 |
jt_eaton |
@libraries = trim_sort(@libraries);
|
| 1565 |
|
|
return (@libraries);
|
| 1566 |
|
|
}
|
| 1567 |
|
|
|
| 1568 |
|
|
|
| 1569 |
|
|
#/*********************************************************************************************/
|
| 1570 |
|
|
#/ find_components */
|
| 1571 |
|
|
#/ */
|
| 1572 |
|
|
#/ returns array of all components from a vendors library */
|
| 1573 |
|
|
#/ */
|
| 1574 |
130 |
jt_eaton |
#/ my @components = yp::lib::find_components($vendor,$library); */
|
| 1575 |
117 |
jt_eaton |
#/ */
|
| 1576 |
|
|
#/*********************************************************************************************/
|
| 1577 |
|
|
|
| 1578 |
|
|
sub find_components
|
| 1579 |
|
|
{
|
| 1580 |
|
|
my @params = @_;
|
| 1581 |
|
|
my $library = pop(@params);
|
| 1582 |
130 |
jt_eaton |
my $vendor = pop(@params);
|
| 1583 |
|
|
my $type;
|
| 1584 |
|
|
my $key;
|
| 1585 |
|
|
my $value;
|
| 1586 |
|
|
my $name;
|
| 1587 |
|
|
my $path;
|
| 1588 |
131 |
jt_eaton |
my $repo_dir;
|
| 1589 |
117 |
jt_eaton |
my @components = ();
|
| 1590 |
130 |
jt_eaton |
my $cursor = $repo_db->db_cursor() ;
|
| 1591 |
|
|
while ($cursor->c_get($key, $value, DB_NEXT) == 0)
|
| 1592 |
|
|
{
|
| 1593 |
131 |
jt_eaton |
( $type,$name, $path,$repo_dir ) = split ':', $value;
|
| 1594 |
130 |
jt_eaton |
if(($type eq "component")&& ($key eq "${vendor}__${library}_${name}"))
|
| 1595 |
|
|
{ push (@components,$name );}
|
| 1596 |
|
|
}
|
| 1597 |
117 |
jt_eaton |
@components = trim_sort(@components);
|
| 1598 |
|
|
return (@components);
|
| 1599 |
|
|
}
|
| 1600 |
|
|
|
| 1601 |
|
|
|
| 1602 |
|
|
|
| 1603 |
|
|
|
| 1604 |
|
|
#/*********************************************************************************************/
|
| 1605 |
130 |
jt_eaton |
#/ find_component_versions */
|
| 1606 |
117 |
jt_eaton |
#/ */
|
| 1607 |
130 |
jt_eaton |
#/ returns array of all versions os a component */
|
| 1608 |
117 |
jt_eaton |
#/ */
|
| 1609 |
130 |
jt_eaton |
#/ my @components = yp::lib::find_component_versions($vendor,$library,$component); */
|
| 1610 |
117 |
jt_eaton |
#/ */
|
| 1611 |
|
|
#/*********************************************************************************************/
|
| 1612 |
|
|
|
| 1613 |
130 |
jt_eaton |
sub find_component_versions
|
| 1614 |
117 |
jt_eaton |
{
|
| 1615 |
|
|
my @params = @_;
|
| 1616 |
130 |
jt_eaton |
my $component = pop(@params);
|
| 1617 |
117 |
jt_eaton |
my $library = pop(@params);
|
| 1618 |
130 |
jt_eaton |
my $vendor = pop(@params);
|
| 1619 |
117 |
jt_eaton |
|
| 1620 |
130 |
jt_eaton |
my $xml_file;
|
| 1621 |
|
|
my $key;
|
| 1622 |
|
|
my $value;
|
| 1623 |
|
|
my $comp_xml_sep;
|
| 1624 |
|
|
my $version;
|
| 1625 |
|
|
|
| 1626 |
117 |
jt_eaton |
my @versions = ();
|
| 1627 |
130 |
jt_eaton |
my $cursor = $component_db->db_cursor() ;
|
| 1628 |
|
|
while ($cursor->c_get($key, $value, DB_NEXT) == 0)
|
| 1629 |
|
|
{
|
| 1630 |
|
|
( $xml_file,$comp_xml_sep, $version ) = split ':', $value;
|
| 1631 |
|
|
if(($key eq "${vendor}__${library}_${component}_${version}"))
|
| 1632 |
|
|
{
|
| 1633 |
|
|
push (@versions,$version );
|
| 1634 |
|
|
}
|
| 1635 |
|
|
}
|
| 1636 |
|
|
@versions = trim_sort(@versions);
|
| 1637 |
|
|
return (@versions);
|
| 1638 |
|
|
}
|
| 1639 |
117 |
jt_eaton |
|
| 1640 |
|
|
|
| 1641 |
130 |
jt_eaton |
|
| 1642 |
|
|
|
| 1643 |
|
|
|
| 1644 |
|
|
#/************************************************************************************************************************/
|
| 1645 |
|
|
#/ find_abstractionDefinition_versions */
|
| 1646 |
|
|
#/ */
|
| 1647 |
|
|
#/ returns array of all versions os a abstractionDefinition */
|
| 1648 |
|
|
#/ */
|
| 1649 |
|
|
#/ my @abstractionDefinitions = yp::lib::find_abstractionDefinition_versions($vendor,$library,$abstractionDefinition); */
|
| 1650 |
|
|
#/ */
|
| 1651 |
|
|
#/************************************************************************************************************************/
|
| 1652 |
|
|
|
| 1653 |
|
|
sub find_abstractionDefinition_versions
|
| 1654 |
|
|
{
|
| 1655 |
|
|
my @params = @_;
|
| 1656 |
|
|
my $abstractionDefinition = pop(@params);
|
| 1657 |
|
|
my $library = pop(@params);
|
| 1658 |
|
|
my $vendor = pop(@params);
|
| 1659 |
|
|
|
| 1660 |
|
|
my $xml_file;
|
| 1661 |
|
|
my $key;
|
| 1662 |
|
|
my $value;
|
| 1663 |
|
|
my $comp_xml_sep;
|
| 1664 |
131 |
jt_eaton |
my $design_vendor;
|
| 1665 |
|
|
my $design_library;
|
| 1666 |
|
|
my $design_name;
|
| 1667 |
|
|
my $design_version;
|
| 1668 |
130 |
jt_eaton |
|
| 1669 |
|
|
my @versions = ();
|
| 1670 |
|
|
my $cursor = $abstractionDefinition_db->db_cursor() ;
|
| 1671 |
|
|
while ($cursor->c_get($key, $value, DB_NEXT) == 0)
|
| 1672 |
|
|
{
|
| 1673 |
131 |
jt_eaton |
( $xml_file,$comp_xml_sep, $design_version,$design_name,$design_library,$design_vendor ) = split ':', $value;
|
| 1674 |
|
|
if(($key eq "${vendor}__${library}_${abstractionDefinition}_${design_version}"))
|
| 1675 |
130 |
jt_eaton |
{
|
| 1676 |
131 |
jt_eaton |
push (@versions,$design_version );
|
| 1677 |
130 |
jt_eaton |
}
|
| 1678 |
|
|
}
|
| 1679 |
117 |
jt_eaton |
@versions = trim_sort(@versions);
|
| 1680 |
|
|
return (@versions);
|
| 1681 |
|
|
}
|
| 1682 |
|
|
|
| 1683 |
|
|
|
| 1684 |
131 |
jt_eaton |
#/*********************************************************************************************/
|
| 1685 |
|
|
#/ find_abstractionDefinitions */
|
| 1686 |
|
|
#/ */
|
| 1687 |
|
|
#/ returns array of all abstractionDefinitions vendor__library_abstractionDefinition_version */
|
| 1688 |
|
|
#/ */
|
| 1689 |
|
|
#/ my @abstractionDefinitions = yp::lib::find_abstractionDefinitions(); */
|
| 1690 |
|
|
#/ */
|
| 1691 |
|
|
#/*********************************************************************************************/
|
| 1692 |
117 |
jt_eaton |
|
| 1693 |
|
|
|
| 1694 |
|
|
|
| 1695 |
|
|
|
| 1696 |
131 |
jt_eaton |
|
| 1697 |
|
|
|
| 1698 |
|
|
|
| 1699 |
|
|
|
| 1700 |
|
|
|
| 1701 |
|
|
|
| 1702 |
|
|
sub find_abstractionDefinitions
|
| 1703 |
|
|
{
|
| 1704 |
|
|
my $key;
|
| 1705 |
|
|
my $value;
|
| 1706 |
|
|
my $type;
|
| 1707 |
|
|
my $name;
|
| 1708 |
|
|
my $path;
|
| 1709 |
|
|
|
| 1710 |
|
|
my $design_xml_file;
|
| 1711 |
|
|
my $design_xml_sep;
|
| 1712 |
|
|
|
| 1713 |
|
|
my $design_version;
|
| 1714 |
|
|
my $design_name;
|
| 1715 |
|
|
my $design_library;
|
| 1716 |
|
|
my $design_vendor;
|
| 1717 |
|
|
|
| 1718 |
|
|
|
| 1719 |
|
|
my @abstractionDefinitions = ();
|
| 1720 |
|
|
|
| 1721 |
|
|
my $cursor = $abstractionDefinition_db->db_cursor() ;
|
| 1722 |
|
|
while ($cursor->c_get($key, $value, DB_NEXT) == 0)
|
| 1723 |
|
|
{
|
| 1724 |
|
|
|
| 1725 |
|
|
( $design_xml_file, $design_xml_sep,$design_version,$design_name,$design_library,$design_vendor ) = split ':', $value;
|
| 1726 |
|
|
push (@abstractionDefinitions,"${design_vendor}:${design_library}:${design_name}:${design_version}" );
|
| 1727 |
|
|
@abstractionDefinitions = trim_sort(@abstractionDefinitions);
|
| 1728 |
|
|
}
|
| 1729 |
|
|
return (@abstractionDefinitions);
|
| 1730 |
|
|
}
|
| 1731 |
|
|
|
| 1732 |
|
|
|
| 1733 |
130 |
jt_eaton |
#/************************************************************************************************************************/
|
| 1734 |
|
|
#/ find_busDefinition_versions */
|
| 1735 |
|
|
#/ */
|
| 1736 |
|
|
#/ returns array of all versions os a busDefinition */
|
| 1737 |
|
|
#/ */
|
| 1738 |
|
|
#/ my @busDefinitions = yp::lib::find_busDefinition_versions($vendor,$library,$busDefinition); */
|
| 1739 |
|
|
#/ */
|
| 1740 |
|
|
#/************************************************************************************************************************/
|
| 1741 |
117 |
jt_eaton |
|
| 1742 |
130 |
jt_eaton |
sub find_busDefinition_versions
|
| 1743 |
117 |
jt_eaton |
{
|
| 1744 |
|
|
my @params = @_;
|
| 1745 |
130 |
jt_eaton |
my $busDefinition = pop(@params);
|
| 1746 |
|
|
my $library = pop(@params);
|
| 1747 |
117 |
jt_eaton |
my $vendor = pop(@params);
|
| 1748 |
|
|
|
| 1749 |
130 |
jt_eaton |
my $xml_file;
|
| 1750 |
|
|
my $key;
|
| 1751 |
|
|
my $value;
|
| 1752 |
|
|
my $comp_xml_sep;
|
| 1753 |
|
|
my $version;
|
| 1754 |
117 |
jt_eaton |
|
| 1755 |
130 |
jt_eaton |
my @versions = ();
|
| 1756 |
|
|
my $cursor = $busDefinition_db->db_cursor() ;
|
| 1757 |
|
|
while ($cursor->c_get($key, $value, DB_NEXT) == 0)
|
| 1758 |
|
|
{
|
| 1759 |
|
|
( $xml_file,$comp_xml_sep, $version ) = split ':', $value;
|
| 1760 |
|
|
if(($key eq "${vendor}__${library}_${busDefinition}_${version}"))
|
| 1761 |
|
|
{
|
| 1762 |
|
|
push (@versions,$version );
|
| 1763 |
|
|
}
|
| 1764 |
|
|
}
|
| 1765 |
|
|
@versions = trim_sort(@versions);
|
| 1766 |
|
|
return (@versions);
|
| 1767 |
117 |
jt_eaton |
}
|
| 1768 |
|
|
|
| 1769 |
122 |
jt_eaton |
#/*********************************************************************************************/
|
| 1770 |
|
|
#/ get_module_name */
|
| 1771 |
|
|
#/ */
|
| 1772 |
|
|
#/ returns module name for component */
|
| 1773 |
|
|
#/ */
|
| 1774 |
|
|
#/ my $module_name = yp::lib::get_module_name($vendor,$library,$component,$version); */
|
| 1775 |
|
|
#/ */
|
| 1776 |
|
|
#/*********************************************************************************************/
|
| 1777 |
117 |
jt_eaton |
|
| 1778 |
122 |
jt_eaton |
sub get_module_name
|
| 1779 |
|
|
{
|
| 1780 |
|
|
my @params = @_;
|
| 1781 |
|
|
my $version = pop(@params);
|
| 1782 |
|
|
my $component = pop(@params);
|
| 1783 |
125 |
jt_eaton |
my $library = pop(@params);
|
| 1784 |
122 |
jt_eaton |
my $vendor = pop(@params);
|
| 1785 |
|
|
|
| 1786 |
125 |
jt_eaton |
my $name_depth =2;
|
| 1787 |
122 |
jt_eaton |
|
| 1788 |
125 |
jt_eaton |
my $parser = XML::LibXML->new();
|
| 1789 |
|
|
|
| 1790 |
131 |
jt_eaton |
my $socgen_component_filename = yp::lib::find_componentConfiguration($vendor,$library,$component);
|
| 1791 |
|
|
unless($socgen_component_filename)
|
| 1792 |
|
|
{
|
| 1793 |
134 |
jt_eaton |
return("");
|
| 1794 |
131 |
jt_eaton |
}
|
| 1795 |
|
|
my $socgen_component_file = $parser->parse_file($socgen_component_filename);
|
| 1796 |
125 |
jt_eaton |
|
| 1797 |
|
|
foreach my $new_comp ($socgen_component_file->findnodes("//socgen:componentConfiguration"))
|
| 1798 |
|
|
{
|
| 1799 |
|
|
$name_depth = $new_comp->findnodes('./socgen:ip_name_depth/text()')->to_literal ;
|
| 1800 |
|
|
}
|
| 1801 |
127 |
jt_eaton |
if($name_depth eq "0"){ return("${library}");}
|
| 1802 |
125 |
jt_eaton |
if($name_depth eq "1"){ return("${component}");}
|
| 1803 |
|
|
if($name_depth eq "2"){ return("${component}_${version}");}
|
| 1804 |
|
|
if($name_depth eq "3"){ return("${library}_${component}_${version}");}
|
| 1805 |
|
|
if($name_depth eq "4"){ return("${vendor}_${library}_${component}_${version}");}
|
| 1806 |
122 |
jt_eaton |
|
| 1807 |
|
|
}
|
| 1808 |
|
|
|
| 1809 |
|
|
|
| 1810 |
130 |
jt_eaton |
#/*********************************************************************************************/
|
| 1811 |
125 |
jt_eaton |
#/ parse_component_file */
|
| 1812 |
|
|
#/ */
|
| 1813 |
|
|
#/ returns design names for component */
|
| 1814 |
|
|
#/ */
|
| 1815 |
|
|
#/ my @filelist = yp::lib::parse_component_file($vendor,$library,$component,$version); */
|
| 1816 |
|
|
#/ */
|
| 1817 |
|
|
#/*********************************************************************************************/
|
| 1818 |
117 |
jt_eaton |
|
| 1819 |
135 |
jt_eaton |
sub parse_component_file
|
| 1820 |
|
|
{
|
| 1821 |
|
|
my @params = @_;
|
| 1822 |
|
|
my $version = pop(@params);
|
| 1823 |
|
|
my $component = pop(@params);
|
| 1824 |
|
|
my $library = pop(@params);
|
| 1825 |
|
|
my $vendor = pop(@params);
|
| 1826 |
|
|
my @filelist_acc = parse_component_fileX($vendor,$library,$component,$version,1);
|
| 1827 |
|
|
return(@filelist_acc);
|
| 1828 |
|
|
}
|
| 1829 |
117 |
jt_eaton |
|
| 1830 |
|
|
|
| 1831 |
135 |
jt_eaton |
|
| 1832 |
|
|
|
| 1833 |
|
|
|
| 1834 |
|
|
|
| 1835 |
|
|
sub parse_component_fileX
|
| 1836 |
125 |
jt_eaton |
{
|
| 1837 |
|
|
my @params = @_;
|
| 1838 |
135 |
jt_eaton |
my $switch = pop(@params);
|
| 1839 |
125 |
jt_eaton |
my $version = pop(@params);
|
| 1840 |
|
|
my $component = pop(@params);
|
| 1841 |
|
|
my $library = pop(@params);
|
| 1842 |
|
|
my $vendor = pop(@params);
|
| 1843 |
|
|
my $parser = XML::LibXML->new();
|
| 1844 |
130 |
jt_eaton |
my $spirit_cmp_filename =yp::lib::find_ipxact_component($vendor,$library,$component,$version );
|
| 1845 |
125 |
jt_eaton |
|
| 1846 |
|
|
unless($spirit_cmp_filename)
|
| 1847 |
|
|
{
|
| 1848 |
135 |
jt_eaton |
print("ipxact:component MISSING $vendor,$library,$component,$version \n");
|
| 1849 |
125 |
jt_eaton |
}
|
| 1850 |
|
|
|
| 1851 |
130 |
jt_eaton |
my $spirit_component_file = $parser->parse_file(yp::lib::find_ipxact_component($vendor,$library,$component,$version ));
|
| 1852 |
135 |
jt_eaton |
my $line;
|
| 1853 |
|
|
my @filelist_acc = ( );
|
| 1854 |
125 |
jt_eaton |
|
| 1855 |
135 |
jt_eaton |
if($switch) { push(@filelist_acc,"::${vendor}::${library}::${component}::${version}::");}
|
| 1856 |
125 |
jt_eaton |
|
| 1857 |
135 |
jt_eaton |
foreach my $new_comp ($spirit_component_file->findnodes("//ipxact:component/ipxact:model/ipxact:views/ipxact:view/ipxact:vendorExtensions/ipxact:componentRef"))
|
| 1858 |
125 |
jt_eaton |
{
|
| 1859 |
135 |
jt_eaton |
my($new_vendor) = $new_comp->findnodes('./@ipxact:vendor')->to_literal ;
|
| 1860 |
|
|
my($new_library) = $new_comp->findnodes('./@ipxact:library')->to_literal ;
|
| 1861 |
|
|
my($new_name) = $new_comp->findnodes('./@ipxact:name')->to_literal ;
|
| 1862 |
|
|
my($new_version) = $new_comp->findnodes('./@ipxact:version')->to_literal ;
|
| 1863 |
|
|
my @filelist_sub = parse_component_fileX($new_vendor,$new_library,$new_name,$new_version,0);
|
| 1864 |
125 |
jt_eaton |
foreach $line (@filelist_sub) { push(@filelist_acc,"$line"); }
|
| 1865 |
|
|
}
|
| 1866 |
|
|
|
| 1867 |
135 |
jt_eaton |
foreach my $new_comp ($spirit_component_file->findnodes("//ipxact:component/ipxact:model/ipxact:views/ipxact:view/ipxact:hierarchyRef"))
|
| 1868 |
125 |
jt_eaton |
{
|
| 1869 |
135 |
jt_eaton |
my($new_vendor) = $new_comp->findnodes('./@ipxact:vendor')->to_literal ;
|
| 1870 |
|
|
my($new_library) = $new_comp->findnodes('./@ipxact:library')->to_literal ;
|
| 1871 |
|
|
my($new_name) = $new_comp->findnodes('./@ipxact:name')->to_literal ;
|
| 1872 |
|
|
my($new_version) = $new_comp->findnodes('./@ipxact:version')->to_literal ;
|
| 1873 |
125 |
jt_eaton |
|
| 1874 |
130 |
jt_eaton |
if(yp::lib::find_ipxact_design($new_vendor,$new_library,$new_name,$new_version ))
|
| 1875 |
135 |
jt_eaton |
{
|
| 1876 |
|
|
# print "FFFFFFFF $new_vendor $new_library $new_name $new_version hierarchyRef \n";
|
| 1877 |
130 |
jt_eaton |
my $spirit_design_file = $parser->parse_file(yp::lib::find_ipxact_design($new_vendor,$new_library,$new_name,$new_version ));
|
| 1878 |
135 |
jt_eaton |
foreach
|
| 1879 |
|
|
my $i_name ($spirit_design_file->findnodes("//ipxact:design/ipxact:componentInstances/ipxact:componentInstance/ipxact:componentRef"))
|
| 1880 |
125 |
jt_eaton |
{
|
| 1881 |
135 |
jt_eaton |
my($vendor_name) = $i_name ->findnodes('./@vendor')->to_literal ;
|
| 1882 |
|
|
my($library_name) = $i_name ->findnodes('./@library')->to_literal ;
|
| 1883 |
|
|
my($component_name) = $i_name ->findnodes('./@name')->to_literal ;
|
| 1884 |
|
|
my($version_name) = $i_name ->findnodes('./@version')->to_literal ;
|
| 1885 |
125 |
jt_eaton |
|
| 1886 |
|
|
push(@filelist_acc,"::${vendor_name}::${library_name}::${component_name}::${version_name}::");
|
| 1887 |
135 |
jt_eaton |
my @filelist_sub = parse_component_fileX($vendor_name,$library_name,$component_name,$version_name,0);
|
| 1888 |
125 |
jt_eaton |
foreach $line (@filelist_sub) { push(@filelist_acc,"$line"); }
|
| 1889 |
130 |
jt_eaton |
}
|
| 1890 |
|
|
}
|
| 1891 |
125 |
jt_eaton |
}
|
| 1892 |
|
|
|
| 1893 |
|
|
|
| 1894 |
|
|
|
| 1895 |
135 |
jt_eaton |
foreach my $new_comp ($spirit_component_file->findnodes("//ipxact:component/ipxact:model/ipxact:views/ipxact:view/ipxact:designInstantiationRef/text()"))
|
| 1896 |
|
|
{
|
| 1897 |
|
|
my($designInsref_value) = $new_comp ->to_literal ;
|
| 1898 |
|
|
my($designInsref_name) = $new_comp ->findnodes('../../ipxact:name')->to_literal ;
|
| 1899 |
125 |
jt_eaton |
|
| 1900 |
|
|
|
| 1901 |
135 |
jt_eaton |
foreach my $new_comp ($spirit_component_file->findnodes("//ipxact:component/ipxact:model/ipxact:instantiations/ipxact:designInstantiation"))
|
| 1902 |
|
|
{
|
| 1903 |
|
|
my($t_ref) = $new_comp->findnodes('./ipxact:name/text()')->to_literal ;
|
| 1904 |
|
|
my($t_vendor) = $new_comp->findnodes('./ipxact:designRef/@vendor')->to_literal ;
|
| 1905 |
|
|
my($t_library) = $new_comp->findnodes('./ipxact:designRef/@library')->to_literal ;
|
| 1906 |
|
|
my($t_name) = $new_comp->findnodes('./ipxact:designRef/@name')->to_literal ;
|
| 1907 |
|
|
my($t_version) = $new_comp->findnodes('./ipxact:designRef/@version')->to_literal ;
|
| 1908 |
125 |
jt_eaton |
|
| 1909 |
|
|
|
| 1910 |
135 |
jt_eaton |
if($t_ref eq $designInsref_name )
|
| 1911 |
|
|
{
|
| 1912 |
125 |
jt_eaton |
|
| 1913 |
128 |
jt_eaton |
|
| 1914 |
|
|
|
| 1915 |
135 |
jt_eaton |
|
| 1916 |
128 |
jt_eaton |
|
| 1917 |
135 |
jt_eaton |
if(yp::lib::find_ipxact_design($t_vendor,$t_library,$t_name,$t_version ))
|
| 1918 |
|
|
{
|
| 1919 |
128 |
jt_eaton |
|
| 1920 |
135 |
jt_eaton |
my $spirit_design_file = $parser->parse_file(yp::lib::find_ipxact_design($t_vendor,$t_library,$t_name,$t_version ));
|
| 1921 |
|
|
foreach
|
| 1922 |
|
|
my $i_name ($spirit_design_file->findnodes("//ipxact:design/ipxact:componentInstances/ipxact:componentInstance/ipxact:componentRef"))
|
| 1923 |
|
|
{
|
| 1924 |
|
|
my($vendor_name) = $i_name ->findnodes('./@vendor')->to_literal ;
|
| 1925 |
|
|
my($library_name) = $i_name ->findnodes('./@library')->to_literal ;
|
| 1926 |
|
|
my($component_name) = $i_name ->findnodes('./@name')->to_literal ;
|
| 1927 |
|
|
my($version_name) = $i_name ->findnodes('./@version')->to_literal ;
|
| 1928 |
128 |
jt_eaton |
|
| 1929 |
135 |
jt_eaton |
push(@filelist_acc,"::${vendor_name}::${library_name}::${component_name}::${version_name}::");
|
| 1930 |
|
|
my @filelist_sub = parse_component_fileX($vendor_name,$library_name,$component_name,$version_name,0);
|
| 1931 |
|
|
foreach $line (@filelist_sub) { push(@filelist_acc,"$line"); }
|
| 1932 |
|
|
}
|
| 1933 |
|
|
}
|
| 1934 |
|
|
}
|
| 1935 |
|
|
}
|
| 1936 |
|
|
}
|
| 1937 |
128 |
jt_eaton |
|
| 1938 |
|
|
|
| 1939 |
130 |
jt_eaton |
|
| 1940 |
128 |
jt_eaton |
|
| 1941 |
|
|
|
| 1942 |
|
|
|
| 1943 |
|
|
|
| 1944 |
135 |
jt_eaton |
|
| 1945 |
|
|
|
| 1946 |
128 |
jt_eaton |
@filelist_acc = sys::lib::trim_sort(@filelist_acc);
|
| 1947 |
|
|
return(@filelist_acc);
|
| 1948 |
|
|
}
|
| 1949 |
|
|
|
| 1950 |
|
|
|
| 1951 |
|
|
|
| 1952 |
|
|
|
| 1953 |
|
|
|
| 1954 |
|
|
|
| 1955 |
135 |
jt_eaton |
|
| 1956 |
|
|
|
| 1957 |
|
|
|
| 1958 |
|
|
|
| 1959 |
128 |
jt_eaton |
#/*********************************************************************************************/
|
| 1960 |
|
|
#/ parse_component_brothers */
|
| 1961 |
|
|
#/ */
|
| 1962 |
|
|
#/ returns names for component brothers */
|
| 1963 |
|
|
#/ */
|
| 1964 |
134 |
jt_eaton |
#/ my @filelist = yp::lib::parse_component_brothers($vendor,$library,$component,$version); */
|
| 1965 |
128 |
jt_eaton |
#/ */
|
| 1966 |
|
|
#/*********************************************************************************************/
|
| 1967 |
|
|
|
| 1968 |
|
|
sub parse_component_brothers
|
| 1969 |
|
|
{
|
| 1970 |
|
|
my @params = @_;
|
| 1971 |
|
|
my $version = pop(@params);
|
| 1972 |
|
|
my $component = pop(@params);
|
| 1973 |
|
|
my $library = pop(@params);
|
| 1974 |
|
|
my $vendor = pop(@params);
|
| 1975 |
|
|
|
| 1976 |
|
|
my $parser = XML::LibXML->new();
|
| 1977 |
130 |
jt_eaton |
unless (yp::lib::find_ipxact_component($vendor,$library,$component,$version)){print "Missing Component $vendor, $library, $component, $version \n"; }
|
| 1978 |
|
|
my $spirit_component_file = $parser->parse_file(yp::lib::find_ipxact_component($vendor,$library,$component,$version ));
|
| 1979 |
128 |
jt_eaton |
|
| 1980 |
|
|
my $line;
|
| 1981 |
|
|
my @filelist_acc = ( );
|
| 1982 |
|
|
push(@filelist_acc,"::${vendor}::${library}::${component}::${version}::");
|
| 1983 |
|
|
|
| 1984 |
135 |
jt_eaton |
foreach my $new_comp ($spirit_component_file->findnodes("//ipxact:component/ipxact:model/ipxact:views/ipxact:view/ipxact:vendorExtensions/ipxact:componentRef"))
|
| 1985 |
128 |
jt_eaton |
{
|
| 1986 |
135 |
jt_eaton |
my($new_vendor) = $new_comp->findnodes('./@ipxact:vendor')->to_literal ;
|
| 1987 |
|
|
my($new_library) = $new_comp->findnodes('./@ipxact:library')->to_literal ;
|
| 1988 |
|
|
my($new_component) = $new_comp->findnodes('./@ipxact:name')->to_literal ;
|
| 1989 |
|
|
my($new_version) = $new_comp->findnodes('./@ipxact:version')->to_literal ;
|
| 1990 |
128 |
jt_eaton |
push(@filelist_acc,"::${new_vendor}::${new_library}::${new_component}::${new_version}::");
|
| 1991 |
|
|
}
|
| 1992 |
|
|
|
| 1993 |
|
|
return(@filelist_acc);
|
| 1994 |
|
|
}
|
| 1995 |
|
|
|
| 1996 |
125 |
jt_eaton |
#/*****************************************************************************************************/
|
| 1997 |
|
|
#/ find_ipxact_design_files */
|
| 1998 |
|
|
#/ */
|
| 1999 |
|
|
#/ returns parser tokens to ip-xact design files referred to by component file vlnv */
|
| 2000 |
|
|
#/ */
|
| 2001 |
135 |
jt_eaton |
#/ my @spirit_design_files = yp::lib::find_ipxact_design_files($vendor,$library,$component,$version); */
|
| 2002 |
125 |
jt_eaton |
#/ */
|
| 2003 |
|
|
#/*****************************************************************************************************/
|
| 2004 |
|
|
|
| 2005 |
|
|
sub find_ipxact_design_files
|
| 2006 |
|
|
{
|
| 2007 |
|
|
my @params = @_;
|
| 2008 |
|
|
my $version = pop(@params);
|
| 2009 |
|
|
my $component = pop(@params);
|
| 2010 |
130 |
jt_eaton |
my $library = pop(@params);
|
| 2011 |
125 |
jt_eaton |
my $vendor = pop(@params);
|
| 2012 |
|
|
|
| 2013 |
|
|
|
| 2014 |
|
|
my @design_files = ();
|
| 2015 |
|
|
my $parser = XML::LibXML->new();
|
| 2016 |
130 |
jt_eaton |
unless (yp::lib::find_ipxact_component($vendor,$library,$component,$version)){print "Missing Component $vendor, $library, $component, $version \n"; }
|
| 2017 |
|
|
my $spirit_component_file = $parser->parse_file(yp::lib::find_ipxact_component($vendor,$library,$component,$version));
|
| 2018 |
125 |
jt_eaton |
|
| 2019 |
135 |
jt_eaton |
foreach my $new_comp ($spirit_component_file->findnodes("//ipxact:component/ipxact:model/ipxact:views/ipxact:view/ipxact:vendorExtensions/ipxact:componentRef"))
|
| 2020 |
125 |
jt_eaton |
{
|
| 2021 |
135 |
jt_eaton |
my($new_vendor) = $new_comp->findnodes('./@ipxact:vendor')->to_literal ;
|
| 2022 |
|
|
my($new_library) = $new_comp->findnodes('./@ipxact:library')->to_literal ;
|
| 2023 |
|
|
my($new_name) = $new_comp->findnodes('./@ipxact:name')->to_literal ;
|
| 2024 |
|
|
my($new_version) = $new_comp->findnodes('./@ipxact:version')->to_literal ;
|
| 2025 |
125 |
jt_eaton |
my @filelist_sub = yp::lib::find_ipxact_design_files($new_vendor,$new_library,$new_name,$new_version);
|
| 2026 |
130 |
jt_eaton |
foreach my $line (@filelist_sub) { push(@design_files,"$line"); } }
|
| 2027 |
125 |
jt_eaton |
|
| 2028 |
135 |
jt_eaton |
|
| 2029 |
|
|
|
| 2030 |
|
|
|
| 2031 |
|
|
|
| 2032 |
|
|
|
| 2033 |
|
|
|
| 2034 |
|
|
|
| 2035 |
|
|
|
| 2036 |
|
|
|
| 2037 |
|
|
|
| 2038 |
|
|
|
| 2039 |
|
|
|
| 2040 |
|
|
|
| 2041 |
|
|
|
| 2042 |
|
|
|
| 2043 |
|
|
|
| 2044 |
|
|
foreach my $comp_view ($spirit_component_file->findnodes('//ipxact:component/ipxact:model/ipxact:views/ipxact:view'))
|
| 2045 |
125 |
jt_eaton |
{
|
| 2046 |
135 |
jt_eaton |
my($hier_ref_vendor) = $comp_view->findnodes('./ipxact:hierarchyRef/@ipxact:vendor')->to_literal ;
|
| 2047 |
|
|
my($hier_ref_library) = $comp_view->findnodes('./ipxact:hierarchyRef/@ipxact:library')->to_literal ;
|
| 2048 |
|
|
my($hier_ref_design) = $comp_view->findnodes('./ipxact:hierarchyRef/@ipxact:name')->to_literal ;
|
| 2049 |
|
|
my($hier_ref_version) = $comp_view->findnodes('./ipxact:hierarchyRef/@ipxact:version')->to_literal ;
|
| 2050 |
130 |
jt_eaton |
if(find_ipxact_design($hier_ref_vendor,$hier_ref_library,$hier_ref_design,$hier_ref_version))
|
| 2051 |
135 |
jt_eaton |
{
|
| 2052 |
|
|
# print "FFFFFFFF $hier_ref_vendor $hier_ref_library $hier_ref_design $hier_ref_version hierarchyRef \n";
|
| 2053 |
130 |
jt_eaton |
push(@design_files,":::${hier_ref_vendor}:::${hier_ref_library}:::${hier_ref_design}:::${hier_ref_version}:::");
|
| 2054 |
|
|
}
|
| 2055 |
125 |
jt_eaton |
}
|
| 2056 |
135 |
jt_eaton |
|
| 2057 |
|
|
|
| 2058 |
|
|
|
| 2059 |
|
|
foreach my $comp_view ($spirit_component_file->findnodes("//ipxact:component/ipxact:model/ipxact:views/ipxact:view/ipxact:designInstantiationRef/text()"))
|
| 2060 |
|
|
{
|
| 2061 |
|
|
my($designInsref_value) = $comp_view ->to_literal ;
|
| 2062 |
|
|
my($designInsref_name) = $comp_view ->findnodes('../../ipxact:name')->to_literal ;
|
| 2063 |
|
|
|
| 2064 |
|
|
|
| 2065 |
|
|
foreach my $comp_view ($spirit_component_file->findnodes("//ipxact:component/ipxact:model/ipxact:instantiations/ipxact:designInstantiation"))
|
| 2066 |
|
|
{
|
| 2067 |
|
|
|
| 2068 |
|
|
my($t_ref) = $comp_view->findnodes('./ipxact:name/text()')->to_literal ;
|
| 2069 |
|
|
my($t_vendor) = $comp_view->findnodes('./ipxact:designRef/@vendor')->to_literal ;
|
| 2070 |
|
|
my($t_library) = $comp_view->findnodes('./ipxact:designRef/@library')->to_literal ;
|
| 2071 |
|
|
my($t_name) = $comp_view->findnodes('./ipxact:designRef/@name')->to_literal ;
|
| 2072 |
|
|
my($t_version) = $comp_view->findnodes('./ipxact:designRef/@version')->to_literal ;
|
| 2073 |
|
|
|
| 2074 |
|
|
if($t_ref eq $designInsref_name )
|
| 2075 |
|
|
{
|
| 2076 |
|
|
|
| 2077 |
|
|
if(find_ipxact_design($t_vendor,$t_library,$t_name,$t_version))
|
| 2078 |
|
|
{
|
| 2079 |
|
|
# print "FFFFFFFF $t_vendor $t_library $t_name $t_version designInstantiationRef \n";
|
| 2080 |
|
|
push(@design_files,":::${t_vendor}:::${t_library}:::${t_name}:::${t_version}:::");
|
| 2081 |
|
|
}
|
| 2082 |
|
|
|
| 2083 |
|
|
|
| 2084 |
|
|
|
| 2085 |
|
|
|
| 2086 |
|
|
|
| 2087 |
|
|
}
|
| 2088 |
|
|
}
|
| 2089 |
|
|
}
|
| 2090 |
|
|
|
| 2091 |
|
|
|
| 2092 |
|
|
|
| 2093 |
|
|
|
| 2094 |
|
|
|
| 2095 |
|
|
|
| 2096 |
|
|
|
| 2097 |
|
|
|
| 2098 |
|
|
|
| 2099 |
|
|
|
| 2100 |
|
|
|
| 2101 |
|
|
|
| 2102 |
|
|
|
| 2103 |
|
|
|
| 2104 |
|
|
|
| 2105 |
|
|
|
| 2106 |
|
|
|
| 2107 |
|
|
|
| 2108 |
|
|
|
| 2109 |
|
|
|
| 2110 |
|
|
|
| 2111 |
|
|
|
| 2112 |
|
|
|
| 2113 |
|
|
|
| 2114 |
|
|
|
| 2115 |
130 |
jt_eaton |
return(@design_files);
|
| 2116 |
|
|
}
|
| 2117 |
125 |
jt_eaton |
|
| 2118 |
130 |
jt_eaton |
sub trim_sort {
|
| 2119 |
|
|
my @output_files = @_;
|
| 2120 |
|
|
my %trim = ();
|
| 2121 |
|
|
foreach my $descriptor (@output_files) { $trim{$descriptor} = 1; }
|
| 2122 |
|
|
my @k = keys %trim;
|
| 2123 |
|
|
@output_files = sort(sort @k);
|
| 2124 |
|
|
return(@output_files);
|
| 2125 |
125 |
jt_eaton |
}
|
| 2126 |
|
|
|
| 2127 |
|
|
|
| 2128 |
117 |
jt_eaton |
1;
|