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

Subversion Repositories socgen

[/] [socgen/] [trunk/] [tools/] [yp/] [lib.pm] - Diff between revs 134 and 135

Show entire file | Details | Blame | View Log

Rev 134 Rev 135
Line 94... Line 94...
 
 
 
 
 
 
my $number_of_cpus;
my $number_of_cpus;
my $workspace;
my $workspace;
 
my $child;
 
my $code;
 
my $data;
my $yellow_pages;
my $yellow_pages;
my $io_ports;
my $io_ports;
my $doc_dir;
my $doc_dir;
 
 
 
 
foreach my $repo ($workspace_xml->findnodes('//socgen:workspace'))
foreach my $repo ($workspace_xml->findnodes('//socgen:workspace'))
                  {
                  {
                  $number_of_cpus  = $repo->findnodes('./socgen:number_of_cpus/text()')->to_literal ;
                  $number_of_cpus  = $repo->findnodes('./socgen:number_of_cpus/text()')->to_literal ;
                  $workspace       = $repo->findnodes('./socgen:build_dir/text()')->to_literal ;
                  $workspace       = $repo->findnodes('./socgen:build_dir/text()')->to_literal ;
 
                  $child           = $repo->findnodes('./socgen:child_dir/text()')->to_literal ;
 
                  $code            = $repo->findnodes('./socgen:code_dir/text()')->to_literal ;
 
                  $data            = $repo->findnodes('./socgen:data_dir/text()')->to_literal ;
                  $yellow_pages    = $repo->findnodes('./socgen:yp_dir/text()')->to_literal ;
                  $yellow_pages    = $repo->findnodes('./socgen:yp_dir/text()')->to_literal ;
                  $io_ports        = $repo->findnodes('./socgen:ports_dir/text()')->to_literal ;
                  $io_ports        = $repo->findnodes('./socgen:ports_dir/text()')->to_literal ;
                  $doc_dir         = $repo->findnodes('./socgen:doc_dir/text()')->to_literal ;
                  $doc_dir         = $repo->findnodes('./socgen:doc_dir/text()')->to_literal ;
 
 
                  }
                  }
 
 
 
 
 
 
unless(defined $number_of_cpus)  {    $number_of_cpus = 1;         }
unless(defined $number_of_cpus)  {    $number_of_cpus = 1;         }
unless(defined $workspace     )  {    $workspace      = "work";    }
unless(defined $workspace     )  {    $workspace      = "work";    }
 
unless(defined $child         )  {    $child          = "children"; }
 
unless(defined $code          )  {    $code           = "code";     }
 
unless(defined $data          )  {    $data           = "dbs";      }
unless(defined $yellow_pages  )  {    $yellow_pages   = "yp";      }
unless(defined $yellow_pages  )  {    $yellow_pages   = "yp";      }
unless(defined $io_ports      )  {    $io_ports       = "io_ports";}
unless(defined $io_ports      )  {    $io_ports       = "io_ports";}
unless(defined $doc_dir       )  {    $doc_dir        = "doc_dir"; }
unless(defined $doc_dir       )  {    $doc_dir        = "doc_dir"; }
 
 
#print "number_of_cpus  $number_of_cpus  \n";
#print "number_of_cpus  $number_of_cpus  \n";
Line 124... Line 134...
 
 
my $path  = "${home}/${yellow_pages}";
my $path  = "${home}/${yellow_pages}";
 
 
unless( -e $path )
unless( -e $path )
{
{
print "$path does not exist \n";
print "Creating Yellow Pages \n";
my $cmd = "./tools/yp/create_yp $path \n";
my $cmd = "./tools/yp/create_yp $path \n";
if(system($cmd)){};
if(system($cmd)){};
}
}
 
 
my $repo_db                     = new BerkeleyDB::Hash( -Filename => "${yellow_pages}/repo.dbm", -Flags => DB_CREATE ) or die "Cannot open file: $!";
my $repo_db                     = new BerkeleyDB::Hash( -Filename => "${yellow_pages}/repo.dbm", -Flags => DB_CREATE ) or die "Cannot open file: $!";
Line 218... Line 228...
   return("${number_of_cpus}");
   return("${number_of_cpus}");
   }
   }
 
 
 
 
 
 
 
#/***********************************************************************************************/
 
#/  get_child_dir                                                                               */
 
#/                                                                                              */
 
