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

Subversion Repositories socgen

[/] [socgen/] [trunk/] [tools/] [yp/] [lib.pm] - Diff between revs 118 and 120

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 118 Rev 120
Line 89... Line 89...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
#/*****************************************************************************************************/
#/*****************************************************************************************************/
#/  find_ipxact_design_file                                                                           */
#/  find_ipxact_design_files                                                                          */
#/                                                                                                    */
#/                                                                                                    */
#/  returns parser token  to ip-xact design file referred to by component file vlnv                   */
#/  returns parser tokens  to ip-xact design files referred to by component file vlnv                 */
#/                                                                                                    */
#/                                                                                                    */
#/  my $spirit_design_file = yp::lib::find_ipxact_design_file($vendor,$library,$component,$version);  */
#/  my @spirit_design_files = yp::lib::find_ipxact_design_file($vendor,$library,$component,$version);  */
#/                                                                                                    */
#/                                                                                                    */
#/*****************************************************************************************************/
#/*****************************************************************************************************/
 
 
sub find_ipxact_design_file
sub find_ipxact_design_files
   {
   {
   my @params     = @_;
   my @params     = @_;
   my $version    = pop(@params);
   my $version    = pop(@params);
   my $component  = pop(@params);
   my $component  = pop(@params);
   my $project    = pop(@params);
   my $project    = pop(@params);
Line 115... Line 117...
   my $card_vendor;
   my $card_vendor;
   my $card_library;
   my $card_library;
   my $card_component;
   my $card_component;
   my $card_version;
   my $card_version;
 
 
 
   my @design_files = ();
 
 
   my $parser           = XML::LibXML->new();
   my $parser           = XML::LibXML->new();
   my $yp_index_file    = $parser->parse_file("./tools/yp/hier_index.xml");
   my $yp_index_file    = $parser->parse_file("./tools/yp/hier_index.xml");
 
 
   unless (yp::lib::find_ipxact("spirit:component",$vendor,$project,$component,$version)){print "Missing Component  $vendor, $project, $component, $version \n";  }
   unless (yp::lib::find_ipxact("spirit:component",$vendor,$project,$component,$version)){print "Missing Component  $vendor, $project, $component, $version \n";  }
 
 
   my $spirit_component_file    = $parser->parse_file(yp::lib::find_ipxact("spirit:component",$vendor,$project,$component,$version));
   my $spirit_component_file    = $parser->parse_file(yp::lib::find_ipxact("spirit:component",$vendor,$project,$component,$version));
 
 
   foreach my $comp_view ($spirit_component_file->findnodes('//spirit:component/spirit:model/spirit:views/spirit:view'))
   foreach my $comp_view ($spirit_component_file->findnodes('//spirit:component/spirit:model/spirit:views/spirit:view'))
      {
      {
      my($view_name)          = $comp_view->findnodes('./spirit:name/text()')->to_literal ;
 
      if($view_name eq "Hierarchical")
 
        {
 
        my($hier_ref_vendor)         = $comp_view->findnodes('./spirit:hierarchyRef/@spirit:vendor')->to_literal ;
        my($hier_ref_vendor)         = $comp_view->findnodes('./spirit:hierarchyRef/@spirit:vendor')->to_literal ;
        my($hier_ref_library)        = $comp_view->findnodes('./spirit:hierarchyRef/@spirit:library')->to_literal ;
        my($hier_ref_library)        = $comp_view->findnodes('./spirit:hierarchyRef/@spirit:library')->to_literal ;
        my($hier_ref_component)      = $comp_view->findnodes('./spirit:hierarchyRef/@spirit:name')->to_literal ;
        my($hier_ref_component)      = $comp_view->findnodes('./spirit:hierarchyRef/@spirit:name')->to_literal ;
        my($hier_ref_version)        = $comp_view->findnodes('./spirit:hierarchyRef/@spirit:version')->to_literal ;
        my($hier_ref_version)        = $comp_view->findnodes('./spirit:hierarchyRef/@spirit:version')->to_literal ;
 
 
        my $spirit_designCfg_file
 
         = $parser->parse_file(yp::lib::find_ipxact("spirit:designConfiguration",$hier_ref_vendor,$hier_ref_library,$hier_ref_component,$hier_ref_version ));
 
 
 
        foreach my $design_ref_view ($spirit_designCfg_file->findnodes('//spirit:designConfiguration'))
 
           {
 
           my($hier_xref_vendor)         = $design_ref_view->findnodes('./spirit:designRef/@spirit:vendor')->to_literal ;
 
           my($hier_xref_library)        = $design_ref_view->findnodes('./spirit:designRef/@spirit:library')->to_literal ;
 
           my($hier_xref_component)      = $design_ref_view->findnodes('./spirit:designRef/@spirit:name')->to_literal ;
 
           my($hier_xref_version)        = $design_ref_view->findnodes('./spirit:designRef/@spirit:version')->to_literal ;
 
 
 
           foreach  my   $index_card ($yp_index_file->findnodes("//socgen:file_types/socgen:file_type[socgen:name/text() = 'spirit:design']/socgen:vendors/socgen:vendor[socgen:name/text() = '$hier_xref_vendor']/socgen:libraries/socgen:library[socgen:name/text() = '$hier_xref_library']/socgen:components/socgen:component[socgen:name/text() = '$hier_xref_component']/socgen:versions/socgen:version[socgen:name/text() = '$hier_xref_version']"))
 
             {
 
             return($parser->parse_file(yp::lib::find_ipxact("spirit:design",$hier_xref_vendor,$hier_xref_library,$hier_xref_component,$hier_xref_version )));
 
             };
 
           }
 
        }
 
      }
 
     return("");
 
   }
 
 
 
 
 
 
 
 
      if(yp::lib::find_ipxact("spirit:designConfiguration",$hier_ref_vendor,$hier_ref_library,$hier_ref_component,$hier_ref_version ))
#/*****************************************************************************************************/
 
#/  find_ipxact_padring_file                                                                         */
 
#/                                                                                                    */
 
#/  returns parser token  to ip-xact padring component file referred to by component file vlnv        */
 
#/                                                                                                    */
 
#/  my $spirit_padring_file = yp::lib::find_ipxact_padring_file($vendor,$library,$component,$version);*/
 
#/                                                                                                    */
 
#/*****************************************************************************************************/
 
 
 
sub find_ipxact_padring_file
 
   {
   {
   my @params     = @_;
 
   my $version    = pop(@params);
 
   my $component  = pop(@params);
 
   my $project    = pop(@params);
 
   my $vendor     = pop(@params);
 
 
 
 
 
   my $card_type;
      my $spirit_designCfg_file
   my $card_file_name;
       = $parser->parse_file(yp::lib::find_ipxact("spirit:designConfiguration",$hier_ref_vendor,$hier_ref_library,$hier_ref_component,$hier_ref_version ));
   my $card_dir_name;
 
   my $card_vendor;
 
   my $card_library;
 
   my $card_component;
 
   my $card_version;
 
 
 
   my $parser           = XML::LibXML->new();
 
   my $yp_index_file    = $parser->parse_file("./tools/yp/hier_index.xml");
 
 
 
   my $spirit_component_file    = $parser->parse_file(yp::lib::find_ipxact("spirit:component",$vendor,$project,$component,$version));
 
 
 
   foreach my $comp_view ($spirit_component_file->findnodes('//spirit:component/spirit:model/spirit:views/spirit:view'))
      foreach my $design_ref_view ($spirit_designCfg_file->findnodes('//spirit:designConfiguration'))
      {
 
      my($view_name)          = $comp_view->findnodes('./spirit:name/text()')->to_literal ;
 
      if($view_name eq "Pad_Ring")
 
        {
        {
        my($hier_ref_vendor)         = $comp_view->findnodes('./spirit:hierarchyRef/@spirit:vendor')->to_literal ;
         ($hier_ref_vendor)         = $design_ref_view->findnodes('./spirit:designRef/@spirit:vendor')->to_literal ;
        my($hier_ref_library)        = $comp_view->findnodes('./spirit:hierarchyRef/@spirit:library')->to_literal ;
         ($hier_ref_library)        = $design_ref_view->findnodes('./spirit:designRef/@spirit:library')->to_literal ;
        my($hier_ref_component)      = $comp_view->findnodes('./spirit:hierarchyRef/@spirit:name')->to_literal ;
         ($hier_ref_component)      = $design_ref_view->findnodes('./spirit:designRef/@spirit:name')->to_literal ;
        my($hier_ref_version)        = $comp_view->findnodes('./spirit:hierarchyRef/@spirit:version')->to_literal ;
         ($hier_ref_version)        = $design_ref_view->findnodes('./spirit:designRef/@spirit:version')->to_literal ;
 
 
        return($parser->parse_file(yp::lib::find_ipxact("spirit:component",$hier_ref_vendor,$hier_ref_library,$hier_ref_component,$hier_ref_version )));
 
 
 
 
 
        }
 
      }
      }
     return("");
 
   }
 
 
 
 
 
 
 
 
      }
#/*****************************************************************************************************/
 
#/  find_ipxact_padring_design_file                                                                         */
 
#/                                                                                                    */
 
#/  returns parser token  to ip-xact padring component file referred to by component file vlnv        */
 
#/                                                                                                    */
 
#/  my $spirit_padring_design_file = yp::lib::find_ipxact_padring_file($vendor,$library,$component,$version);*/
 
#/                                                                                                    */
 
#/*****************************************************************************************************/
 
 
 
sub find_ipxact_padring_design_file
 
   {
 
   my @params     = @_;
 
   my $version    = pop(@params);
 
   my $component  = pop(@params);
 
   my $project    = pop(@params);
 
   my $vendor     = pop(@params);
 
 
 
 
 
   my $card_type;
 
   my $card_file_name;
 
   my $card_dir_name;
 
   my $card_vendor;
 
   my $card_library;
 
   my $card_component;
 
   my $card_version;
 
   my $w;
 
   my $parser           = XML::LibXML->new();
 
   my $yp_index_file    = $parser->parse_file("./tools/yp/hier_index.xml");
 
 
 
   my $spirit_component_file    = $parser->parse_file(yp::lib::find_ipxact("spirit:component",$vendor,$project,$component,$version));
 
 
 
 
 
 
 
 
 
   foreach my $comp_view ($spirit_component_file->findnodes('//spirit:component/spirit:model/spirit:views/spirit:view'))
         foreach  my   $index_card ($yp_index_file->findnodes("//socgen:file_types/socgen:file_type[socgen:name/text() = 'spirit:design']/socgen:vendors/socgen:vendor[socgen:name/text() = '$hier_ref_vendor']/socgen:libraries/socgen:library[socgen:name/text() = '$hier_ref_library']/socgen:components/socgen:component[socgen:name/text() = '$hier_ref_component']/socgen:versions/socgen:version[socgen:name/text() = '$hier_ref_version']"))
      {
      {
      my($view_name)          = $comp_view->findnodes('./spirit:name/text()')->to_literal ;
           push(@design_files,$parser->parse_file(yp::lib::find_ipxact("spirit:design",$hier_ref_vendor,$hier_ref_library,$hier_ref_component,$hier_ref_version )));
 
           };
 
 
      if($view_name eq "Pad_Ring")
 
        {
 
        my($hier_ref_vendor)         = $comp_view->findnodes('./spirit:hierarchyRef/@spirit:vendor')->to_literal ;
 
        my($hier_ref_library)        = $comp_view->findnodes('./spirit:hierarchyRef/@spirit:library')->to_literal ;
 
        my($hier_ref_component)      = $comp_view->findnodes('./spirit:hierarchyRef/@spirit:name')->to_literal ;
 
        my($hier_ref_version)        = $comp_view->findnodes('./spirit:hierarchyRef/@spirit:version')->to_literal ;
 
 
 
 
 
 
 
        return(find_ipxact_design_file($hier_ref_vendor,$hier_ref_library,$hier_ref_component,$hier_ref_version ));
 
 
 
 
 
        }
        }
 
     return(@design_files);
      }
      }
     return("");
 
   }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
