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

Subversion Repositories socgen

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

Only display areas with differences | Details | Blame | View Log

Rev 134 Rev 135
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
############################################################################
############################################################################
use Getopt::Long;
use Getopt::Long;
use English;
use English;
use File::Basename;
use File::Basename;
use Cwd;
use Cwd;
use Scalar::Util qw(looks_like_number);
use Scalar::Util qw(looks_like_number);
use XML::LibXML;
use XML::LibXML;
use lib './tools';
use lib './tools';
use sys::lib;
use sys::lib;
use yp::lib;
use yp::lib;
use BerkeleyDB;
use BerkeleyDB;
$OUTPUT_AUTOFLUSH = 1; # set autoflush of stdout to TRUE.
$OUTPUT_AUTOFLUSH = 1; # set autoflush of stdout to TRUE.
############################################################################
############################################################################
### Process the options
### Process the options
############################################################################
############################################################################
Getopt::Long::config("require_order", "prefix=-");
Getopt::Long::config("require_order", "prefix=-");
GetOptions("h","help",
GetOptions("h","help",
           "envidentifier=s" => \$envidentifier,
           "envidentifier=s" => \$envidentifier,
           "prefix=s"        => \$prefix,
           "prefix=s"        => \$prefix,
           "vendor=s"        => \$vendor,
           "vendor=s"        => \$vendor,
           "library=s"       => \$library,
           "library=s"       => \$library,
           "component=s"     => \$component,
           "component=s"     => \$component,
           "version=s"       => \$version,
           "version=s"       => \$version,
           "path=s"          => \$path,
           "path=s"          => \$path,
           "bus_name=s"      => \$bus_name,
           "bus_name=s"      => \$bus_name,
           "test_name=s"      => \$test_name,
           "test_name=s"      => \$test_name,
           "dest_dir=s"      => \$dest_dir
           "dest_dir=s"      => \$dest_dir
) || die "(use '$program_name -h' for help)";
) || die "(use '$program_name -h' for help)";
##############################################################################
##############################################################################
## Help option
## Help option
##############################################################################
##############################################################################
if ( $opt_h  or $opt_help  )
if ( $opt_h  or $opt_help  )
  { print "\n trace_bus -envidentifier {sim/syn}  -prefix /work -vendor vendor_name -library library_name  -component component_name  -version version_name -path root.dut.core.cpu -bus_name cpu -dest_dir dest_dir    \n";
  { print "\n trace_bus -envidentifier {sim/syn}  -prefix /work -vendor vendor_name -library library_name  -component component_name  -version version_name -path root.dut.core.cpu -bus_name cpu -dest_dir dest_dir    \n";
    exit 1;
    exit 1;
  }
  }
#############################################################################
#############################################################################
##
##
##
##
#############################################################################
#############################################################################
$home = cwd();
$home = cwd();
unless ($prefix)
unless ($prefix)
 {
 {
 $prefix   = yp::lib::get_workspace();
 $prefix   = yp::lib::get_workspace();
 $prefix   =  "/${prefix}";
 $prefix   =  "/${prefix}";
 }
 }
unless ($path)
unless ($path)
 {
 {
 $path   =  "root";
 $path   =  "root";
 }
 }
my   $variant;
my   $variant;
unless(defined   $dest_dir  ){ $dest_dir            = "elab";}
unless(defined   $dest_dir  ){ $dest_dir            = "elab";}
my $main_module_name = yp::lib::get_module_name($vendor,$library,$component,$version);
my $main_module_name = yp::lib::get_module_name($vendor,$library,$component,$version);
my   $destination         = "${main_module_name}";
my   $destination         = "${main_module_name}";
if($test_name)
if($test_name)
  {
  {
  $destination         = "${destination}_${test_name}";
  $destination         = "${destination}_${test_name}";
  }
  }