#/  returns name  of child directory                                                            */
 
#/                                                                                              */
 
#/  my $child_dir  = yp::lib::get_child_dir ();                                        */
 
#/                                                                                              */
 
#/***********************************************************************************************/
 
 
 
sub get_child_dir
 
   {
 
   return("${child}");
 
   }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
#/***************************************************************************************************/
#/***************************************************************************************************/
#/  get_io_ports_db_filename                                                                        */
#/  get_io_ports_db_filename                                                                        */
#/                                                                                                  */
#/                                                                                                  */
#/  returns full path name to io_ports database filename                                            */
#/  returns full path name to io_ports database filename                                            */
Line 345... Line 375...
   my $library    = pop(@params);
   my $library    = pop(@params);
   my $vendor     = pop(@params);
   my $vendor     = pop(@params);
 
 
   my $elab_db_filename;
   my $elab_db_filename;
 
 
   mkdir "${home}/dbs",0755  unless (-e "${home}/dbs" );
   mkdir "${home}/${data}",0755  unless (-e "${home}/${data}" );
 
 
   if($configuration eq "xxxxxx")
   if($configuration eq "xxxxxx")
   {
   {
    $elab_db_filename = "${home}/dbs/${vendor}_${library}_${component}_${version}.db";
    $elab_db_filename = "${home}/${data}/${vendor}_${library}_${component}_${version}.db";
   }
   }
   else
   else
   {
   {
    $elab_db_filename = "${home}/dbs/${vendor}_${library}_${component}_${version}_${configuration}.db";
    $elab_db_filename = "${home}/${data}/${vendor}_${library}_${component}_${version}_${configuration}.db";
   }
   }
 
 
   return("${elab_db_filename}");
   return("${elab_db_filename}");
   }
   }
 
 
Line 374... Line 404...
#/***********************************************************************************************************/
#/***********************************************************************************************************/
 
 
sub get_design_db_file
sub get_design_db_file
   {
   {
 
 
   mkdir "${home}/dbs",0755  unless (-e "${home}/dbs" );
   mkdir "${home}/${data}",0755  unless (-e "${home}/${data}" );
   return("${home}/dbs/design.dbm");
   return("${home}/${data}/design.dbm");
   }
   }
 
 
 
 
 
 
 
 
Line 930... Line 960...
   return(@busses);
   return(@busses);
   }
   }
 
 
 
 
 
 
#/***************************************************************************************************/
#/********************************************************************************************************/
#/  get_files                                                                                       */
#/  get_files                                                                                       */
#/                                                                                                  */
#/                                                                                                  */
#/  returns array of all verilog usertypes in a component                                           */
#/  returns array of all verilog usertypes in a component                                           */
#/                                                                                                  */
#/                                                                                                  */
#/  my @fragments  = yp::lib::get_fragments($vendor,$library,$component,$version,$fileSet_name);    */
#/  my @fragments  = yp::lib::get_files($vendor,$library,$component,$version,$fileSet_name,"fragment");  */
#/                                                                                                  */
#/                                                                                                  */
#/***************************************************************************************************/
#/********************************************************************************************************/
 
 
sub get_files
sub get_files
   {
   {
   my @params     = @_;
   my @params     = @_;
   my $userType       = pop(@params);
   my $userType       = pop(@params);
Line 1057... Line 1087...
   my @params     = @_;
   my @params     = @_;
   my $version    = pop(@params);
   my $version    = pop(@params);
   my $component  = pop(@params);
   my $component  = pop(@params);
   my $library    = pop(@params);
   my $library    = pop(@params);
   my $vendor     = pop(@params);
   my $vendor     = pop(@params);
   my $data;
   my $design_data;
   my $design_xml_sep ;
   my $design_xml_sep ;
   my $design_xml_file ;
   my $design_xml_file ;
   my $design_version;
   my $design_version;
 
 
      $design_db->db_get("${vendor}__${library}_${component}_${version}", $data );
      $design_db->db_get("${vendor}__${library}_${component}_${version}", $design_data );
      ( $design_xml_file, $design_xml_sep,$design_version ) = split ':', $data;
      ( $design_xml_file, $design_xml_sep,$design_version ) = split ':', $design_data;
 
 
      return("$design_xml_file");
      return("$design_xml_file");
   }
   }
 
 
 
 
