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

Subversion Repositories socgen

[/] [socgen/] [trunk/] [tools/] [verilog/] [elab_config_verilog] - Diff between revs 134 and 135

Show entire file | Details | Blame | View Log

Rev 134 Rev 135
Line 1... Line 1...
eval 'exec `which perl` -S $0 ${1+"$@"}'
eval 'exec `which perl` -S $0 ${1+"$@"}'
   if 0;
   if 0;
#/**********************************************************************/
#/****************************************************************************/
#/*                                                                    */
#/*                                                                    */
#/*             -------                                                */
#/*   SOCGEN Design for Reuse toolset                                        */
#/*            /   SOC  \                                              */
 
#/*           /    GEN   \                                             */
 
#/*          /    TOOL    \                                            */
 
#/*          ==============                                            */
 
#/*          |            |                                            */
 
#/*          |____________|                                            */
 
#/*                                                                    */
#/*                                                                    */
 
#/*   Version 1.0.0                                                          */
#/*                                                                    */
#/*                                                                    */
 
#/*   Author(s):                                                             */
 
#/*      - John Eaton, z3qmtr45@gmail.com                                    */
#/*                                                                    */
#/*                                                                    */
 
#/****************************************************************************/
#/*                                                                    */
#/*                                                                    */
#/*  Author(s):                                                        */
 
#/*      - John Eaton, jt_eaton@opencores.org                          */
 
#/*                                                                    */
#/*                                                                    */
#/**********************************************************************/
#/*             Copyright 2016 John T Eaton                                  */
#/*                                                                    */
#/*                                                                    */
#/*    Copyright (C) <2010-2011>                */
#/* Licensed under the Apache License, Version 2.0 (the "License");          */
 
#/* you may not use this file except in compliance with the License.         */
 
#/* You may obtain a copy of the License at                                  */
#/*                                                                    */
#/*                                                                    */
#/*  This source file may be used and distributed without              */
#/*    http://www.apache.org/licenses/LICENSE-2.0                            */
#/*  restriction provided that this copyright statement is not         */
 
#/*  removed from the file and that any derivative work contains       */
 
#/*  the original copyright notice and the associated disclaimer.      */
 
#/*                                                                    */
 
#/*  This source file is free software; you can redistribute it        */
 
#/*  and/or modify it under the terms of the GNU Lesser General        */
 
#/*  Public License as published by the Free Software Foundation;      */
 
#/*  either version 2.1 of the License, or (at your option) any        */
 
#/*  later version.                                                    */
 
#/*                                                                    */
 
#/*  This source is distributed in the hope that it will be            */
 
#/*  useful, but WITHOUT ANY WARRANTY; without even the implied        */
 
#/*  warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR           */
 
#/*  PURPOSE.  See the GNU Lesser General Public License for more      */
 
#/*  details.                                                          */
 
#/*                                                                    */
 
#/*  You should have received a copy of the GNU Lesser General         */
 
#/*  Public License along with this source; if not, download it        */
 
#/*  from http://www.opencores.org/lgpl.shtml                          */
 
#/*                                                                    */
#/*                                                                    */
#/**********************************************************************/
#/* Unless required by applicable law or agreed to in writing, software      */
 
#/* distributed under the License is distributed on an "AS IS" BASIS,        */
 
#/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */
 
#/* See the License for the specific language governing permissions and      */
 
#/* limitations under the License.                                           */
 
#/*                                                                          */
 
#/*                                                                          */
 
#/****************************************************************************/
 
 
 
 
 
 
############################################################################
############################################################################
# General PERL config
# General PERL config
############################################################################
############################################################################
Line 309... Line 296...
   my $elab_root                 = pop(@params);
   my $elab_root                 = pop(@params);
   my $spirit_component_file      = pop(@params);
   my $spirit_component_file      = pop(@params);
 
 
 
 
 
 
