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

Subversion Repositories socgen

[/] [socgen/] [trunk/] [tools/] [geda/] [gen_geda] - Rev 135

Compare with Previous | Blame | View Log

eval 'exec `which perl` -S $0 ${1+"$@"}'
   if 0;
#/**********************************************************************/
#/*                                                                    */
#/*             -------                                                */
#/*            /   SOC  \                                              */
#/*           /    GEN   \                                             */
#/*          /    TOOL    \                                            */
#/*          ==============                                            */
#/*          |            |                                            */
#/*          |____________|                                            */
#/*                                                                    */
#/*                                                                    */
#/*                                                                    */
#/*                                                                    */
#/*  Author(s):                                                        */
#/*      - John Eaton, jt_eaton@opencores.org                          */
#/*                                                                    */
#/**********************************************************************/
#/*                                                                    */
#/*    Copyright (C) <2010-2011>  <Ouabache Design Works>              */
#/*                                                                    */
#/*  This source file may be used and distributed without              */
#/*  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                          */
#/*                                                                    */
#/**********************************************************************/


############################################################################
# General PERL config
############################################################################
use Getopt::Long;
use English;
use File::Basename;
use Cwd;
use Scalar::Util qw(looks_like_number);
use XML::LibXML;
use lib './tools';
use sys::lib;
use yp::lib;
use BerkeleyDB;


$OUTPUT_AUTOFLUSH = 1; # set autoflush of stdout to TRUE.


############################################################################
### Process the options
############################################################################
Getopt::Long::config("require_order", "prefix=-");
GetOptions("h","help",
           "envidentifier=s"  => \$envidentifier,
           "prefix=s"         => \$prefix,
           "vendor=s"         => \$vendor,
           "library=s"        => \$library,
           "version=s"        => \$version,
           "component=s"      => \$component,
           "dest_dir=s"       => \$dest_dir
) || die "(use '$program_name -h' for help)";


##############################################################################
## Help option
##############################################################################
if ( $opt_h  or $opt_help  ) 
  { print "\n gen_geda -envidentifier :*Simulation:*  -prefix /work/children -vendor vendor_name -library library_name  -component component_name  -version version_name     \n";
    exit 1;
  }



#############################################################################
## 
## 
#############################################################################

$home = cwd();


my $variant;

if($version)       {$variant   = "${component}_${version}";}
else               {$variant   = "${component}";}
print "\n---GEN_geda    -vendor $vendor -library $library -component $component -version $version    \n";


my $main_module_name = yp::lib::get_module_name($vendor,$library,$component,$version) ;

my $destination = $main_module_name;

my  $configuration = "default";

my $repo           = yp::lib::find_library_repo($vendor,$library);

my $parser = XML::LibXML->new();

my $socgen_file              = $parser->parse_file(yp::lib::find_componentConfiguration($vendor,$library,$component));

unless ($socgen_file)      { print "No socgen ip file   \n";};

my $doc_library_path = $socgen_file->findnodes("//socgen:componentConfiguration/socgen:doc/socgen:library_path/text()")->to_literal;

my $spirit_component_file    = $parser->parse_file(yp::lib::find_ipxact_component($vendor,$library,$component,$version));

my $path  = "${home}${repo}/${vendor}/${library}${doc_library_path}";
mkdir $path,0755             unless( -e $path );


if (defined $dest_dir && length $dest_dir > 0)
   { 
   $doc_library_path = "${doc_library_path}/${dest_dir}";
   }

 my $path  = "${home}${repo}/${vendor}/${library}${doc_library_path}";
 mkdir $path,0755             unless( -e $path );

 my $sym_path  = "${home}${repo}/${vendor}/${library}${doc_library_path}/sym";
 mkdir $sym_path,0755             unless( -e $sym_path );

 my $sch_path  = "${home}${repo}/${vendor}/${library}${doc_library_path}/sch";
 mkdir $sch_path,0755             unless( -e $sch_path );


 my $png_path  = "${home}${repo}/${vendor}/${library}${doc_library_path}/png";
 mkdir $png_path,0755             unless( -e $png_path );


 my $html_path  = "${home}${repo}/${vendor}/${library}${doc_library_path}/html";
 mkdir $html_path,0755             unless( -e $html_path );


   $symfile ="${sym_path}/${destination}.sym";
   print "$symfile  \n";
   open SYM_FILE,">$symfile" or die "unable to open $symfile";


   my $sym_pngfile ="${png_path}/${destination}_sym.png";



   $schfile ="${sch_path}/${destination}.sch";
   print "$schfile  \n";
   open SCH_FILE,">$schfile" or die "unable to open $outfile";


   my $sch_pngfile ="${png_path}/${destination}_sch.png";


   my $htmlfile ="${html_path}/${destination}.html";



  unless( -e $htmlfile )
    {
    my $cmd = "cp  ${home}/tools/documentation/template.html   $htmlfile      ";
    if (system($cmd)) {}
    };


   open HTML_FILE,">$htmlfile" or die "unable to open $outfile";