#/*********************************************************************************************/
#/*********************************************************************************************/
#/  find_ipxact_file                                                                          */
#/  find_ipxact_file                                                                          */
Line 560... Line 459...
   }
   }
 
 
 
 
 
 
 
 
 
 
#/*********************************************************************************************/
#/*********************************************************************************************/
#/  find_lib_comp_sep                                                                         */
#/  find_lib_comp_sep                                                                         */
#/                                                                                            */
#/                                                                                            */
#/  returns  path to the component from library level                                         */
#/  returns  path to the component from library level                                         */
#/  The file MUST be stored under a subdirectory that matches the component name              */
#/  The file MUST be stored under a subdirectory that matches the component name              */
Line 584... Line 484...
   my $card_dir_name;
   my $card_dir_name;
   my $card_vendor_path;
   my $card_vendor_path;
   my $card_library_path;
   my $card_library_path;
   my $card_component_path;
   my $card_component_path;
   my $card_lib_comp_sep;
   my $card_lib_comp_sep;
 
   my $card_lib_ip_dir;
   my $card_vendor;
   my $card_vendor;
   my $card_library;
   my $card_library;
   my $card_component;
   my $card_component;
   my $card_version;
   my $card_version;
 
 
Line 601... Line 502...
     $card_dir_name      = $index_card->findnodes('../dir_name/text()')->to_literal ;
     $card_dir_name      = $index_card->findnodes('../dir_name/text()')->to_literal ;
     $card_vendor_path   = $index_card->findnodes('../vendor_path/text()')->to_literal ;
     $card_vendor_path   = $index_card->findnodes('../vendor_path/text()')->to_literal ;
     $card_component_path= $index_card->findnodes('../component_path/text()')->to_literal ;
     $card_component_path= $index_card->findnodes('../component_path/text()')->to_literal ;
     $card_library_path  = $index_card->findnodes('../library_path/text()')->to_literal ;
     $card_library_path  = $index_card->findnodes('../library_path/text()')->to_literal ;
     $card_lib_comp_sep  = $index_card->findnodes('../lib_comp_sep/text()')->to_literal ;
     $card_lib_comp_sep  = $index_card->findnodes('../lib_comp_sep/text()')->to_literal ;
 
     $card_lib_ip_dir    = $index_card->findnodes('../lib_ip_dir/text()')->to_literal ;
     $card_vendor        = $index_card->findnodes('../vendor/text()')->to_literal ;
     $card_vendor        = $index_card->findnodes('../vendor/text()')->to_literal ;
     $card_library       = $index_card->findnodes('../library/text()')->to_literal ;
     $card_library       = $index_card->findnodes('../library/text()')->to_literal ;
     $card_component     = $index_card->findnodes('../name/text()')->to_literal ;
     $card_component     = $index_card->findnodes('../name/text()')->to_literal ;
     $card_version       = $index_card->findnodes('../version/text()')->to_literal ;
     $card_version       = $index_card->findnodes('../version/text()')->to_literal ;
     if(( $card_vendor    eq "${vendor}"    ) &
     if(( $card_vendor    eq "${vendor}"    ) &
        ( $card_library   eq "${project}"   )
        ( $card_library   eq "${project}"   ) &
 
        ( $card_type      eq "socgen:lib"   )
       )
       )
       {
       {
       if($card_lib_comp_sep)   {return("/${card_lib_comp_sep}");}
       if($card_lib_ip_dir)   {return("/${card_lib_ip_dir}");}
       else                     {return("");}
       else                     {return("");}
 
       }
 
     }
 
   }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