foreach my $new_comp ($spirit_component_file->findnodes("//spirit:component/spirit:vendor"))
foreach my $new_comp ($spirit_component_file->findnodes("//ipxact:component/ipxact:vendor"))
   {
   {
   my($new_vendor)          = $new_comp->findnodes('./text()')->to_literal ;
   my($new_vendor)          = $new_comp->findnodes('./text()')->to_literal ;
   my($new_library)         = $new_comp->findnodes('../spirit:library/text()')->to_literal ;
   my($new_library)         = $new_comp->findnodes('../ipxact:library/text()')->to_literal ;
   my($new_name)            = $new_comp->findnodes('../spirit:name/text()')->to_literal ;
   my($new_name)            = $new_comp->findnodes('../ipxact:name/text()')->to_literal ;
   my($new_version)         = $new_comp->findnodes('../spirit:version/text()')->to_literal ;
   my($new_version)         = $new_comp->findnodes('../ipxact:version/text()')->to_literal ;
#   print "PARSE component file $elab_root $new_vendor $new_library $new_name    $new_version         \n";
#   print "PARSE component file $elab_root $new_vendor $new_library $new_name    $new_version         \n";
 
 
 
 
  my $parent_socgen_filename              = yp::lib::find_componentConfiguration($new_vendor,$new_library,$new_name);
  my $parent_socgen_filename              = yp::lib::find_componentConfiguration($new_vendor,$new_library,$new_name);
 
 
Line 356... Line 343...
     #/*                                                                    */
     #/*                                                                    */
     #/* parse parameters and values                                        */
     #/* parse parameters and values                                        */
     #/*                                                                    */
     #/*                                                                    */
     #/**********************************************************************/
     #/**********************************************************************/
 
 
     foreach  my   $i_name ($spirit_component_file->findnodes('//spirit:model/spirit:modelParameters/spirit:modelParameter/spirit:name'))
     foreach  my   $i_name ($spirit_component_file->findnodes('//ipxact:model/ipxact:modelParameters/ipxact:modelParameter/ipxact:name'))
        {
        {
        my($parameter_name)     = $i_name ->to_literal;
        my($parameter_name)     = $i_name ->to_literal;
        my($parameter_default)  = $i_name ->findnodes('../spirit:value/text()')->to_literal ;
        my($parameter_default)  = $i_name ->findnodes('../ipxact:value/text()')->to_literal ;
        my $repo_data;
        my $repo_data;
        $elab_db->db_get("parameter_${elab_root}__${parameter_name}", $repo_data );
        $elab_db->db_get("parameter_${elab_root}__${parameter_name}", $repo_data );
 
 
 
 
        unless (defined $repo_data)
        unless (defined $repo_data)
Line 371... Line 358...
            $elab_db->db_put( "parameter_${elab_root}__${parameter_name}","${parameter_default}"  );
            $elab_db->db_put( "parameter_${elab_root}__${parameter_name}","${parameter_default}"  );
                }
                }
        }
        }
    }
    }
 
 
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 ;
    if(yp::lib::find_ipxact_component($new_vendor,$new_library,$new_name,$new_version))
    if(yp::lib::find_ipxact_component($new_vendor,$new_library,$new_name,$new_version))
     {
     {
     parse_component_file($parser->parse_file(yp::lib::find_ipxact_component($new_vendor,$new_library,$new_name,$new_version)),$elab_root    );
     parse_component_file($parser->parse_file(yp::lib::find_ipxact_component($new_vendor,$new_library,$new_name,$new_version)),$elab_root    );
     }
     }
 
 
Line 411... Line 398...
   my $spirit_component_file      = pop(@params);
   my $spirit_component_file      = pop(@params);
 
 
 
 
 
 
 
 
  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 ;
#            print "PARSE design files $elab_root $new_vendor $new_library $new_name    $new_version         \n";
#            print "PARSE design files $elab_root $new_vendor $new_library $new_name    $new_version         \n";
            parse_design_files($parser->parse_file(yp::lib::find_ipxact_component($new_vendor,$new_library,$new_name,$new_version )),$elab_root );
            parse_design_files($parser->parse_file(yp::lib::find_ipxact_component($new_vendor,$new_library,$new_name,$new_version )),$elab_root );
   }
   }
 
 
 
 
 
 
 
 
  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 "PARSE DESIGN file $elab_root $new_vendor $new_library $new_name    $new_version         \n";