my   @instantiations    =       ();
my   @parameters        =       ();
my   %parameter_values  =       ();
my   %parameter_descriptions  = ();



#/******************************************************************************************/
#/*                                                                                        */
#/* get parameters                                                                         */
#/*                                                                                        */
#/******************************************************************************************/


print "PAM \n";
my @Pams = yp::lib::get_parameters($vendor,$library,$component,$version,$configuration);

foreach my $Pam (@Pams)
{
my $param_name;
my $param_value;


( $param_name,$param_value) = split( /\::/ , $Pam); 
unless(defined $parameter_values{$param_name}) {push ( @parameters,  "$param_name");};
$parameter_values{$param_name} = $param_value;
}




my @signals = yp::lib::get_signals($vendor,$library,$component,$version);
   




   my @I_names = yp::lib::get_instance_names($vendor,$library,$component,$version,$configuration);
 
   foreach my $I_name (@I_names)
        {
        my $foo_ven;
        my $foo_lib;
        my $foo_cmp;
        my $foo_ver;
        my $foo_cfg;

        my $vlnvc  = yp::lib::get_instance_vlnvc($vendor,$library,$component,$version,$I_name,$configuration );

          ( $foo_ven,$foo_lib,$foo_cmp,$foo_ver,$foo_cfg) = split( /\:/ , $vlnvc); 


        push @instantiations  , "/*  ${vlnvc}  */ \n";
        my $module_name  = yp::lib::get_instance_module_name($vendor,$library,$component,$version,$I_name,$configuration);
        if(defined $foo_cfg && length $foo_cfg > 0)
          {
          push @instantiations  ,          "${module_name}_${foo_cfg}\n";
          }
        else
          {
          push @instantiations  ,          "${module_name}\n";
          $first = 1;
          my @Pams = yp::lib::get_Parameters($vendor,$library,$component,$version,"root.${I_name}",$configuration);
          foreach my $pam (@Pams)
            {
            ( $foo_name,$foo_value) = split( /\::/ , $pam); 
            if($first)
              {
              push @instantiations  , "#( .${foo_name} (${foo_value})";
              $first = 0;         
              }  
            else  {push @instantiations  , ",\n   .${foo_name} (${foo_value})";}  
            }
 
          if($first == 0)  { push @instantiations  , ")\n";}
          }

          push @instantiations  , "$I_name \n   (\n ";
          $first = 1;
 
          my @Inst_conns = yp::lib::get_instance_adhoc_conns($vendor,$library,$component,$version,$I_name);
          my @Buss_conns = yp::lib::get_instance_conns($vendor,$library,$component,$version,$I_name);
          foreach my $Buss_conn (@Buss_conns)
             {
               push @instantiations  ,          "  $Buss_conn";
             }
          foreach my $Inst_conn (@Inst_conns)
             {
               push @instantiations  ,          "  $Inst_conn";
             }
        push @instantiations  , ");\n\n";         
        }





 
   #/**********************************************************************/
   #/*                                                                    */
   #/* Add any and all global parameters with their default values        */
   #/*                                                                    */
   #/**********************************************************************/
      

     foreach my $parameter_name (@parameters)  
        {
        my $parameter_value = $parameter_values{$parameter_name};
#        print SCH_FILE  "    parameter \n      ${parameter_name}=${parameter_value}";
        }
      




 

   #/**********************************************************************/
   #/*                                                                    */
   #/* sort all  ports  with their type, size and direction               */
   #/*                                                                    */
   #/**********************************************************************/

   my @in_port_list   = ();
   my @out_port_list  = ();
   my @io_port_list  = ();
   my @in_bus_port_list   = ();
   my @out_bus_port_list  = ();
   my @io_bus_port_list  = ();

 

   my $key;
   my $value;