#/*********************************************************************************************/
 
#/  find_file_type                                                                            */
 
#/                                                                                            */
 
#/  returns  file_type                                                                        */
 
#/  The file MUST be stored under a subdirectory that matches the component name              */
 
#/   my $file_type = yp::lib::find_file_type($vendor,$library,$component,$version);           */
 
#/                                                                                            */
 
#/*********************************************************************************************/
 
 
 
sub find_file_type
 
   {
 
   my @params     = @_;
 
   my $version    = pop(@params);
 
   my $component  = pop(@params);
 
   my $project    = pop(@params);
 
   my $vendor     = pop(@params);
 
 
 
 
 
 
 
   my $card_type;
 
   my $card_file_name;
 
   my $card_dir_name;
 
   my $card_vendor_path;
 
   my $card_library_path;
 
   my $card_component_path;
 
   my $card_lib_comp_sep;
 
   my $card_vendor;
 
   my $card_library;
 
   my $card_component;
 
   my $card_version;
 
 
 
   my $parser           = XML::LibXML->new();
 
   my $yp_index_file    = $parser->parse_file("./tools/yp/index.xml");
 
 
 
   foreach my $index_card  ($yp_index_file->findnodes('//socgen:index_file/index_card/type'))
 
     {
 
     $card_type          = $index_card->findnodes('./text()')->to_literal ;
 
     $card_file_name     = $index_card->findnodes('../file_name/text()')->to_literal ;
 
     $card_dir_name      = $index_card->findnodes('../dir_name/text()')->to_literal ;
 
     $card_vendor_path   = $index_card->findnodes('../vendor_path/text()')->to_literal ;
 
     $card_component_path= $index_card->findnodes('../component_path/text()')->to_literal ;
 
     $card_library_path  = $index_card->findnodes('../library_path/text()')->to_literal ;
 
     $card_lib_comp_sep  = $index_card->findnodes('../lib_comp_sep/text()')->to_literal ;
 
     $card_vendor        = $index_card->findnodes('../vendor/text()')->to_literal ;
 
     $card_library       = $index_card->findnodes('../library/text()')->to_literal ;
 
     $card_component     = $index_card->findnodes('../name/text()')->to_literal ;
 
     $card_version       = $index_card->findnodes('../version/text()')->to_literal ;
 
     if(( $card_vendor    eq "${vendor}"    ) &
 
        ( $card_library   eq "${project}"   ) &
 
        ( $card_component eq "${component}" ) &
 
        ( $card_version   eq "${version}"   )
 
       )
 
       {
 
       if($card_type)    {return("${card_type}");}
 
       else                     {return("xxxx");}
 
       }
 
     }
       }
       }
 
 
 
 
 
 
 
 
 
