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

Subversion Repositories socgen

[/] [socgen/] [trunk/] [tools/] [verilog/] [gen_ports] - 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 107... Line 93...
my $parser = XML::LibXML->new();
my $parser = XML::LibXML->new();
 
 
 
 
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));
 
 
#print "\n GEN_ports     $vendor $library $component $version         \n";
print "\n GEN_ports     $vendor $library $component $version         \n";
 
 
 
 
 
 
my $io_ports  = yp::lib::get_io_ports() ;
my $io_ports  = yp::lib::get_io_ports() ;
 
 
Line 206... Line 192...
   {
   {
   my @params     = @_;
   my @params     = @_;
   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 ;
    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))    );
     parse_component_file($parser->parse_file(yp::lib::find_ipxact_component($new_vendor,$new_library,$new_name,$new_version))    );
     }
     }
   }
   }
Line 228... Line 214...
     #/*                                                                    */
     #/*                                                                    */
     #/*                                                                    */
     #/*                                                                    */
     #/*                                                                    */
     #/*                                                                    */
     #/**********************************************************************/
     #/**********************************************************************/
 
 
foreach my $bus_iface ($spirit_component_file->findnodes("//spirit:component/spirit:busInterfaces/spirit:busInterface/spirit:slave"))
foreach my $bus_iface ($spirit_component_file->findnodes("//ipxact:component/ipxact:busInterfaces/ipxact:busInterface/ipxact:slave"))
        {
        {
        my $busInterface_name          = $bus_iface->findnodes('../spirit:name/text()')->to_literal ;
        my $busInterface_name          = $bus_iface->findnodes('../ipxact:name/text()')->to_literal ;
        my $memMap_name                = $bus_iface->findnodes('./spirit:memoryMapRef/@spirit:memoryMapRef')->to_literal ;
        my $memMap_name                = $bus_iface->findnodes('./ipxact:memoryMapRef/@ipxact:memoryMapRef')->to_literal ;
 
 
 
 
        foreach my $bus_iface ($spirit_component_file->findnodes("//spirit:busInterface[spirit:name/text() = '$busInterface_name']/spirit:slave/spirit:bridge"))
        foreach my $bus_iface ($spirit_component_file->findnodes("//ipxact:busInterface[ipxact:name/text() = '$busInterface_name']/ipxact:slave/ipxact:bridge"))
          {
          {
          my($bridge_map)        = $bus_iface->findnodes('./@spirit:masterRef')->to_literal ;
          my($bridge_map)        = $bus_iface->findnodes('./@ipxact:masterRef')->to_literal ;
#          print "FFFFFFF SLAVE BRIDGE  $busInterface_name  $memMap_name --  $bridge_map   \n";
 
 
 
          foreach my $mem_map ($spirit_component_file->findnodes("//spirit:component/spirit:memoryMaps/spirit:memoryMap[spirit:name/text() = '$memMap_name']/spirit:subspaceMap[spirit:name/text() = '$bridge_map']/spirit:baseAddress"))
 
 
          foreach my $mem_map ($spirit_component_file->findnodes("//ipxact:component/ipxact:memoryMaps/ipxact:memoryMap[ipxact:name/text() = '$memMap_name']/ipxact:subspaceMap[ipxact:name/text() = '$bridge_map']/ipxact:baseAddress"))
              {
              {
#               my $xxx         = $mem_map->findnodes('../spirit:subspaceMap/@spirit:masterRef')->to_literal ;
#               my $xxx         = $mem_map->findnodes('../ipxact:subspaceMap/@ipxact:masterRef')->to_literal ;
               my $add         = $mem_map->findnodes('./text()')->to_literal ;
               my $add         = $mem_map->findnodes('./text()')->to_literal ;
               my $int_base_addr    = hex($add);
               my $int_base_addr    = hex($add);
 
 
                  my $repo_data;
                  my $repo_data;
                  $busses_db->db_get( "AbsDef.${busInterface_name}.bridge", $repo_data );
                  $busses_db->db_get( "AbsDef.${busInterface_name}.bridge", $repo_data );
                  $busses_db->db_put( "AbsDef.${busInterface_name}.bridge","${bridge_map}..${int_base_addr}::${repo_data}" );
                  $busses_db->db_put( "AbsDef.${busInterface_name}.bridge","${bridge_map}..${int_base_addr}::${repo_data}" );
 
 
#                  print "FFFFFFF SUBSPACE   BI name  $busInterface_name MM name  $memMap_name bridge  $bridge_map  Add - $add   \n";
 
 
 
 
 
 
 
 
 
          foreach my $addSpace_map ($spirit_component_file->findnodes("//spirit:component/spirit:addressSpaces/spirit:addressSpace[spirit:name/text() = '$bridge_map']/spirit:range"))
 
 
          foreach my $addSpace_map ($spirit_component_file->findnodes("//ipxact:component/ipxact:addressSpaces/ipxact:addressSpace[ipxact:name/text() = '$bridge_map']/ipxact:range"))
               {
               {
               my $range         = $addSpace_map->findnodes('./text()')->to_literal ;
               my $range         = $addSpace_map->findnodes('./text()')->to_literal ;
               my $int_range    = hex($range);
               my $int_range    = hex($range);
             $busses_db->db_put( "BlkDef.${busInterface_name}.${bridge_map}","${int_base_addr}::${int_range}::8" );
             $busses_db->db_put( "BlkDef.${busInterface_name}.${bridge_map}","${int_base_addr}::${int_range}::8" );
#             print "FFFFFFF RANGE    BlkDef.${busInterface_name}.${bridge_map}   ${int_base_addr}::${int_range}::8   \n";
#             print "FFFFFFF RANGE    BlkDef.${busInterface_name}.${bridge_map}   ${int_base_addr}::${int_range}::8   \n";
Line 268... Line 254...
 
 
          }
          }
 
 
 
 
 
 
        foreach my $mem_map ($spirit_component_file->findnodes("//spirit:component/spirit:memoryMaps/spirit:memoryMap[spirit:name/text() = '$memMap_name']/spirit:bank/spirit:addressBlock"))
        foreach my $mem_map ($spirit_component_file->findnodes("//ipxact:component/ipxact:memoryMaps/ipxact:memoryMap[ipxact:name/text() = '$memMap_name']/ipxact:bank/ipxact:addressBlock"))
                {
                {
                     my($addB_name)        = $mem_map->findnodes('./spirit:name/text()')->to_literal ;
                     my($addB_name)        = $mem_map->findnodes('./ipxact:name/text()')->to_literal ;
                     my($baseAdd)          = $mem_map->findnodes('../spirit:baseAddress/text()')->to_literal ;
                     my($baseAdd)          = $mem_map->findnodes('../ipxact:baseAddress/text()')->to_literal ;
                     my($range)            = $mem_map->findnodes('./spirit:range/text()')->to_literal ;
                     my($range)            = $mem_map->findnodes('./ipxact:range/text()')->to_literal ;
                     my($width)            = $mem_map->findnodes('./spirit:width/text()')->to_literal ;
                     my($width)            = $mem_map->findnodes('./ipxact:width/text()')->to_literal ;
                     my $int_baseAdd      = hex($baseAdd);
                     my $int_baseAdd      = hex($baseAdd);
                     my $int_range      = hex($range);
                     my $int_range      = hex($range);
                     $busses_db->db_put( "BlkDef.${memMap_name}.${addB_name}","${int_baseAdd}::${int_range}::${width}" );
                     $busses_db->db_put( "BlkDef.${memMap_name}.${addB_name}","${int_baseAdd}::${int_range}::${width}" );
                     }
                     }
 
 
 
 
 
 
 
 
 
 
        foreach my $mem_map ($spirit_component_file->findnodes("//spirit:component/spirit:memoryMaps/spirit:memoryMap[spirit:name/text() = '$memMap_name']/spirit:bank/spirit:addressBlock/spirit:register"))
        foreach my $mem_map ($spirit_component_file->findnodes("//ipxact:component/ipxact:memoryMaps/ipxact:memoryMap[ipxact:name/text() = '$memMap_name']/ipxact:bank/ipxact:addressBlock/ipxact:register"))
                {
                {
                     my($reg_name)         = $mem_map->findnodes('./spirit:name/text()')->to_literal ;
                     my($reg_name)         = $mem_map->findnodes('./ipxact:name/text()')->to_literal ;
                     my($bank_name)        = $mem_map->findnodes('../../../spirit:name/text()')->to_literal ;
                     my($bank_name)        = $mem_map->findnodes('../../../ipxact:name/text()')->to_literal ;
                     my($reg_offset)       = $mem_map->findnodes('./spirit:addressOffset/text()')->to_literal ;
                     my($reg_offset)       = $mem_map->findnodes('./ipxact:addressOffset/text()')->to_literal ;
                     my($reg_size)         = $mem_map->findnodes('./spirit:size/text()')->to_literal ;
                     my($reg_size)         = $mem_map->findnodes('./ipxact:size/text()')->to_literal ;
                     my($reg_access)       = $mem_map->findnodes('./spirit:access/text()')->to_literal ;
                     my($reg_access)       = $mem_map->findnodes('./ipxact:access/text()')->to_literal ;
                     my $int_reg_offset    = hex($reg_offset);
                     my $int_reg_offset    = hex($reg_offset);
                     $busses_db->db_put( "RegDef.${bank_name}.${reg_name}","${int_reg_offset}::${reg_name}::${reg_size}::${reg_access}" );
                     $busses_db->db_put( "RegDef.${bank_name}.${reg_name}","${int_reg_offset}::${reg_name}::${reg_size}::${reg_access}" );
#                     print "FFFFFFF REGISTER  ${bank_name}.${reg_name}    ${reg_offset}::${reg_size}::${reg_access}   \n";
#                     print "FFFFFFF REGISTER  ${bank_name}.${reg_name}    ${reg_offset}::${reg_size}::${reg_access}   \n";
                     }
                     }
 
 
Line 351... Line 337...
     push @mas_slave  , "slave";
     push @mas_slave  , "slave";
 
 
     foreach $seek_type (@mas_slave)
     foreach $seek_type (@mas_slave)
        {
        {
 
 
         foreach my $bus_iface ($spirit_component_file->findnodes("//spirit:component/spirit:busInterfaces/spirit:busInterface/spirit:${seek_type}"))
         foreach my $bus_iface ($spirit_component_file->findnodes("//ipxact:component/ipxact:busInterfaces/ipxact:busInterface/ipxact:${seek_type}"))
            {
            {
            my($mmm_cname)         = $bus_iface->findnodes('../spirit:name/text()')->to_literal ;
            my($mmm_cname)         = $bus_iface->findnodes('../ipxact:name/text()')->to_literal ;
            my($mmm_vendor)        = $bus_iface->findnodes('../spirit:abstractionType/@spirit:vendor')->to_literal ;
            my($mmm_vendor)        = $bus_iface->findnodes('../ipxact:abstractionTypes/ipxact:abstractionType/ipxact:abstractionRef/@vendor')->to_literal ;
            my($mmm_library)       = $bus_iface->findnodes('../spirit:abstractionType/@spirit:library')->to_literal ;
            my($mmm_library)       = $bus_iface->findnodes('../ipxact:abstractionTypes/ipxact:abstractionType/ipxact:abstractionRef/@library')->to_literal ;
            my($mmm_name)          = $bus_iface->findnodes('../spirit:abstractionType/@spirit:name')->to_literal ;
            my($mmm_name)          = $bus_iface->findnodes('../ipxact:abstractionTypes/ipxact:abstractionType/ipxact:abstractionRef/@name')->to_literal ;
            my($mmm_version)       = $bus_iface->findnodes('../spirit:abstractionType/@spirit:version')->to_literal ;
            my($mmm_version)       = $bus_iface->findnodes('../ipxact:abstractionTypes/ipxact:abstractionType/ipxact:abstractionRef/@version')->to_literal ;
 
 
 
 
 
 
            if($mmm_cname)
            if($mmm_cname)
              {
              {
              $busses_db->db_put( "AbsDef.${mmm_cname}.${seek_type}","${mmm_vendor}:${mmm_library}:${mmm_name}:${mmm_version}"  );
              $busses_db->db_put( "AbsDef.${mmm_cname}.${seek_type}","${mmm_vendor}:${mmm_library}:${mmm_name}:${mmm_version}"  );
              }
              }
 
 
            foreach my $port_face ($spirit_component_file->findnodes('//spirit:component/spirit:busInterfaces/spirit:busInterface/spirit:portMaps/spirit:portMap/spirit:logicalPort'))
            foreach my $port_face ($spirit_component_file->findnodes('//ipxact:component/ipxact:busInterfaces/ipxact:busInterface/ipxact:abstractionTypes/ipxact:abstractionType/ipxact:portMaps/ipxact:portMap/ipxact:logicalPort'))
               {
               {
               my($rrr_log_name)      = $port_face->findnodes('./spirit:name/text()')->to_literal ;
               my($rrr_log_name)      = $port_face->findnodes('./ipxact:name/text()')->to_literal ;
               my($rrr_int_name)      = $port_face->findnodes('../../../spirit:name/text()')->to_literal ;
               my($rrr_int_name)      = $port_face->findnodes('../../../../../ipxact:name/text()')->to_literal ;
               my($rrr_phy_name)      = $port_face->findnodes('../spirit:physicalPort/spirit:name/text()')->to_literal ;
               my($rrr_phy_name)      = $port_face->findnodes('../ipxact:physicalPort/ipxact:name/text()')->to_literal ;
               my($rrr_type_name)     = $port_face->findnodes('../spirit:physicalPort/spirit:wireTypeDefs/spirit:wireTypeDef/spirit:typeName/text()')->to_literal ;
               my($rrr_type_name)     = $port_face->findnodes('../ipxact:physicalPort/ipxact:wireTypeDefs/ipxact:wireTypeDef/ipxact:typeName/text()')->to_literal ;
               my($rrr_left_value)    = $port_face->findnodes('../spirit:physicalPort/spirit:wire/spirit:vector/spirit:left/text()')->to_literal ;
               my($rrr_left_value)    = $port_face->findnodes('../ipxact:physicalPort/ipxact:wire/ipxact:vectors/ipxact:vector/ipxact:left/text()')->to_literal ;
               my($rrr_right_value)   = $port_face->findnodes('../spirit:physicalPort/spirit:wire/spirit:vector/spirit:right/text()')->to_literal ;
               my($rrr_right_value)   = $port_face->findnodes('../ipxact:physicalPort/ipxact:wire/ipxact:vectors/ipxact:vector/ipxact:right/text()')->to_literal ;
 
 
               unless ($rrr_type_name)  {$rrr_type_name = "wire";}
               unless ($rrr_type_name)  {$rrr_type_name = "wire";}
               unless ($rrr_phy_name)   {$rrr_phy_name  = ${rrr_log_name} ;}
               unless ($rrr_phy_name)   {$rrr_phy_name  = ${rrr_log_name} ;}
 
 
               if(   $mmm_cname  eq  $rrr_int_name )
               if(   $mmm_cname  eq  $rrr_int_name )
Line 424... Line 410...
     #/*                                                                    */
     #/*                                                                    */
     #/* Read all ports and store into array                                */
     #/* Read all ports and store into array                                */
     #/*                                                                    */
     #/*                                                                    */
     #/**********************************************************************/
     #/**********************************************************************/
 
 
     foreach  my   $i_name ($spirit_component_file->findnodes("//spirit:component/spirit:model/spirit:ports/spirit:port/spirit:name"))
     foreach  my   $i_name ($spirit_component_file->findnodes("//ipxact:component/ipxact:model/ipxact:ports/ipxact:port/ipxact:name"))
        {
        {
        my($port_name)       = $i_name ->findnodes('./text()')->to_literal ;
        my($port_name)       = $i_name ->findnodes('./text()')->to_literal ;
        my($direction)       = $i_name ->findnodes('../spirit:wire/spirit:direction/text()')->to_literal ;
        my($direction)       = $i_name ->findnodes('../ipxact:wire/ipxact:direction/text()')->to_literal ;
        my($left)            = $i_name ->findnodes('../spirit:wire/spirit:vector/spirit:left/text()')->to_literal ;
        my($left)            = $i_name ->findnodes('../ipxact:wire/ipxact:vectors/ipxact:vector/ipxact:left/text()')->to_literal ;
        my($right)           = $i_name ->findnodes('../spirit:wire/spirit:vector/spirit:right/text()')->to_literal ;
        my($right)           = $i_name ->findnodes('../ipxact:wire/ipxact:vectors/ipxact:vector/ipxact:right/text()')->to_literal ;
        my($type)            = $i_name ->findnodes('../spirit:wireTypeDefs/spirit:wireTypeDef/spirit:typeName/text()')->to_literal ;
        my($type)            = $i_name ->findnodes('../ipxact:wire/ipxact:wireTypeDefs/ipxact:wireTypeDef/ipxact:typeName/text()')->to_literal ;
 
 
 
        unless (defined $type) {$type = "wire";}
 
 
        if    ($direction eq "in")  { $direction = "input";}
        if    ($direction eq "in")  { $direction = "input";}
        elsif ($direction eq "out") { $direction = "output";}
        elsif ($direction eq "out") { $direction = "output";}
 
 
 
 
Line 483... Line 470...
   my $spirit_component_file      = pop(@params);
   my $spirit_component_file      = pop(@params);
 
 
   #print "\n";
   #print "\n";
 
 
 
 
  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 ;
            process_design_files($parser->parse_file(yp::lib::find_ipxact_component($new_vendor,$new_library,$new_name,$new_version )) );
            process_design_files($parser->parse_file(yp::lib::find_ipxact_component($new_vendor,$new_library,$new_name,$new_version )) );
    }
    }
 
 
  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 )  )
              {
              {
              if($opt_verbose){print "process_design_file  $new_vendor $new_library $new_name $new_version  \n"; }
              #print "FFFFFFF  $new_vendor $new_library $new_name $new_version hierarchyRef \n";
              process_design_file($parser->parse_file(yp::lib::find_ipxact_design($new_vendor,$new_library,$new_name,$new_version )) );
              process_design_file($parser->parse_file(yp::lib::find_ipxact_design($new_vendor,$new_library,$new_name,$new_version )) );
              }
              }
    }
    }
 
 
 
 
 
 
 
 
 
   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 "FFFFFFF  $t_vendor $t_library $t_name $t_version designgInstantiationRef \n";
 
              process_design_file($parser->parse_file(yp::lib::find_ipxact_design($t_vendor,$t_library,$t_name,$t_version )) );
 
              }
 
 
 
        }
 
 
 
        }
 
 
 
     }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
}
}
 
 
 
 
#/*********************************************************************************************/
#/*********************************************************************************************/
#/                                                                                            */
#/                                                                                            */
Line 522... Line 549...
sub process_design_file
sub process_design_file
   {
   {
   my @params     = @_;
   my @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 "XXXXXX-  $new_vendor $new_library $new_name $new_version  DESIGN \n";
     #   print "XXXXXX-  $new_vendor $new_library $new_name $new_version  DESIGN \n";
     }
     }
 
 
   foreach  my   $i_name ($spirit_design_file->findnodes("//spirit:design/spirit:componentInstances/spirit:componentInstance/spirit:instanceName"))
   foreach  my   $i_name ($spirit_design_file->findnodes("//ipxact:design/ipxact:componentInstances/ipxact:componentInstance/ipxact:instanceName"))
        {
        {
        my($instance_name)       = $i_name ->findnodes('./text()')->to_literal ;
        my($instance_name)       = $i_name ->findnodes('./text()')->to_literal ;
        my($vendor_name)         = $i_name  ->findnodes('../spirit:componentRef/@spirit:vendor')->to_literal ;
        my($vendor_name)         = $i_name  ->findnodes('../ipxact:componentRef/@vendor')->to_literal ;
        my($library_name)        = $i_name  ->findnodes('../spirit:componentRef/@spirit:library')->to_literal ;
        my($library_name)        = $i_name  ->findnodes('../ipxact:componentRef/@library')->to_literal ;
        my($component_name)      = $i_name  ->findnodes('../spirit:componentRef/@spirit:name')->to_literal ;
        my($component_name)      = $i_name  ->findnodes('../ipxact:componentRef/@name')->to_literal ;
        my($version_name)        = $i_name  ->findnodes('../spirit:componentRef/@spirit:version')->to_literal ;
        my($version_name)        = $i_name  ->findnodes('../ipxact:componentRef/@version')->to_literal ;
        my $module_name          = yp::lib::get_module_name($vendor_name,$library_name,$component_name,$version_name) ;
        my $module_name          = yp::lib::get_module_name($vendor_name,$library_name,$component_name,$version_name) ;
        my $inst_path             = "${home}/${io_ports}/${vendor_name}__${library_name}/${component_name}";
        my $inst_path             = "${home}/${io_ports}/${vendor_name}__${library_name}/${component_name}";
 
 
        my $file =  "$inst_path/${module_name}";
        my $file =  "$inst_path/${module_name}";
        if(-e $file) { # print "XXXXXXXX   $file  Exists \n";
        if(-e $file) { # print "XXXXXXXX   $file  Exists \n";
Line 556... Line 583...
          }
          }
 
 
        }
        }
 
 
 
 
            #/**********************************************************************/
 
            #/*                                                                    */
 
            #/* Hierarchical connections                                           */
 
            #/*                                                                    */
 
            #/**********************************************************************/
 
 
 
 
 
#        print "XCCCD  Process HierConns \n";
 
        foreach  my   $i_name ($spirit_design_file->findnodes('//spirit:hierConnections/spirit:hierConnection/@spirit:interfaceRef'))
 
        {
 
 
 
        my($hierConn_name)                   = $i_name ->to_literal ;
 
        my($hierConn_comref_name)            = $i_name ->findnodes('../spirit:interface/@spirit:componentRef')->to_literal ;
 
        my($hierConn_busref_name)            = $i_name ->findnodes('../spirit:interface/@spirit:busRef')->to_literal ;
 
 
 
#        print "XCCCC HIER_CONN  inst  ${hierConn_comref_name}  name  ${hierConn_name} busref  $hierConn_busref_name \n";
 
 
 
 
 
          foreach  my   $i_name ($spirit_design_file->findnodes("//spirit:design/spirit:componentInstances/spirit:componentInstance/spirit:instanceName[text() = '$hierConn_comref_name']"))
 
            {
 
            #/**********************************************************************/
            #/**********************************************************************/
            #/*                                                                    */
            #/*                                                                    */
            #/* Lookup VLNV for each instantiated component                        */
            #/* Hierarchical connections  1685_2014 style                          */
            #/*                                                                    */
            #/*                                                                    */
            #/**********************************************************************/
            #/**********************************************************************/
 
 
            my($vendor_name)         = $i_name  ->findnodes('../spirit:componentRef/@spirit:vendor')->to_literal ;
        foreach  my   $i_name ($spirit_design_file->findnodes('//ipxact:interconnections/ipxact:interconnection/ipxact:hierInterface/@busRef'))
            my($library_name)        = $i_name  ->findnodes('../spirit:componentRef/@spirit:library')->to_literal ;
 
            my($component_name)      = $i_name  ->findnodes('../spirit:componentRef/@spirit:name')->to_literal ;
 
            my($version_name)        = $i_name  ->findnodes('../spirit:componentRef/@spirit:version')->to_literal ;
 
 
 
#            print "XCCXX HIER_CONN  inst  ${hierConn_comref_name}  name  ${hierConn_name} busref  $hierConn_busref_name  child ${vendor_name}_${library_name}_${component_name}_${version_name}\n";
 
 
 
            my $child_file  = yp::lib::get_io_busses_db_filename($vendor_name,$library_name,$component_name,$version_name,"default");
 
            $child_ports_db   = new BerkeleyDB::Hash( -Filename => $child_file, -Flags => DB_CREATE ) or die "Cannot open ${child_file}: $!";
 
 
 
#            print "XXXXXXXX         GEN_PORTS OPENNED $child_file  \n";
 
 
 
            my $child_cursor = $child_ports_db->db_cursor() ;
 
            while ($child_cursor->c_get($key, $value, DB_NEXT) == 0)
 
               {
 
               ( ${log_name},${direction},${type},${vector},${left},${right}) = split ':', $value;
 
 
 
 
 
               if(($key eq "BusRef.${hierConn_busref_name}.${log_name}"))
 
                 {
 
                 if(${vector} eq "vector")
 
                      {
 
                      unless( looks_like_number($left) ) { $left=0;}
 
                      }
 
                  uplift_busref(${hierConn_name},${log_name},${direction},"wire",${vector},${left},${right},"${hierConn_name}_${log_name}");
 
 
 
                $busses_db->db_put( "IXstance.${hierConn_comref_name}.${hierConn_busref_name}.${log_name}","${value}"  );
 
 
 
                }
 
               elsif (($key eq "AbsDef.${hierConn_busref_name}.master"))
 
                {
                {
                ( ${xx_vendor},${xx_library},${xx_name},${xx_version}) = split ':', $value;
 
                $busses_db->db_put( "AbsDef.${hierConn_name}.master","${xx_vendor}:${xx_library}:${xx_name}:${xx_version}"  );
 
                $busses_db->db_put( "AbsDef.${hierConn_name}.interconnect","${hierConn_comref_name}..${hierConn_busref_name}::"  );
 
                $busses_db->db_put( "Instance.${hierConn_comref_name}.${hierConn_busref_name}","${hierConn_name}"  );
 
 
 
                }
        my($hierConn_name)                   = $i_name ->to_literal ;
               elsif (($key eq "AbsDef.${hierConn_busref_name}.slave"))
        my($hierConn_comref_name)            = $i_name ->findnodes('../../ipxact:activeInterface/@componentRef')->to_literal ;
                {
        my($hierConn_busref_name)            = $i_name ->findnodes('../../ipxact:activeInterface/@busRef')->to_literal ;
                ( ${xx_vendor},${xx_library},${xx_name},${xx_version}) = split ':', $value;
 
                $busses_db->db_put( "AbsDef.${hierConn_name}.slave","${xx_vendor}:${xx_library}:${xx_name}:${xx_version}"  );
 
                $busses_db->db_put( "AbsDef.${hierConn_name}.interconnect","${hierConn_comref_name}..${hierConn_busref_name}::"  );
 
                $busses_db->db_put( "Instance.${hierConn_comref_name}.${hierConn_busref_name}","${hierConn_name}"  );
 
                }
 
               }
 
 
 
               my $status = $child_cursor->c_close() ;
        process_hier ( $hierConn_comref_name,$hierConn_name,$hierConn_busref_name  , $spirit_design_file);
               $child_ports_db   -> db_close();
 
            }
 
   }
   }
 
 
 
 
 
 
 
 
Line 649... Line 616...
 
 
 
 
 
 
 
 
 
 
        foreach  my  $i_name ($spirit_design_file->findnodes('//spirit:interconnections/spirit:interconnection/spirit:activeInterface'))
        foreach  my  $i_name ($spirit_design_file->findnodes('//ipxact:interconnections/ipxact:interconnection/ipxact:activeInterface'))
           {
           {
           my($lp_componentref_name)   = $i_name ->findnodes('./@spirit:componentRef')->to_literal ;
           my($lp_componentref_name)   = $i_name ->findnodes('./@componentRef')->to_literal ;
           my($lp_busref_name)         = $i_name ->findnodes('./@spirit:busRef')->to_literal ;
           my($lp_busref_name)         = $i_name ->findnodes('./@busRef')->to_literal ;
           my($lp_interconnect_name)   = $i_name ->findnodes('../spirit:name/text()')->to_literal ;
           my($lp_interconnect_name)   = $i_name ->findnodes('../ipxact:name/text()')->to_literal ;
 
 
           my $repo_data;
           my $repo_data;
           $busses_db->db_get( "AbsDef.${lp_interconnect_name}.interconnect" , $repo_data );
           $busses_db->db_get( "AbsDef.${lp_interconnect_name}.interconnect" , $repo_data );
           $busses_db->db_put( "AbsDef.${lp_interconnect_name}.interconnect","${lp_componentref_name}..${lp_busref_name}::${repo_data}"  );
           $busses_db->db_put( "AbsDef.${lp_interconnect_name}.interconnect","${lp_componentref_name}..${lp_busref_name}::${repo_data}"  );
           $busses_db->db_put( "Instance.${lp_componentref_name}.${lp_busref_name}","${lp_interconnect_name}"  );
           $busses_db->db_put( "Instance.${lp_componentref_name}.${lp_busref_name}","${lp_interconnect_name}"  );
Line 677... Line 644...
     #/**************************************************************************/
     #/**************************************************************************/
 
 
 
 
 
 
 
 
     foreach  my   $i_name ($spirit_design_file->findnodes('//spirit:interconnections/spirit:interconnection/spirit:activeInterface/@spirit:componentRef'))
     foreach  my   $i_name ($spirit_design_file->findnodes('//ipxact:interconnections/ipxact:interconnection/ipxact:activeInterface/@componentRef'))
        {
        {
        my($hierConn_comref_name)            = $i_name ->to_literal;
        my($hierConn_comref_name)            = $i_name ->to_literal;
        my($hierConn_busref_name)            = $i_name ->findnodes('../@spirit:busRef')->to_literal ;
        my($hierConn_busref_name)            = $i_name ->findnodes('../@busRef')->to_literal ;
        my($hierConn_name)                   = $i_name ->findnodes('../../spirit:name/text()')->to_literal ;
        my($hierConn_name)                   = $i_name ->findnodes('../../ipxact:name/text()')->to_literal ;
 
 
 
 
     #/*******************************************************************************/
     #/*******************************************************************************/
     #/*                                                                             */
     #/*                                                                             */
     #/* Read each  interconnection and enter modified signals into wire_decs        */
     #/* Read each  interconnection and enter modified signals into wire_decs        */
Line 694... Line 661...
 
 
 
 
 
 
 
 
 
 
        foreach  my  $i_name ($spirit_design_file->findnodes('//spirit:interconnections/spirit:interconnection/spirit:activeInterface/spirit:portMaps/spirit:portMap/spirit:logicalPort/spirit:name'))
        foreach  my  $i_name ($spirit_design_file->findnodes('//ipxact:interconnections/ipxact:interconnection/ipxact:activeInterface/ipxact:portMaps/ipxact:portMap/ipxact:logicalPort/ipxact:name'))
           {
           {
           my($lp_name)                = $i_name ->to_literal;
           my($lp_name)                = $i_name ->to_literal;
           my($lp_pname)               = $i_name ->findnodes('../../spirit:physicalPort/spirit:name/text()')->to_literal ;
           my($lp_pname)               = $i_name ->findnodes('../../ipxact:physicalPort/ipxact:name/text()')->to_literal ;
           my($lp_left)                = $i_name ->findnodes('../../spirit:physicalPort/spirit:wire/spirit:vector/spirit:left/text()')->to_literal ;
           my($lp_left)                = $i_name ->findnodes('../../ipxact:physicalPort/ipxact:wire/ipxact:vector/ipxact:left/text()')->to_literal ;
           my($lp_right)               = $i_name ->findnodes('../../spirit:physicalPort/spirit:wire/spirit:vector/spirit:right/text()')->to_literal ;
           my($lp_right)               = $i_name ->findnodes('../../ipxact:physicalPort/ipxact:wire/ipxact:vector/ipxact:right/text()')->to_literal ;
           my($lp_componentref_name)   = $i_name ->findnodes('../../../../@spirit:componentRef')->to_literal ;
           my($lp_componentref_name)   = $i_name ->findnodes('../../../../@componentRef')->to_literal ;
           my($lp_busref_name)         = $i_name ->findnodes('../../../../@spirit:busRef')->to_literal ;
           my($lp_busref_name)         = $i_name ->findnodes('../../../../@busRef')->to_literal ;
           my($lp_interconnect_name)   = $i_name ->findnodes('../../../../../spirit:name/text()')->to_literal ;
           my($lp_interconnect_name)   = $i_name ->findnodes('../../../../../ipxact:name/text()')->to_literal ;
           $lp_vector = "vector";
           $lp_vector = "vector";
 
 
 
 
           if ( $lp_pname eq '' ) { $lp_pname ="${lp_interconnect_name}_${lp_name}";}
           if ( $lp_pname eq '' ) { $lp_pname ="${lp_interconnect_name}_${lp_name}";}
           if ( $lp_left  eq '' )
           if ( $lp_left  eq '' )
Line 733... Line 700...
 
 
              uplift_busref(${hierConn_name},${lp_name},"node","wire",${lp_vector},${lp_left},${lp_right},${lp_pname});
              uplift_busref(${hierConn_name},${lp_name},"node","wire",${lp_vector},${lp_left},${lp_right},${lp_pname});
             }
             }
           }
           }
 
 
          foreach  my   $i_name ($spirit_design_file->findnodes("//spirit:design/spirit:componentInstances/spirit:componentInstance/spirit:instanceName[text() = '$hierConn_comref_name']"))
          foreach  my   $i_name ($spirit_design_file->findnodes("//ipxact:design/ipxact:componentInstances/ipxact:componentInstance/ipxact:instanceName[text() = '$hierConn_comref_name']"))
            {
            {
            #/**********************************************************************/
            #/**********************************************************************/
            #/*                                                                    */
            #/*                                                                    */
            #/* Lookup VLNV for each instantiated component                        */
            #/* Lookup VLNV for each instantiated component                        */
            #/*                                                                    */
            #/*                                                                    */
            #/**********************************************************************/
            #/**********************************************************************/
 
 
            my($vendor_name)         = $i_name  ->findnodes('../spirit:componentRef/@spirit:vendor')->to_literal ;
            my($vendor_name)         = $i_name  ->findnodes('../ipxact:componentRef/@vendor')->to_literal ;
            my($library_name)        = $i_name  ->findnodes('../spirit:componentRef/@spirit:library')->to_literal ;
            my($library_name)        = $i_name  ->findnodes('../ipxact:componentRef/@library')->to_literal ;
            my($component_name)      = $i_name  ->findnodes('../spirit:componentRef/@spirit:name')->to_literal ;
            my($component_name)      = $i_name  ->findnodes('../ipxact:componentRef/@name')->to_literal ;
            my($version_name)        = $i_name  ->findnodes('../spirit:componentRef/@spirit:version')->to_literal ;
            my($version_name)        = $i_name  ->findnodes('../ipxact:componentRef/@version')->to_literal ;
 
 
 
 
 
 
 
 
 
 
Line 786... Line 753...
               my $status = $child_cursor->c_close() ;
               my $status = $child_cursor->c_close() ;
               $child_ports_db   -> db_close();
               $child_ports_db   -> db_close();
            }
            }
 
 
 
 
        foreach  my   $i_name ($spirit_design_file->findnodes("//spirit:design/spirit:componentInstances/spirit:componentInstance/spirit:instanceName"))
        foreach  my   $i_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)       = $i_name ->findnodes('./text()')->to_literal ;
           my($instance_name)       = $i_name ->findnodes('./text()')->to_literal ;
           my($vendor_name)         = $i_name  ->findnodes('../spirit:componentRef/@spirit:vendor')->to_literal ;
           my($vendor_name)         = $i_name  ->findnodes('../ipxact:componentRef/@vendor')->to_literal ;
           my($library_name)        = $i_name  ->findnodes('../spirit:componentRef/@spirit:library')->to_literal ;
           my($library_name)        = $i_name  ->findnodes('../ipxact:componentRef/@library')->to_literal ;
           my($component_name)      = $i_name  ->findnodes('../spirit:componentRef/@spirit:name')->to_literal ;
           my($component_name)      = $i_name  ->findnodes('../ipxact:componentRef/@name')->to_literal ;
           my($version_name)        = $i_name  ->findnodes('../spirit:componentRef/@spirit:version')->to_literal ;
           my($version_name)        = $i_name  ->findnodes('../ipxact:componentRef/@version')->to_literal ;
 
 
           if( "$instance_name" eq  "$hierConn_comref_name"     )
           if( "$instance_name" eq  "$hierConn_comref_name"     )
             {
             {
#              print "INTERCONNECTION    $instance_name   $vendor_name   $library_name    $component_name  $version_name  $hierConn_busref_name   $hierConn_name           \n";
#              print "INTERCONNECTION    $instance_name   $vendor_name   $library_name    $component_name  $version_name  $hierConn_busref_name   $hierConn_name           \n";
             }
             }
Line 815... Line 782...
     #/*                                                                    */
     #/*                                                                    */
     #/**********************************************************************/
     #/**********************************************************************/
 
 
 
 
 
 
   foreach  my   $i_name ($spirit_design_file->findnodes("//spirit:design/spirit:vendorExtensions/socgen:nodes/socgen:node/spirit:name"))
   foreach  my   $i_name ($spirit_design_file->findnodes("//ipxact:design/ipxact:vendorExtensions/socgen:nodes/socgen:node/ipxact:name"))
        {
        {
        my($node_name)       = $i_name ->findnodes('./text()')->to_literal ;
        my($node_name)       = $i_name ->findnodes('./text()')->to_literal ;
        my($node_busdef)     = $i_name ->findnodes('../socgen:busDef/text()')->to_literal ;
        my($node_busdef)     = $i_name ->findnodes('../socgen:busDef/text()')->to_literal ;
        my($node_left)       = $i_name ->findnodes('../spirit:wire/spirit:vector/spirit:left/text()')->to_literal ;
        my($node_left)       = $i_name ->findnodes('../ipxact:wire/ipxact:vector/ipxact:left/text()')->to_literal ;
        my($node_right)      = $i_name ->findnodes('../spirit:wire/spirit:vector/spirit:right/text()')->to_literal ;
        my($node_right)      = $i_name ->findnodes('../ipxact:wire/ipxact:vector/ipxact:right/text()')->to_literal ;
        my($node_type)       = $i_name ->findnodes('../spirit:typeName/text()')->to_literal ;
        my($node_type)       = $i_name ->findnodes('../ipxact:typeName/text()')->to_literal ;
 
 
        unless($node_busdef){   $node_busdef =    $node_name;     }
        unless($node_busdef){   $node_busdef =    $node_name;     }
 
 
        if(  $node_left ne "" )
        if(  $node_left ne "" )
          {
          {
Line 850... Line 817...
     #/*                                                                    */
     #/*                                                                    */
     #/**********************************************************************/
     #/**********************************************************************/
 
 
 
 
 
 
     foreach  my   $i_name ($spirit_design_file->findnodes('//spirit:adHocConnections/spirit:adHocConnection/spirit:internalPortReference/@spirit:componentRef'))
     foreach  my   $i_name ($spirit_design_file->findnodes('//ipxact:adHocConnections/ipxact:adHocConnection/ipxact:internalPortReference/@componentRef'))
        {
        {
        my($componentRef_name)      = $i_name ->to_literal;
        my($componentRef_name)      = $i_name ->to_literal;
        my($adhocConnection_name)   = $i_name ->findnodes('../../spirit:name/text()')->to_literal ;
        my($adhocConnection_name)   = $i_name ->findnodes('../../ipxact:name/text()')->to_literal ;
        my($tied_value)             = $i_name ->findnodes('../../@spirit:tiedValue')->to_literal ;
        my($tied_value)             = $i_name ->findnodes('../../@tiedValue')->to_literal ;
        my($int_portRef_name)       = $i_name ->findnodes('../@spirit:portRef')->to_literal ;
        my($int_portRef_name)       = $i_name ->findnodes('../@portRef')->to_literal ;
        my($ext_portRef_name)       = $i_name ->findnodes('../../spirit:externalPortReference/@spirit:portRef')->to_literal ;
        my($ext_portRef_name)       = $i_name ->findnodes('../../ipxact:externalPortReference/@portRef')->to_literal ;
        my($left)                   = $i_name ->findnodes('../../spirit:externalPortReference/@spirit:left')->to_literal ;
        my($left)                   = $i_name ->findnodes('../../ipxact:externalPortReference/@left')->to_literal ;
        my($right)                  = $i_name ->findnodes('../../spirit:externalPortReference/@spirit:right')->to_literal ;
        my($right)                  = $i_name ->findnodes('../../ipxact:externalPortReference/@right')->to_literal ;
 
 
 
 
        if(  $left ne "" )
        if(  $left ne "" )
          {
          {
          if(  $right  eq "" ){ $right = $left; }
          if(  $right  eq "" ){ $right = $left; }
          $vector = "vector";
          $vector = "vector";
          }
          }
Line 872... Line 837...
          {
          {
          $vector = "scaler";
          $vector = "scaler";
          $left   = "none";
          $left   = "none";
          $right  = "none";
          $right  = "none";
          }
          }
 
          if ( ${adhocConnection_name} eq "" )  { $adhocConnection_name = "***";}
 
          if (  ${ext_portRef_name} eq ""    )  { $ext_portRef_name     = "***";}
 
#print "NNNNNNNNN $componentRef_name $adhocConnection_name ||${tied_value}||  $int_portRef_name $ext_portRef_name $left $right \n";
 
        if($tied_value )
 
          {
 
          $busses_db->db_put( "AdHoc_${componentRef_name}__${int_portRef_name}","${tied_value}:${ext_portRef_name}:${type}:${vector}:${left}:${right}"  );
 
#print"NNNNNNNNN  AdHoc_${componentRef_name}__${int_portRef_name}    ${tied_value}:${ext_portRef_name}:${type}:${vector}:${left}:${right}\n"  ;
 
          }
 
         else
 
          {
 
          $busses_db->db_put( "AdHoc_${componentRef_name}__${int_portRef_name}","${adhocConnection_name}:${ext_portRef_name}:${type}:${vector}:${left}:${right}"  );
 
#print "NNNNNNNNN   AdHoc_${componentRef_name}__${int_portRef_name}    ${adhocConnection_name}:${ext_portRef_name}:${type}:${vector}:${left}:${right} \n"  ;
 
        $_ = ${adhocConnection_name};
 
        if(/(\w+)/)
 
            {
 
            $adhocConnection_name      = $1;
 
            unless( looks_like_number($adhocConnection_name) )
 
                  {
 
#                  print "ADHOC_NODE   ${adhocConnection_name}  ,  node  ,  wire  , $vector, $left , $right  \n";
 
                  uplift_busref("adhoc", ${adhocConnection_name} , "node" , "wire" , ${vector}, ${left} , ${right}, ${adhocConnection_name});
 
                  }
 
            }
 
          }
 
        }
 
 
 
 
 
 
          if ( ${adhocConnection_name} eq "" )  { $adhocConnection_name = "***";}
 
          if (  ${ext_portRef_name} eq ""    )  { $ext_portRef_name     = "***";}
 
 
 
 
 
#print "NNNNNNNNNN $componentRef_name $adhocConnection_name ||${tied_value}||  $int_portRef_name $ext_portRef_name $left $right \n";
     #/**********************************************************************/
 
     #/*   1685_2014 version                                                */
 
     #/* Read all adHocConnections and load instance connect info into array*/
 
     #/*                                                                    */
 
     #/**********************************************************************/
 
 
 
 
 
 
 
     foreach  my   $i_name ($spirit_design_file->findnodes('//ipxact:adHocConnections/ipxact:adHocConnection/ipxact:portReferences/ipxact:internalPortReference/@componentRef'))
 
        {
 
        my($componentRef_name)      = $i_name ->to_literal;
 
        my($adhocConnection_name)   = $i_name ->findnodes('../../../ipxact:name/text()')->to_literal ;
 
        my($tied_value)             = $i_name ->findnodes('../../../@tiedValue')->to_literal ;
 
        my($int_portRef_name)       = $i_name ->findnodes('../@portRef')->to_literal ;
 
        my($ext_portRef_name)       = $i_name ->findnodes('../../ipxact:externalPortReference/@portRef')->to_literal ;
 
        my($left)                   = $i_name ->findnodes('../../ipxact:externalPortReference/@left')->to_literal ;
 
        my($right)                  = $i_name ->findnodes('../../ipxact:externalPortReference/@right')->to_literal ;
 
        if(  $left ne "" )
 
          {
 
          if(  $right  eq "" ){ $right = $left; }
 
          $vector = "vector";
 
          }
 
        else
 
          {
 
          $vector = "scaler";
 
          $left   = "none";
 
          $right  = "none";
 
          }
 
          if ( ${adhocConnection_name} eq "" )  { $adhocConnection_name = "***";}
 
          if (  ${ext_portRef_name} eq ""    )  { $ext_portRef_name     = "***";}
 
#print "NNNNNNNNN-N $componentRef_name $adhocConnection_name ||${tied_value}||  $int_portRef_name $ext_portRef_name $left $right \n";
        if($tied_value )
        if($tied_value )
          {
          {
          $busses_db->db_put( "AdHoc_${componentRef_name}__${int_portRef_name}","${tied_value}:${ext_portRef_name}:${type}:${vector}:${left}:${right}"  );
          $busses_db->db_put( "AdHoc_${componentRef_name}__${int_portRef_name}","${tied_value}:${ext_portRef_name}:${type}:${vector}:${left}:${right}"  );
 
#print "NNNNNNNNN-N  AdHoc_${componentRef_name}__${int_portRef_name}    ${tied_value}:${ext_portRef_name}:${type}:${vector}:${left}:${right}\n"  ;
#print"NNNNNNNNNNNNN  AdHoc_${componentRef_name}__${int_portRef_name}    ${tied_value}:${ext_portRef_name}:${type}:${vector}:${left}:${right}\n"  ;
 
 
 
          }
          }
         else
         else
          {
          {
          $busses_db->db_put( "AdHoc_${componentRef_name}__${int_portRef_name}","${adhocConnection_name}:${ext_portRef_name}:${type}:${vector}:${left}:${right}"  );
          $busses_db->db_put( "AdHoc_${componentRef_name}__${int_portRef_name}","${adhocConnection_name}:${ext_portRef_name}:${type}:${vector}:${left}:${right}"  );
#          print "NNNNNNNNN   AdHoc_${componentRef_name}__${int_portRef_name}    ${adhocConnection_name}:${ext_portRef_name}:${type}:${vector}:${left}:${right} \n"  ;
#print "NNNNNNNNN-N   AdHoc_${componentRef_name}__${int_portRef_name}    ${adhocConnection_name}:${ext_portRef_name}:${type}:${vector}:${left}:${right} \n"  ;
 
 
 
 
        $_ = ${adhocConnection_name};
        $_ = ${adhocConnection_name};
        if(/(\w+)/)
        if(/(\w+)/)
            {
            {
            $adhocConnection_name      = $1;
            $adhocConnection_name      = $1;
            unless( looks_like_number($adhocConnection_name) )
            unless( looks_like_number($adhocConnection_name) )
                  {
                  {
#                  print "ADHOC_NODE   ${adhocConnection_name}  ,  node  ,  wire  , $vector, $left , $right  \n";
#                  print "ADHOC_NODE   ${adhocConnection_name}  ,  node  ,  wire  , $vector, $left , $right  \n";
                  uplift_busref("adhoc", ${adhocConnection_name} , "node" , "wire" , ${vector}, ${left} , ${right}, ${adhocConnection_name});
                  uplift_busref("adhoc", ${adhocConnection_name} , "node" , "wire" , ${vector}, ${left} , ${right}, ${adhocConnection_name});
                  }
                  }
            }
            }
 
          }
          }
          }
 
 
 
 
        }
 
 
 
 
 
 
 
 
 
 
 
}
}
 
 
 
 
 
 
 
 
Line 1016... Line 1033...
 
 
 
 
 
 
 
 
 
 
 
#/*********************************************************************************************/
 
#/                                                                                            */
 
#/ Process hierarchial connection                                                             */
 
#/                                                                                            */
 
#/                                                                                            */
 
#/                                                                                            */
 
#/                                                                                            */
 
#/*********************************************************************************************/
 
 
 
 
 
 
 
 
 
sub process_hier
 
   {
 
   my @params                    = @_;
 
   my $spirit_design_file        = pop(@params);
 
   my $hierConn_busref_name      = pop(@params);
 
   my $hierConn_name             = pop(@params);
 
   my $hierConn_comref_name      = pop(@params);
 
 
 
 
 
 
 
   foreach  my   $i_name ($spirit_design_file->findnodes("//ipxact:design/ipxact:componentInstances/ipxact:componentInstance/ipxact:instanceName[text() = '$hierConn_comref_name']"))
 
            {
 
            #/**********************************************************************/
 
            #/*                                                                    */
 
            #/* Lookup VLNV for each instantiated component                        */
 
            #/*                                                                    */
 
            #/**********************************************************************/
 
 
 
            my($vendor_name)         = $i_name  ->findnodes('../ipxact:componentRef/@vendor')->to_literal ;
 
            my($library_name)        = $i_name  ->findnodes('../ipxact:componentRef/@library')->to_literal ;
 
            my($component_name)      = $i_name  ->findnodes('../ipxact:componentRef/@name')->to_literal ;
 
            my($version_name)        = $i_name  ->findnodes('../ipxact:componentRef/@version')->to_literal ;
 
 
 
            my $child_file  = yp::lib::get_io_busses_db_filename($vendor_name,$library_name,$component_name,$version_name,"default");
 
            $child_ports_db   = new BerkeleyDB::Hash( -Filename => $child_file, -Flags => DB_CREATE ) or die "Cannot open ${child_file}: $!";
 
            my $child_cursor = $child_ports_db->db_cursor() ;
 
            while ($child_cursor->c_get($key, $value, DB_NEXT) == 0)
 
               {
 
               ( ${log_name},${direction},${type},${vector},${left},${right}) = split ':', $value;
 
               if(($key eq "BusRef.${hierConn_busref_name}.${log_name}"))
 
                 {
 
                 if(${vector} eq "vector")
 
                      {
 
                      unless( looks_like_number($left) ) { $left=0;}
 
                      }
 
                  uplift_busref(${hierConn_name},${log_name},${direction},"wire",${vector},${left},${right},"${hierConn_name}_${log_name}");
 
                $busses_db->db_put( "IXstance.${hierConn_comref_name}.${hierConn_busref_name}.${log_name}","${value}"  );
 
                }
 
               elsif (($key eq "AbsDef.${hierConn_busref_name}.master"))
 
                {
 
                ( ${xx_vendor},${xx_library},${xx_name},${xx_version}) = split ':', $value;
 
                $busses_db->db_put( "AbsDef.${hierConn_name}.master","${xx_vendor}:${xx_library}:${xx_name}:${xx_version}"  );
 
                $busses_db->db_put( "AbsDef.${hierConn_name}.interconnect","${hierConn_comref_name}..${hierConn_busref_name}::"  );
 
                $busses_db->db_put( "Instance.${hierConn_comref_name}.${hierConn_busref_name}","${hierConn_name}"  );
 
                }
 
               elsif (($key eq "AbsDef.${hierConn_busref_name}.slave"))
 
                {
 
                ( ${xx_vendor},${xx_library},${xx_name},${xx_version}) = split ':', $value;
 
                $busses_db->db_put( "AbsDef.${hierConn_name}.slave","${xx_vendor}:${xx_library}:${xx_name}:${xx_version}"  );
 
                $busses_db->db_put( "AbsDef.${hierConn_name}.interconnect","${hierConn_comref_name}..${hierConn_busref_name}::"  );
 
                $busses_db->db_put( "Instance.${hierConn_comref_name}.${hierConn_busref_name}","${hierConn_name}"  );
 
                }
 
               }
 
               my $status = $child_cursor->c_close() ;
 
               $child_ports_db   -> db_close();
 
            }
 
 
 
 
 
 
 
           }
 
 
 
 
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.