my $in_count;
my $out_count;
my $in_length;
my $out_length;


   foreach my $signal (@signals)  
         {
         ( ${port_name},${direction},${type},${vector},${left},${right}) = split ':', $signal;
#         print " ${port_name},${direction},${type},${vector},${left},${right} \n";
         if( ${vector} eq "vector" )  
            { 
            $port_name ="${port_name}[${left}:${right}]";             
            if(  $direction eq "input"   )
              {  
              $in_count = $in_count+1;
              push (@in_bus_port_list,  "${port_name}");       
              my $length = length $port_name;
              if($length > $in_length ){$in_length = $length }
              }
             elsif(  $direction eq "output"   )
              {
              $out_count = $out_count+1;
              push (@out_bus_port_list,  "${port_name}");
              my $length = length $port_name;
              if($length > $out_length ){$out_length = $length }       
              }
             elsif(  $direction eq "inout"   )
              {
              $out_count = $out_count+1;
              push (@io_bus_port_list,  "${port_name}");       
              my $length = length $port_name;
              if($length > $out_length ){$out_length = $length }       
              }
             }
          else
            {
            if(  $direction eq "input"   )
              {  
              $in_count = $in_count+1;
              push (@in_port_list,  "${port_name}");       
              my $length = length $port_name;
              if($length > $in_length ){$in_length = $length }
              }
            elsif(  $direction eq "output"   )
              {
              $out_count = $out_count+1;
              push (@out_port_list,  "${port_name}");
              my $length = length $port_name;
              if($length > $out_length ){$out_length = $length }       
              }
            elsif(  $direction eq "inout"   )
              {
              $out_count = $out_count+1;
              push (@io_port_list,  "${port_name}");       
              my $length = length $port_name;
              if($length > $out_length ){$out_length = $length }       
              }
            }
         }

         
   @in_port_list          = sys::lib::trim_sort(@in_port_list);
   @out_port_list         = sys::lib::trim_sort(@out_port_list);
   @io_port_list          = sys::lib::trim_sort(@io_port_list);
   @in_bus_port_list      = sys::lib::trim_sort(@in_bus_port_list);
   @out_bus_port_list     = sys::lib::trim_sort(@out_bus_port_list);

   my @In_port_list      = @in_port_list;
   my @Out_port_list     = @out_port_list;
   my @Io_port_list      = @io_port_list;
   my @In_bus_port_list  = @in_bus_port_list;
   my @Out_bus_port_list = @out_bus_port_list;
   my @Io_bus_port_list  = @io_bus_port_list;


   my @hIn_port_list      = @in_port_list;
   my @hOut_port_list     = @out_port_list;
   my @hIo_port_list      = @io_port_list;
   my @hIn_bus_port_list  = @in_bus_port_list;
   my @hOut_bus_port_list = @out_bus_port_list;
   my @hIo_bus_port_list  = @io_bus_port_list;