#/*********************************************************************************************/
 
#/  find_lib_ip_dir                                                                           */
 
#/                                                                                            */
 
#/  returns  library ip directory                                                             */
 
#/                                                                                            */
 
#/   my $file_lib_ip_dir = yp::lib::find_file_lib_ip_dir($vendor,$library);                   */
 
#/                                                                                            */
 
#/*********************************************************************************************/
 
 
 
sub find_lib_ip_dir
 
   {
 
   my @params     = @_;
 
   my $project    = pop(@params);
 
   my $vendor     = pop(@params);
 
 
 
   my $card_type;
 
   my $card_file_name;
 
   my $card_dir_name;
 
   my $card_vendor_path;
 
   my $card_library_path;
 
   my $card_component_path;
 
   my $card_lib_comp_sep;
 
   my $card_vendor;
 
   my $card_library;
 
   my $card_component;
 
   my $card_version;
 
   my $card_lib_ip_dir;
 
   my $card_lib_sw_dir;
 
 
 
   my $parser           = XML::LibXML->new();
 
   my $yp_index_file    = $parser->parse_file("./tools/yp/index.xml");
 
 
 
   foreach my $index_card  ($yp_index_file->findnodes('//socgen:index_file/index_card/type'))
 
     {
 
     $card_type          = $index_card->findnodes('./text()')->to_literal ;
 
     $card_file_name     = $index_card->findnodes('../file_name/text()')->to_literal ;
 
     $card_dir_name      = $index_card->findnodes('../dir_name/text()')->to_literal ;
 
     $card_vendor_path   = $index_card->findnodes('../vendor_path/text()')->to_literal ;
 
     $card_component_path= $index_card->findnodes('../component_path/text()')->to_literal ;
 
     $card_library_path  = $index_card->findnodes('../library_path/text()')->to_literal ;
 
     $card_lib_comp_sep  = $index_card->findnodes('../lib_comp_sep/text()')->to_literal ;
 
     $card_vendor        = $index_card->findnodes('../vendor/text()')->to_literal ;
 
     $card_library       = $index_card->findnodes('../library/text()')->to_literal ;
 
     $card_component     = $index_card->findnodes('../name/text()')->to_literal ;
 
     $card_version       = $index_card->findnodes('../version/text()')->to_literal ;
 
     $card_lib_ip_dir    = $index_card->findnodes('../lib_ip_dir/text()')->to_literal ;
 
     $card_lib_sw_dir    = $index_card->findnodes('../lib_sw_dir/text()')->to_literal ;
 
     if(( $card_vendor    eq "${vendor}"    ) &
 
        ( $card_library   eq "${project}"   )
 
       )
 
       {
 
       return("${card_lib_ip_dir}");
 
 
 
       }
 
     }
 
   }
 
 
 
 
 
 
 