my @reg_list ="";
my @reg_list ="";
my @param_list ="";
my @param_list ="";
my $root                =      "root";
my $root                =      "root";
if($version)       {$variant   = "${component}_${version}";}
if($version)       {$variant   = "${component}_${version}";}
else               {$variant   = "${component}";}
else               {$variant   = "${component}";}
#print "trace_bus  -prefix $prefix -vendor $vendor -library $library -component $component -version $version -path $path   -bus_name $bus_name -test_name $test_name  \n";
#print "trace_bus  -prefix $prefix -vendor $vendor -library $library -component $component -version $version -path $path   -bus_name $bus_name -test_name $test_name  \n";
my $parser = XML::LibXML->new();
my $parser = XML::LibXML->new();
my $socgen_file              = $parser->parse_file(yp::lib::find_componentConfiguration($vendor,$library,$component));
my $socgen_file              = $parser->parse_file(yp::lib::find_componentConfiguration($vendor,$library,$component));
#unless ($socgen_file)      { print "No socgen ip file   \n";};
#unless ($socgen_file)      { print "No socgen ip file   \n";};
my $comp_xml_sep    = yp::lib::find_comp_xml_sep($vendor,$library,$component,$version);
my $comp_xml_sep    = yp::lib::find_comp_xml_sep($vendor,$library,$component,$version);
my $lib_comp_sep    = yp::lib::find_lib_comp_sep($vendor,$library,$component);
my $lib_comp_sep    = yp::lib::find_lib_comp_sep($vendor,$library,$component);
my $root_path;
my $root_path;
if($dest_dir eq "elab")
if($dest_dir eq "elab")
{
{
 $root_path  = "${home}${prefix}/${vendor}__${library}${lib_comp_sep}${component}${comp_xml_sep}/../${dest_dir}";
 $root_path  = "${home}${prefix}/${vendor}__${library}${lib_comp_sep}${component}${comp_xml_sep}/../${dest_dir}";
}
}
else
else
{
{
 $root_path  = "${home}/${dest_dir}";
 $root_path  = "${home}/${dest_dir}";
}
}
 unless( -e $root_path )
 unless( -e $root_path )
      {
      {
      #print "$root_path does not exist... creating \n";
      #print "$root_path does not exist... creating \n";
      my $cmd = "mkdir $root_path \n";
      my $cmd = "mkdir $root_path \n";
      if(system($cmd)){};
      if(system($cmd)){};
      }
      }
 $root_path  = "${root_path}/${destination}";
 $root_path  = "${root_path}/${destination}";
 unless( -e $root_path )
 unless( -e $root_path )
      {
      {
      #print "$root_path does not exist... creating \n";
      #print "$root_path does not exist... creating \n";
      my $cmd = "mkdir $root_path \n";
      my $cmd = "mkdir $root_path \n";
      if(system($cmd)){};
      if(system($cmd)){};
      }
      }
my $sw_dir     = "${root_path}/sw";
my $sw_dir     = "${root_path}/sw";
mkdir $sw_dir,0755             unless( -e $sw_dir );
mkdir $sw_dir,0755             unless( -e $sw_dir );
my $output_file = "${sw_dir}/${path}_${bus_name}.v";
my $output_file = "${sw_dir}/${path}_${bus_name}.v";
$output_file =~s/root.dut.//;
$output_file =~s/root.dut.//;
open PARAM_FILE,">$output_file" or die "unable to open $output_file";
open PARAM_FILE,">$output_file" or die "unable to open $output_file";
my $output_file = "${sw_dir}/${path}_${bus_name}.h";
my $output_file = "${sw_dir}/${path}_${bus_name}.h";
$output_file =~s/root.dut.//;
$output_file =~s/root.dut.//;
open PARAMH_FILE,">$output_file" or die "unable to open $output_file";
open PARAMH_FILE,">$output_file" or die "unable to open $output_file";
my $report_dir     = "${root_path}/memmaps";
my $report_dir     = "${root_path}/memmaps";
mkdir $report_dir,0755             unless( -e $report_dir );
mkdir $report_dir,0755             unless( -e $report_dir );
$output_file = "${report_dir}/${path}_${bus_name}.txt";
$output_file = "${report_dir}/${path}_${bus_name}.txt";
$output_file =~s/root.dut.//;
$output_file =~s/root.dut.//;
open DEST_FILE,">$output_file" or die "unable to open $output_file";
open DEST_FILE,">$output_file" or die "unable to open $output_file";
my $elab_db_file = yp::lib::get_elab_db_filename($vendor,$library,$component,$version,"default");
my $elab_db_file = yp::lib::get_elab_db_filename($vendor,$library,$component,$version,"default");
unless(-e  $elab_db_file  )
unless(-e  $elab_db_file  )
        {
        {
        #print "$elab_db_file  root file does not exist  \n";
        #print "$elab_db_file  root file does not exist  \n";
        }
        }