#  Dump out symbol

        my $color =  5;
        my $size  = 10;
        my $max_pins;
        if($in_count > $out_count) {$max_pins = $in_count ;} else  {$max_pins = $out_count ;}
        my $width = $in_length +$out_length;

        print "SIZE width  $width height $max_pins \n";



        my $box_h     = ($max_pins * 200) +300;
        my $box_w     = ($in_length +$out_length)*10*$size +400;
        my $out_title = ($in_length +$out_length)*10*$size +600;
        my $out_edg   = ($in_length +$out_length)*10*$size +700;
        my $out_pad   = ($in_length +$out_length)*10*$size +1000;
        my $title     = $box_h +150;
        my $ref_des   = $box_h +350;
        my $vlnv      = $box_h +500;

        printf SYM_FILE ("v 20100214 1\n");
        printf SYM_FILE ("B 300 0  $box_w $box_h 3 60 0 0 -1 -1 0 -1 -1 -1 -1 -1\n");
        printf SYM_FILE ("T 400 $title   5 10 1 1 0 0 1 1\ndevice=${main_module_name}\n");
        printf SYM_FILE ("T 400 $ref_des 5 10 1 1 0 0 1 1\nrefdes=U?\n");
        printf SYM_FILE ("T 400 $vlnv    0 10 0 1 0 0 1 1\nvendor=${vendor}\n");
        printf SYM_FILE ("T 400 $vlnv    0 10 0 1 0 0 1 1\nlibrary=${library}\n");
        printf SYM_FILE ("T 400 $vlnv    0 10 0 1 0 0 1 1\ncomponent=${component}\n");
        printf SYM_FILE ("T 400 $vlnv    0 10 0 1 0 0 1 1\nversion=${version}\n");



         my $pin_y = 200;
         my $pin_seq = 1;

         while( $name =pop(@In_bus_port_list))
          {
          printf SYM_FILE ("P 300 $pin_y 0 $pin_y 10 1 1 \n");
          printf SYM_FILE ("{\nT 400 $pin_y $color $size 1 1 0 1 1 1\npinnumber=%s\n",$name);
          printf SYM_FILE ("T 400 $pin_y $color $size 0 1 0 1 1 1\npinseq=%s\n}\n",$pin_seq);
          $pin_seq = $pin_seq +1;
          $pin_y = $pin_y +200;
          }


         while( $name =pop(@In_port_list))
          {
           printf SYM_FILE ("P 300 $pin_y 0 $pin_y 4 0 1  \n");
           printf SYM_FILE ("{\nT 400 $pin_y $color $size 1 1 0 1 1 1 \npinnumber=%s\n",$name);
           printf SYM_FILE ("T 400 $pin_y $color $size 0 1 0 1 1 1 \npinseq=%s\n}\n",$pin_seq);
           $pin_seq = $pin_seq +1;
           $pin_y = $pin_y +200;
          }



         $pin_y = 200;

         while( $name =pop(@Out_bus_port_list))         
          {
           printf SYM_FILE ("P $out_edg $pin_y $out_pad $pin_y 10 1 1\n");
           printf SYM_FILE ("{\nT $out_title $pin_y $color  $size 1 1 0 7 1 1 \npinnumber=%s\n",$name);
           printf SYM_FILE ("T $out_title $pin_y $color  $size 0 1 0 7 1 1 \npinseq=%s\n}\n",$pin_seq);
           $pin_seq = $pin_seq +1;
           $pin_y = $pin_y +200;
          }

         while( $name =pop(@Io_bus_port_list))         
          {
           printf SYM_FILE ("P $out_edg $pin_y $out_pad $pin_y 10 1 1\n");
           printf SYM_FILE ("{\nT $out_title $pin_y $color  $size 1 1 0 7 1 1 \npinnumber=%s\n",$name);
           printf SYM_FILE ("T $out_title $pin_y $color  $size 0 1 0 7 1 1 \npinseq=%s\n}\n",$pin_seq);
           $pin_seq = $pin_seq +1;
           $pin_y = $pin_y +200;
          }


         while( $name =pop(@Out_port_list))         
          {
           printf SYM_FILE ("P $out_edg $pin_y $out_pad $pin_y 4 0 1\n");
           printf SYM_FILE ("{\nT $out_title $pin_y $color  $size 1 1 0 7 1 1\npinnumber=%s\n",$name);
           printf SYM_FILE ("T $out_edg $pin_y $color  $size 0 1 0 7 1 1\npinseq=%s\n}\n",$pin_seq);
           $pin_seq = $pin_seq +1;
           $pin_y = $pin_y +200;
          }


         while( $name =pop(@Io_port_list))         
          {
           printf SYM_FILE ("P $out_edg $pin_y $out_pad $pin_y 4 0 1\n");
           printf SYM_FILE ("{\nT $out_title $pin_y $color  $size 1 1 0 7 1 1\npinnumber=%s\n",$name);
           printf SYM_FILE ("T $out_edg $pin_y $color  $size 0 1 0 7 1 1\npinseq=%s\n}\n",$pin_seq);
           $pin_seq = $pin_seq +1;
           $pin_y = $pin_y +200;
          }



        my $in_edg  = ($in_length)*10*$size +200;
        my $in_pad  = ($in_length)*10*$size +200;
        my $out_edg = ($in_length +$out_length)*10*$size +2500;
        my $out_pad = ($in_length +$out_length)*10*$size +1500;

        printf SCH_FILE ("v 20100214 1\n");


         my $pin_y = 300;

         while( $name =pop(@in_bus_port_list))
          {
         printf SCH_FILE ("C $in_pad $pin_y 1 0 0 in_port_vector.sym   \n{\nT $in_edg $pin_y $color $size 1 1 0 6 1 1\nrefdes=%s\n}\n",$name);
         $pin_y = $pin_y +400;
          }


         while( $name =pop(@in_port_list))
          {
           printf  SCH_FILE  ("C $in_pad $pin_y 1 0 0 in_port.sym  \n{\nT $in_edg $pin_y $color $size 1 1 0 6 1 1 \nrefdes=%s\n}\n",$name);
           $pin_y = $pin_y +400;
          }


         $pin_y = 300;

         while( $name =pop(@out_bus_port_list))         
          {
           printf  SCH_FILE  ("C $out_pad $pin_y  1 0  0 out_port_vector.sym\n{\nT $out_edg $pin_y $color  $size 1 1 0 0 1 1 \nrefdes=%s\n}\n",$name);
           $pin_y = $pin_y +400;
          }


         while( $name =pop(@out_port_list))         
          {
           printf  SCH_FILE  ("C $out_pad $pin_y  1 0 0 out_port.sym\n{\nT $out_edg $pin_y $color  $size 1 1 0 0 1 1\nrefdes=%s\n}\n",$name);
           $pin_y = $pin_y +400;
          }


         while( $name =pop(@io_bus_port_list))         
          {
           printf  SCH_FILE  ("C $out_pad $pin_y  1 0  0 io_port_vector.sym\n{\nT $out_edg $pin_y $color  $size 1 1 0 0 1 1 \nrefdes=%s\n}\n",$name);
           $pin_y = $pin_y +400;
          }


         while( $name =pop(@io_port_list))         
          {
           printf  SCH_FILE  ("C $out_pad $pin_y  1 0 0 io_port.sym\n{\nT $out_edg $pin_y $color  $size 1 1 0 0 1 1\nrefdes=%s\n}\n",$name);
           $pin_y = $pin_y +400;
          }


















   #/**********************************************************************/
   #/*                                                                    */
   #/* Now add all ports  with their type, size and direction             */
   #/*                                                                    */
   #/**********************************************************************/

 #  print SCH_FILE  "\n    ";
      
   foreach $port_line (@port_list)  
        {
 #           print SCH_FILE  " ${port_line} \n";
            
          
        }



     #/**********************************************************************/
     #/*                                                                    */
     #/* Dump everything from the ip-xact files into component              */
     #/*                                                                    */
     #/**********************************************************************/

