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

Subversion Repositories socgen

[/] [socgen/] [trunk/] [tools/] [verilog/] [gen_verilog] - Diff between revs 128 and 130

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

Rev 128 Rev 130
Line 99... Line 99...
##
##
#############################################################################
#############################################################################
 
 
 
 
$home = cwd();
$home = cwd();
 
 
 
my $projects_dir = "/projects";
my $variant;
my $variant;
my $view;
my $view;
 
 
 
 
my $interface_in_count   =0;
my $interface_in_count   =0;
Line 116... Line 118...
 else               {$variant   = "${component}";}
 else               {$variant   = "${component}";}
 
 
unless($destination) { $destination = $variant;}
unless($destination) { $destination = $variant;}
unless($autodoc)     { $autodoc     = "/Geda";}
unless($autodoc)     { $autodoc     = "/Geda";}
 
 
#print "\n WARNING  GEN_verilog    $prefix $vendor $project $component $version $configuration      $dest_dir  $destination   \n";
print "\n GEN_verilog    $prefix $vendor $project $component $version $configuration      $dest_dir  $destination   \n";
 
 
 
 
my $lib_comp_sep    = yp::lib::find_lib_comp_sep($vendor,$project,$component);
my $lib_comp_sep    = yp::lib::find_lib_comp_sep($vendor,$project,$component);
my $comp_xml_sep    = yp::lib::find_ipxact_component_path("spirit:component",$vendor,$project,$component,$version);
my $comp_xml_sep    = yp::lib::find_comp_xml_sep($vendor,$project,$component,$version);
 
 
 
 
 
 
 
 
my $parser = XML::LibXML->new();
my $parser = XML::LibXML->new();
 
 
my $socgen_file               = $parser->parse_file(yp::lib::find_socgen("socgen:componentConfiguration",$vendor,$project,$component));
my $socgen_file              = $parser->parse_file(yp::lib::find_componentConfiguration($vendor,$project,$component));
my $spirit_component_file    = $parser->parse_file(yp::lib::find_ipxact("spirit:component",$vendor,$project,$component,$version));
my $spirit_component_file    = $parser->parse_file(yp::lib::find_ipxact_component($vendor,$project,$component,$version));
my $sim_library_path         = $socgen_file->findnodes("//socgen:componentConfiguration/socgen:sim/socgen:library_path/text()")->to_literal;
 
my $doc_library_path         = $socgen_file->findnodes("//socgen:componentConfiguration/socgen:doc/socgen:library_path/text()")->to_literal;
my $doc_library_path         = $socgen_file->findnodes("//socgen:componentConfiguration/socgen:doc/socgen:library_path/text()")->to_literal;
 
 
 
 
 
my $sim_library_path ;
 
my $lib_comp_sep             = yp::lib::find_lib_comp_sep($vendor,$project,$component);
 
 
 
 
 
 
 
my $sim_comp_path            = $socgen_file->findnodes("//socgen:componentConfiguration/socgen:sim/socgen:comp_path/text()")->to_literal;
 
 
 
if ($sim_comp_path)
 
{
 
$sim_library_path            ="${lib_comp_sep}${sim_comp_path}";
 
}
 
else
 
{
 
$sim_library_path            = $socgen_file->findnodes("//socgen:componentConfiguration/socgen:sim/socgen:library_path/text()")->to_literal;
 
}
 
 
 
 
 
 
 
 
 
 
foreach my $X_view ($spirit_component_file->findnodes('//spirit:component/spirit:model/spirit:views/spirit:view'))
foreach my $X_view ($spirit_component_file->findnodes('//spirit:component/spirit:model/spirit:views/spirit:view'))
         {
         {
         my($Xview_name)   = $X_view->findnodes('./spirit:name/text()')->to_literal ;
         my($Xview_name)   = $X_view->findnodes('./spirit:name/text()')->to_literal ;
         my($Xview_envidentifier)   = $X_view->findnodes('./spirit:envIdentifier/text()')->to_literal ;
         my($Xview_envidentifier)   = $X_view->findnodes('./spirit:envIdentifier/text()')->to_literal ;
Line 150... Line 170...
 
 
 
 
 
 
 
 
 
 
my $path  = "${home}${prefix}/${vendor}__${project}${lib_comp_sep}/${component}${comp_xml_sep}/${dest_dir}";
my $path  = "${home}${prefix}/${vendor}__${project}${lib_comp_sep}${component}${comp_xml_sep}/${dest_dir}";
mkdir $path,0755             unless( -e $path );
mkdir $path,0755             unless( -e $path );
 
 
my $path  = "${home}${prefix}/${vendor}__${project}${lib_comp_sep}/${component}${comp_xml_sep}/${dest_dir}/${view}";
my $path  = "${home}${prefix}/${vendor}__${project}${lib_comp_sep}${component}${comp_xml_sep}/${dest_dir}/${view}";
mkdir $path,0755             unless( -e $path );
mkdir $path,0755             unless( -e $path );
 
 
my   @filelist_hier     =       ();
my   @filelist_hier     =       ();
my   @instantiations    =       ();
my   @instantiations    =       ();
my   @parameters        =       ();
my   @parameters        =       ();
Line 165... Line 185...
my   %parameter_descriptions  = ();
my   %parameter_descriptions  = ();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
#if( ($prefix eq "/work")  && ($sim_library_path)         ){$opt_tb = 1;}
 
 
 
 
 
if($opt_tb )
if($opt_tb )
{
{
   print "Creating testbench for   $vendor $project $component  $version \n";
   print "Creating testbench for   $vendor $project $component  $version \n";
 
 
 
 
   my $path  ="${home}/projects/${vendor}/${project}${sim_library_path}";
   my $path  ="${home}${projects_dir}/${vendor}/${project}${sim_library_path}";
   mkdir $path,0755             unless( -e $path );
   mkdir $path,0755             unless( -e $path );
 
 
   my $path  ="${home}/projects/${vendor}/${project}${sim_library_path}/testbenches";
   my $path  ="${home}${projects_dir}/${vendor}/${project}${sim_library_path}/testbenches";
   mkdir $path,0755             unless( -e $path );
   mkdir $path,0755             unless( -e $path );
 
 
      $path  ="${home}/projects/${vendor}/${project}${sim_library_path}/testbenches/xml";
      $path  ="${home}${projects_dir}/${vendor}/${project}${sim_library_path}/testbenches/xml";
   mkdir $path,0755             unless( -e $path );
   mkdir $path,0755             unless( -e $path );
 
 
 
 
   $outfile ="${home}/projects/${vendor}/${project}${sim_library_path}/testbenches/xml/${variant}_dut.params.xml";
   $outfile ="${home}${projects_dir}/${vendor}/${project}${sim_library_path}/testbenches/xml/${variant}_dut.params.xml";
   open TB_COMP_FILE,">$outfile" or die "unable to open $outfile";
   open TB_COMP_FILE,">$outfile" or die "unable to open $outfile";
 
 
   print TB_COMP_FILE  "\n";
   print TB_COMP_FILE  "\n";
   print TB_COMP_FILE  "