Line 1086... Line 1116...
   my $version    = pop(@params);
   my $version    = pop(@params);
   my $component  = pop(@params);
   my $component  = pop(@params);
   my $library    = pop(@params);
   my $library    = pop(@params);
   my $vendor     = pop(@params);
   my $vendor     = pop(@params);
 
 
   my $data;
   my $design_data;
   my $design_xml_sep ;
   my $design_xml_sep ;
   my $design_xml_file ;
   my $design_xml_file ;
   my $design_version;
   my $design_version;
   my $design_name;
   my $design_name;
   my $design_library;
   my $design_library;
   my $design_vendor;
   my $design_vendor;
 
 
 
 
      $abstractionDefinition_db->db_get("${vendor}__${library}_${component}_${version}", $data );
      $abstractionDefinition_db->db_get("${vendor}__${library}_${component}_${version}", $design_data );
      ( $design_xml_file, $design_xml_sep,$design_version,$design_name,$design_library,$design_vendor ) = split ':', $data;
      ( $design_xml_file, $design_xml_sep,$design_version,$design_name,$design_library,$design_vendor ) = split ':', $design_data;
 
 
      return("$design_xml_file");
      return("$design_xml_file");
 
 
   }
   }
 
 
Line 1121... Line 1151...
   my $version    = pop(@params);
   my $version    = pop(@params);
   my $component  = pop(@params);
   my $component  = pop(@params);
   my $library    = pop(@params);
   my $library    = pop(@params);
   my $vendor     = pop(@params);
   my $vendor     = pop(@params);
 
 
   my $data;
   my $design_data;
   my $design_xml_sep ;
   my $design_xml_sep ;
   my $design_xml_file ;
   my $design_xml_file ;
   my $design_version;
   my $design_version;
 
 
 
 
      $busDefinition_db->db_get("${vendor}__${library}_${component}_${version}", $data );
      $busDefinition_db->db_get("${vendor}__${library}_${component}_${version}", $design_data );
      ( $design_xml_file, $design_xml_sep,$design_version ) = split ':', $data;
      ( $design_xml_file, $design_xml_sep,$design_version ) = split ':', $design_data;
 
 
      return("$design_xml_file");
      return("$design_xml_file");
   }
   }
 
 
 
 
Line 1320... Line 1350...
   {
   {
   my $socgen_libraryConfiguration= $parser->parse_file(yp::lib::find_libraryConfiguration($vendor,$library));
   my $socgen_libraryConfiguration= $parser->parse_file(yp::lib::find_libraryConfiguration($vendor,$library));
      $lib_sw_dir  = $socgen_libraryConfiguration->findnodes('//socgen:libraryConfiguration/socgen:lib_sw_dir/text()')->to_literal ;
      $lib_sw_dir  = $socgen_libraryConfiguration->findnodes('//socgen:libraryConfiguration/socgen:lib_sw_dir/text()')->to_literal ;
   }
   }
 
 
      return("/${lib_sw_dir}");
      return("${lib_sw_dir}");
 
 
   }
   }
 
 
 
 
 
 