my $root_db = new BerkeleyDB::Hash( -Filename => "$elab_db_file", -Flags => DB_CREATE ) or die "Cannot open $elab_db_file: $!";
my $root_db = new BerkeleyDB::Hash( -Filename => "$elab_db_file", -Flags => DB_CREATE ) or die "Cannot open $elab_db_file: $!";
my $comp_data;
my $comp_data;
my $bd_vendor;
my $bd_vendor;
my $bd_library;
my $bd_library;
my $bd_component;
my $bd_component;
my $bd_version;
my $bd_version;
#print "STARTING $path       ::  $bus_name  \n";
#print "STARTING $path       ::  $bus_name  \n";
$root_db->db_get("component___${path}", $comp_data );
$root_db->db_get("component___${path}", $comp_data );
( $vendor,$library,$component,$version) = split( /\:/ , $comp_data);
( $vendor,$library,$component,$version) = split( /\:/ , $comp_data);
my $instance_db_file  = yp::lib::get_io_busses_db_filename($vendor,$library,$component,$version,"default");
my $instance_db_file  = yp::lib::get_io_busses_db_filename($vendor,$library,$component,$version,"default");
unless(-e  $instance_db_file  )
unless(-e  $instance_db_file  )
        {
        {
        #print "$instance_db_file  instance file does not exist  \n";
        #print "$instance_db_file  instance file does not exist  \n";
        }
        }
my $instance_db      = new BerkeleyDB::Hash( -Filename => "$instance_db_file", -Flags => DB_CREATE ) or die "Cannot open $instance_db_file: $!";
my $instance_db      = new BerkeleyDB::Hash( -Filename => "$instance_db_file", -Flags => DB_CREATE ) or die "Cannot open $instance_db_file: $!";
my $base_addr = hex(0x0000);
my $base_addr = hex(0x0000);
my $repo_data;
my $repo_data;
$instance_db->db_get("AbsDef.${bus_name}.master", $repo_data );
$instance_db->db_get("AbsDef.${bus_name}.master", $repo_data );
if($repo_data)
if($repo_data)
  {
  {
  ( $bd_vendor,$bd_library,$bd_component,$bd_version) = split( /\:/ , $repo_data);
  ( $bd_vendor,$bd_library,$bd_component,$bd_version) = split( /\:/ , $repo_data);
#  print  "MASTER $bd_vendor $bd_library $bd_component $bd_version   \n";
#  print  "MASTER $bd_vendor $bd_library $bd_component $bd_version   \n";
  $repo_data = "";
  $repo_data = "";
  $_ = "$path";
  $_ = "$path";
  if(/(\S+)\.(\S+)/)
  if(/(\S+)\.(\S+)/)
    {
    {
    $path      = $1;
    $path      = $1;
    }
    }
    follow_bus("${path}",$bus_name,$base_addr);
    follow_bus("${path}",$bus_name,$base_addr);
  }
  }