#     print SCH_FILE  "\n\n\n";
#     while(   my $line_out      = shift(@instantiations))             {  print SCH_FILE  "$line_out";}



my $cmd ="gaf export -c -s auto -m 5px  --dpi  600  --no-color -o  $sym_pngfile $symfile \n";
if (system($cmd)) {}
print "$cmd";
my $cmd ="gaf export -c -s auto -m 5px  --dpi  600  --no-color -o  $sch_pngfile $schfile \n";
if (system($cmd)) {}
print "$cmd";






   print HTML_FILE  " <!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">  \n";
   print HTML_FILE  " <html>  \n";
   print HTML_FILE  " <head>  \n";
   print HTML_FILE  "   <meta http-equiv=\"CONTENT-TYPE\" content=\"text/html; charset=utf-8\">  \n";
   print HTML_FILE  "   <title>start</title>  \n";
   print HTML_FILE  "   <meta name=\"GENERATOR\" content=\"OpenOffice.org 3.0  (Linux)\">  \n";
   print HTML_FILE  "   <meta name=\"CREATED\" content=\"0;0\">  \n";
   print HTML_FILE  "   <meta name=\"CHANGED\" content=\"20090513;8521600\">  \n";
   print HTML_FILE  "   <meta name=\"KEYWORDS\" content=\"start\">  \n";
   print HTML_FILE  "   <meta name=\"Info 3\" content=\"\">  \n";
   print HTML_FILE  "   <meta name=\"Info 4\" content=\"\">  \n";
   print HTML_FILE  "   <meta name=\"date\" content=\"2008-01-08T12:01:41-0500\">  \n";
   print HTML_FILE  "   <meta name=\"robots\" content=\"index,follow\">  \n";
   print HTML_FILE  " </head>  \n";
   print HTML_FILE  " <body dir=\"ltr\" lang=\"en-US\">  \n";
   print HTML_FILE  " <h1><a name=\"${main_module_name}\"></a>SOCGEN Datasheet:<br>  \n";
   print HTML_FILE  " </h1>  \n";
   print HTML_FILE  " <div id=\"toc__inside\" dir=\"ltr\">  \n";
   print HTML_FILE  " <ul>  \n";
   print HTML_FILE  "   <li>  \n";
   print HTML_FILE  "     <p style=\"margin-bottom: 0in;\"><a href=\"#${main_module_name}\">${main_module_name}<br>  \n";
   print HTML_FILE  "     </a></p>  \n";

   foreach my $socgen_cfg ($socgen_file->findnodes("//socgen:componentConfiguration/socgen:doc/socgen:versions/socgen:version/socgen:name[text() = '$version']")) 
             {
             $module_description        = $socgen_cfg->findnodes('../socgen:description/text()')->to_literal ;
             }
   print HTML_FILE  " <br>  \n";
   print HTML_FILE  " <br>  $module_description         \n";
   print HTML_FILE  " <br>  \n";

   print HTML_FILE  "       <li>  \n";
   print HTML_FILE  "         <p><a href=\"../src/${main_module_name}.v\">SourceCode <br>  \n";
   print HTML_FILE  "         </a></p>  \n";
   print HTML_FILE  "       </li>  \n";


   print HTML_FILE  "       <li>  \n";
   print HTML_FILE  "         <p style=\"margin-bottom: 0in;\"><a href=\"#Parameters\">Parameters<br>  \n";
   print HTML_FILE  "         </a></p>  \n";
   print HTML_FILE  "       </li>  \n";

   print HTML_FILE  "       <li>  \n";
   print HTML_FILE  "         <p style=\"margin-bottom: 0in;\"><a href=\"#Interface\">Interface<br>  \n";
   print HTML_FILE  "         </a></p>  \n";
   print HTML_FILE  "       </li>  \n";


   print HTML_FILE  "       <li>  \n";
   print HTML_FILE  "         <p style=\"margin-bottom: 0in;\"><a href=\"#Children\">Children<br>  \n";
   print HTML_FILE  "         </a></p>  \n";
   print HTML_FILE  "       </li>  \n";



   print HTML_FILE  "       <li>  \n";
   print HTML_FILE  "         <p><a href=\"../../html/${main_module_name}.html#TheoryofOperation\">Theory of Operation<br>  \n";
   print HTML_FILE  "         </a></p>  \n";
   print HTML_FILE  "       </li>  \n";


   print HTML_FILE  "     </ul>  \n";
   print HTML_FILE  "   </li>  \n";
   print HTML_FILE  " </ul>  \n";
   print HTML_FILE  " </div>  \n";

   if($in_count >= $out_count) {$max_lines = $in_count }
   else  {$max_lines = $out_count }

   $scale = 0.7500;
   $max_lines =(($max_lines *24)+110);
   $max_width = $in_length +  $out_length;
   $max_width =(($max_width * 10) + 343) * $scale ;

   print "$max_width   $max_width  max_lines  $max_lines \n";

   print HTML_FILE  " <img style=\"width: ${max_width}px; height: ${max_lines}px;\" alt=\"\"  src=\"../png/${main_module_name}_sym.png\"><br>  \n";
   print HTML_FILE  " <b><br>  \n";

   print HTML_FILE  " <h2><b><a name=\"Parameters\"></a>Parameters<br></b></h2>  \n";
   print HTML_FILE  " <b><br>  \n";
   print HTML_FILE  " <br>  \n";
   print HTML_FILE  " </b>  \n";
   print HTML_FILE  "<table style=\"text-align: left; width: 640px; height: 120px;\" border=\"8\" cellpadding=\"4\" cellspacing=\"4\"> \n";
   print HTML_FILE  "  <tbody> \n";

   print HTML_FILE  "   <tr> \n";
   print HTML_FILE  "      <td style=\"vertical-align: top;\">Name<br>      </td> \n";
   print HTML_FILE  "      <td style=\"vertical-align: top;\">default <br>      </td> \n";
   print HTML_FILE  "      <td style=\"vertical-align: top;\">Description<br></td> \n";
   print HTML_FILE  "    </tr> \n";



   foreach my $Pam (@Pams)
    {
    my $param_name;
    my $param_value;
    ( $param_name,$param_value) = split( /\::/ , $Pam); 

    print HTML_FILE "   <tr> \n      <td style=\"vertical-align: top;\">${param_name}<br>      </td> \n          <td style=\"vertical-align: top;\">${param_value}<br>      </td> \n          <td style=\"vertical-align: top;\">${parameter_description}<br></td> \n         </tr> \n";

    }






   print HTML_FILE  "   </tbody>  \n";
   print HTML_FILE  "  </table>  \n";
   print HTML_FILE  " <p><b><b><br>  \n";
   print HTML_FILE  " </b></b></p>  \n";
   print HTML_FILE  " <p><br>  \n";
   print HTML_FILE  " </p>  \n";
   print HTML_FILE  " <p><b><b><br>  \n";
   print HTML_FILE  " </b></b></p>  \n";
   print HTML_FILE  " <p><b><b><br>  \n";

   print HTML_FILE  " <br>  \n";
   print HTML_FILE  " </b></b></p>  \n";

   print HTML_FILE  " <h2><b><b><a name=\"Interface\"></a>Interface</b><b>&nbsp;<br>  \n";
   print HTML_FILE  " </b></b></h2>  \n";
   print HTML_FILE  " <p style=\"margin-bottom: 0in;\"></p>  \n";
   print HTML_FILE  " <br>  \n";
   print HTML_FILE  " <br>  \n";
   print HTML_FILE  " <br>  \n";


   print HTML_FILE  " <table style=\"text-align: left; width: 640px; height: 120px;\" border=\"8\"  \n";
   print HTML_FILE  "  cellpadding=\"4\" cellspacing=\"4\">  \n";
   print HTML_FILE  "   <tbody>  \n";
   print HTML_FILE  "     <tr>  \n";
   print HTML_FILE  "       <td style=\"vertical-align: top;\">NAME<br>      </td>  \n";
   print HTML_FILE  "       <td style=\"vertical-align: top;\">Type<br>      </td>  \n";
   print HTML_FILE  "       <td style=\"vertical-align: top;\">Description<br>      </td>  \n";
   print HTML_FILE  "     </tr>  \n";

   foreach my $line (@hIn_port_list)
      {
      print HTML_FILE "     <tr>  \n        <td style=\"vertical-align: top;\">${line}<br>      </td>  \n       <td style=\"vertical-align: top;\">input<br>      </td>  \n       <td style=\"vertical-align: top;\">${interface_description}<br>      </td>  \n     </tr>  \n"  ;
      }

   foreach my $line (@hIn_bus_port_list)
      {
      print HTML_FILE "     <tr>  \n        <td style=\"vertical-align: top;\">${line}<br>      </td>  \n       <td style=\"vertical-align: top;\">input<br>      </td>  \n       <td style=\"vertical-align: top;\">${interface_description}<br>      </td>  \n     </tr>  \n"  ;
      }


   foreach my $line (@hOut_port_list)
      {
      print HTML_FILE "     <tr>  \n        <td style=\"vertical-align: top;\">${line}<br>      </td>  \n       <td style=\"vertical-align: top;\">output<br>      </td>  \n       <td style=\"vertical-align: top;\">${interface_description}<br>      </td>  \n     </tr>  \n"  ;
      }


   foreach my $line (@hOut_bus_port_list)
      {
      print HTML_FILE "     <tr>  \n        <td style=\"vertical-align: top;\">${line}<br>      </td>  \n       <td style=\"vertical-align: top;\">output<br>      </td>  \n       <td style=\"vertical-align: top;\">${interface_description}<br>      </td>  \n     </tr>  \n"  ;
      }


   foreach my $line (@hIo_bus_port_list)
      {
      print HTML_FILE "     <tr>  \n        <td style=\"vertical-align: top;\">${line}<br>      </td>  \n       <td style=\"vertical-align: top;\">inout<br>      </td>  \n       <td style=\"vertical-align: top;\">${interface_description}<br>      </td>  \n     </tr>  \n"  ;
      }


   print HTML_FILE  "   </tbody>  \n";
   print HTML_FILE  "  </table>  \n";
   print HTML_FILE  " <p><b><b><br>  \n";
   print HTML_FILE  " </b></b></p>  \n";



   print HTML_FILE  " <h2><b><a name=\"Children\"></a>Children<br></b></h2>  \n";
   print HTML_FILE  " <b><br>  \n";
   print HTML_FILE  " </b>  \n";
   print HTML_FILE  "<table style=\"text-align: left; width: 640px; height: 120px;\" border=\"8\" cellpadding=\"4\" cellspacing=\"4\"> \n";
   print HTML_FILE  "  <tbody> \n";

   print HTML_FILE  "   <tr> \n";
   print HTML_FILE  "      <td style=\"vertical-align: top;\">Instance<br>      </td> \n";
   print HTML_FILE  "      <td style=\"vertical-align: top;\">Vendor<br>      </td> \n";
   print HTML_FILE  "      <td style=\"vertical-align: top;\">Library<br></td> \n";
   print HTML_FILE  "      <td style=\"vertical-align: top;\">Component<br></td> \n";
   print HTML_FILE  "      <td style=\"vertical-align: top;\">Version<br></td> \n";
   print HTML_FILE  "    </tr> \n";

     my @spirit_design_files       = yp::lib::find_ipxact_design_files($vendor,$library,$component,$version);

     foreach  my   $sd_file (@spirit_design_files)
     {

     $_ = $sd_file;
        if(/:::(\S+):::(\S+):::(\S+):::(\S+):::/) 
          { 
          $q_vendor            = $1;
          $q_library           = $2;
          $q_design            = $3;
          $q_version           = $4;
          $sd_file             = $parser->parse_file(yp::lib::find_ipxact_design($q_vendor,$q_library,$q_design,$q_version));
          }
                  
          foreach  my   $x_name ($sd_file->findnodes("//ipxact:design/ipxact:componentInstances/ipxact:componentInstance/ipxact:instanceName"))
            {
            #/**********************************************************************/
            #/*                                                                    */
            #/* Lookup VLNV for each instantiated component                        */
            #/*                                                                    */
            #/**********************************************************************/


           my($instance_name)       = $x_name ->findnodes('./text()')->to_literal ;
           my($vendor_name)         = $x_name  ->findnodes('../ipxact:componentRef/@vendor')->to_literal ;
           my($library_name)        = $x_name  ->findnodes('../ipxact:componentRef/@library')->to_literal ;
           my($component_name)      = $x_name  ->findnodes('../ipxact:componentRef/@name')->to_literal ;
           my($version_name)        = $x_name  ->findnodes('../ipxact:componentRef/@version')->to_literal ;

           print HTML_FILE  "   <tr> \n";
           print HTML_FILE  "      <td style=\"vertical-align: top;\">$instance_name<br>      </td> \n";
           print HTML_FILE  "      <td style=\"vertical-align: top;\">$vendor_name<br>      </td> \n";
           print HTML_FILE  "      <td style=\"vertical-align: top;\">$library_name<br></td> \n";
           print HTML_FILE  "      <td style=\"vertical-align: top;\">$component_name<br></td> \n";
           print HTML_FILE  "      <td style=\"vertical-align: top;\">$version_name<br></td> \n";
           print HTML_FILE  "    </tr> \n";
           }    
     }

     print HTML_FILE  "   </tbody>  \n";
     print HTML_FILE  "  </table>  \n";
     print HTML_FILE  " <p><b><b><br>  \n";
     print HTML_FILE  " </b></b></p>  \n";
     print HTML_FILE  " <br>  \n";
     print HTML_FILE  " <br>  \n";
     print HTML_FILE  " <br>  \n";
     print HTML_FILE  " <br>  \n";
     print HTML_FILE  " <br>  \n";
     print HTML_FILE  " <br>  \n";
     print HTML_FILE  " <br>  \n";
     print HTML_FILE  " <br>  \n";
     print HTML_FILE  " <img style=\"width: ${max_width}px; height: ${max_lines}px;\" alt=\"\"  src=\"../png/${main_module_name}_sch.png\"><br>  \n";
     print HTML_FILE  " <b><br>  \n";
     print HTML_FILE  " <br>  \n";
     print HTML_FILE  " <br>  \n";
     print HTML_FILE  " <br>  \n";
     print HTML_FILE  " <br>  \n";
     print HTML_FILE  " <br>  \n";
     print HTML_FILE  " <br>  \n";
     print HTML_FILE  " <br>  \n";
     print HTML_FILE  " <br>  \n";
     print HTML_FILE  " <br>  \n";
     print HTML_FILE  " <br>  \n";
     print HTML_FILE  " <br>  \n";
     print HTML_FILE  " <br>  \n";
     print HTML_FILE  " <br>  \n";
     print HTML_FILE  " <br>  \n";
     print HTML_FILE  " <br>  \n";
     print HTML_FILE  " <br>  \n";
     print HTML_FILE  " <br>  \n";
     print HTML_FILE  " <br>  \n";
     print HTML_FILE  " <br>  \n";
     print HTML_FILE  " <br>  \n";
     print HTML_FILE  " <br>  \n";
     print HTML_FILE  " <br>  \n";
     print HTML_FILE  " <br>  \n";
     print HTML_FILE  " <br>  \n";
     print HTML_FILE  " </body>  \n";
     print HTML_FILE  " </html>  \n";










1

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

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