#              print "FFFFFF $new_vendor $new_library $new_name    $new_version     hierarchyRef    \n";
              parse_design_file($parser->parse_file(yp::lib::find_ipxact_design($new_vendor,$new_library,$new_name,$new_version )),$elab_root   );
              parse_design_file($parser->parse_file(yp::lib::find_ipxact_design($new_vendor,$new_library,$new_name,$new_version )),$elab_root   );
              }
              }
  }
  }
 
 
 
 
 
   foreach my $new_comp ($spirit_component_file->findnodes("//ipxact:component/ipxact:model/ipxact:views/ipxact:view/ipxact:designInstantiationRef/text()"))
 
     {
 
     my($designInsref_value)         = $new_comp  ->to_literal ;
 
     my($designInsref_name)          = $new_comp  ->findnodes('../../ipxact:name')->to_literal ;
 
     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 ;
 
 
 
 
 
        if($t_ref eq $designInsref_name )
 
        {
 
 
 
         if(yp::lib::find_ipxact_design($t_vendor,$t_library,$t_name,$t_version ))
 
              {
 
#              print "FFFFFF $t_vendor $t_library $t_name    $t_version     designInstantiationRef    \n";
 
              parse_design_file($parser->parse_file(yp::lib::find_ipxact_design($t_vendor,$t_library,$t_name,$t_version )),$elab_root   );
 
              }
 
 
 
 
 
 
 
        }
 
        }
 
     }
 
 
 
 
 
 
 
 
}
}
 
 
 
 
 
 
 
 
Line 491... Line 510...
   {
   {
   my @params     = @_;
   my @params     = @_;
   my $elab_root               = pop(@params);
   my $elab_root               = pop(@params);
   my $spirit_design_file      = pop(@params);
   my $spirit_design_file      = pop(@params);
 
 
   foreach my $new_comp ($spirit_design_file->findnodes("//spirit:design/spirit:vendor"))
   foreach my $new_comp ($spirit_design_file->findnodes("//ipxact:design/ipxact:vendor"))
     {
     {
     my($new_vendor)          = $new_comp->findnodes('./text()')->to_literal ;
     my($new_vendor)          = $new_comp->findnodes('./text()')->to_literal ;
     my($new_library)         = $new_comp->findnodes('../spirit:library/text()')->to_literal ;
     my($new_library)         = $new_comp->findnodes('../ipxact:library/text()')->to_literal ;
     my($new_name)            = $new_comp->findnodes('../spirit:name/text()')->to_literal ;
     my($new_name)            = $new_comp->findnodes('../ipxact:name/text()')->to_literal ;
     my($new_version)         = $new_comp->findnodes('../spirit:version/text()')->to_literal ;
     my($new_version)         = $new_comp->findnodes('../ipxact:version/text()')->to_literal ;
  #   print "WARNING  $new_vendor $new_library $new_name $new_version  DESIGN \n";
  #   print "WARNING  $new_vendor $new_library $new_name $new_version  DESIGN \n";
 
 
     foreach  my   $x_name ($spirit_design_file->findnodes("//spirit:design/spirit:componentInstances/spirit:componentInstance/spirit:instanceName"))
     foreach  my   $x_name ($spirit_design_file->findnodes("//ipxact:design/ipxact:componentInstances/ipxact:componentInstance/ipxact:instanceName"))
            {
            {
            #/**********************************************************************/
            #/**********************************************************************/
            #/*                                                                    */
            #/*                                                                    */
            #/* Lookup VLNV for each instantiated component                        */
            #/* Lookup VLNV for each instantiated component                        */
            #/*                                                                    */
            #/*                                                                    */
            #/**********************************************************************/
            #/**********************************************************************/
            my($instance_name)       = $x_name   ->findnodes('./text()')->to_literal ;
            my($instance_name)       = $x_name   ->findnodes('./text()')->to_literal ;
            my($vendor_name)         = $x_name  ->findnodes('../spirit:componentRef/@spirit:vendor')->to_literal ;
            my($vendor_name)         = $x_name  ->findnodes('../ipxact:componentRef/@vendor')->to_literal ;
            my($library_name)        = $x_name  ->findnodes('../spirit:componentRef/@spirit:library')->to_literal ;
            my($library_name)        = $x_name  ->findnodes('../ipxact:componentRef/@library')->to_literal ;
            my($component_name)      = $x_name  ->findnodes('../spirit:componentRef/@spirit:name')->to_literal ;
            my($component_name)      = $x_name  ->findnodes('../ipxact:componentRef/@name')->to_literal ;
            my($version_name)        = $x_name  ->findnodes('../spirit:componentRef/@spirit:version')->to_literal ;
            my($version_name)        = $x_name  ->findnodes('../ipxact:componentRef/@version')->to_literal ;
       #     print "INSTANCED $instance_name  $vendor_name $library_name $component_name $version_name   \n";
       #     print "INSTANCED $instance_name  $vendor_name $library_name $component_name $version_name   \n";
            $elab_db->db_put( "component___${elab_root}.${instance_name}","${vendor_name}:${library_name}:${component_name}:${version_name}"  );
            $elab_db->db_put( "component___${elab_root}.${instance_name}","${vendor_name}:${library_name}:${component_name}:${version_name}"  );
 
 
            my $repo_data;
            my $repo_data;
            if(defined $name && length $name >0)
            if(defined $name && length $name >0)
Line 533... Line 552...
 
 
 
 
 
 
            if  ($instance_name)
            if  ($instance_name)
              {
              {
            foreach  my   $i_parameter ($spirit_design_file->findnodes("//spirit:componentInstance[spirit:instanceName/text() = '$instance_name']/spirit:configurableElementValues/spirit:configurableElementValue/\@spirit:referenceId"))
            foreach  my   $i_parameter ($spirit_design_file->findnodes("//ipxact:componentInstance[ipxact:instanceName/text() = '$instance_name']/ipxact:configurableElementValues/ipxact:configurableElementValue/\@ipxact:referenceId"))
             {
             {
             my($foo_name)       = $i_parameter ->to_literal ;
             my($foo_name)       = $i_parameter ->to_literal ;
             my($foo_value)      = $i_parameter ->findnodes('../text()')->to_literal ;
             my($foo_value)      = $i_parameter ->findnodes('../text()')->to_literal ;
 
 
             my $fee_value       = $foo_value;
             my $fee_value       = $foo_value;

powered by: WebSVN 2.1.0

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