Line 1784... Line 1814...
#/                                                                                            */
#/                                                                                            */
#/   my @filelist = yp::lib::parse_component_file($vendor,$library,$component,$version);      */
#/   my @filelist = yp::lib::parse_component_file($vendor,$library,$component,$version);      */
#/                                                                                            */
#/                                                                                            */
#/*********************************************************************************************/
#/*********************************************************************************************/
 
 
 
 
 
 
sub parse_component_file
sub parse_component_file
   {
   {
   my @params     = @_;
   my @params     = @_;
   my $version    = pop(@params);
   my $version    = pop(@params);
   my $component  = pop(@params);
   my $component  = pop(@params);
   my $library    = pop(@params);
   my $library    = pop(@params);
   my $vendor     = pop(@params);
   my $vendor     = pop(@params);
 
   my @filelist_acc       = parse_component_fileX($vendor,$library,$component,$version,1);
 
   return(@filelist_acc);
 
   }
 
 
   my $parser     = XML::LibXML->new();
 
 
 
 
 
 
 
 
 
 
 
 
sub parse_component_fileX
 
   {
 
   my @params     = @_;
 
   my $switch     = pop(@params);
 
   my $version    = pop(@params);
 
   my $component  = pop(@params);
 
   my $library    = pop(@params);
 
   my $vendor     = pop(@params);
 
   my $parser     = XML::LibXML->new();
   my $spirit_cmp_filename =yp::lib::find_ipxact_component($vendor,$library,$component,$version );
   my $spirit_cmp_filename =yp::lib::find_ipxact_component($vendor,$library,$component,$version );
 
 
   unless($spirit_cmp_filename)
   unless($spirit_cmp_filename)
      {
      {
      print("spirit:component MISSING   $vendor,$library,$component,$version \n");
      print("ipxact:component MISSING   $vendor,$library,$component,$version \n");
      }
      }
 
 
 
 
   my $spirit_component_file  = $parser->parse_file(yp::lib::find_ipxact_component($vendor,$library,$component,$version ));
   my $spirit_component_file  = $parser->parse_file(yp::lib::find_ipxact_component($vendor,$library,$component,$version ));
 
 
 
 
   my $line;
   my $line;
 
 
   my      @filelist_acc = (  );
   my      @filelist_acc = (  );
   push(@filelist_acc,"::${vendor}::${library}::${component}::${version}::");
 
 
 
   foreach my $new_comp ($spirit_component_file->findnodes("//spirit:component/spirit:model/spirit:views/spirit:view/spirit:vendorExtensions/spirit:componentRef"))
   if($switch)     {   push(@filelist_acc,"::${vendor}::${library}::${component}::${version}::");}
 
 
 
   foreach my $new_comp ($spirit_component_file->findnodes("//ipxact:component/ipxact:model/ipxact:views/ipxact:view/ipxact:vendorExtensions/ipxact:componentRef"))
     {
     {
     my($new_vendor)        = $new_comp->findnodes('./@spirit:vendor')->to_literal ;
     my($new_vendor)        = $new_comp->findnodes('./@ipxact:vendor')->to_literal ;
     my($new_library)       = $new_comp->findnodes('./@spirit:library')->to_literal ;
     my($new_library)       = $new_comp->findnodes('./@ipxact:library')->to_literal ;
     my($new_name)          = $new_comp->findnodes('./@spirit:name')->to_literal ;
     my($new_name)          = $new_comp->findnodes('./@ipxact:name')->to_literal ;
     my($new_version)       = $new_comp->findnodes('./@spirit:version')->to_literal ;
     my($new_version)       = $new_comp->findnodes('./@ipxact:version')->to_literal ;
     my @filelist_sub       = parse_component_fileX($new_vendor,$new_library,$new_name,$new_version);
     my @filelist_sub       = parse_component_fileX($new_vendor,$new_library,$new_name,$new_version,0);
                              foreach $line (@filelist_sub) { push(@filelist_acc,"$line"); }
                              foreach $line (@filelist_sub) { push(@filelist_acc,"$line"); }
     }
     }
 
 
   foreach my $new_comp ($spirit_component_file->findnodes("//spirit:component/spirit:model/spirit:views/spirit:view/spirit:hierarchyRef"))
   foreach my $new_comp ($spirit_component_file->findnodes("//ipxact:component/ipxact:model/ipxact:views/ipxact:view/ipxact:hierarchyRef"))
     {
     {
     my($new_vendor)        = $new_comp->findnodes('./@spirit:vendor')->to_literal ;
     my($new_vendor)        = $new_comp->findnodes('./@ipxact:vendor')->to_literal ;
     my($new_library)       = $new_comp->findnodes('./@spirit:library')->to_literal ;
     my($new_library)       = $new_comp->findnodes('./@ipxact:library')->to_literal ;
     my($new_name)          = $new_comp->findnodes('./@spirit:name')->to_literal ;
     my($new_name)          = $new_comp->findnodes('./@ipxact:name')->to_literal ;
     my($new_version)       = $new_comp->findnodes('./@spirit:version')->to_literal ;
     my($new_version)       = $new_comp->findnodes('./@ipxact:version')->to_literal ;
 
 
     if(yp::lib::find_ipxact_design($new_vendor,$new_library,$new_name,$new_version ))
     if(yp::lib::find_ipxact_design($new_vendor,$new_library,$new_name,$new_version ))
             {
             {
 
#        print "FFFFFFFF  $new_vendor $new_library $new_name $new_version  hierarchyRef \n";
             my $spirit_design_file = $parser->parse_file(yp::lib::find_ipxact_design($new_vendor,$new_library,$new_name,$new_version ));
             my $spirit_design_file = $parser->parse_file(yp::lib::find_ipxact_design($new_vendor,$new_library,$new_name,$new_version ));
             foreach  my   $i_name ($spirit_design_file->findnodes("//spirit:design/spirit:componentInstances/spirit:componentInstance/spirit:componentRef/\@spirit:vendor"))
             foreach
 
                my   $i_name ($spirit_design_file->findnodes("//ipxact:design/ipxact:componentInstances/ipxact:componentInstance/ipxact:componentRef"))
                {
                {
                my($vendor_name)         = $i_name  ->to_literal ;
                my($vendor_name)         = $i_name  ->findnodes('./@vendor')->to_literal ;
                my($library_name)        = $i_name  ->findnodes('../@spirit:library')->to_literal ;
                my($library_name)        = $i_name  ->findnodes('./@library')->to_literal ;
                my($component_name)      = $i_name  ->findnodes('../@spirit:name')->to_literal ;
                my($component_name)      = $i_name  ->findnodes('./@name')->to_literal ;
                my($version_name)        = $i_name  ->findnodes('../@spirit:version')->to_literal ;
                my($version_name)        = $i_name  ->findnodes('./@version')->to_literal ;
 
 
                push(@filelist_acc,"::${vendor_name}::${library_name}::${component_name}::${version_name}::");
                push(@filelist_acc,"::${vendor_name}::${library_name}::${component_name}::${version_name}::");
                my  @filelist_sub = parse_component_fileX($vendor_name,$library_name,$component_name,$version_name);
                my  @filelist_sub = parse_component_fileX($vendor_name,$library_name,$component_name,$version_name,0);
                  foreach $line (@filelist_sub) { push(@filelist_acc,"$line"); }
                  foreach $line (@filelist_sub) { push(@filelist_acc,"$line"); }
                }
                }
             }
             }
     }
     }
 
 
   @filelist_acc     =       sys::lib::trim_sort(@filelist_acc);
 
   return(@filelist_acc);
 
}
 
 
 
 
 
 
 
 
 
 
   foreach my $new_comp ($spirit_component_file->findnodes("//ipxact:component/ipxact:model/ipxact:views/ipxact:view/ipxact:designInstantiationRef/text()"))
sub parse_component_fileX
 
   {
   {
   my @params     = @_;
     my($designInsref_value)         = $new_comp  ->to_literal ;
   my $version    = pop(@params);
     my($designInsref_name)          = $new_comp  ->findnodes('../../ipxact:name')->to_literal ;
   my $component  = pop(@params);
 
   my $library    = pop(@params);
 
   my $vendor     = pop(@params);
 
 
 
   my $parser     = XML::LibXML->new();
 
 
 
 
   foreach my $new_comp ($spirit_component_file->findnodes("//ipxact:component/ipxact:model/ipxact:instantiations/ipxact:designInstantiation"))
 
        {
 
                my($t_ref)           = $new_comp->findnodes('./ipxact:name/text()')->to_literal ;
 
                my($t_vendor)        = $new_comp->findnodes('./ipxact:designRef/@vendor')->to_literal ;
 
                my($t_library)       = $new_comp->findnodes('./ipxact:designRef/@library')->to_literal ;
 
                my($t_name)          = $new_comp->findnodes('./ipxact:designRef/@name')->to_literal ;
 
                my($t_version)       = $new_comp->findnodes('./ipxact:designRef/@version')->to_literal ;
 
 
   my $spirit_cmp_filename =yp::lib::find_ipxact_component($vendor,$library,$component,$version );
 
 
 
   unless($spirit_cmp_filename)
        if($t_ref eq $designInsref_name )
      {
      {
      print("spirit:component MISSING   $vendor,$library,$component,$version \n");
 
      }
 
 
 
 
 
   my $spirit_component_file  = $parser->parse_file(yp::lib::find_ipxact_component($vendor,$library,$component,$version ));
 
 
 
 
 
   my $line;
 
 
 
   my      @filelist_acc = (  );
 
 
 
 
        if(yp::lib::find_ipxact_design($t_vendor,$t_library,$t_name,$t_version ))
   foreach my $new_comp ($spirit_component_file->findnodes("//spirit:component/spirit:model/spirit:views/spirit:view/spirit:vendorExtensions/spirit:componentRef"))
 
     {
     {
     my($new_vendor)        = $new_comp->findnodes('./@spirit:vendor')->to_literal ;
 
     my($new_library)       = $new_comp->findnodes('./@spirit:library')->to_literal ;
 
     my($new_name)          = $new_comp->findnodes('./@spirit:name')->to_literal ;
 
     my($new_version)       = $new_comp->findnodes('./@spirit:version')->to_literal ;
 
     my @filelist_sub       = parse_component_fileX($new_vendor,$new_library,$new_name,$new_version);
 
                              foreach $line (@filelist_sub) { push(@filelist_acc,"$line"); }
 
     }
 
 
 
   foreach my $new_comp ($spirit_component_file->findnodes("//spirit:component/spirit:model/spirit:views/spirit:view/spirit:hierarchyRef"))
             my $spirit_design_file = $parser->parse_file(yp::lib::find_ipxact_design($t_vendor,$t_library,$t_name,$t_version ));
 
             foreach
 
                my   $i_name ($spirit_design_file->findnodes("//ipxact:design/ipxact:componentInstances/ipxact:componentInstance/ipxact:componentRef"))
     {
     {
     my($new_vendor)        = $new_comp->findnodes('./@spirit:vendor')->to_literal ;
                my($vendor_name)         = $i_name  ->findnodes('./@vendor')->to_literal ;
     my($new_library)       = $new_comp->findnodes('./@spirit:library')->to_literal ;
                my($library_name)        = $i_name  ->findnodes('./@library')->to_literal ;
     my($new_name)          = $new_comp->findnodes('./@spirit:name')->to_literal ;
                my($component_name)      = $i_name  ->findnodes('./@name')->to_literal ;
     my($new_version)       = $new_comp->findnodes('./@spirit:version')->to_literal ;
                my($version_name)        = $i_name  ->findnodes('./@version')->to_literal ;
 
 
     if(yp::lib::find_ipxact_design($new_vendor,$new_library,$new_name,$new_version ))
 
          {
 
          my $spirit_design_file = $parser->parse_file(yp::lib::find_ipxact_design($new_vendor,$new_library,$new_name,$new_version ));
 
          foreach  my   $i_name ($spirit_design_file->findnodes("//spirit:design/spirit:componentInstances/spirit:componentInstance/spirit:componentRef/\@spirit:vendor"))
 
                {
 
                my($vendor_name)         = $i_name  ->to_literal ;
 
                my($library_name)        = $i_name  ->findnodes('../@spirit:library')->to_literal ;
 
                my($component_name)      = $i_name  ->findnodes('../@spirit:name')->to_literal ;
 
                my($version_name)        = $i_name  ->findnodes('../@spirit:version')->to_literal ;
 
 
 
                push(@filelist_acc,"::${vendor_name}::${library_name}::${component_name}::${version_name}::");
                push(@filelist_acc,"::${vendor_name}::${library_name}::${component_name}::${version_name}::");
                my  @filelist_sub = parse_component_fileX($vendor_name,$library_name,$component_name,$version_name);
                my  @filelist_sub = parse_component_fileX($vendor_name,$library_name,$component_name,$version_name,0);
                  foreach $line (@filelist_sub) { push(@filelist_acc,"$line"); }
                  foreach $line (@filelist_sub) { push(@filelist_acc,"$line"); }
                }
                }
 
 
           }
           }
     }
     }
 
        }
 
     }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
   @filelist_acc     =       sys::lib::trim_sort(@filelist_acc);
   @filelist_acc     =       sys::lib::trim_sort(@filelist_acc);
   return(@filelist_acc);
   return(@filelist_acc);
}
}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
#/*********************************************************************************************/
#/*********************************************************************************************/
#/  parse_component_brothers                                                                  */
#/  parse_component_brothers                                                                  */
#/                                                                                            */
#/                                                                                            */
#/  returns names for component brothers                                                      */
#/  returns names for component brothers                                                      */
#/                                                                                            */
#/                                                                                            */
Line 1951... Line 1979...
 
 
   my $line;
   my $line;
   my      @filelist_acc = (  );
   my      @filelist_acc = (  );
   push(@filelist_acc,"::${vendor}::${library}::${component}::${version}::");
   push(@filelist_acc,"::${vendor}::${library}::${component}::${version}::");
 
 
   foreach my $new_comp ($spirit_component_file->findnodes("//spirit:component/spirit:model/spirit:views/spirit:view/spirit:vendorExtensions/spirit:componentRef"))
   foreach my $new_comp ($spirit_component_file->findnodes("//ipxact:component/ipxact:model/ipxact:views/ipxact:view/ipxact:vendorExtensions/ipxact:componentRef"))
     {
     {
     my($new_vendor)        = $new_comp->findnodes('./@spirit:vendor')->to_literal ;
     my($new_vendor)        = $new_comp->findnodes('./@ipxact:vendor')->to_literal ;
     my($new_library)       = $new_comp->findnodes('./@spirit:library')->to_literal ;
     my($new_library)       = $new_comp->findnodes('./@ipxact:library')->to_literal ;
     my($new_component)     = $new_comp->findnodes('./@spirit:name')->to_literal ;
     my($new_component)     = $new_comp->findnodes('./@ipxact:name')->to_literal ;
     my($new_version)       = $new_comp->findnodes('./@spirit:version')->to_literal ;
     my($new_version)       = $new_comp->findnodes('./@ipxact:version')->to_literal ;
     push(@filelist_acc,"::${new_vendor}::${new_library}::${new_component}::${new_version}::");
     push(@filelist_acc,"::${new_vendor}::${new_library}::${new_component}::${new_version}::");
     }
     }
 
 
   return(@filelist_acc);
   return(@filelist_acc);
}
}
Line 1968... Line 1996...
#/*****************************************************************************************************/
#/*****************************************************************************************************/
#/  find_ipxact_design_files                                                                          */
#/  find_ipxact_design_files                                                                          */
#/                                                                                                    */
#/                                                                                                    */
#/  returns parser tokens  to ip-xact design files referred to by component file vlnv                 */
#/  returns parser tokens  to ip-xact design files referred to by component file vlnv                 */
#/                                                                                                    */
#/                                                                                                    */
#/  my @spirit_design_files = yp::lib::find_ipxact_design_file($vendor,$library,$component,$version);  */
#/  my @spirit_design_files = yp::lib::find_ipxact_design_files($vendor,$library,$component,$version);  */
#/                                                                                                    */
#/                                                                                                    */
#/*****************************************************************************************************/
#/*****************************************************************************************************/
 
 
sub find_ipxact_design_files
sub find_ipxact_design_files
   {
   {
Line 1986... Line 2014...
   my @design_files = ();
   my @design_files = ();
   my $parser           = XML::LibXML->new();
   my $parser           = XML::LibXML->new();
   unless (yp::lib::find_ipxact_component($vendor,$library,$component,$version)){print "Missing Component  $vendor, $library, $component, $version \n";  }
   unless (yp::lib::find_ipxact_component($vendor,$library,$component,$version)){print "Missing Component  $vendor, $library, $component, $version \n";  }
   my $spirit_component_file    = $parser->parse_file(yp::lib::find_ipxact_component($vendor,$library,$component,$version));
   my $spirit_component_file    = $parser->parse_file(yp::lib::find_ipxact_component($vendor,$library,$component,$version));
 
 
   foreach my $new_comp ($spirit_component_file->findnodes("//spirit:component/spirit:model/spirit:views/spirit:view/spirit:vendorExtensions/spirit:componentRef"))
   foreach my $new_comp ($spirit_component_file->findnodes("//ipxact:component/ipxact:model/ipxact:views/ipxact:view/ipxact:vendorExtensions/ipxact:componentRef"))
     {
     {
     my($new_vendor)        = $new_comp->findnodes('./@spirit:vendor')->to_literal ;
     my($new_vendor)        = $new_comp->findnodes('./@ipxact:vendor')->to_literal ;
     my($new_library)       = $new_comp->findnodes('./@spirit:library')->to_literal ;
     my($new_library)       = $new_comp->findnodes('./@ipxact:library')->to_literal ;
     my($new_name)          = $new_comp->findnodes('./@spirit:name')->to_literal ;
     my($new_name)          = $new_comp->findnodes('./@ipxact:name')->to_literal ;
     my($new_version)       = $new_comp->findnodes('./@spirit:version')->to_literal ;
     my($new_version)       = $new_comp->findnodes('./@ipxact:version')->to_literal ;
     my @filelist_sub       = yp::lib::find_ipxact_design_files($new_vendor,$new_library,$new_name,$new_version);
     my @filelist_sub       = yp::lib::find_ipxact_design_files($new_vendor,$new_library,$new_name,$new_version);
                              foreach my $line (@filelist_sub) { push(@design_files,"$line"); }     }
                              foreach my $line (@filelist_sub) { push(@design_files,"$line"); }     }
 
 
   foreach my $comp_view ($spirit_component_file->findnodes('//spirit:component/spirit:model/spirit:views/spirit:view'))
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
   foreach my $comp_view ($spirit_component_file->findnodes('//ipxact:component/ipxact:model/ipxact:views/ipxact:view'))
      {
      {
      my($hier_ref_vendor)         = $comp_view->findnodes('./spirit:hierarchyRef/@spirit:vendor')->to_literal ;
      my($hier_ref_vendor)         = $comp_view->findnodes('./ipxact:hierarchyRef/@ipxact:vendor')->to_literal ;
      my($hier_ref_library)        = $comp_view->findnodes('./spirit:hierarchyRef/@spirit:library')->to_literal ;
      my($hier_ref_library)        = $comp_view->findnodes('./ipxact:hierarchyRef/@ipxact:library')->to_literal ;
      my($hier_ref_design)         = $comp_view->findnodes('./spirit:hierarchyRef/@spirit:name')->to_literal ;
      my($hier_ref_design)         = $comp_view->findnodes('./ipxact:hierarchyRef/@ipxact:name')->to_literal ;
      my($hier_ref_version)        = $comp_view->findnodes('./spirit:hierarchyRef/@spirit:version')->to_literal ;
      my($hier_ref_version)        = $comp_view->findnodes('./ipxact:hierarchyRef/@ipxact:version')->to_literal ;
      if(find_ipxact_design($hier_ref_vendor,$hier_ref_library,$hier_ref_design,$hier_ref_version))
      if(find_ipxact_design($hier_ref_vendor,$hier_ref_library,$hier_ref_design,$hier_ref_version))
        {
        {
 
#       print "FFFFFFFF $hier_ref_vendor  $hier_ref_library $hier_ref_design  $hier_ref_version   hierarchyRef \n";
        push(@design_files,":::${hier_ref_vendor}:::${hier_ref_library}:::${hier_ref_design}:::${hier_ref_version}:::");
        push(@design_files,":::${hier_ref_vendor}:::${hier_ref_library}:::${hier_ref_design}:::${hier_ref_version}:::");
        }
        }
      }
      }
 
 
 
 
 
 
 
   foreach my $comp_view ($spirit_component_file->findnodes("//ipxact:component/ipxact:model/ipxact:views/ipxact:view/ipxact:designInstantiationRef/text()"))
 
     {
 
     my($designInsref_value)         = $comp_view  ->to_literal ;
 
     my($designInsref_name)          = $comp_view  ->findnodes('../../ipxact:name')->to_literal ;
 
 
 
 
 
   foreach my $comp_view ($spirit_component_file->findnodes("//ipxact:component/ipxact:model/ipxact:instantiations/ipxact:designInstantiation"))
 
        {
 
 
 
        my($t_ref)           = $comp_view->findnodes('./ipxact:name/text()')->to_literal ;
 
        my($t_vendor)        = $comp_view->findnodes('./ipxact:designRef/@vendor')->to_literal ;
 
        my($t_library)       = $comp_view->findnodes('./ipxact:designRef/@library')->to_literal ;
 
        my($t_name)          = $comp_view->findnodes('./ipxact:designRef/@name')->to_literal ;
 
        my($t_version)       = $comp_view->findnodes('./ipxact:designRef/@version')->to_literal ;
 
 
 
        if($t_ref eq $designInsref_name )
 
        {
 
 
 
      if(find_ipxact_design($t_vendor,$t_library,$t_name,$t_version))
 
      {
 
#       print "FFFFFFFF  $t_vendor $t_library $t_name $t_version  designInstantiationRef \n";
 
        push(@design_files,":::${t_vendor}:::${t_library}:::${t_name}:::${t_version}:::");
 
        }
 
 
 
 
 
 
 
 
 
 
 
        }
 
        }
 
     }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
     return(@design_files);
     return(@design_files);
   }
   }
 
 
sub trim_sort {
sub trim_sort {
   my @output_files  = @_;
   my @output_files  = @_;

powered by: WebSVN 2.1.0

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