$instance_db->db_get("AbsDef.${bus_name}.slave", $repo_data );
$instance_db->db_get("AbsDef.${bus_name}.slave", $repo_data );
$instance_db->db_close();
$instance_db->db_close();
if($repo_data)
if($repo_data)
  {
  {
  ( $bd_vendor,$bd_library,$bd_component,$bd_version) = split( /\:/ , $repo_data);
  ( $bd_vendor,$bd_library,$bd_component,$bd_version) = split( /\:/ , $repo_data);
#  print  "SLAVE $bd_vendor $bd_library $bd_component $bd_version   \n";
#  print  "SLAVE $bd_vendor $bd_library $bd_component $bd_version   \n";
  $repo_data = "";
  $repo_data = "";
  follow_bus("${path}",$bus_name,$base_addr);
  follow_bus("${path}",$bus_name,$base_addr);
  }
  }
$root_db->db_close();
$root_db->db_close();
@reg_list = sys::lib::trim_sort(@reg_list);
@reg_list = sys::lib::trim_sort(@reg_list);
foreach my $reg_line (@reg_list)
foreach my $reg_line (@reg_list)
{
{
print DEST_FILE "$reg_line  \n";
print DEST_FILE "$reg_line  \n";
}
}
@param_list = sys::lib::trim_sort(@param_list);
@param_list = sys::lib::trim_sort(@param_list);
foreach my $param_line (@param_list)
foreach my $param_line (@param_list)
{
{
( $address,$parameter) = split( /\:/ , $param_line);
( $address,$parameter) = split( /\:/ , $param_line);
if($parameter)
if($parameter)
{
{
print PARAM_FILE   "parameter $parameter = $address ; \n";
print PARAM_FILE   "parameter $parameter = $address ; \n";
print PARAMH_FILE "$parameter = $address ; \n";
print PARAMH_FILE "$parameter = $address ; \n";
}
}
}
}
#print "FINISHED \n";
#print "FINISHED \n";
sub follow_bus
sub follow_bus
   {
   {
   my @params           = @_;
   my @params           = @_;
   my $base_addr        = pop(@params);
   my $base_addr        = pop(@params);
   my $bus_name         = pop(@params);
   my $bus_name         = pop(@params);
   my $path            = pop(@params);
   my $path            = pop(@params);
   my $vendor;
   my $vendor;
   my $library;
   my $library;
   my $component;
   my $component;
   my $version;
   my $version;
   my $comp_data;
   my $comp_data;
   my $bd_vendor;
   my $bd_vendor;
   my $bd_library;
   my $bd_library;
   my $bd_component;
   my $bd_component;
   my $bd_version;
   my $bd_version;
   my $repo_data;
   my $repo_data;
#   print "START_FOLLOW   $path                 == $bus_name  \n";
#   print "START_FOLLOW   $path                 == $bus_name  \n";
   $root_db->db_get("component___${path}", $comp_data );
   $root_db->db_get("component___${path}", $comp_data );
   ( $vendor,$library,$component,$version) = split( /\:/ , $comp_data);
   ( $vendor,$library,$component,$version) = split( /\:/ , $comp_data);
#   print "QQQQQQ  $path    ||  $vendor $library $component $version ==  $bus_name  \n";
#   print "QQQQQQ  $path    ||  $vendor $library $component $version ==  $bus_name  \n";
   my $instance_db_file  = yp::lib::get_io_busses_db_filename($vendor,$library,$component,$version,"default");
   my $instance_db_file  = yp::lib::get_io_busses_db_filename($vendor,$library,$component,$version,"default");
   unless(-e  $instance_db_file  )
   unless(-e  $instance_db_file  )
        {
        {
        #print "$instance_db_file  instance file does not exist  \n";
        #print "$instance_db_file  instance file does not exist  \n";
        }
        }
   my $instance_db = new BerkeleyDB::Hash( -Filename => "$instance_db_file", -Flags => DB_CREATE ) or die "Cannot open $instance_db_file: $!";
   my $instance_db = new BerkeleyDB::Hash( -Filename => "$instance_db_file", -Flags => DB_CREATE ) or die "Cannot open $instance_db_file: $!";
   $instance_db->db_get("AbsDef.${bus_name}.master", $repo_data );
   $instance_db->db_get("AbsDef.${bus_name}.master", $repo_data );
   if($repo_data)
   if($repo_data)
     {
     {
     ( $bd_vendor,$bd_library,$bd_component,$bd_version) = split( /\:/ , $repo_data);
     ( $bd_vendor,$bd_library,$bd_component,$bd_version) = split( /\:/ , $repo_data);
#  print  "MASTER $bd_vendor $bd_library $bd_component $bd_version   \n";
#  print  "MASTER $bd_vendor $bd_library $bd_component $bd_version   \n";
     $repo_data = "";
     $repo_data = "";
     }
     }
    $instance_db->db_get("AbsDef.${bus_name}.interconnect", $repo_data );
    $instance_db->db_get("AbsDef.${bus_name}.interconnect", $repo_data );
    if($repo_data)
    if($repo_data)
      {
      {
      my @couples = split( /\:/ , $repo_data);
      my @couples = split( /\:/ , $repo_data);
      foreach my $pair (@couples)
      foreach my $pair (@couples)
        {
        {
        my $new_instance;
        my $new_instance;
        my $new_bus_name;
        my $new_bus_name;
        ($new_instance,$new_bus_name) = split( /\.\./ , $pair);
        ($new_instance,$new_bus_name) = split( /\.\./ , $pair);
#        print  "INTC    $path           $new_instance  ==  $new_bus_name   \n";
#        print  "INTC    $path           $new_instance  ==  $new_bus_name   \n";
        follow_bus("${path}.${new_instance}",$new_bus_name,$base_addr);
        follow_bus("${path}.${new_instance}",$new_bus_name,$base_addr);
        return(1);
        return(1);
        }
        }
      $repo_data = "";
      $repo_data = "";
      }
      }
   $instance_db->db_get("AbsDef.${bus_name}.slave", $repo_data );
   $instance_db->db_get("AbsDef.${bus_name}.slave", $repo_data );
   if($repo_data)
   if($repo_data)
      {
      {
      ( $bd_vendor,$bd_library,$bd_component,$bd_version) = split( /\:/ , $repo_data);
      ( $bd_vendor,$bd_library,$bd_component,$bd_version) = split( /\:/ , $repo_data);
#      print  "SLAVE  $bd_vendor $bd_library $bd_component $bd_version   \n";
#      print  "SLAVE  $bd_vendor $bd_library $bd_component $bd_version   \n";
      $repo_data = "";
      $repo_data = "";
      $instance_db->db_get("AbsDef.${bus_name}.bridge", $repo_data );
      $instance_db->db_get("AbsDef.${bus_name}.bridge", $repo_data );
      if($repo_data)
      if($repo_data)
         {
         {
         $_ = "$path";
         $_ = "$path";
         if(/(\S+)\.(\S+)/)
         if(/(\S+)\.(\S+)/)
           {
           {
           $path      = $1;
           $path      = $1;
           }
           }
         my @couples = split( /\::/ , $repo_data);
         my @couples = split( /\::/ , $repo_data);
         foreach my $pair (@couples)
         foreach my $pair (@couples)
           {
           {
           my $new_bus_name;
           my $new_bus_name;
           my $new_base_addr;
           my $new_base_addr;
          ($new_bus_name,$new_base_addr) = split( /\.\./ , $pair);
          ($new_bus_name,$new_base_addr) = split( /\.\./ , $pair);
           my $mapped_addr = $base_addr + $new_base_addr;
           my $mapped_addr = $base_addr + $new_base_addr;
#           print  "BRIDGE  $path        ==  ${bus_name}   $new_bus_name  $mapped_addr           \n";
#           print  "BRIDGE  $path        ==  ${bus_name}   $new_bus_name  $mapped_addr           \n";
           $instance_db->db_get("BlkDef.${bus_name}.${new_bus_name}", $Repo_data );
           $instance_db->db_get("BlkDef.${bus_name}.${new_bus_name}", $Repo_data );
#           print "BlkDef.${bus_name}.${new_bus_name} $Repo_data  \n";
#           print "BlkDef.${bus_name}.${new_bus_name} $Repo_data  \n";
           ( $Base,$Range) = split( /\::/ , $Repo_data);
           ( $Base,$Range) = split( /\::/ , $Repo_data);
           $Saddr = $Base + $base_addr;
           $Saddr = $Base + $base_addr;
           $Eaddr = $Base + $base_addr + $Range-1;
           $Eaddr = $Base + $base_addr + $Range-1;
#           print "FRRRRRRRR $base_addr $Base  $Range   $Saddr  $Eaddr  \n";
#           print "FRRRRRRRR $base_addr $Base  $Range   $Saddr  $Eaddr  \n";
           my $hex = sprintf("0x%04x",$Saddr);
           my $hex = sprintf("0x%04x",$Saddr);
           push @reg_list ,"$hex                                     ${component}.${path} ($component) ${bus_name}  Start "  ;
           push @reg_list ,"$hex                                     ${component}.${path} ($component) ${bus_name}  Start "  ;
           $hex = sprintf("0x%04x",$Eaddr);
           $hex = sprintf("0x%04x",$Eaddr);
           push @reg_list ,"$hex                                     ${bus_name}  End "  ;
           push @reg_list ,"$hex                                     ${bus_name}  End "  ;
           follow_bus( "${path}",$new_bus_name,$mapped_addr);
           follow_bus( "${path}",$new_bus_name,$mapped_addr);
           }
           }
        $repo_data = "";
        $repo_data = "";
        }
        }
      else
      else
        {
        {
#        print "Now dump registers for $path     $bus_name   $base_addr\n";
#        print "Now dump registers for $path     $bus_name   $base_addr\n";
         my $hex = sprintf("0x%04x",$base_addr);
         my $hex = sprintf("0x%04x",$base_addr);
         my $key;
         my $key;
         my $value;
         my $value;
         my $RegDef;
         my $RegDef;
         my $reg_bus;
         my $reg_bus;
         my $reg_name;
         my $reg_name;
         my $cursor = $instance_db ->db_cursor() ;
         my $cursor = $instance_db ->db_cursor() ;
         while ($cursor->c_get($key, $value, DB_NEXT) == 0)
         while ($cursor->c_get($key, $value, DB_NEXT) == 0)
            {
            {
            ($RegDef,$reg_bus,$reg_name) = split( /\./ , $key);
            ($RegDef,$reg_bus,$reg_name) = split( /\./ , $key);
#   print " $key      $value  \n";
#   print " $key      $value  \n";
             if( ($RegDef eq "RegDef") && ($reg_bus eq $bus_name))
             if( ($RegDef eq "RegDef") && ($reg_bus eq $bus_name))
               {
               {
               ( $Xoffset,$Xname,$Xsize,$Xaccess) = split( /\::/ , $value);
               ( $Xoffset,$Xname,$Xsize,$Xaccess) = split( /\::/ , $value);
               $addr = $base_addr + $Xoffset;
               $addr = $base_addr + $Xoffset;
               my $hex = sprintf("0x%04x    %16s ",$addr, $Xname);
               my $hex = sprintf("0x%04x    %16s ",$addr, $Xname);
               push @reg_list ,"$hex            $Xsize   $Xaccess";
               push @reg_list ,"$hex            $Xsize   $Xaccess";
               my $temp = "${path}_${Xname}";
               my $temp = "${path}_${Xname}";
               $temp =~s/root.dut.//;
               $temp =~s/root.dut.//;
               $temp =~s/\./_/g;
               $temp =~s/\./_/g;
               $hex = sprintf("'h%04x:%16s ",$addr, $temp);
               $hex = sprintf("'h%04x:%16s ",$addr, $temp);
               if($hex) {push @param_list ,"$hex";}
               if($hex) {push @param_list ,"$hex";}
 #   print  " $addr   $Xname   $Xsize   $Xaccess    \n";
 #   print  " $addr   $Xname   $Xsize   $Xaccess    \n";
   }
   }
   if( ($RegDef eq "BlkDef") && ($reg_bus eq $bus_name))
   if( ($RegDef eq "BlkDef") && ($reg_bus eq $bus_name))
   {
   {
   ( $Base,$Range) = split( /\::/ , $value);
   ( $Base,$Range) = split( /\::/ , $value);
   $Saddr = $Base + $base_addr;
   $Saddr = $Base + $base_addr;
   $Eaddr = $Base + $base_addr + $Range-1;
   $Eaddr = $Base + $base_addr + $Range-1;
#print "FRRRRRRRR $base_addr $Base  $Range   $Saddr  $Eaddr  \n";
#print "FRRRRRRRR $base_addr $Base  $Range   $Saddr  $Eaddr  \n";
   my $hex = sprintf("0x%04x",$Saddr);
   my $hex = sprintf("0x%04x",$Saddr);
   push @reg_list ,"$hex                                     ${component}.${path} ($component) ${bus_name}  Start "  ;
   push @reg_list ,"$hex                                     ${component}.${path} ($component) ${bus_name}  Start "  ;
   $hex = sprintf("0x%04x",$Eaddr);
   $hex = sprintf("0x%04x",$Eaddr);
   push @reg_list ,"$hex                                     ${bus_name}  End "  ;
   push @reg_list ,"$hex                                     ${bus_name}  End "  ;
   }
   }
   }
   }
   my $status = $cursor->c_close() ;
   my $status = $cursor->c_close() ;
        }
        }
      }
      }
$instance_db->db_get("AbsDef.${bus_name}.node", $repo_data );
$instance_db->db_get("AbsDef.${bus_name}.node", $repo_data );
if($repo_data)
if($repo_data)
  {
  {
  ( $bd_vendor,$bd_library,$bd_component,$bd_version) = split( /\:/ , $repo_data);
  ( $bd_vendor,$bd_library,$bd_component,$bd_version) = split( /\:/ , $repo_data);
#  print  "NODE   $bd_vendor $bd_library $bd_component $bd_version   \n";
#  print  "NODE   $bd_vendor $bd_library $bd_component $bd_version   \n";
  $repo_data = "";
  $repo_data = "";
  $instance_db->db_get("AbsDef.${bus_name}.interconnect", $repo_data );
  $instance_db->db_get("AbsDef.${bus_name}.interconnect", $repo_data );
  if($repo_data)
  if($repo_data)
     {
     {
#     print  "INTC   $repo_data \n";
#     print  "INTC   $repo_data \n";
     my @couples = split( /\:/ , $repo_data);
     my @couples = split( /\:/ , $repo_data);
     foreach my $pair (@couples)
     foreach my $pair (@couples)
      {
      {
       my $new_instance;
       my $new_instance;
       my $new_bus_name;
       my $new_bus_name;
      ($new_instance,$new_bus_name) = split( /\.\./ , $pair);
      ($new_instance,$new_bus_name) = split( /\.\./ , $pair);
#       print  "NODE  $path         $new_instance  ==  $new_bus_name   \n";
#       print  "NODE  $path         $new_instance  ==  $new_bus_name   \n";
       follow_bus("${path}.${new_instance}",$new_bus_name,$base_addr);
       follow_bus("${path}.${new_instance}",$new_bus_name,$base_addr);
       return(1);
       return(1);
      }
      }
     }
     }
  }
  }
$instance_db->db_close();
$instance_db->db_close();
return(0);
return(0);
   }
   }
1
1
 
 

powered by: WebSVN 2.1.0

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