#/*********************************************************************************************/
 
#/  find_lib_sw_dir                                                                           */
 
#/                                                                                            */
 
#/  returns  library sw directory                                                             */
 
#/                                                                                            */
 
#/   my $file_lib_sw_dir = yp::lib::find_file_lib_sw_dir($vendor,$library);                   */
 
#/                                                                                            */
 
#/*********************************************************************************************/
 
 
 
sub find_lib_sw_dir
 
   {
 
   my @params     = @_;
 
   my $project    = pop(@params);
 
   my $vendor     = pop(@params);
 
 
 
   my $card_type;
 
   my $card_file_name;
 
   my $card_dir_name;
 
   my $card_vendor_path;
 
   my $card_library_path;
 
   my $card_component_path;
 
   my $card_lib_comp_sep;
 
   my $card_vendor;
 
   my $card_library;
 
   my $card_component;
 
   my $card_version;
 
   my $card_lib_ip_dir;
 
   my $card_lib_sw_dir;
 
 
 
   my $parser           = XML::LibXML->new();
 
   my $yp_index_file    = $parser->parse_file("./tools/yp/index.xml");
 
 
 
   foreach my $index_card  ($yp_index_file->findnodes('//socgen:index_file/index_card/type'))
 
     {
 
     $card_type          = $index_card->findnodes('./text()')->to_literal ;
 
     $card_file_name     = $index_card->findnodes('../file_name/text()')->to_literal ;
 
     $card_dir_name      = $index_card->findnodes('../dir_name/text()')->to_literal ;
 
     $card_vendor_path   = $index_card->findnodes('../vendor_path/text()')->to_literal ;
 
     $card_component_path= $index_card->findnodes('../component_path/text()')->to_literal ;
 
     $card_library_path  = $index_card->findnodes('../library_path/text()')->to_literal ;
 
     $card_lib_comp_sep  = $index_card->findnodes('../lib_comp_sep/text()')->to_literal ;
 
     $card_vendor        = $index_card->findnodes('../vendor/text()')->to_literal ;
 
     $card_library       = $index_card->findnodes('../library/text()')->to_literal ;
 
     $card_component     = $index_card->findnodes('../name/text()')->to_literal ;
 
     $card_version       = $index_card->findnodes('../version/text()')->to_literal ;
 
     $card_lib_ip_dir    = $index_card->findnodes('../lib_ip_dir/text()')->to_literal ;
 
     $card_lib_sw_dir    = $index_card->findnodes('../lib_sw_dir/text()')->to_literal ;
 
     if(( $card_vendor    eq "${vendor}"    ) &
 
        ( $card_library   eq "${project}"   ) &
 
        ( $card_type      eq "socgen:lib"   )
 
       )
 
       {
 
       if($card_lib_sw_dir){return("/${card_lib_sw_dir}");}
 
       }
     }
     }
   }
   }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
#/*********************************************************************************************/
#/*********************************************************************************************/
#/  find_vendors                                                                              */
#/  find_vendors                                                                              */
#/                                                                                            */
#/                                                                                            */
#/  returns  array of all vendors                                                             */
#/  returns  array of all vendors                                                             */
#/                                                                                            */
#/                                                                                            */
Line 909... Line 995...
   }
   }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1;
1;
 
 
 No newline at end of file
 No newline at end of file

powered by: WebSVN 2.1.0

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