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

Subversion Repositories socgen

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /socgen/trunk/tools
    from Rev 130 to Rev 131
    Reverse comparison

Rev 130 → Rev 131

/simulation/run_coverage
73,7 → 73,7
## Help option
##############################################################################
if ( $opt_h or $opt_help )
{ print "\n run_coverage project_name project_vendor";
{ print "\n run_coverage vendor library";
print "\n";
exit 1;
}
80,7 → 80,7
 
 
#/**********************************************************************/
#/* Process each project by finding any ip-xact file in any component */
#/* Process each library by finding any ip-xact file in any component */
#/* */
#/* Each ip-xact file is parsed and it's filename and the names of any*/
#/* modules that it uses are saved. */
91,33 → 91,41
 
my $home = cwd();
my $vendor ;
my $project ;
my $library ;
 
 
my $prefix = yp::lib::get_workspace();
 
$_ = $ARGV[0];
my $work_site = $ARGV[1];
 
 
 
if(/(\S+)__(\S+)/)
{
$vendor = $1;
$project = $2;
$library = $2;
}
 
 
print "$work_site $vendor $project \n";
 
 
 
my $parser = XML::LibXML->new();
 
 
 
my @components = yp::lib::find_components($vendor,$project);
my @components = yp::lib::find_components($vendor,$library);
 
foreach my $component (@components)
{
my $socgen_file = $parser->parse_file(yp::lib::find_componentConfiguration($vendor,$project,$component));
 
my $socgen_filename = yp::lib::find_componentConfiguration($vendor,$library,$component);
if($socgen_filename)
{
 
my $socgen_file = $parser->parse_file($socgen_filename);
my $sim_library_path ;
my $lib_comp_sep = yp::lib::find_lib_comp_sep($vendor,$project,$component);
my $lib_comp_sep = yp::lib::find_lib_comp_sep($vendor,$library,$component);
my $sim_comp_path = $socgen_file->findnodes("//socgen:componentConfiguration/socgen:sim/socgen:comp_path/text()")->to_literal;
 
if ($sim_comp_path)
129,7 → 137,7
$sim_library_path = $socgen_file->findnodes("//socgen:componentConfiguration/socgen:sim/socgen:library_path/text()")->to_literal;
}
 
print "XXXX- $vendor $project $component $sim_library_path \n";
print "XXXX- $vendor $library $component $sim_library_path \n";
 
#/*********************************************************************************************/
#/ create coverage database .cdd file */
145,7 → 153,7
if($tb_tool eq "coverage")
{
print " COVERAGEs $tb_tool $tb_variant $tb_version \n";
chdir ".${work_site}/${vendor}__${project}${sim_library_path}/cov/${tb_variant}";
chdir "./${prefix}/${vendor}__${library}${sim_library_path}/cov/${tb_variant}";
 
$cmd ="make build_cdd \n";
if (system($cmd)) {}
189,5 → 197,7
 
}
 
}
 
 
 
/simulation/run_sims
55,6 → 55,7
use lib './tools';
use sys::lib;
use yp::lib;
use Parallel::ForkManager;
 
$OUTPUT_AUTOFLUSH = 1; # set autoflush of stdout to TRUE.
 
73,7 → 74,7
## Help option
##############################################################################
if ( $opt_h or $opt_help )
{ print "\n run_sims project_name project_vendor";
{ print "\n run_sims vendor library";
print "\n";
exit 1;
}
80,7 → 81,7
 
 
#/**********************************************************************/
#/* Process each project by finding any ip-xact file in any component */
#/* Process each library by finding any ip-xact file in any component */
#/* */
#/* Each ip-xact file is parsed and it's filename and the names of any*/
#/* modules that it uses are saved. */
91,42 → 92,36
 
my $home = cwd();
my $vendor ;
my $project ;
my $library ;
 
 
my $prefix = yp::lib::get_workspace();
 
 
$_ = $ARGV[0];
my $work_site = $ARGV[1];
 
 
 
if(/(\S+)__(\S+)/)
{
$vendor = $1;
$project = $2;
$library = $2;
}
 
 
 
 
 
 
 
 
 
 
 
my $parser = XML::LibXML->new();
 
 
 
my @components = yp::lib::find_components($vendor,$project);
my @components = yp::lib::find_components($vendor,$library);
 
foreach my $component (@components)
{
my $socgen_file = $parser->parse_file(yp::lib::find_componentConfiguration($vendor,$project,$component));
my $socgen_filename = yp::lib::find_componentConfiguration($vendor,$library,$component);
 
if($socgen_filename)
{
my $socgen_file = $parser->parse_file($socgen_filename);
my $sim_library_path ;
my $lib_comp_sep = yp::lib::find_lib_comp_sep($vendor,$project,$component);
my $lib_comp_sep = yp::lib::find_lib_comp_sep($vendor,$library,$component);
my $sim_comp_path = $socgen_file->findnodes("//socgen:componentConfiguration/socgen:sim/socgen:comp_path/text()")->to_literal;
 
if ($sim_comp_path)
145,43 → 140,43
#/ files for simulation */
#/ */
#/*********************************************************************************************/
my $cmd;
my @cmds = ();
my $manager = new Parallel::ForkManager( 6 );
 
 
foreach my $i_name ($socgen_file->findnodes("//socgen:componentConfiguration/socgen:sim/socgen:icarus/socgen:test/socgen:name"))
{
my($sim_name) = $i_name ->findnodes('./text()')->to_literal ;
my($sim_configuration) = $i_name ->findnodes('../socgen:configuration/text()')->to_literal ;
my($sim_variant) = $i_name ->findnodes('../socgen:variant/text()')->to_literal ;
print " SIMs $sim_name $sim_configuration $sim_variant ";
chdir ".${work_site}/${vendor}__${project}${sim_library_path}/icarus/${sim_name}";
$cmd ="./tools/simulation/run_icarus $vendor $library $sim_library_path $sim_name $sim_variant \n";
push @cmds,$cmd;
}
 
$cmd ="iverilog -f ../../testbenches/filelists/${sim_variant}.sim -D VCD 2> ./${sim_name}_elab.log | tee >> ./${$sim_name}_elab.log \n";
if (system($cmd)) {}
$cmd ="./a.out 2> ./${sim_name}_sim.log | tee >> ./${sim_name}_sim.log \n";
if (system($cmd)) {}
$cmd ="grep PASSED ./${sim_name}_sim.log \n";
if (system($cmd)) {}
$cmd ="rm a.out \n";
if (system($cmd)) {}
 
chdir $home;
}
 
 
 
foreach my $i_name ($socgen_file->findnodes("//socgen:componentConfiguration/socgen:sim/socgen:verilator/socgen:test/socgen:name"))
foreach my $i_name ($socgen_file->findnodes("//socgen:componentConfiguration/socgen:sim/socgen:verilator/socgen:test/socgen:name"))
{
my($sim_name) = $i_name ->findnodes('./text()')->to_literal ;
my($sim_configuration) = $i_name ->findnodes('../socgen:configuration/text()')->to_literal ;
my($sim_variant) = $i_name ->findnodes('../socgen:variant/text()')->to_literal ;
print " VSIMs $sim_name $sim_configuration $sim_variant ";
chdir ".${work_site}/${vendor}__${project}${sim_library_path}/verilator/${sim_name}";
$cmd ="make verilator\n";
if (system($cmd)) {}
chdir $home;
$cmd ="./tools/simulation/run_verilator $vendor $library $sim_library_path $sim_name $sim_variant \n";
if(system($cmd)){};
}
 
 
foreach $cmd (@cmds)
{
$manager->start and next;
system($cmd);
$manager->finish;
}
 
$manager->wait_all_children;
print "run_sims COMPLETE \n";
 
}
 
}
 
 
/simulation/build_sim_master
0,0 → 1,266
eval 'exec `which perl` -S $0 ${1+"$@"}'
if 0;
 
#/**********************************************************************/
#/* */
#/* ------- */
#/* / SOC \ */
#/* / GEN \ */
#/* / TOOL \ */
#/* ============== */
#/* | | */
#/* |____________| */
#/* */
#/* */
#/* */
#/* Author(s): */
#/* - John Eaton, jt_eaton@opencores.org */
#/* */
#/**********************************************************************/
#/* */
#/* Copyright (C) <2010-2013> <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 XML::LibXML;
use lib './tools';
use sys::lib;
use yp::lib;
use Parallel::ForkManager;
 
$OUTPUT_AUTOFLUSH = 1; # set autoflush of stdout to TRUE.
 
 
############################################################################
### Process the options
############################################################################
Getopt::Long::config("require_order", "prefix=-");
GetOptions("h","help",
) || die "(use '$program_name -h' for help)";
 
 
 
 
##############################################################################
## Help option
##############################################################################
if ( $opt_h or $opt_help )
{ print "\n build_sim_master";
print "\n";
exit 1;
}
 
 
my $parser = XML::LibXML->new();
 
 
my $cmd;
my @cmds = ();
my @cov_cmds = ();
my @rep_cmds = ();
 
 
 
#/**********************************************************************/
#/* Process each library by finding any ip-xact file in any component */
#/* */
#/* Each ip-xact file is parsed and it's filename and the names of any*/
#/* modules that it uses are saved. */
#/* */
#/* */
#/**********************************************************************/
 
my $home = cwd();
 
my $prefix = yp::lib::get_workspace();
$prefix = "/${prefix}";
 
my @vendors = yp::lib::find_vendors();
 
foreach my $vendor (@vendors)
{
my $vendor_status = yp::lib::get_vendor_status($vendor);
if($vendor_status eq "active")
{
my @libraries = yp::lib::find_libraries($vendor);
foreach my $library (@libraries)
{
my $library_status = yp::lib::get_library_status($vendor,$library);
if($library_status eq "active")
{
print " $vendor $library \n";
my @components = yp::lib::find_components($vendor,$library);
 
foreach my $component (@components)
{
my $socgen_filename = yp::lib::find_componentConfiguration($vendor,$library,$component);
 
if($socgen_filename)
{
my $socgen_file = $parser->parse_file($socgen_filename);
my $sim_library_path ;
my $lib_comp_sep = yp::lib::find_lib_comp_sep($vendor,$library,$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 $i_name ($socgen_file->findnodes("//socgen:componentConfiguration/socgen:sim/socgen:icarus/socgen:test/socgen:name"))
{
my($sim_name) = $i_name ->findnodes('./text()')->to_literal ;
my($sim_configuration) = $i_name ->findnodes('../socgen:configuration/text()')->to_literal ;
my($sim_variant) = $i_name ->findnodes('../socgen:variant/text()')->to_literal ;
$cmd ="./tools/simulation/run_icarus $vendor $library $sim_library_path $sim_name $sim_variant \n";
push @cmds,$cmd;
}
 
foreach my $i_name ($socgen_file->findnodes("//socgen:componentConfiguration/socgen:sim/socgen:verilator/socgen:test/socgen:name"))
{
my($sim_name) = $i_name ->findnodes('./text()')->to_literal ;
my($sim_configuration) = $i_name ->findnodes('../socgen:configuration/text()')->to_literal ;
my($sim_variant) = $i_name ->findnodes('../socgen:variant/text()')->to_literal ;
$cmd ="./tools/simulation/run_verilator $vendor $library $sim_library_path $sim_name $sim_variant \n";
push @cmds,$cmd;
}
 
 
 
foreach my $i_name ($socgen_file->findnodes("//socgen:componentConfiguration/socgen:sim/socgen:rtl_check/socgen:lint/socgen:name"))
{
my($sim_name) = $i_name ->findnodes('./text()')->to_literal ;
my($sim_configuration) = $i_name ->findnodes('../socgen:configuration/text()')->to_literal ;
my($sim_variant) = $i_name ->findnodes('../socgen:variant/text()')->to_literal ;
print " lint $sim_name $sim_configuration $sim_variant ";
$cmd ="cd .${prefix}/${vendor}__${library}${sim_library_path}/rtl_check/${sim_name};make lint";
push @cmds,$cmd;
}
 
 
 
 
 
#/*********************************************************************************************/
#/ create coverage database .cdd file */
#/ */
#/*********************************************************************************************/
 
foreach my $i_name ($socgen_file->findnodes("//socgen:componentConfiguration/socgen:sim/socgen:testbenches/socgen:testbench/socgen:tools/socgen:tool"))
{
my($tb_tool) = $i_name ->findnodes('./text()')->to_literal ;
my($tb_variant) = $i_name ->findnodes('../../socgen:variant/text()')->to_literal ;
my($tb_version) = $i_name ->findnodes('../../socgen:version/text()')->to_literal ;
if($tb_tool eq "coverage")
{
print " COVERAGEs $tb_tool $tb_variant $tb_version \n";
$cmd= "cd ./${prefix}/${vendor}__${library}${sim_library_path}/cov/${tb_variant};make build_cdd \n";
push @cmds,$cmd;
 
foreach my $i_name ($socgen_file->findnodes("//socgen:test/socgen:variant"))
{
my($test_variant) = $i_name ->findnodes('./text()')->to_literal ;
my($test_name) = $i_name ->findnodes('../socgen:name/text()')->to_literal ;
 
if($tb_variant eq $test_variant )
{
print " $tb_variant $test_variant $test_name \n";
$cmd= "cd ./${prefix}/${vendor}__${library}${sim_library_path}/cov/${tb_variant};make score_cov TEST=${test_name} \n";
push @cov_cmds,$cmd;
}
}
$cmd= "cd ./${prefix}/${vendor}__${library}${sim_library_path}/cov/${tb_variant};make report_cov \n";
push @rep_cmds,$cmd;
}
}
 
 
 
 
}
 
}
}
}
}
}
 
 
my $manager = new Parallel::ForkManager( 6 );
 
foreach $cmd (@cmds)
{
$manager->start and next;
system($cmd);
$manager->finish;
}
 
$manager->wait_all_children;
print "run_sims COMPLETE \n";
 
 
 
 
 
foreach $cmd (@cov_cmds)
{
$manager->start and next;
system($cmd);
$manager->finish;
}
 
$manager->wait_all_children;
print "coverage COMPLETE \n";
 
 
 
 
foreach $cmd (@rep_cmds)
{
$manager->start and next;
system($cmd);
$manager->finish;
}
 
$manager->wait_all_children;
print "coverage reports COMPLETE \n";
 
 
 
 
 
 
simulation/build_sim_master Property changes : Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Index: simulation/build_icarus_filelists =================================================================== --- simulation/build_icarus_filelists (revision 130) +++ simulation/build_icarus_filelists (revision 131) @@ -68,7 +68,7 @@ GetOptions("h","help", "work_site=s" => \$work_site, "vendor=s" => \$vendor, - "project=s" => \$project, + "library=s" => \$library, "component=s" => \$component, "version=s" => \$version ) || die "(use '$program_name -h' for help)"; @@ -79,7 +79,7 @@ ## Help option ############################################################################## if ( $opt_h or $opt_help) - { print "\n build_icarus_filelists -work_site /work -vendor vendor_name -project project_name -component component_name "; + { print "\n build_icarus_filelists -work_site /work -vendor vendor_name -library library_name -component component_name "; print "\n"; exit 1; } @@ -127,11 +127,11 @@ ## ############################################################################# -print "Building SIM filelists for $work_site $vendor $project $component $version $variant \n" ; +print "Building SIM filelists for $work_site $vendor $library $component $version $variant \n" ; my $sim_library_path ; -my $spirit_component_file = $parser->parse_file(yp::lib::find_ipxact_component($vendor,$project,$component,$version)); -my $socgen_file = $parser->parse_file(yp::lib::find_componentConfiguration($vendor,$project,$component)); -my $lib_comp_sep = yp::lib::find_lib_comp_sep($vendor,$project,$component); +my $spirit_component_file = $parser->parse_file(yp::lib::find_ipxact_component($vendor,$library,$component,$version)); +my $socgen_file = $parser->parse_file(yp::lib::find_componentConfiguration($vendor,$library,$component)); +my $lib_comp_sep = yp::lib::find_lib_comp_sep($vendor,$library,$component); my $sim_comp_path = $socgen_file->findnodes("//socgen:componentConfiguration/socgen:sim/socgen:comp_path/text()")->to_literal; @@ -182,12 +182,12 @@ my $variant = ""; if($version) {$variant = "${name}_${version}"} else {$variant = "${name}"} - print "rtl/gen directories for $project - $component VLNV $vendor - $library - $name - $variant \n"; + print "rtl/gen directories for $library - $component VLNV $vendor - $library - $name - $variant \n"; $module_name = yp::lib::get_module_name($vendor,$library,$name,$version); } - print "CREATING componentRef filelists for $project $component $name $variant \n"; + print "CREATING componentRef filelists for $library $component $name $variant \n"; #/*********************************************************************************************/ @@ -203,13 +203,13 @@ foreach my $i_name ($socgen_file->findnodes("//socgen:testbench[socgen:variant/text() = '$variant']/socgen:code_coverage")) { - my $path ="${home}${work_site}/${vendor}__${project}${sim_library_path}/cov"; + my $path ="${home}${work_site}/${vendor}__${library}${sim_library_path}/cov"; mkdir $path,0755 unless( -e $path ); - $path ="${home}${work_site}/${vendor}__${project}${sim_library_path}/cov/${variant}"; + $path ="${home}${work_site}/${vendor}__${library}${sim_library_path}/cov/${variant}"; mkdir $path,0755 unless( -e $path ); - my $outfile ="${home}${work_site}/${vendor}__${project}${sim_library_path}/cov/${variant}/TestBench"; + my $outfile ="${home}${work_site}/${vendor}__${library}${sim_library_path}/cov/${variant}/TestBench"; open DUTFILE,">$outfile" or die "unable to open $outfile"; print DUTFILE "`timescale 1ns/1ns \n"; print DUTFILE " module TB(); \n"; @@ -265,7 +265,7 @@ #/ */ #/*********************************************************************************************/ - print "CREATING sim files for $project $component $chip $name $variant \n"; + print "CREATING sim files for $library $component $chip $name $variant \n"; @@ -276,14 +276,14 @@ { my($simulation) = $i_name ->findnodes('socgen:name/text()')->to_literal ; my($configuration) = $i_name ->findnodes('socgen:configuration/text()')->to_literal ; - print " sim files for $project $component $variant $simulation $configuration \n"; + print " sim files for $library $component $variant $simulation $configuration \n"; - my $outfile ="${home}${work_site}/${vendor}__${project}${sim_library_path}/icarus/${simulation}/Makefile"; + my $outfile ="${home}${work_site}/${vendor}__${library}${sim_library_path}/icarus/${simulation}/Makefile"; open MAKSIMFILE,">$outfile" or die "unable to open $outfile"; - my $outfile ="${home}${work_site}/${vendor}__${project}${sim_library_path}/icarus/${simulation}/TestBench"; + my $outfile ="${home}${work_site}/${vendor}__${library}${sim_library_path}/icarus/${simulation}/TestBench"; open SIM_PARM_FILE,">$outfile" or die "unable to open $outfile"; print MAKSIMFILE "include ${home}/tools/bin/Makefile.root\n"; @@ -336,7 +336,7 @@ - print SIM_PARM_FILE "// Testbench for $project $component $variant $configuration $simulation\n"; + print SIM_PARM_FILE "// Testbench for $library $component $variant $configuration $simulation\n"; print SIM_PARM_FILE "`ifndef TIMESCALE \n"; print SIM_PARM_FILE "`define TIMESCALE 1ns/1ns \n"; print SIM_PARM_FILE "`endif \n";
/simulation/build_lint_filelists
68,7 → 68,7
GetOptions("h","help",
"work_site=s" => \$work_site,
"vendor=s" => \$vendor,
"project=s" => \$project,
"library=s" => \$library,
"component=s" => \$component,
"version=s" => \$version
) || die "(use '$program_name -h' for help)";
79,7 → 79,7
## Help option
##############################################################################
if ( $opt_h or $opt_help)
{ print "\n build_lint_filelists -work_site /work -vendor vendor_name -project project_name -component component_name ";
{ print "\n build_lint_filelists -work_site /work -vendor vendor_name -library library_name -component component_name ";
print "\n";
exit 1;
}
115,7 → 115,7
 
@filelist_sim = ( );
 
my @filelist = yp::lib::parse_component_file("$vendor","$project","$component","$version");
my @filelist = yp::lib::parse_component_file("$vendor","$library","$component","$version");
 
 
 
150,7 → 150,7
 
 
 
if(($new_vendor eq $vendor ) && ($new_proj eq $project ) && ($new_comp eq $component ) && ($new_version eq $version ) )
if(($new_vendor eq $vendor ) && ($new_proj eq $library ) && ($new_comp eq $component ) && ($new_version eq $version ) )
{
 
203,10 → 203,10
##
#############################################################################
 
print "Building rtl_check filelists for $work_site $vendor $project $component $version $variant \n" ;
print "Building rtl_check filelists for $work_site $vendor $library $component $version $variant \n" ;
 
my $spirit_component_file = $parser->parse_file(yp::lib::find_ipxact_component($vendor,$project,$component,$version));
my $socgen_file = $parser->parse_file(yp::lib::find_componentConfiguration($vendor,$project,$component));
my $spirit_component_file = $parser->parse_file(yp::lib::find_ipxact_component($vendor,$library,$component,$version));
my $socgen_file = $parser->parse_file(yp::lib::find_componentConfiguration($vendor,$library,$component));
 
 
 
249,7 → 249,7
my $variant = "";
if($version) {$variant = "${name}_${version}"}
else {$variant = "${name}"}
print "rtl/gen directories for $project - $component VLNV $vendor - $library - $name - $variant \n";
print "rtl/gen directories for $library - $component VLNV $vendor - $library - $name - $variant \n";
}
 
 
264,7 → 264,7
 
push(@filelist_sim," ./TestBench\n");
 
print "CREATING componentRef filelists for $project $component $name $variant \n";
print "CREATING componentRef filelists for $library $component $name $variant \n";
 
@filelist_sim = sys::lib::trim_sort(@filelist_sim);
 
289,12 → 289,12
#/ */
#/*********************************************************************************************/
 
print "CREATING sim files for $project $component $chip $name $variant \n";
print "CREATING sim files for $library $component $chip $name $variant \n";
 
 
 
 
my $socgen_file = $parser->parse_file(yp::lib::find_componentConfiguration($vendor,$project,$component));
my $socgen_file = $parser->parse_file(yp::lib::find_componentConfiguration($vendor,$library,$component));
 
foreach my $i_name ($socgen_file->findnodes("//socgen:componentConfiguration/socgen:sim/socgen:rtl_check/socgen:lint[socgen:variant/text() = '$variant']"))
{
301,10 → 301,10
my($simulation) = $i_name ->findnodes('socgen:name/text()')->to_literal ;
my($configuration) = $i_name ->findnodes('socgen:configuration/text()')->to_literal ;
 
print " lint files for $project $component $variant $simulation $configuration \n";
print " lint files for $library $component $variant $simulation $configuration \n";
 
my $sim_library_path ;
my $lib_comp_sep = yp::lib::find_lib_comp_sep($vendor,$project,$component);
my $lib_comp_sep = yp::lib::find_lib_comp_sep($vendor,$library,$component);
my $sim_comp_path = $socgen_file->findnodes("//socgen:componentConfiguration/socgen:sim/socgen:comp_path/text()")->to_literal;
 
if ($sim_comp_path)
317,19 → 317,19
}
 
 
my $path = "${home}${work_site}/${vendor}__${project}${sim_library_path}/rtl_check";
my $path = "${home}${work_site}/${vendor}__${library}${sim_library_path}/rtl_check";
 
mkdir $path,0755 unless (-e $path) ;
 
$path = "${home}${work_site}/${vendor}__${project}${sim_library_path}/rtl_check/${simulation}";
$path = "${home}${work_site}/${vendor}__${library}${sim_library_path}/rtl_check/${simulation}";
mkdir $path,0755 unless (-e $path);
 
my $outfile ="${home}${work_site}/${vendor}__${project}${sim_library_path}/rtl_check/${simulation}/Makefile";
my $outfile ="${home}${work_site}/${vendor}__${library}${sim_library_path}/rtl_check/${simulation}/Makefile";
open MAKSIMFILE,">$outfile" or die "unable to open $outfile";
 
 
 
$outfile ="${home}${work_site}/${vendor}__${project}${sim_library_path}/rtl_check/${simulation}/TestBench";
$outfile ="${home}${work_site}/${vendor}__${library}${sim_library_path}/rtl_check/${simulation}/TestBench";
open SIM_PARM_FILE,">$outfile" or die "unable to open $outfile";
 
 
360,9 → 360,9
 
 
my $module_name = yp::lib::get_module_name($vendor,$project,$component,$version);
my $module_name = yp::lib::get_module_name($vendor,$library,$component,$version);
print SIM_PARM_FILE "// Testbench for $project $component $variant $configuration $simulation\n";
print SIM_PARM_FILE "// Testbench for $library $component $variant $configuration $simulation\n";
print SIM_PARM_FILE " \n";
print SIM_PARM_FILE "module TB(input clk,input reset); \n";
print SIM_PARM_FILE " \n\n";
/simulation/build_verilator_filelists
68,7 → 68,7
GetOptions("h","help",
"work_site=s" => \$work_site,
"vendor=s" => \$vendor,
"project=s" => \$project,
"library=s" => \$library,
"component=s" => \$component,
"version=s" => \$version
) || die "(use '$program_name -h' for help)";
79,7 → 79,7
## Help option
##############################################################################
if ( $opt_h or $opt_help)
{ print "\n build_sim_filelists -work_site /work -vendor vendor_name -project project_name -component component_name ";
{ print "\n build_verilator_filelists -work_site /work -vendor vendor_name -library library_name -component component_name ";
print "\n";
exit 1;
}
117,12 → 117,12
##
#############################################################################
 
print "Building SIM filelists for $work_site $vendor $project $component $version $variant \n" ;
print "Building SIM filelists for $work_site $vendor $library $component $version $variant \n" ;
 
my $spirit_component_file = $parser->parse_file(yp::lib::find_ipxact_component($vendor,$project,$component,$version));
my $socgen_file = $parser->parse_file(yp::lib::find_componentConfiguration($vendor,$project,$component));
my $spirit_component_file = $parser->parse_file(yp::lib::find_ipxact_component($vendor,$library,$component,$version));
my $socgen_file = $parser->parse_file(yp::lib::find_componentConfiguration($vendor,$library,$component));
my $sim_library_path ;
my $lib_comp_sep = yp::lib::find_lib_comp_sep($vendor,$project,$component);
my $lib_comp_sep = yp::lib::find_lib_comp_sep($vendor,$library,$component);
my $sim_comp_path = $socgen_file->findnodes("//socgen:componentConfiguration/socgen:sim/socgen:comp_path/text()")->to_literal;
 
if ($sim_comp_path)
175,10 → 175,10
my $variant = "";
if($version) {$variant = "${name}_${version}"}
else {$variant = "${name}"}
print "rtl/gen directories for $project - $component VLNV $vendor - $library - $name - $variant \n";
print "rtl/gen directories for $library - $component VLNV $vendor - $library - $name - $variant \n";
}
 
print "CREATING componentRef filelists for $project $component $name $variant \n";
print "CREATING componentRef filelists for $library $component $name $variant \n";
 
 
#/*********************************************************************************************/
194,13 → 194,13
foreach my $i_name ($socgen_file->findnodes("//socgen:testbench[socgen:variant/text() = '$variant']/socgen:code_coverage"))
{
my $path ="${home}${work_site}/${vendor}__${project}${sim_library_path}/cov";
my $path ="${home}${work_site}/${vendor}__${library}${sim_library_path}/cov";
mkdir $path,0755 unless( -e $path );
$path ="${home}${work_site}/${vendor}__${project}${sim_library_path}/cov/${variant}";
$path ="${home}${work_site}/${vendor}__${library}${sim_library_path}/cov/${variant}";
mkdir $path,0755 unless( -e $path );
 
my $outfile ="${home}${work_site}/${vendor}__${project}${sim_library_path}/cov/${variant}/TestBench";
my $outfile ="${home}${work_site}/${vendor}__${library}${sim_library_path}/cov/${variant}/TestBench";
open DUTFILE,">$outfile" or die "unable to open $outfile";
print DUTFILE "`timescale 1ns/1ns \n";
print DUTFILE " module TB(); \n";
277,7 → 277,7
#/ */
#/*********************************************************************************************/
 
print "CREATING sim files for $project $component $chip $name $variant \n";
print "CREATING sim files for $library $component $chip $name $variant \n";
 
 
 
288,18 → 288,18
{
my($simulation) = $i_name ->findnodes('socgen:name/text()')->to_literal ;
my($configuration) = $i_name ->findnodes('socgen:configuration/text()')->to_literal ;
print " sim files for $project $component $variant $simulation $configuration \n";
print " sim files for $library $component $variant $simulation $configuration \n";
 
my $path ="${home}${work_site}/${vendor}__${project}${sim_library_path}/verilator";
my $path ="${home}${work_site}/${vendor}__${library}${sim_library_path}/verilator";
mkdir $path,0755 unless( -e $path );
$path ="${home}${work_site}/${vendor}__${project}${sim_library_path}/verilator/${simulation}";
$path ="${home}${work_site}/${vendor}__${library}${sim_library_path}/verilator/${simulation}";
mkdir $path,0755 unless( -e $path );
 
my $outfile ="${home}${work_site}/${vendor}__${project}${sim_library_path}/verilator/${simulation}/Makefile";
my $outfile ="${home}${work_site}/${vendor}__${library}${sim_library_path}/verilator/${simulation}/Makefile";
open MAKSIMFILE,">$outfile" or die "unable to open $outfile";
 
 
my $outfile ="${home}${work_site}/${vendor}__${project}${sim_library_path}/verilator/${simulation}/TestBench";
my $outfile ="${home}${work_site}/${vendor}__${library}${sim_library_path}/verilator/${simulation}/TestBench";
open SIM_PARM_FILE,">$outfile" or die "unable to open $outfile";
 
350,12 → 350,12
 
 
 
my $module_name = yp::lib::get_module_name($vendor,$project,$component,$version);
my $module_name = yp::lib::get_module_name($vendor,$library,$component,$version);
 
 
 
print SIM_PARM_FILE "// Testbench for $project $component $variant $configuration $simulation\n";
print SIM_PARM_FILE "// Testbench for $library $component $variant $configuration $simulation\n";
print SIM_PARM_FILE " \n";
print SIM_PARM_FILE "module TB(input clk, input START, output FINISH,output FAIL ); \n";
print SIM_PARM_FILE " \n";
/simulation/build_coverage
66,7 → 66,7
GetOptions("h","help",
"work_site=s" => \$work_site,
"vendor=s" => \$vendor,
"project=s" => \$project,
"library=s" => \$library,
"version=s" => \$version,
"component=s" => \$component,
) || die "(use '$program_name -h' for help)";
78,7 → 78,7
## Help option
##############################################################################
if ( $opt_h or $opt_help )
{ print "\n build_coverage -work_site /work -vendor vendor_name -project project_name -component component_name -version version_name ";
{ print "\n build_coverage -work_site /work -vendor vendor_name -library library_name -component component_name -version version_name ";
print "\n";
exit 1;
}
94,17 → 94,17
 
 
my $home = cwd();
my $prefix = "${work_site}/${vendor}__${project}";
my $prefix = "${work_site}/${vendor}__${library}";
 
print " Building Code Coverage and linting for $work_site $vendor $project $component $version \n" ;
print " Building Code Coverage and linting for $work_site $vendor $library $component $version \n" ;
 
 
my $parser = XML::LibXML->new();
 
 
my $socgen_file = $parser->parse_file(yp::lib::find_componentConfiguration($vendor,$project,$component));
my $socgen_file = $parser->parse_file(yp::lib::find_componentConfiguration($vendor,$library,$component));
my $sim_library_path ;
my $lib_comp_sep = yp::lib::find_lib_comp_sep($vendor,$project,$component);
my $lib_comp_sep = yp::lib::find_lib_comp_sep($vendor,$library,$component);
my $sim_comp_path = $socgen_file->findnodes("//socgen:componentConfiguration/socgen:sim/socgen:comp_path/text()")->to_literal;
 
if ($sim_comp_path)
145,14 → 145,14
unless($tool_name eq "coverage") {$tool = $tool_name}
}
 
print "Code coverage directories for $tool $project - $component . ${version}. - $variant \n";
print "Code coverage directories for $tool $library - $component . ${version}. - $variant \n";
 
 
my $path = "${home}${work_site}/${vendor}__${project}${sim_library_path}/cov";
my $path = "${home}${work_site}/${vendor}__${library}${sim_library_path}/cov";
mkdir $path,0755 unless( -e $path );
my $path = "${home}${work_site}/${vendor}__${project}${sim_library_path}/cov/${variant}";
my $path = "${home}${work_site}/${vendor}__${library}${sim_library_path}/cov/${variant}";
mkdir $path,0755 unless( -e $path );
my $outfile ="${home}${work_site}/${vendor}__${project}${sim_library_path}/cov/${variant}/Makefile";
my $outfile ="${home}${work_site}/${vendor}__${library}${sim_library_path}/cov/${variant}/Makefile";
open MAKCOVFILE,">$outfile" or die "unable to open $outfile";
 
print MAKCOVFILE "SHELL=/bin/sh \n";
/simulation/run_lint
73,7 → 73,7
## Help option
##############################################################################
if ( $opt_h or $opt_help )
{ print "\n run_lint project_name project_vendor";
{ print "\n run_lint vendor__library";
print "\n";
exit 1;
}
80,7 → 80,7
 
 
#/**********************************************************************/
#/* Process each project by finding any ip-xact file in any component */
#/* Process each library by finding any ip-xact file in any component */
#/* */
#/* Each ip-xact file is parsed and it's filename and the names of any*/
#/* modules that it uses are saved. */
91,19 → 91,19
 
my $home = cwd();
my $vendor ;
my $project ;
my $library ;
 
 
my $prefix = yp::lib::get_workspace();
$prefix = "/${prefix}";
$_ = $ARGV[0];
 
 
$_ = $ARGV[0];
my $work_site = $ARGV[1];
 
 
if(/(\S+)__(\S+)/)
{
$vendor = $1;
$project = $2;
$library = $2;
}
 
 
116,13 → 116,18
 
 
 
my @components = yp::lib::find_components($vendor,$project);
my @components = yp::lib::find_components($vendor,$library);
 
foreach my $component (@components)
{
my $socgen_file = $parser->parse_file(yp::lib::find_componentConfiguration($vendor,$project,$component));
my $socgen_filename = yp::lib::find_componentConfiguration($vendor,$library,$component);
 
 
if($socgen_filename)
{
my $socgen_file = $parser->parse_file($socgen_filename);
my $sim_library_path ;
my $lib_comp_sep = yp::lib::find_lib_comp_sep($vendor,$project,$component);
my $lib_comp_sep = yp::lib::find_lib_comp_sep($vendor,$library,$component);
 
my $sim_comp_path = $socgen_file->findnodes("//socgen:componentConfiguration/socgen:sim/socgen:comp_path/text()")->to_literal;
 
147,17 → 152,16
my($sim_variant) = $i_name ->findnodes('../socgen:variant/text()')->to_literal ;
print " lint $sim_name $sim_configuration $sim_variant ";
chdir ".${work_site}/${vendor}__${project}${sim_library_path}/rtl_check/${sim_name}";
 
$cmd ="make lint";
$cmd ="cd .${prefix}/${vendor}__${library}${sim_library_path}/rtl_check/${sim_name};make lint";
if (system($cmd)) {}
 
chdir $home;
 
 
}
 
}
 
}
 
 
 
/simulation/run_icarus
0,0 → 1,112
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 XML::LibXML;
use lib './tools';
use sys::lib;
use yp::lib;
 
$OUTPUT_AUTOFLUSH = 1; # set autoflush of stdout to TRUE.
 
 
############################################################################
### Process the options
############################################################################
Getopt::Long::config("require_order", "prefix=-");
GetOptions("h","help",
) || die "(use '$program_name -h' for help)";
 
 
 
 
##############################################################################
## Help option
##############################################################################
if ( $opt_h or $opt_help )
{ print "\n run_icarus vendor library sim_library_path sim_name sim_variant";
print "\n";
exit 1;
}
 
my $home = cwd();
my $prefix = yp::lib::get_workspace();
my $vendor = $ARGV[0];
my $library = $ARGV[1];
my $sim_library_path = $ARGV[2];
my $sim_name = $ARGV[3];
my $sim_variant = $ARGV[4];
 
chdir "./${prefix}/${vendor}__${library}${sim_library_path}/icarus/${sim_name}";
 
$cmd ="iverilog -f ../../testbenches/filelists/${sim_variant}.sim -D VCD 2> ./${sim_name}_elab.log | tee >> ./${$sim_name}_elab.log \n";
if (system($cmd)) {}
$cmd ="./a.out 2> ./${sim_name}_sim.log | tee >> ./${sim_name}_sim.log \n";
print " SIM Icarus $sim_name $sim_configuration $sim_variant \n ";
if (system($cmd)) {}
$cmd ="grep PASSED ./${sim_name}_sim.log \n";
if (system($cmd)) {}
$cmd ="rm a.out \n";
if (system($cmd)) {}
 
chdir $home;
 
 
 
 
 
 
 
 
 
 
simulation/run_icarus Property changes : Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Index: simulation/run_verilator =================================================================== --- simulation/run_verilator (nonexistent) +++ simulation/run_verilator (revision 131) @@ -0,0 +1,106 @@ +eval 'exec `which perl` -S $0 ${1+"$@"}' + if 0; + +#/**********************************************************************/ +#/* */ +#/* ------- */ +#/* / SOC \ */ +#/* / GEN \ */ +#/* / TOOL \ */ +#/* ============== */ +#/* | | */ +#/* |____________| */ +#/* */ +#/* */ +#/* */ +#/* Author(s): */ +#/* - John Eaton, jt_eaton@opencores.org */ +#/* */ +#/**********************************************************************/ +#/* */ +#/* Copyright (C) <2010-2011> */ +#/* */ +#/* 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 XML::LibXML; +use lib './tools'; +use sys::lib; +use yp::lib; + +$OUTPUT_AUTOFLUSH = 1; # set autoflush of stdout to TRUE. + + +############################################################################ +### Process the options +############################################################################ +Getopt::Long::config("require_order", "prefix=-"); +GetOptions("h","help", +) || die "(use '$program_name -h' for help)"; + + + + +############################################################################## +## Help option +############################################################################## +if ( $opt_h or $opt_help ) + { print "\n run_verilator vendor library sim_library_path sim_name sim_variant"; + print "\n"; + exit 1; + } + +my $home = cwd(); +my $prefix = yp::lib::get_workspace(); +my $vendor = $ARGV[0]; +my $library = $ARGV[1]; +my $sim_library_path = $ARGV[2]; +my $sim_name = $ARGV[3]; +my $sim_variant = $ARGV[4]; + + +chdir "./${prefix}/${vendor}__${library}${sim_library_path}/verilator/${sim_name}"; + +$cmd ="make verilator \n"; +if (system($cmd)) {} +print " SIM verilator $sim_name $sim_configuration $sim_variant \n"; + +chdir $home; + + + + + + + + + +
simulation/run_verilator Property changes : Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Index: icarus/verilog-0.9.6.tar.gz =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: icarus/verilog-0.9.6.tar.gz =================================================================== --- icarus/verilog-0.9.6.tar.gz (nonexistent) +++ icarus/verilog-0.9.6.tar.gz (revision 131)
icarus/verilog-0.9.6.tar.gz Property changes : Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: yp/check_busDefs =================================================================== --- yp/check_busDefs (revision 130) +++ yp/check_busDefs (nonexistent) @@ -1,241 +0,0 @@ -eval 'exec `which perl` -S $0 ${1+"$@"}' - if 0; - -#/**********************************************************************/ -#/* */ -#/* ------- */ -#/* / SOC \ */ -#/* / GEN \ */ -#/* / TOOL \ */ -#/* ============== */ -#/* | | */ -#/* |____________| */ -#/* */ -#/* */ -#/* */ -#/* Author(s): */ -#/* - John Eaton, jt_eaton@opencores.org */ -#/* */ -#/**********************************************************************/ -#/* */ -#/* Copyright (C) <2010-2011> */ -#/* */ -#/* 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 */ -#/* */ -#/**********************************************************************/ - -use Getopt::Long; -use English; -use File::Basename; -use Cwd; -use XML::LibXML; -use lib './tools'; -use sys::lib; -use yp::lib; - -$OUTPUT_AUTOFLUSH = 1; # set autoflush of stdout to TRUE. - -my $parser = XML::LibXML->new(); - - -#/*********************************************************************************************/ -#/ */ -#/ */ -#/ */ -#/ */ -#/*********************************************************************************************/ - -my $home = cwd(); -my $vendor_check = $ARGV[0]; - - -chomp($vendor_check); -my @vendors = yp::lib::find_vendors(); - print "Checking busDefinitions and and rtl abstractors \n"; - - -foreach my $vendor (@vendors) -{ -if ( ($vendor_check eq "") or ($vendor eq $vendor_check) ) - { - my @libraries = yp::lib::find_libraries($vendor); - foreach my $library (@libraries) - { - - my @components = yp::lib::find_components($vendor,$library); - foreach my $component (@components) - { - - my @versions = yp::lib::find_abstractionDefinition_versions( $vendor,$library,$component); - - - - foreach my $version (@versions) - { - print "${vendor}:${library}:${component}:${version}\n"; - print "\t--------------------------------------------------------------------------------------------------------\n"; - - my $spirit_file = yp::lib::find_ipxact_abstractionDefinition($vendor,$library,$component,$version); - - print "\tFilename: ${spirit_file}\n"; - unless ($spirit_file) {print "Error absDef file does not exist";} - - my $spirit_absDef_file = $parser->parse_file($spirit_file); - foreach my $absDef ($spirit_absDef_file->findnodes("//spirit:abstractionDefinition/spirit:vendor")) - { - my($bd_vendor) = $absDef->findnodes('./text()')->to_literal ; - my($bd_library) = $absDef->findnodes('../spirit:library/text()')->to_literal ; - my($bd_name) = $absDef->findnodes('../spirit:name/text()')->to_literal ; - my($bd_version) = $absDef->findnodes('../spirit:version/text()')->to_literal ; - print "\tVLNV-ad ${bd_vendor}_${bd_library}_${bd_name}_${bd_version}\n"; - - my %systemGroupNames = (); - - - foreach my $bus_type ($spirit_absDef_file->findnodes("//spirit:abstractionDefinition/spirit:busType")) - { - my($bt_vendor) = $bus_type->findnodes('./@spirit:vendor')->to_literal ; - my($bt_library) = $bus_type->findnodes('./@spirit:library')->to_literal ; - my($bt_name) = $bus_type->findnodes('./@spirit:name')->to_literal ; - my($bt_version) = $bus_type->findnodes('./@spirit:version')->to_literal ; - print "\tVLNV-bt ${bt_vendor}_${bt_library}_${bt_name}_${bt_version}\n"; - - my $spirit_file = yp::lib::find_ipxact_busDefinition($bt_vendor,$bt_library,$bt_name,$bt_version); - - unless ($spirit_file) {print "ERROR: No bus definition\n";} - else - { - my $spirit_busDef_file = $parser->parse_file($spirit_file); - foreach my $i_name ($spirit_busDef_file->findnodes("//spirit:busDefinition/spirit:systemGroupNames/spirit:systemGroupName")) - { - my($sysgroup_name) = $i_name ->findnodes('./text()')->to_literal; - print "\t SystemGroup Name $sysgroup_name \n"; - $systemGroupNames{$sysgroup_name} = 1; - } - } - } - - foreach my $absDef ($spirit_absDef_file->findnodes("//spirit:abstractionDefinition/spirit:ports/spirit:port/spirit:logicalName")) - { - my($logical_name) = $absDef->findnodes('./text()')->to_literal ; - my($is_clock) = $absDef->findnodes('../spirit:wire/spirit:qualifier/spirit:isClock/text()')->to_literal ; - my($is_reset) = $absDef->findnodes('../spirit:wire/spirit:qualifier/spirit:isReset/text()')->to_literal ; - my($is_address) = $absDef->findnodes('../spirit:wire/spirit:qualifier/spirit:isAddress/text()')->to_literal ; - my($is_data) = $absDef->findnodes('../spirit:wire/spirit:qualifier/spirit:isData/text()')->to_literal ; - my($requires_driver) = $absDef->findnodes('../spirit:wire/spirit:requiresDriver/text()')->to_literal ; - my($driver_type) = $absDef->findnodes('../spirit:wire/spirit:requiresDriver/@spirit:driverType')->to_literal ; - my($default_value) = $absDef->findnodes('../spirit:wire/spirit:defaultValue/text()')->to_literal ; - - print "\nPort: ${logical_name} "; - - if($is_clock) - { - if($is_reset) { print " BOTH CLOCK and RESET ";} - else { print " CLOCK ";} - } - elsif($is_reset) { print " RESET ";} - else { print " ";} - - if($is_address) { print " ADDRESS ";} - if($is_data) { print " DATA ";} - - - if($requires_driver) {print " Requires Driver $driver_type ";} - else {print " ";} - - if($default_value) {print " Default Value $default_value \n";} - else {print " \n";} - - my $master_presence; - my $master_width; - my $master_direction; - - foreach my $onMaster ($spirit_absDef_file->findnodes("//spirit:abstractionDefinition/spirit:ports/spirit:port/spirit:logicalName[text() = '$logical_name']/../spirit:wire/spirit:onMaster/spirit:presence")) - { - $master_presence = $onMaster->findnodes('./text()')->to_literal ; - $master_width = $onMaster->findnodes('../spirit:width/text()')->to_literal ; - $master_direction = $onMaster->findnodes('../spirit:direction/text()')->to_literal ; - print " onMaster presence $master_presence \n"; - #unless($master_width) {$master_width = 1;} - if($master_width) {print " onMaster width $master_width \n";} - if($master_direction) {print " onMaster direction $master_direction \n";} - print "\n"; - } - - my $slave_presence; - my $slave_width; - my $slave_direction; - - foreach my $onSlave ($spirit_absDef_file->findnodes("//spirit:abstractionDefinition/spirit:ports/spirit:port/spirit:logicalName[text() = '$logical_name']/../spirit:wire/spirit:onSlave/spirit:presence")) - { - $slave_presence = $onSlave->findnodes('./text()')->to_literal ; - $slave_width = $onSlave->findnodes('../spirit:width/text()')->to_literal ; - $slave_direction = $onSlave->findnodes('../spirit:direction/text()')->to_literal ; - print " onSlave presence $slave_presence \n"; - #unless($slave_width) {$slave_width = 1;} - if($slave_width) {print " onSlave width $slave_width \n";} - if($slave_direction) {print " onSlave direction $slave_direction \n";} - print "\n"; - } - - - my %systemGroupPresence= (); - my %systemGroupWidth= (); - my %systemGroupDirection= (); - - - - foreach my $onSystem ($spirit_absDef_file->findnodes("//spirit:abstractionDefinition/spirit:ports/spirit:port/spirit:logicalName[text() = '$logical_name']/../spirit:wire/spirit:onSystem/spirit:group")) - { - my($system_group) = $onSystem->findnodes('./text()')->to_literal ; - my($presence) = $onSystem->findnodes('../spirit:presence/text()')->to_literal ; - my($width) = $onSystem->findnodes('../spirit:width/text()')->to_literal ; - my($direction) = $onSystem->findnodes('../spirit:direction/text()')->to_literal ; - print " onSystem Group $system_group \n"; - print " onSystem presence $presence \n"; - #unless($width) {$width = 1;} - if($width){print " onSystem width $width \n";} - if($direction){print " onSystem direction $direction \n";} - print "\n"; - $systemGroupPresence{$system_group} =$presence ; - $systemGroupWidth{$system_group} =$width ; - $systemGroupDirection{$system_group} =$direction ; - unless( $systemGroupNames{$system_group}) {print "Group $system_group not defined in busDefinition \n"; } - } -# insert DRC checks here - - } - } - - - print "\n"; - } - - } - - - } - - if ($vendor eq $vendor_check) {last;}; - } -print "\n"; -}
yp/check_busDefs Property changes : Deleted: svn:executable ## -1 +0,0 ## -* \ No newline at end of property Index: yp/read_db =================================================================== --- yp/read_db (nonexistent) +++ yp/read_db (revision 131) @@ -0,0 +1,129 @@ +eval 'exec `which perl` -S $0 ${1+"$@"}' + if 0; +#/**********************************************************************/ +#/* */ +#/* ------- */ +#/* / SOC \ */ +#/* / GEN \ */ +#/* / TOOL \ */ +#/* ============== */ +#/* | | */ +#/* |____________| */ +#/* */ +#/* */ +#/* */ +#/* */ +#/* Author(s): */ +#/* - John Eaton, jt_eaton@opencores.org */ +#/* */ +#/**********************************************************************/ +#/* */ +#/* Copyright (C) <2010-2011> */ +#/* */ +#/* 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 BerkeleyDB; + + +$OUTPUT_AUTOFLUSH = 1; # set autoflush of stdout to TRUE. + + +############################################################################ +### Process the options +############################################################################ +Getopt::Long::config("require_order", "prefix=-"); +GetOptions("h","help", + "vendor=s" => \$vendor, + "library=s" => \$library, + "version=s" => \$version, + "component=s" => \$component, + "debug","verbose" +) || die "(use '$program_name -h' for help)"; + + +############################################################################## +## Help option +############################################################################## +if ( $opt_h or $opt_help ) + { print "\n read_db database_filename "; + print "\n"; + exit 1; + } + + + + + + +############################################################################# +## +## +############################################################################# + + +$home = cwd(); + + + + + + + + + my $data_db_file_name = $ARGV[0]; + + print " READ_db $data_db_file_name \n"; + + $data_db = new BerkeleyDB::Hash( -Filename => $data_db_file_name, -Flags => DB_CREATE ) or die "Cannot open ${data_db_file_name}: $!"; + + + my $key; + my $value; + + + + + my $cursor = $data_db ->db_cursor() ; + while ($cursor->c_get($key, $value, DB_NEXT) == 0) + { + print "INPUT $key, $value \n"; + } + + my $status = $cursor->c_close() ; + + $data_db -> db_close(); + + + + +1 \ No newline at end of file
yp/read_db Property changes : Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Index: yp/lib.pm =================================================================== --- yp/lib.pm (revision 130) +++ yp/lib.pm (revision 131) @@ -51,24 +51,404 @@ ############################################################################ -### Set up Databases +# General PERL config ############################################################################ - +use Getopt::Long; +use English; +use File::Basename; +use Cwd; +use XML::LibXML; +use lib './tools'; +use sys::lib; use BerkeleyDB; -my $repo_db = new BerkeleyDB::Hash( -Filename => 'tools/yp/Berkeley/repo.dbm', -Flags => DB_CREATE ) or die "Cannot open file: $!"; -my $component_db = new BerkeleyDB::Hash( -Filename => 'tools/yp/Berkeley/component.dbm', -Flags => DB_CREATE ) or die "Cannot open file: $!"; -my $design_db = new BerkeleyDB::Hash( -Filename => 'tools/yp/Berkeley/design.dbm', -Flags => DB_CREATE ) or die "Cannot open file: $!"; -my $abstractionDefinition_db = new BerkeleyDB::Hash( -Filename => 'tools/yp/Berkeley/abstractionDefinition.dbm', -Flags => DB_CREATE ) or die "Cannot open file: $!"; -my $busDefinition_db = new BerkeleyDB::Hash( -Filename => 'tools/yp/Berkeley/busDefinition.dbm', -Flags => DB_CREATE ) or die "Cannot open file: $!"; -my $libraryConfiguration_db = new BerkeleyDB::Hash( -Filename => 'tools/yp/Berkeley/libraryConfiguration.dbm', -Flags => DB_CREATE ) or die "Cannot open file: $!"; -my $componentConfiguration_db = new BerkeleyDB::Hash( -Filename => 'tools/yp/Berkeley/componentConfiguration.dbm', -Flags => DB_CREATE ) or die "Cannot open file: $!"; +$OUTPUT_AUTOFLUSH = 1; # set autoflush of stdout to TRUE. + + +my $home = cwd(); + + +my $parser = XML::LibXML->new(); + + + +my $workspace_xml = $parser->parse_file("${home}/workspace.xml"); +my @repos =(); +my $repo; + + +foreach my $repo ($workspace_xml->findnodes('//socgen:workspace/socgen:repos/socgen:repo')) + { + my $repo_name = $repo->findnodes('./socgen:name/text()')->to_literal ; + push @repos,$repo_name; + } + + + + + + + +my $number_of_cpus; +my $workspace; +my $yellow_pages; +my $io_ports; +my $doc_dir; + + +foreach my $repo ($workspace_xml->findnodes('//socgen:workspace')) + { + $number_of_cpus = $repo->findnodes('./socgen:number_of_cpus/text()')->to_literal ; + $workspace = $repo->findnodes('./socgen:build_dir/text()')->to_literal ; + $yellow_pages = $repo->findnodes('./socgen:yp_dir/text()')->to_literal ; + $io_ports = $repo->findnodes('./socgen:ports_dir/text()')->to_literal ; + $doc_dir = $repo->findnodes('./socgen:doc_dir/text()')->to_literal ; + + } + + + +#print "number_of_cpus $number_of_cpus \n"; +#print "workspace $workspace \n"; +#print "yellow_pages $yellow_pages \n"; +#print "io_ports $io_ports \n"; + + + + +my $path = "${home}/${yellow_pages}"; + +unless( -e $path ) +{ +print "$path does not exist \n"; +my $cmd = "./tools/yp/create_yp $path \n"; +if(system($cmd)){}; + +} + + + +my $repo_db = new BerkeleyDB::Hash( -Filename => "${yellow_pages}/repo.dbm", -Flags => DB_CREATE ) or die "Cannot open file: $!"; +my $component_db = new BerkeleyDB::Hash( -Filename => "${yellow_pages}/component.dbm", -Flags => DB_CREATE ) or die "Cannot open file: $!"; +my $design_db = new BerkeleyDB::Hash( -Filename => "${yellow_pages}/design.dbm", -Flags => DB_CREATE ) or die "Cannot open file: $!"; +my $abstractionDefinition_db = new BerkeleyDB::Hash( -Filename => "${yellow_pages}/abstractionDefinition.dbm", -Flags => DB_CREATE ) or die "Cannot open file: $!"; +my $busDefinition_db = new BerkeleyDB::Hash( -Filename => "${yellow_pages}/busDefinition.dbm", -Flags => DB_CREATE ) or die "Cannot open file: $!"; +my $libraryConfiguration_db = new BerkeleyDB::Hash( -Filename => "${yellow_pages}/libraryConfiguration.dbm", -Flags => DB_CREATE ) or die "Cannot open file: $!"; +my $componentConfiguration_db = new BerkeleyDB::Hash( -Filename => "${yellow_pages}/componentConfiguration.dbm", -Flags => DB_CREATE ) or die "Cannot open file: $!"; + + + + + + + + + #/***********************************************************************************************/ +#/ get_workspace */ +#/ */ +#/ returns name for the workspace subdirectory under ${home} */ +#/ */ +#/ my $workspace = yp::lib::get_workspace(); */ +#/ */ +#/***********************************************************************************************/ + +sub get_workspace + { + return("${workspace}"); + } + + + +#/***********************************************************************************************/ +#/ get_yp */ +#/ */ +#/ returns name for the yellow_pages subdirectory under ${home} */ +#/ */ +#/ my $workspace = yp::lib::get_yp(); */ +#/ */ +#/***********************************************************************************************/ + +sub get_yp + { + return("${yellow_pages}"); + } + + + + + +#/***********************************************************************************************/ +#/ get_io_ports */ +#/ */ +#/ returns name for the io_ports subdirectory under ${home} */ +#/ */ +#/ my $workspace = yp::lib::get_io_ports(); */ +#/ */ +#/***********************************************************************************************/ + +sub get_io_ports + { + return("${io_ports}"); + } + +#/***********************************************************************************************/ +#/ get_doc_dir */ +#/ */ +#/ returns name for the documentation subdirectory under ${home} */ +#/ */ +#/ my $workspace = yp::lib::get_doc_dir (); */ +#/ */ +#/***********************************************************************************************/ + +sub get_doc_dir + { + return("${doc_dir}"); + } + + + + +#/***************************************************************************************************/ +#/ get_io_ports_db_filename */ +#/ */ +#/ returns full path name to io_ports database filename */ +#/ */ +#/ my $io_ports_filename = yp::lib::get_io_ports_db_filename($vendor,$library,$component,$version);*/ +#/ */ +#/***************************************************************************************************/ + +sub get_io_ports_db_filename + { + my @params = @_; + my $version = pop(@params); + my $component = pop(@params); + my $library = pop(@params); + my $vendor = pop(@params); + my $main_module_name = yp::lib::get_module_name($vendor,$library,$component,$version) ; + my $io_ports_db_filename = "${home}/${io_ports}/${vendor}__${library}/${component}/${main_module_name}_PORTS.dbm"; + + if(-e ${io_ports_db_filename } ) + { + return("${io_ports_db_filename}"); + } + my $cmd = "./tools/verilog/gen_ports -vendor $vendor -library $library -component $component -version $version "; + if (system($cmd)) {} + return("${io_ports_db_filename}"); + } + + + + + +#/***************************************************************************************************/ +#/ get_io_busses_db_filename */ +#/ */ +#/ returns full path name to io_busses database filename */ +#/ */ +#/ my $io_ports_filename = yp::lib::get_io_busses_db_filename($vendor,$library,$component,$version);*/ +#/ */ +#/***************************************************************************************************/ + +sub get_io_busses_db_filename + { + my @params = @_; + my $version = pop(@params); + my $component = pop(@params); + my $library = pop(@params); + my $vendor = pop(@params); + my $main_module_name = yp::lib::get_module_name($vendor,$library,$component,$version) ; + my $io_busses_db_filename = "${home}/${io_ports}/${vendor}__${library}/${component}/${main_module_name}_BUSSES.dbm"; + + if(-e ${io_busses_db_filename } ) + { + return("${io_busses_db_filename}"); + } + my $cmd = "./tools/verilog/gen_ports -vendor $vendor -library $library -component $component -version $version "; + if (system($cmd)) {} + return("${io_busses_db_filename}"); + } + + + + + + + +#/***************************************************************************************************/ +#/ get_signals */ +#/ */ +#/ returns array of all signals in a component */ +#/ */ +#/ my @signals = yp::lib::get_signals($vendor,$library,$component,$version); */ +#/ */ +#/***************************************************************************************************/ + +sub get_signals + { + my @params = @_; + my $version = pop(@params); + my $component = pop(@params); + my $library = pop(@params); + my $vendor = pop(@params); + my $main_module_name = yp::lib::get_module_name($vendor,$library,$component,$version) ; + my $io_ports_db_filename = "${home}/${io_ports}/${vendor}__${library}/${component}/${main_module_name}_PORTS.dbm"; + + + unless (-e ${io_ports_db_filename } ) + { + + my $cmd = "./tools/verilog/gen_ports -vendor $vendor -library $library -component $component -version $version "; + if (system($cmd)) {} + $cmd = "./tools/verilog/gen_signals -vendor $vendor -library $library -component $component -version $version "; + if (system($cmd)) {} + } + + + + my $ports_db = new BerkeleyDB::Hash( -Filename => $io_ports_db_filename, -Flags => DB_CREATE ) or die "Cannot open ${io_ports_db_filename}: $!"; + my @signals = (); + my $key; + my $value; + my $port_cursor = $ports_db->db_cursor() ; + while ($port_cursor->c_get($key, $value, DB_NEXT) == 0) + { + + push (@signals, $value); + } + my $status = $port_cursor->c_close() ; + + @signals = sys::lib::trim_sort(@signals); + return(@signals); + } + + + + + +#/***************************************************************************************************/ +#/ get_busses */ +#/ */ +#/ returns array of all busses in a component */ +#/ */ +#/ my @signals = yp::lib::get_busses($vendor,$library,$component,$version); */ +#/ */ +#/***************************************************************************************************/ + +sub get_busses + { + my @params = @_; + my $version = pop(@params); + my $component = pop(@params); + my $library = pop(@params); + my $vendor = pop(@params); + my $main_module_name = yp::lib::get_module_name($vendor,$library,$component,$version) ; + my $io_busses_db_filename = "${home}/${io_ports}/${vendor}__${library}/${component}/${main_module_name}_BUSSES.dbm"; + + + unless (-e ${io_busses_db_filename } ) + { + + my $cmd = "./tools/verilog/gen_ports -vendor $vendor -library $library -component $component -version $version "; + if (system($cmd)) {} + } + + my $ports_db = new BerkeleyDB::Hash( -Filename => $io_busses_db_filename, -Flags => DB_CREATE ) or die "Cannot open ${io_busses_db_filename}: $!"; + my @busses = (); + my $key; + my $value; + my ${key_type}; + my ${busref}; + my ${conn}; + my ${log_name}; + my ${direction}; + my ${type}; + my ${vector}; + my ${left}; + my ${right}; + my ${phy_name}; + my $port_cursor = $ports_db->db_cursor() ; + while ($port_cursor->c_get($key, $value, DB_NEXT) == 0) + { + ( ${key_type},${busref},${conn}) = split( /\./ , $key); + ( ${log_name},${direction},${type},${vector},${left},${right},${phy_name}) = split ':', $value; + + if(($key_type eq "BusRef")) + { + push (@busses, "${busref}:::${conn}:::${phy_name}:::${log_name}:::${direction}:::${type}:::${vector}:::${left}:::${right}"); + } + } + my $status = $port_cursor->c_close() ; + + @busses = sys::lib::trim_sort(@busses); + return(@busses); + } + + + + + + + + + + + + + + + + + + + + + + + + +#/***************************************************************************************************/ +#/ get_absDef_db_filename */ +#/ */ +#/ returns full path name to abstractionDefinition database filename */ +#/ */ +#/ my $absDef_filename = yp::lib::get_absDef_db_filename($vendor,$library,$component,$version); */ +#/ */ +#/***************************************************************************************************/ + +sub get_absDef_db_filename + { + my @params = @_; + my $version = pop(@params); + my $component = pop(@params); + my $library = pop(@params); + my $vendor = pop(@params); + my $absDef_db_filename = "${io_ports}/${vendor}__${library}/${component}/${component}_${version}_ABSDEF.dbm"; + + if(-e ${absDef_db_filename } ) + { + return("${absDef_db_filename}"); + } + my $cmd = "./tools/busdefs/gen_busdef -vendor $vendor -library $library -component $component -version $version "; + if (system($cmd)) {} + + return("${absDef_db_filename}"); + } + + + + + + + + + +#/***********************************************************************************************/ #/ find_ipxact_component */ #/ */ #/ returns full path name to ip-xact component file */ @@ -147,9 +527,13 @@ my $design_xml_sep ; my $design_xml_file ; my $design_version; + my $design_name; + my $design_library; + my $design_vendor; + $abstractionDefinition_db->db_get("${vendor}__${library}_${component}_${version}", $data ); - ( $design_xml_file, $design_xml_sep,$design_version ) = split ':', $data; + ( $design_xml_file, $design_xml_sep,$design_version,$design_name,$design_library,$design_vendor ) = split ':', $data; return("$design_xml_file"); @@ -234,6 +618,64 @@ #/**************************************************************************************************************/ +#/ find_component_repo */ +#/ */ +#/ returns repository that containing component */ +#/ */ +#/ my $repo_name = yp::lib::find_component_repo($vendor,$library,$component); */ +#/ */ +#/**************************************************************************************************************/ + +sub find_component_repo { + my @params = @_; + my $component = pop(@params); + my $library = pop(@params); + my $vendor = pop(@params); + + my $type; + my $name; + my $lib_comp_sep; + my $repo_dir; + my $repo_data; + + $repo_db->db_get("${vendor}__${library}_${component}", $repo_data ); + ( $type,$name, $lib_comp_sep, $repo_dir ) = split ':', $repo_data; + return("${repo_dir}"); + } + + + + +#/**************************************************************************************************************/ +#/ find_library_repo */ +#/ */ +#/ returns repository containing library */ +#/ */ +#/ my $repo_name = yp::lib::find_library_repo($vendor,$library); */ +#/ */ +#/**************************************************************************************************************/ + +sub find_library_repo { + my @params = @_; + my $library = pop(@params); + my $vendor = pop(@params); + + my $type; + my $name; + my $status; + my $library_path; + my $repo_dir; + my $repo_data; + + $repo_db->db_get("${vendor}__${library}", $repo_data ); + ( $type,$name, $library_path,$status, $repo_dir ) = split ':', $repo_data; + return("${repo_dir}"); + } + + + + +#/**************************************************************************************************************/ #/ find_lib_comp_sep */ #/ */ #/ returns libraries path to components */ @@ -252,15 +694,16 @@ my $type; my $name; my $lib_comp_sep; + my $repo_dir; my $repo_data; $repo_db->db_get("${vendor}__${library}_${component}", $repo_data ); - ( $type,$name, $lib_comp_sep ) = split ':', $repo_data; + ( $type,$name, $lib_comp_sep, $repo_dir ) = split ':', $repo_data; return("${lib_comp_sep}"); } - + #/***********************************************************************************************/ #/ find_ipxact_comp_xml_sep */ #/ */ @@ -321,6 +764,141 @@ + + +#/**************************************************************************************************************/ +#/ get_vendor_status */ +#/ */ +#/ returns vendor status */ +#/ */ +#/ my $vendor_status = yp::lib::get_vendor_status($vendor); */ +#/ */ +#/**************************************************************************************************************/ + +sub get_vendor_status { + my @params = @_; + my $vendor = pop(@params); + + my $type; + my $name; + my $status; + my $repo_dir; + my $repo_data; + + $repo_db->db_get("${vendor}", $repo_data ); + ( $type,$name, $status, $repo_dir ) = split ':', $repo_data; + return("${status}"); + } + + + + +#/**************************************************************************************************************/ +#/ set_vendor_status */ +#/ */ +#/ sets vendor status */ +#/ */ +#/ my $vendor_status = yp::lib::set_vendor_status($vendor,$status); */ +#/ */ +#/**************************************************************************************************************/ + +sub set_vendor_status { + my @params = @_; + my $status = pop(@params); + my $vendor = pop(@params); + + my $type; + my $name; + my $old_status; + my $repo_dir; + my $repo_data; + my @repo_info; + + $repo_db->db_get("${vendor}", $repo_data ); + ( $type,$name, $old_status, $repo_dir ) = split ':', $repo_data; + + my @repo_info = ("vendor","$vendor","$status","$repo_dir" ); + $repo_db->db_put( $vendor, join(':', @repo_info) ); + + return("${status}"); + } + + + + +#/**************************************************************************************************************/ +#/ get_library_status */ +#/ */ +#/ returns library status */ +#/ */ +#/ my $library_status = yp::lib::get_library_status($vendor); */ +#/ */ +#/**************************************************************************************************************/ + +sub get_library_status { + my @params = @_; + my $library = pop(@params); + my $vendor = pop(@params); + + my $type; + my $name; + my $library_path; + my $status; + my $repo_dir; + my $repo_data; + + $repo_db->db_get("${vendor}_${library}", $repo_data ); + ( $type,$name,$library_path, $status, $repo_dir ) = split ':', $repo_data; + return("${status}"); + } + + + + +#/**************************************************************************************************************/ +#/ set_library_status */ +#/ */ +#/ sets library status */ +#/ */ +#/ my $library_status = yp::lib::set_library_status($vendor,$library,$status); */ +#/ */ +#/**************************************************************************************************************/ + +sub set_library_status { + my @params = @_; + my $status = pop(@params); + my $library = pop(@params); + my $vendor = pop(@params); + + my $type; + my $name; + my $old_status; + my $library_path; + my $repo_dir; + my $repo_data; + my @repo_info; + + $repo_db->db_get("${vendor}_${library}", $repo_data ); + ( $type,$name,$library_path, $old_status, $repo_dir ) = split ':', $repo_data; + + my @repo_info = ("library","$library","$library_path","$status","$repo_dir" ); + $repo_db->db_put( "${vendor}_${library}", join(':', @repo_info) ); + + return("${status}"); + } + + + + + + + + + + + + + #/*********************************************************************************************/ #/ find_vendors */ #/ */ @@ -337,12 +915,13 @@ my $type; my $name; my $path; + my $repo_dir; my @vendors = (); my $cursor = $repo_db->db_cursor() ; while ($cursor->c_get($key, $value, DB_NEXT) == 0) { - ( $type,$name, $path ) = split ':', $value; + ( $type,$name, $path,$repo_dir ) = split ':', $value; if($type eq "vendor") { push (@vendors,$name ); @@ -371,13 +950,15 @@ my $key; my $value; my $name; + my $status; my $path; + my $repo_dir; my @libraries = (); my $cursor = $repo_db->db_cursor() ; while ($cursor->c_get($key, $value, DB_NEXT) == 0) { - ( $type,$name, $path ) = split ':', $value; + ( $type,$name, $path,$status, $repo_dir) = split ':', $value; if(($type eq "library")&& ($key eq "${vendor}__${name}") ) @@ -409,11 +990,12 @@ my $value; my $name; my $path; + my $repo_dir; my @components = (); my $cursor = $repo_db->db_cursor() ; while ($cursor->c_get($key, $value, DB_NEXT) == 0) { - ( $type,$name, $path ) = split ':', $value; + ( $type,$name, $path,$repo_dir ) = split ':', $value; if(($type eq "component")&& ($key eq "${vendor}__${library}_${name}")) { push (@components,$name );} } @@ -484,16 +1066,19 @@ my $key; my $value; my $comp_xml_sep; - my $version; + my $design_vendor; + my $design_library; + my $design_name; + my $design_version; my @versions = (); my $cursor = $abstractionDefinition_db->db_cursor() ; while ($cursor->c_get($key, $value, DB_NEXT) == 0) { - ( $xml_file,$comp_xml_sep, $version ) = split ':', $value; - if(($key eq "${vendor}__${library}_${abstractionDefinition}_${version}")) + ( $xml_file,$comp_xml_sep, $design_version,$design_name,$design_library,$design_vendor ) = split ':', $value; + if(($key eq "${vendor}__${library}_${abstractionDefinition}_${design_version}")) { - push (@versions,$version ); + push (@versions,$design_version ); } } @versions = trim_sort(@versions); @@ -501,10 +1086,55 @@ } +#/*********************************************************************************************/ +#/ find_abstractionDefinitions */ +#/ */ +#/ returns array of all abstractionDefinitions vendor__library_abstractionDefinition_version */ +#/ */ +#/ my @abstractionDefinitions = yp::lib::find_abstractionDefinitions(); */ +#/ */ +#/*********************************************************************************************/ + + + + + + +sub find_abstractionDefinitions + { + my $key; + my $value; + my $type; + my $name; + my $path; + + my $design_xml_file; + my $design_xml_sep; + + my $design_version; + my $design_name; + my $design_library; + my $design_vendor; + + + my @abstractionDefinitions = (); + + my $cursor = $abstractionDefinition_db->db_cursor() ; + while ($cursor->c_get($key, $value, DB_NEXT) == 0) + { + + ( $design_xml_file, $design_xml_sep,$design_version,$design_name,$design_library,$design_vendor ) = split ':', $value; + push (@abstractionDefinitions,"${design_vendor}:${design_library}:${design_name}:${design_version}" ); + @abstractionDefinitions = trim_sort(@abstractionDefinitions); + } + return (@abstractionDefinitions); + } + + #/************************************************************************************************************************/ #/ find_busDefinition_versions */ #/ */ @@ -562,7 +1192,12 @@ my $parser = XML::LibXML->new(); - my $socgen_component_file = $parser->parse_file(yp::lib::find_componentConfiguration($vendor,$library,$component)); + my $socgen_component_filename = yp::lib::find_componentConfiguration($vendor,$library,$component); + unless($socgen_component_filename) + { + return(""); + } + my $socgen_component_file = $parser->parse_file($socgen_component_filename); foreach my $new_comp ($socgen_component_file->findnodes("//socgen:componentConfiguration")) { @@ -577,59 +1212,7 @@ } - - - - - - #/*********************************************************************************************/ -#/ find_versions */ -#/ */ -#/ returns array of all versions from a vendors library component */ -#/ */ -#/ my @versions = yp::lib::find_versions($type,$vendor,$library,component); */ -#/ */ -#/*********************************************************************************************/ - -sub find_versions - { - my @params = @_; - my $component = pop(@params); - my $library = pop(@params); - my $vendor = pop(@params); - my $type = pop(@params); - my $card_type; - my $card_vendor; - my $card_library; - my $card_component; - my $card_version; - - my $parser = XML::LibXML->new(); - my $yp_index_file = $parser->parse_file("./tools/yp/index.xml"); - my @versions = (); - - foreach my $index_card ($yp_index_file->findnodes('//socgen:index_file/index_card/type')) - { - $card_type = $index_card->findnodes('./text()')->to_literal ; - $card_vendor = $index_card->findnodes('../vendor/text()')->to_literal ; - $card_library = $index_card->findnodes('../library/text()')->to_literal ; - $card_component = $index_card->findnodes('../name/text()')->to_literal ; - $card_version = $index_card->findnodes('../version/text()')->to_literal ; - if(($card_type eq $type) & ($card_vendor eq $vendor) & ($card_library eq $library) & ($card_component eq $component)) - - { - push (@versions,$card_version);} -# print "XXXXXG ${vendor}__${library}_${component} $card_version \n"; - - } - @versions = trim_sort(@versions); -# print "XXXXXG ++++++++++++++++++++ Old \n"; - return (@versions); - } - - -#/*********************************************************************************************/ #/ parse_component_file */ #/ */ #/ returns design names for component */
/yp/clean
0,0 → 1,168
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 XML::LibXML;
use lib './tools';
use sys::lib;
use BerkeleyDB;
 
 
$OUTPUT_AUTOFLUSH = 1; # set autoflush of stdout to TRUE.
 
 
 
 
############################################################################
### Process the options
############################################################################
 
Getopt::Long::config("require_order", "prefix=-");
GetOptions("h","help"
) || die "(use '$program_name -h' for help)";
 
 
##############################################################################
## Help option
##############################################################################
if ( $opt_h or $opt_help )
{
print "\n type clean \n";
exit 1;
}
 
 
##############################################################################
##
##############################################################################
 
my $home = cwd();
 
my $parser = XML::LibXML->new();
 
my $workspace_xml = $parser->parse_file("${home}/workspace.xml");
 
 
 
 
 
 
 
 
 
my @repos =();
my $repo;
 
 
foreach my $repo ($workspace_xml->findnodes('//socgen:workspace/socgen:external/socgen:repo'))
{
my $repo_name = $repo->findnodes('./socgen:name/text()')->to_literal ;
my $repo_path = $repo->findnodes('./socgen:path/text()')->to_literal ;
print "cleaning $repo_name \n";
if(-e $repo_name)
{
print "Removing $repo_name \n";
my $cmd = "rm -r $repo_name \n";
if(system($cmd)){};
}
}
 
 
 
my $build_dir;
my $yp_dir;
my $ports_dir;
my $doc_dir;
 
 
 
foreach my $repo ($workspace_xml->findnodes('//socgen:workspace'))
{
$build_dir = $repo->findnodes('./socgen:build_dir/text()')->to_literal ;
$yp_dir = $repo->findnodes('./socgen:yp_dir/text()')->to_literal ;
$ports_dir = $repo->findnodes('./socgen:ports_dir/text()')->to_literal ;
$doc_dir = $repo->findnodes('./socgen:doc_dir/text()')->to_literal ;
}
 
 
if(-e $build_dir)
{
print "Removing $build_dir \n";
my $cmd = "rm -r ./${build_dir} \n";
if(system($cmd)){};
}
 
 
if(-e $yp_dir)
{
print "Removing $yp_dir \n";
my $cmd = "rm -r ./${yp_dir} \n";
if(system($cmd)){};
}
 
 
if(-e $ports_dir)
{
print "Removing $ports_dir \n";
my $cmd = "rm -r ./${ports_dir} \n";
if(system($cmd)){};
}
if(-e $doc_dir)
{
print "Removing $doc_dir \n";
my $cmd = "rm -r ./${doc_dir} \n";
if(system($cmd)){};
}
 
 
1
yp/clean Property changes : Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Index: yp/create_yp =================================================================== --- yp/create_yp (revision 130) +++ yp/create_yp (revision 131) @@ -53,6 +53,9 @@ use File::Basename; use Cwd; use XML::LibXML; +use lib './tools'; +use sys::lib; +use BerkeleyDB; $OUTPUT_AUTOFLUSH = 1; # set autoflush of stdout to TRUE. @@ -74,7 +77,7 @@ ############################################################################## if ( $opt_h or $opt_help ) { - print "\n type create_yp\n"; + print "\n type create_yp $path \n"; exit 1; } @@ -83,28 +86,28 @@ ## ############################################################################## -my $home = cwd(); +my $home = cwd(); +my $path = $ARGV[0]; +mkdir $path,0755 unless( -e $path ); +$repo_db = new BerkeleyDB::Hash( -Filename => "${path}/repo.dbm", -Flags => DB_CREATE ) or die "Cannot open file: $!"; +$component_db = new BerkeleyDB::Hash( -Filename => "${path}/component.dbm", -Flags => DB_CREATE ) or die "Cannot open file: $!"; +$design_db = new BerkeleyDB::Hash( -Filename => "${path}/design.dbm", -Flags => DB_CREATE ) or die "Cannot open file: $!"; +$busDefinition_db = new BerkeleyDB::Hash( -Filename => "${path}/busDefinition.dbm", -Flags => DB_CREATE ) or die "Cannot open file: $!"; +$abstractionDefinition_db = new BerkeleyDB::Hash( -Filename => "${path}/abstractionDefinition.dbm", -Flags => DB_CREATE ) or die "Cannot open file: $!"; +$libraryConfiguration_db = new BerkeleyDB::Hash( -Filename => "${path}/libraryConfiguration.dbm", -Flags => DB_CREATE ) or die "Cannot open file: $!"; +$componentConfiguration_db = new BerkeleyDB::Hash( -Filename => "${path}/componentConfiguration.dbm", -Flags => DB_CREATE ) or die "Cannot open file: $!"; -my $projects_dir = $ARGV[0]; -chomp($projects_dir); -$projects_dir = "/${projects_dir}"; +my $parser = XML::LibXML->new(); -use BerkeleyDB; +my $workspace = $parser->parse_file("${home}/workspace.xml"); -$repo_db = new BerkeleyDB::Hash( -Filename => 'tools/yp/Berkeley/repo.dbm', -Flags => DB_CREATE ) or die "Cannot open file: $!"; -$component_db = new BerkeleyDB::Hash( -Filename => 'tools/yp/Berkeley/component.dbm', -Flags => DB_CREATE ) or die "Cannot open file: $!"; -$design_db = new BerkeleyDB::Hash( -Filename => 'tools/yp/Berkeley/design.dbm', -Flags => DB_CREATE ) or die "Cannot open file: $!"; -$busDefinition_db = new BerkeleyDB::Hash( -Filename => 'tools/yp/Berkeley/busDefinition.dbm', -Flags => DB_CREATE ) or die "Cannot open file: $!"; -$abstractionDefinition_db = new BerkeleyDB::Hash( -Filename => 'tools/yp/Berkeley/abstractionDefinition.dbm', -Flags => DB_CREATE ) or die "Cannot open file: $!"; -$libraryConfiguration_db = new BerkeleyDB::Hash( -Filename => 'tools/yp/Berkeley/libraryConfiguration.dbm', -Flags => DB_CREATE ) or die "Cannot open file: $!"; -$componentConfiguration_db = new BerkeleyDB::Hash( -Filename => 'tools/yp/Berkeley/componentConfiguration.dbm', -Flags => DB_CREATE ) or die "Cannot open file: $!"; @@ -113,7 +116,49 @@ - +my @repos =(); +my $repo; + + +foreach my $repo ($workspace->findnodes('//socgen:workspace/socgen:external/socgen:repo')) + { + my $repo_name = $repo->findnodes('./socgen:name/text()')->to_literal ; + my $repo_path = $repo->findnodes('./socgen:path/text()')->to_literal ; + print "Linking $repo_name $repo_path \n"; + if(-e $repo_name) + { + print "Removing $repo_name \n"; + my $cmd = "rm -r $repo_name \n"; + if(system($cmd)){}; + } + + my $cmd = "mkdir $repo_name ;lndir $repo_path $repo_name;"; + if(system($cmd)){}; + + + + } + + + + +foreach my $repo ($workspace->findnodes('//socgen:workspace/socgen:repos/socgen:repo')) + { + my $repo_name = $repo->findnodes('./socgen:name/text()')->to_literal ; + push @repos,$repo_name; + } + +my $repos_dir ; + + + +foreach $repos_dir (@repos) +{ +print "Project_dir $repos_dir \n"; + + + + #/*********************************************************************************************/ #/ */ #/ */ @@ -123,12 +168,12 @@ #/ */ #/*********************************************************************************************/ -my $parser = XML::LibXML->new(); -$root = "${home}${projects_dir}"; -&link_dir( "$root" ); +$root = "${home}${repos_dir}"; +&link_dir( "$root","$repos_dir" ); + #/*********************************************************************************************/ #/ */ #/ */ @@ -142,6 +187,9 @@ sub link_dir { my $src = shift; + my $repos_dir = shift; + + return unless( -e $src ); if( -d $src ) @@ -166,63 +214,22 @@ if(/${home}(\S+)/) { $t_local = $1; } my $xml_file = $parser->parse_file("${home}${t_local}/${t_name}.xml"); - eval {$xml_file-> findnodes('//socgen:componentConfiguration');}; #/ check for socgen namespace - - - if($@) #/ Nope, must be spirit namespace + if(${t_name} eq "libraryCfg" ) { - foreach my $comp ($xml_file->findnodes('//spirit:component')) + foreach my $design ($xml_file->findnodes('//socgen:libraryConfiguration')) { - $vendor = $comp->findnodes('./spirit:vendor/text()')->to_literal ; - $library = $comp->findnodes('./spirit:library/text()')->to_literal ; - $type = "spirit:component"; - $name = $comp->findnodes('./spirit:name/text()')->to_literal ; - $version = $comp->findnodes('./spirit:version/text()')->to_literal ; + $vendor = $design->findnodes('./socgen:vendor/text()')->to_literal ; + $library = $design->findnodes('./socgen:name/text()')->to_literal ; + $name = ""; + $version = ""; + $type = "socgen:libraryConfiguration"; } - - - foreach my $design ($xml_file->findnodes('//spirit:design')) + } + elsif(${t_name} eq "componentCfg" ) + { + foreach my $design ($xml_file->findnodes('//socgen:componentConfiguration')) { - $vendor = $design->findnodes('./spirit:vendor/text()')->to_literal ; - $library = $design->findnodes('./spirit:library/text()')->to_literal ; - $name = $design->findnodes('./spirit:name/text()')->to_literal ; - $version = $design->findnodes('./spirit:version/text()')->to_literal ; - $type = "spirit:design"; - - } - - - - - - foreach my $design ($xml_file->findnodes('//spirit:abstractionDefinition')) - { - $vendor = $design->findnodes('./spirit:vendor/text()')->to_literal ; - $library = $design->findnodes('./spirit:library/text()')->to_literal ; - $name = $design->findnodes('./spirit:name/text()')->to_literal ; - $version = $design->findnodes('./spirit:version/text()')->to_literal ; - $type = "spirit:abstractionDefinition"; - } - - - foreach my $design ($xml_file->findnodes('//spirit:busDefinition')) - { - $vendor = $design->findnodes('./spirit:vendor/text()')->to_literal ; - $library = $design->findnodes('./spirit:library/text()')->to_literal ; - $name = $design->findnodes('./spirit:name/text()')->to_literal ; - $version = $design->findnodes('./spirit:version/text()')->to_literal ; - $type = "spirit:busDefinition"; - } - } - - else #/ socgen namespace - - { - - - foreach my $design ($xml_file->findnodes('//socgen:componentConfiguration')) - { $vendor = $design->findnodes('./socgen:vendor/text()')->to_literal ; $library = $design->findnodes('./socgen:library/text()')->to_literal ; $name = $design->findnodes('./socgen:component/text()')->to_literal ; @@ -229,17 +236,11 @@ $version = ""; $type = "socgen:componentConfiguration"; } + } + + else + { - - foreach my $design ($xml_file->findnodes('//socgen:libraryConfiguration')) - { - $vendor = $design->findnodes('./socgen:vendor/text()')->to_literal ; - $library = $design->findnodes('./socgen:name/text()')->to_literal ; - $name = ""; - $version = ""; - $type = "socgen:libraryConfiguration"; - } - foreach my $comp ($xml_file->findnodes('//spirit:component')) { $vendor = $comp->findnodes('./spirit:vendor/text()')->to_literal ; @@ -260,10 +261,8 @@ } + - - - foreach my $design ($xml_file->findnodes('//spirit:abstractionDefinition')) { $vendor = $design->findnodes('./spirit:vendor/text()')->to_literal ; @@ -284,9 +283,12 @@ } + + - } + + } $vendor_match = "/${vendor}/"; $library_match = "/${library}/"; @@ -308,8 +310,8 @@ - - + +# print "${vendor}__${library}_${name}_${version} $t_local $library_match $lib_comp_sep $name_match \n"; $V_L_N_V = "${vendor}__${library}_${name}_${version}" ; @@ -318,18 +320,18 @@ { my $V = "${vendor}" ; - my @repo_info = ("vendor","$vendor","$vendor_path" ); + my @repo_info = ("vendor","$vendor","idle","$repos_dir" ); $repo_db->db_put( $V, join(':', @repo_info) ); my $V_L = "${vendor}__${library}" ; - @repo_info = ("library","$library","$library_path" ); + @repo_info = ("library","$library","$library_path" ,"idle","$repos_dir"); $repo_db->db_put( $V_L, join(':', @repo_info) ); my $V_L_N = "${vendor}__${library}_${name}" ; - @repo_info = ("component","$name","$lib_comp_sep" ); + @repo_info = ("component","$name","$lib_comp_sep","$repos_dir" ); $repo_db->db_put( $V_L_N, join(':', @repo_info) ); @@ -337,7 +339,7 @@ my @comp_info = (".${t_local}/${t_name}.xml","${component_path}","${version}" ); $component_db->db_put( $V_L_N_V, join(':', @comp_info) ); -# print "${vendor}__${library}_${name}_${version} \n"; + # print " .${t_local}/${t_name}.xml , ${component_path} \n "; @@ -357,7 +359,8 @@ elsif($type eq "spirit:abstractionDefinition") { - @info = (".${t_local}/${t_name}.xml","${component_path}","${version}" ); +# print "ABSDEF $V_L_N_V \n"; + @info = (".${t_local}/${t_name}.xml","${component_path}","${version}","${name}","${library}","${vendor}" ); $abstractionDefinition_db->db_put( $V_L_N_V, join(':', @info) ); } @@ -369,6 +372,10 @@ } + + + + if($type eq "socgen:libraryConfiguration") { $V_L = "${vendor}__${library}" ; @@ -385,15 +392,15 @@ } +my $uplift_data; +$repo_db->db_get("log_name", $uplift_data ); - - } - &link_dir("$src/$item" ); + &link_dir("$src/$item","$repos_dir" ); } } @@ -402,9 +409,9 @@ +} - $repo_db->db_close(); $component_db->db_close(); $design_db->db_close();
/busdefs/gen_busdef
0,0 → 1,273
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",
"vendor=s" => \$vendor,
"library=s" => \$library,
"version=s" => \$version,
"component=s" => \$component,
"debug","verbose"
) || die "(use '$program_name -h' for help)";
 
 
##############################################################################
## Help option
##############################################################################
if ( $opt_h or $opt_help )
{ print "\n gen_busdef -vendor vendor_name -library library_name -component component_name -version version_name ";
print "\n";
exit 1;
}
 
 
#############################################################################
##
##
#############################################################################
 
 
$home = cwd();
 
 
my $variant;
my $parser = XML::LibXML->new();
print "\n GEN_busdef $vendor $library $component $version \n";
 
 
 
my $io_ports = yp::lib::get_io_ports() ;
 
 
 
 
my $path = "${io_ports}";
mkdir $path,0755 unless( -e $path );
$path = "${io_ports}/${vendor}__${library}";
mkdir $path,0755 unless( -e $path );
$path = "${io_ports}/${vendor}__${library}/${component}";
mkdir $path,0755 unless( -e $path );
$filename ="${io_ports}/${vendor}__${library}/${component}/${component}_${version}_ABSDEF.dbm";
 
if(-e ${filename} )
{
print " $filename Exists, exiting \n";
exit 0;
}
 
 
$absDef_db = new BerkeleyDB::Hash( -Filename => $filename, -Flags => DB_CREATE ) or die "Cannot open file: $!";
 
 
 
 
my $spirit_file = yp::lib::find_ipxact_abstractionDefinition($vendor,$library,$component,$version);
 
# print "\tFilename: ${spirit_file}\n";
unless ($spirit_file) {print "Error absDef $vendor $library $component $version file does not exist";}
 
my $spirit_absDef_file = $parser->parse_file($spirit_file);
foreach my $absDef ($spirit_absDef_file->findnodes("//spirit:abstractionDefinition/spirit:vendor"))
{
my($bd_vendor) = $absDef->findnodes('./text()')->to_literal ;
my($bd_library) = $absDef->findnodes('../spirit:library/text()')->to_literal ;
my($bd_name) = $absDef->findnodes('../spirit:name/text()')->to_literal ;
my($bd_version) = $absDef->findnodes('../spirit:version/text()')->to_literal ;
# print "\tVLNV-ad ${bd_vendor}_${bd_library}_${bd_name}_${bd_version}\n";
 
my %systemGroupNames = ();
 
 
foreach my $bus_type ($spirit_absDef_file->findnodes("//spirit:abstractionDefinition/spirit:busType"))
{
my($bt_vendor) = $bus_type->findnodes('./@spirit:vendor')->to_literal ;
my($bt_library) = $bus_type->findnodes('./@spirit:library')->to_literal ;
my($bt_name) = $bus_type->findnodes('./@spirit:name')->to_literal ;
my($bt_version) = $bus_type->findnodes('./@spirit:version')->to_literal ;
# print "\tVLNV-bt ${bt_vendor}_${bt_library}_${bt_name}_${bt_version}\n";
 
my $spirit_file = yp::lib::find_ipxact_busDefinition($bt_vendor,$bt_library,$bt_name,$bt_version);
 
unless ($spirit_file) {print "ERROR: No bus definition\n";}
else
{
my $spirit_busDef_file = $parser->parse_file($spirit_file);
foreach my $i_name ($spirit_busDef_file->findnodes("//spirit:busDefinition/spirit:systemGroupNames/spirit:systemGroupName"))
{
my($sysgroup_name) = $i_name ->findnodes('./text()')->to_literal;
# print "\t SystemGroup Name $sysgroup_name \n";
$systemGroupNames{$sysgroup_name} = 1;
}
}
}
 
foreach my $absDef ($spirit_absDef_file->findnodes("//spirit:abstractionDefinition/spirit:ports/spirit:port/spirit:logicalName"))
{
my($logical_name) = $absDef->findnodes('./text()')->to_literal ;
my($is_clock) = $absDef->findnodes('../spirit:wire/spirit:qualifier/spirit:isClock/text()')->to_literal ;
my($is_reset) = $absDef->findnodes('../spirit:wire/spirit:qualifier/spirit:isReset/text()')->to_literal ;
my($is_address) = $absDef->findnodes('../spirit:wire/spirit:qualifier/spirit:isAddress/text()')->to_literal ;
my($is_data) = $absDef->findnodes('../spirit:wire/spirit:qualifier/spirit:isData/text()')->to_literal ;
my($requires_driver) = $absDef->findnodes('../spirit:wire/spirit:requiresDriver/text()')->to_literal ;
my($driver_type) = $absDef->findnodes('../spirit:wire/spirit:requiresDriver/@spirit:driverType')->to_literal ;
my($default_value) = $absDef->findnodes('../spirit:wire/spirit:defaultValue/text()')->to_literal ;
 
# print "\nPort: ${logical_name} ";
 
 
my $Key = "port__${logical_name}" ;
my @info = ("$logical_name","$is_clock","$is_reset","$is_address","$is_data","$requires_driver","$driver_type","$default_value" );
$absDef_db->db_put( $Key, join(':', @info) );
 
 
 
 
 
my $master_presence;
my $master_width;
my $master_direction;
 
foreach my $onMaster ($spirit_absDef_file->findnodes("//spirit:abstractionDefinition/spirit:ports/spirit:port/spirit:logicalName[text() = '$logical_name']/../spirit:wire/spirit:onMaster/spirit:direction"))
{
$master_direction = $onMaster->findnodes('./text()')->to_literal ;
$master_width = $onMaster->findnodes('../spirit:width/text()')->to_literal ;
$master_presence = $onMaster->findnodes('../spirit:presence/text()')->to_literal ;
#print " onMaster presence $master_presence \n";
#unless($master_width) {$master_width = 1;}
#print "\n";
if($master_direction eq "in") {$master_direction = "input";}
if($master_direction eq "out"){$master_direction = "output";}
 
 
my $Key = "master__${logical_name}" ;
my @info = ("$logical_name","$master_presence","$master_width","$master_direction" );
$absDef_db->db_put( $Key, join(':', @info) );
#print "PUT $Key @info \n";
}
 
my $slave_presence;
my $slave_width;
my $slave_direction;
 
foreach my $onSlave ($spirit_absDef_file->findnodes("//spirit:abstractionDefinition/spirit:ports/spirit:port/spirit:logicalName[text() = '$logical_name']/../spirit:wire/spirit:onSlave/spirit:direction"))
{
$slave_direction = $onSlave->findnodes('./text()')->to_literal ;
$slave_width = $onSlave->findnodes('../spirit:width/text()')->to_literal ;
$slave_presence = $onSlave->findnodes('../spirit:presence/text()')->to_literal ;
#print " onSlave presence $slave_presence \n";
#unless($slave_width) {$slave_width = 1;}
#print "\n";
if($slave_direction eq "in") {$slave_direction = "input";}
if($slave_direction eq "out"){$slave_direction = "output";}
my $Key = "slave__${logical_name}" ;
my @info = ("$logical_name","$slave_presence","$slave_width","$slave_direction" );
$absDef_db->db_put( $Key, join(':', @info) );
#print "PUT $Key @info \n";
 
}
 
 
my %systemGroupPresence= ();
my %systemGroupWidth= ();
my %systemGroupDirection= ();
 
 
 
foreach my $onSystem ($spirit_absDef_file->findnodes("//spirit:abstractionDefinition/spirit:ports/spirit:port/spirit:logicalName[text() = '$logical_name']/../spirit:wire/spirit:onSystem/spirit:group"))
{
my($system_group) = $onSystem->findnodes('./text()')->to_literal ;
my($presence) = $onSystem->findnodes('../spirit:presence/text()')->to_literal ;
my($width) = $onSystem->findnodes('../spirit:width/text()')->to_literal ;
my($direction) = $onSystem->findnodes('../spirit:direction/text()')->to_literal ;
#print " onSystem Group $system_group \n";
#print " onSystem presence $presence \n";
#unless($width) {$width = 1;}
#print "\n";
 
my $Key = "system__${logical_name}" ;
my @info = ("$logical_name","$system_group","$presence","$width","$direction" );
$absDef_db->db_put( $Key, join(':', @info) );
#print "PUT $Key @info \n";
 
$systemGroupPresence{$system_group} =$presence ;
$systemGroupWidth{$system_group} =$width ;
$systemGroupDirection{$system_group} =$direction ;
}
# insert DRC checks here
 
}
}
 
$absDef_db->db_close();
#print "\n";
 
 
 
busdefs/gen_busdef Property changes : Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Index: busdefs/check_busDefs =================================================================== --- busdefs/check_busDefs (nonexistent) +++ busdefs/check_busDefs (revision 131) @@ -0,0 +1,258 @@ +eval 'exec `which perl` -S $0 ${1+"$@"}' + if 0; + +#/**********************************************************************/ +#/* */ +#/* ------- */ +#/* / SOC \ */ +#/* / GEN \ */ +#/* / TOOL \ */ +#/* ============== */ +#/* | | */ +#/* |____________| */ +#/* */ +#/* */ +#/* */ +#/* Author(s): */ +#/* - John Eaton, jt_eaton@opencores.org */ +#/* */ +#/**********************************************************************/ +#/* */ +#/* Copyright (C) <2010-2011> */ +#/* */ +#/* 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 */ +#/* */ +#/**********************************************************************/ + +use Getopt::Long; +use English; +use File::Basename; +use Cwd; +use XML::LibXML; +use lib './tools'; +use sys::lib; +use yp::lib; +use BerkeleyDB; + + +$OUTPUT_AUTOFLUSH = 1; # set autoflush of stdout to TRUE. + +my $parser = XML::LibXML->new(); +my $home = cwd(); + + +#/*********************************************************************************************/ +#/ */ +#/ */ +#/ */ +#/ */ +#/*********************************************************************************************/ + + +my @abstractionDefinitions = yp::lib::find_abstractionDefinitions(); + +my $version; +my $component; +my $library; +my $vendor; + + +foreach my $abstractionDefinition (@abstractionDefinitions) +{ + ( $vendor,$library, $component ,$version) = split ':', $abstractionDefinition; + + print "${vendor}:${library}:${component}:${version}\n"; + print "\t--------------------------------------------------------------------------------------------------------\n"; + + $filename ="tools/busdefs/Berkeley/${vendor}_${library}_${component}_${version}.dbm"; + + $absDef_db = new BerkeleyDB::Hash( -Filename => $filename, -Flags => DB_CREATE ) or die "Cannot open file: $!"; + + + + + my $spirit_file = yp::lib::find_ipxact_abstractionDefinition($vendor,$library,$component,$version); + + print "\tFilename: ${spirit_file}\n"; + unless ($spirit_file) {print "Error absDef file does not exist";} + + my $spirit_absDef_file = $parser->parse_file($spirit_file); + foreach my $absDef ($spirit_absDef_file->findnodes("//spirit:abstractionDefinition/spirit:vendor")) + { + my($bd_vendor) = $absDef->findnodes('./text()')->to_literal ; + my($bd_library) = $absDef->findnodes('../spirit:library/text()')->to_literal ; + my($bd_name) = $absDef->findnodes('../spirit:name/text()')->to_literal ; + my($bd_version) = $absDef->findnodes('../spirit:version/text()')->to_literal ; + print "\tVLNV-ad ${bd_vendor}_${bd_library}_${bd_name}_${bd_version}\n"; + + my %systemGroupNames = (); + + + foreach my $bus_type ($spirit_absDef_file->findnodes("//spirit:abstractionDefinition/spirit:busType")) + { + my($bt_vendor) = $bus_type->findnodes('./@spirit:vendor')->to_literal ; + my($bt_library) = $bus_type->findnodes('./@spirit:library')->to_literal ; + my($bt_name) = $bus_type->findnodes('./@spirit:name')->to_literal ; + my($bt_version) = $bus_type->findnodes('./@spirit:version')->to_literal ; + print "\tVLNV-bt ${bt_vendor}_${bt_library}_${bt_name}_${bt_version}\n"; + + my $spirit_file = yp::lib::find_ipxact_busDefinition($bt_vendor,$bt_library,$bt_name,$bt_version); + + unless ($spirit_file) {print "ERROR: No bus definition\n";} + else + { + my $spirit_busDef_file = $parser->parse_file($spirit_file); + foreach my $i_name ($spirit_busDef_file->findnodes("//spirit:busDefinition/spirit:systemGroupNames/spirit:systemGroupName")) + { + my($sysgroup_name) = $i_name ->findnodes('./text()')->to_literal; + print "\t SystemGroup Name $sysgroup_name \n"; + $systemGroupNames{$sysgroup_name} = 1; + } + } + } + + foreach my $absDef ($spirit_absDef_file->findnodes("//spirit:abstractionDefinition/spirit:ports/spirit:port/spirit:logicalName")) + { + my($logical_name) = $absDef->findnodes('./text()')->to_literal ; + my($is_clock) = $absDef->findnodes('../spirit:wire/spirit:qualifier/spirit:isClock/text()')->to_literal ; + my($is_reset) = $absDef->findnodes('../spirit:wire/spirit:qualifier/spirit:isReset/text()')->to_literal ; + my($is_address) = $absDef->findnodes('../spirit:wire/spirit:qualifier/spirit:isAddress/text()')->to_literal ; + my($is_data) = $absDef->findnodes('../spirit:wire/spirit:qualifier/spirit:isData/text()')->to_literal ; + my($requires_driver) = $absDef->findnodes('../spirit:wire/spirit:requiresDriver/text()')->to_literal ; + my($driver_type) = $absDef->findnodes('../spirit:wire/spirit:requiresDriver/@spirit:driverType')->to_literal ; + my($default_value) = $absDef->findnodes('../spirit:wire/spirit:defaultValue/text()')->to_literal ; + + print "\nPort: ${logical_name} "; + + + my $Key = "port__${logical_name}" ; + my @info = ("$logical_name","$is_clock","$is_reset","$is_address","$is_data","$requires_driver","$driver_type","$default_value" ); + $absDef_db->db_put( $Key, join(':', @info) ); + + + + + + if($is_clock) + { + if($is_reset) { print " BOTH CLOCK and RESET ";} + else { print " CLOCK ";} + } + elsif($is_reset) { print " RESET ";} + else { print " ";} + + if($is_address) { print " ADDRESS ";} + if($is_data) { print " DATA ";} + + + if($requires_driver) {print " Requires Driver $driver_type ";} + else {print " ";} + + if($default_value) {print " Default Value $default_value \n";} + else {print " \n";} + + my $master_presence; + my $master_width; + my $master_direction; + + foreach my $onMaster ($spirit_absDef_file->findnodes("//spirit:abstractionDefinition/spirit:ports/spirit:port/spirit:logicalName[text() = '$logical_name']/../spirit:wire/spirit:onMaster/spirit:presence")) + { + $master_presence = $onMaster->findnodes('./text()')->to_literal ; + $master_width = $onMaster->findnodes('../spirit:width/text()')->to_literal ; + $master_direction = $onMaster->findnodes('../spirit:direction/text()')->to_literal ; + print " onMaster presence $master_presence \n"; + #unless($master_width) {$master_width = 1;} + if($master_width) {print " onMaster width $master_width \n";} + if($master_direction) {print " onMaster direction $master_direction \n";} + print "\n"; + + my $Key = "master__${logical_name}" ; + my @info = ("$logical_name","$master_presence","$master_width","$master_direction" ); + $absDef_db->db_put( $Key, join(':', @info) ); + + } + + my $slave_presence; + my $slave_width; + my $slave_direction; + + foreach my $onSlave ($spirit_absDef_file->findnodes("//spirit:abstractionDefinition/spirit:ports/spirit:port/spirit:logicalName[text() = '$logical_name']/../spirit:wire/spirit:onSlave/spirit:presence")) + { + $slave_presence = $onSlave->findnodes('./text()')->to_literal ; + $slave_width = $onSlave->findnodes('../spirit:width/text()')->to_literal ; + $slave_direction = $onSlave->findnodes('../spirit:direction/text()')->to_literal ; + print " onSlave presence $slave_presence \n"; + #unless($slave_width) {$slave_width = 1;} + if($slave_width) {print " onSlave width $slave_width \n";} + if($slave_direction) {print " onSlave direction $slave_direction \n";} + print "\n"; + + my $Key = "slave__${logical_name}" ; + my @info = ("$logical_name","$slave_presence","$slave_width","$slave_direction" ); + $absDef_db->db_put( $Key, join(':', @info) ); + + + } + + + my %systemGroupPresence= (); + my %systemGroupWidth= (); + my %systemGroupDirection= (); + + + + foreach my $onSystem ($spirit_absDef_file->findnodes("//spirit:abstractionDefinition/spirit:ports/spirit:port/spirit:logicalName[text() = '$logical_name']/../spirit:wire/spirit:onSystem/spirit:group")) + { + my($system_group) = $onSystem->findnodes('./text()')->to_literal ; + my($presence) = $onSystem->findnodes('../spirit:presence/text()')->to_literal ; + my($width) = $onSystem->findnodes('../spirit:width/text()')->to_literal ; + my($direction) = $onSystem->findnodes('../spirit:direction/text()')->to_literal ; + print " onSystem Group $system_group \n"; + print " onSystem presence $presence \n"; + #unless($width) {$width = 1;} + if($width){print " onSystem width $width \n";} + if($direction){print " onSystem direction $direction \n";} + print "\n"; + + my $Key = "syste,__${logical_name}" ; + my @info = ("$logical_name","$system_group","$presence","$width","$direction" ); + $absDef_db->db_put( $Key, join(':', @info) ); + + + $systemGroupPresence{$system_group} =$presence ; + $systemGroupWidth{$system_group} =$width ; + $systemGroupDirection{$system_group} =$direction ; + unless( $systemGroupNames{$system_group}) {print "Group $system_group not defined in busDefinition \n"; } + } +# insert DRC checks here + + } + } + +$absDef_db->db_close(); + print "\n"; + } + + + + +
busdefs/check_busDefs Property changes : Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Index: busdefs/create_busdefs =================================================================== --- busdefs/create_busdefs (nonexistent) +++ busdefs/create_busdefs (revision 131) @@ -0,0 +1,90 @@ +eval 'exec `which perl` -S $0 ${1+"$@"}' + if 0; + +#/**********************************************************************/ +#/* */ +#/* ------- */ +#/* / SOC \ */ +#/* / GEN \ */ +#/* / TOOL \ */ +#/* ============== */ +#/* | | */ +#/* |____________| */ +#/* */ +#/* */ +#/* */ +#/* Author(s): */ +#/* - John Eaton, jt_eaton@opencores.org */ +#/* */ +#/**********************************************************************/ +#/* */ +#/* Copyright (C) <2010-2011> */ +#/* */ +#/* 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 */ +#/* */ +#/**********************************************************************/ + +use Getopt::Long; +use English; +use File::Basename; +use Cwd; +use XML::LibXML; +use lib './tools'; +use sys::lib; +use yp::lib; +use BerkeleyDB; + + +$OUTPUT_AUTOFLUSH = 1; # set autoflush of stdout to TRUE. + +my $parser = XML::LibXML->new(); +my $home = cwd(); + + +#/*********************************************************************************************/ +#/ */ +#/ */ +#/ */ +#/ */ +#/*********************************************************************************************/ + + +my @abstractionDefinitions = yp::lib::find_abstractionDefinitions(); + +my $version; +my $component; +my $library; +my $vendor; + + +foreach my $abstractionDefinition (@abstractionDefinitions) +{ + ( $vendor,$library, $component ,$version) = split ':', $abstractionDefinition; + print "AbsDef ${vendor} ${library} ${component} ${version} \n"; + $cmd = "./tools/busdefs/gen_busdef -vendor $vendor -library $library -component $component -version $version "; + if (system($cmd)) {} +} + + + + +
busdefs/create_busdefs Property changes : Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Index: install/Ubuntu_14.10/Makefile =================================================================== --- install/Ubuntu_14.10/Makefile (revision 130) +++ install/Ubuntu_14.10/Makefile (revision 131) @@ -14,6 +14,8 @@ sudo apt-get install -y cvs;\ sudo apt-get install -y subversion;\ sudo apt-get install -y git;\ + sudo apt-get install -y gitk;\ + sudo apt-get install -y git-gui;\ sudo apt-get install -y xutils-dev;\ sudo apt-get install -y tkcvs;\ sudo apt-get install -y perl-tk\ @@ -27,6 +29,9 @@ sudo apt-get install -y crasm;\ sudo apt-get install -y libverilog-perl;\ sudo apt-get install -y libxml-libxml-perl;\ + sudo apt-get install -y libxml-libusb-dev;\ + sudo apt-get install -y libc6-dev;\ + sudo apt-get install -y fxload;\ sudo apt-get install -y default-jre;\ sudo apt-get install -y gcc-4.4;\ sudo apt-get install -y g++;\ @@ -55,8 +60,37 @@ sudo apt-get install -y elfutils;\ sudo apt-get install -y perl-doc;\ sudo apt-get install -y synaptic;\ - sudo apt-get install -y libberkeleydb-perl;\ - sudo sed -i "s/enabled=1/enabled=0/g" /etc/default/apport;\ + sudo apt-get install -y libberkeleydb-perl;\ + sudo apt-get install -y libscalar-util-numeric-perl;\ + sudo apt-get install -y libparallel-forkmanager-perl;\ ) + + +.PHONY virtualbox: +virtualbox: + (\ + sudo apt-get install -y virtualbox;\ + sudo apt-get install -y virtualbox-dkms;\ + sudo apt-get install -y virtualbox-guest-dkms;\ + sudo apt-get install -y virtualbox-guest-additions-iso;\ + sudo apt-get install -y virtualbox-guest-utils;\ + sudo apt-get install -y virtualbox-guest-x11;\ + sudo apt-get install -y virtualbox-qt;\ + ) + + + + +.PHONY nvidia: +nvidia: + (\ + sudo apt-get install -y nvidia-331;\ + ) + +.PHONY nuizy: +nuizy: + (\ + sudo apt-get install gcc g++ python perl emacs openjdk-7-jdk gtkwave imagemagick libsdl2-dev;\ + ) \ No newline at end of file
/lint/sim_main2.cpp
67,7 → 67,7
}
if (Verilated::gotFinish()) exit(0);
timepassed++;
i = i++;
i++;
if(timepassed > timeout)
{
strcpy(result,fail);
/verilog/gen_verilog
51,11 → 51,14
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.
 
 
67,7 → 70,7
"envidentifier=s" => \$envidentifier,
"prefix=s" => \$prefix,
"vendor=s" => \$vendor,
"project=s" => \$project,
"library=s" => \$library,
"version=s" => \$version,
"component=s" => \$component,
"dest_dir=s" => \$dest_dir,
74,7 → 77,7
"destination=s" => \$destination,
"configuration=s" => \$configuration,
"autodoc=s" => \$autodoc,
"fragment","no_port","local_parameters","tb","debug","verbose","interface_only","html"
"fragment","no_port","local_parameters","tb","debug","verbose","interface_only","top"
) || die "(use '$program_name -h' for help)";
 
 
82,27 → 85,20
## Help option
##############################################################################
if ( $opt_h or $opt_help )
{ print "\n gen_verilog -envidentifier {sim/syn} -prefix /work -vendor vendor_name -project project_name -component component_name -version version_name -fragment -no_port -local_parameters -destination destination -configuration configuration -dest_dir ../verilog";
print "\n";
{ print "\n gen_verilog -envidentifier {sim/syn} -prefix /work -vendor vendor_name -library library_name -component component_name -version version_name -fragment -no_port -local_parameters -destination destination -configuration configuration -dest_dir ../verilog \n";
exit 1;
}
 
my $main_module_name = yp::lib::get_module_name($vendor,$library,$component,$version) ;
 
 
my $main_module_name = yp::lib::get_module_name($vendor,$project,$component,$version) ;
 
 
 
 
#############################################################################
##
##
#############################################################################
 
 
$home = cwd();
 
my $projects_dir = "/projects";
 
my $variant;
my $view;
 
112,50 → 108,31
my $interface_in_size =0;
my $interface_out_size =0;
 
if($version) {$variant = "${component}_${version}";}
else {$variant = "${component}";}
 
 
if($version) {$variant = "${component}_${version}";}
else {$variant = "${component}";}
 
unless($destination) { $destination = $variant;}
unless($autodoc) { $autodoc = "/Geda";}
 
print "\n GEN_verilog $prefix $vendor $project $component $version $configuration $dest_dir $destination \n";
print "\n GEN_verilog -envidentifier $envidentifier -prefix $prefix -vendor $vendor -library $library -component $component -version $version -configuration $configuration -dest_dir $dest_dir -destination $destination \n";
 
my $lib_comp_sep = yp::lib::find_lib_comp_sep($vendor,$library,$component);
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,$project,$component);
my $comp_xml_sep = yp::lib::find_comp_xml_sep($vendor,$project,$component,$version);
 
 
 
 
my $parser = XML::LibXML->new();
 
my $socgen_file = $parser->parse_file(yp::lib::find_componentConfiguration($vendor,$project,$component));
my $spirit_component_file = $parser->parse_file(yp::lib::find_ipxact_component($vendor,$project,$component,$version));
my $socgen_file = $parser->parse_file(yp::lib::find_componentConfiguration($vendor,$library,$component));
my $spirit_component_file = $parser->parse_file(yp::lib::find_ipxact_component($vendor,$library,$component,$version));
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;
}
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'))
{
my($Xview_name) = $X_view->findnodes('./spirit:name/text()')->to_literal ;
169,13 → 146,10
}
 
 
 
 
 
my $path = "${home}${prefix}/${vendor}__${project}${lib_comp_sep}${component}${comp_xml_sep}/${dest_dir}";
my $path = "${home}${prefix}/${vendor}__${library}${lib_comp_sep}${component}${comp_xml_sep}/${dest_dir}";
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}__${library}${lib_comp_sep}${component}${comp_xml_sep}/${dest_dir}/${view}";
mkdir $path,0755 unless( -e $path );
 
my @filelist_hier = ();
186,94 → 160,50
 
 
 
unless ($socgen_file) { print "No socgen ip file \n";};
 
if($opt_tb )
{
print "Creating testbench for $vendor $project $component $version \n";
#/******************************************************************************************/
#/* */
#/* if local parameters check for uplifts */
#/* */
#/******************************************************************************************/
 
if($opt_local_parameters)
{
# print "XXX Reading local parameters \n";
foreach my $socgen_cfg ($socgen_file->findnodes("//socgen:componentConfiguration/socgen:syn/socgen:ise/socgen:chip/socgen:parameters/socgen:parameter"))
{
my($ise_param_value) = $socgen_cfg ->findnodes('./socgen:value/text()')->to_literal ;
my($ise_param_name) = $socgen_cfg ->findnodes('./socgen:name/text()')->to_literal ;
my($ise_new_version ) = $socgen_cfg ->findnodes('../../socgen:version/text()')->to_literal ;
if($variant eq "${component}_${ise_new_version}")
{
# print "XXXXXXX $ise_param_name $ise_param_value $ise_new_version \n";
unless(defined $parameter_values{$ise_param_name}) {push ( @parameters, "$ise_param_name");};
$parameter_values{$ise_param_name} = $ise_param_value;
}
}
 
my $path ="${home}${projects_dir}/${vendor}/${project}${sim_library_path}";
mkdir $path,0755 unless( -e $path );
 
my $path ="${home}${projects_dir}/${vendor}/${project}${sim_library_path}/testbenches";
mkdir $path,0755 unless( -e $path );
}
 
$path ="${home}${projects_dir}/${vendor}/${project}${sim_library_path}/testbenches/xml";
mkdir $path,0755 unless( -e $path );
 
 
$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";
 
print TB_COMP_FILE "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
print TB_COMP_FILE "<!-- \n";
print TB_COMP_FILE "// //\n";
print TB_COMP_FILE "// Generated File Do Not EDIT //\n";
print TB_COMP_FILE "// //\n";
print TB_COMP_FILE "// regen by adding -tb to gen_verilog script //\n";
print TB_COMP_FILE "// //\n";
print TB_COMP_FILE "--> \n";
print TB_COMP_FILE "<spirit:component\n";
print TB_COMP_FILE "xmlns:spirit=\"http://www.spiritconsortium.org/XMLSchema/SPIRIT/1685-2009\"\n";
print TB_COMP_FILE "xmlns:socgen=\"http://opencores.org\"\n";
print TB_COMP_FILE "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n";
print TB_COMP_FILE "xsi:schemaLocation=\"http://www.spiritconsortium.org/XMLSchema/SPIRIT/1685-2009\n";
print TB_COMP_FILE "http://www.spiritconsortium.org/XMLSchema/SPIRIT/1685-2009/index.xsd\">\n";
print TB_COMP_FILE "<spirit:vendor>${vendor}</spirit:vendor>\n";
print TB_COMP_FILE "<spirit:library>${project}</spirit:library>\n";
print TB_COMP_FILE "<spirit:name>${component}</spirit:name>\n";
print TB_COMP_FILE "<spirit:version>${version}_dut.params</spirit:version>\n";
 
 
$outfile ="${home}${projects_dir}/${vendor}/${project}${sim_library_path}/testbenches/xml/${variant}_dutg.design.xml";
open TB_DESIGN_FILE,">$outfile" or die "unable to open $outfile";
 
 
print TB_DESIGN_FILE "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
print TB_DESIGN_FILE "<!-- \n";
print TB_DESIGN_FILE "// //\n";
print TB_DESIGN_FILE "// Generated File Do Not EDIT //\n";
print TB_DESIGN_FILE "// //\n";
print TB_DESIGN_FILE "// regen by adding -tb to gen_verilog script //\n";
print TB_DESIGN_FILE "// //\n";
print TB_DESIGN_FILE "--> \n";
print TB_DESIGN_FILE "<spirit:design\n";
print TB_DESIGN_FILE "xmlns:spirit=\"http://www.spiritconsortium.org/XMLSchema/SPIRIT/1685-2009\"\n";
print TB_DESIGN_FILE "xmlns:socgen=\"http://opencores.org\"\n";
print TB_DESIGN_FILE "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n";
print TB_DESIGN_FILE "xsi:schemaLocation=\"http://www.spiritconsortium.org/XMLSchema/SPIRIT/1685-2009\n";
print TB_DESIGN_FILE "http://www.spiritconsortium.org/XMLSchema/SPIRIT/1685-2009/index.xsd\">\n";
print TB_DESIGN_FILE "<spirit:vendor>${vendor}</spirit:vendor>\n";
print TB_DESIGN_FILE "<spirit:library>${project}</spirit:library>\n";
print TB_DESIGN_FILE "<spirit:name>${component}</spirit:name>\n";
print TB_DESIGN_FILE "<spirit:version>${version}_dutg.design</spirit:version>\n";
 
}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
#/**********************************************************************/
#/* */
#/******************************************************************************************/
#/* */
#/* if configuration set then read parameters from socgen:componentConfiguration file */
#/* */
#/**********************************************************************/
#/* */
#/******************************************************************************************/
 
if($configuration)
{
# print "XXX Reading configuration $configuration \n";
unless ($socgen_file) { print "No socgen ip file \n";};
 
 
foreach my $socgen_cfg ($socgen_file->findnodes("//socgen:componentConfiguration/socgen:configurations/socgen:configuration/socgen:parameters/socgen:parameter/socgen:name"))
{
my($param_name) = $socgen_cfg->findnodes('./text()')->to_literal ;
281,17 → 211,28
my($config_name) = $socgen_cfg->findnodes('../../../socgen:name/text()')->to_literal ;
if($config_name eq $configuration )
{
unless(defined $parameter_values{$param_name}) {push ( @parameters, "$param_name");};
$parameter_values{$param_name} = ${param_value};
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);
 
 
 
 
 
 
 
 
 
#/**********************************************************************/
#/* */
#/* Every hier cell is constructed from the ipxact file with seperate */
306,8 → 247,9
foreach my $comp_view ($spirit_component_file->findnodes("//spirit:component/spirit:model/spirit:views/spirit:view/spirit:name[text() = '$view']" ))
{
my($view_fileset_name) = $comp_view->findnodes('../spirit:fileSetRef/spirit:localName/text()')->to_literal ;
$outfile ="${home}${prefix}/${vendor}__${project}${lib_comp_sep}${component}${comp_xml_sep}/${dest_dir}/${view}/${destination}";
$outfile ="${home}${prefix}/${vendor}__${library}${lib_comp_sep}${component}${comp_xml_sep}/${dest_dir}/${view}/${destination}";
open DEST_FILE,">$outfile" or die "unable to open $outfile";
 
unless ($opt_fragment){ print DEST_FILE "\n module \n\n $main_module_name \n ";}
 
#/*****************************************************************************/
324,267 → 266,25
 
@inst_conns = ( );
 
my @decl_names = ();
my %decl_dirs = ();
my %decl_types = ();
my %decl_vector = ();
my %decl_lefts = ();
my %decl_rights = ();
 
 
# component file
 
parse_component_file($spirit_component_file);
if($opt_verbose){print "parse design files \n"; }
parse_design_files($spirit_component_file);
if($opt_verbose){print "process design files \n"; }
if($opt_verbose){print "parse design files \n"; }
parse_design_files($spirit_component_file);
if($opt_verbose){print "process design files \n"; }
process_design_files($spirit_component_file);
if($opt_verbose){print "process wire_decs \n"; }
if($opt_verbose){print "process wire_decs \n"; }
 
#/**********************************************************************/
#/* */
#/* pack ports and nodes into hashes */
#/* Add any and all global parameters with their default values */
#/* */
#/**********************************************************************/
 
 
@wire_decs = sys::lib::trim_sort(@wire_decs);
foreach $line (@wire_decs)
{
$_ = $line;
if(/:::(\S+):::(\S+):::(\S+):::(\S+):::(\S+):::(\S+):::(\S+):::(\S+):::(\S+):::(\S+):::(\S+):::(\S+):::/)
{
$q_index = $1;
$q_node_name = $2;
$q_direction = $3;
$q_type = $4;
$q_vector = $5;
$q_left = $6;
$q_right = $7;
$q_instance = $8;
$q_depth = $9;
$q_phy_name = $10;
$q_busref_name = $11;
$q_abslog_name = $12;
 
 
if($opt_debug ){print "XXXXX-- $line \n ";}
 
push ( @decl_names,$q_index);
 
 
if( $decl_pnames{$q_index})
{
if( $decl_pnames{$q_index} eq ${q_index})
{
$decl_pnames{$q_index} = "${q_node_name}";
}
}
else
{
$decl_pnames{$q_index} = "${q_node_name}";
}
 
 
if( $decl_dirs{$q_index})
{
if( $decl_dirs{$q_index} eq "node")
{
$decl_dirs{$q_index} = "${q_direction}";
}
}
else
{
$decl_dirs{$q_index} = "${q_direction}";
}
 
 
 
if( $decl_types{$q_index})
{
if( $decl_types{$q_index} eq "wire")
{
$decl_types{$q_index} = "${q_type}";
}
}
else
{
$decl_types{$q_index} = "${q_type}";
}
 
 
 
 
 
if( $decl_vector{$q_index})
{ unless( $decl_vector{$q_index} eq "vector"){ $decl_vector{$q_index} = "${q_vector}"; }}
else { $decl_vector{$q_index} = "${q_vector}"; }
 
if( $q_vector eq "vector" )
{
if ( defined $decl_lefts{$q_index})
{
 
 
$_ = $q_left;
if(/(\D+)/)
{
$_ = $decl_lefts{$q_index};
if(/(\D+)/)
{
print "Info: $variant :: $q_node_name : $q_left is NOT a number $decl_lefts{$q_index} is NOT a number \n";
#if($decl_lefts{$q_index} <= $q_left ) {$decl_lefts{$q_index} = $q_left;}
}
else
{
$decl_lefts{$q_index} = $q_left;
}
}
else
{
$_ = $decl_lefts{$q_index};
if(/(\D+)/)
{
#print "WARNING $variant :: $q_node_name : $q_left is a number $decl_lefts{$q_index} is NOT a number \n";
#if($decl_lefts{$q_index} <= $q_left ) {$decl_lefts{$q_index} = $q_left;}
}
else
{
#print "WARNING $variant :: $q_node_name : $q_left is a number $decl_lefts{$q_index} is a number \n";
if($decl_lefts{$q_index} <= $q_left ) {$decl_lefts{$q_index} = $q_left;}
}
}
unless (defined $decl_rights{$q_index}) {$decl_rights{$q_index} = $q_right;}
if($decl_rights{$q_index} >= $q_right ) {$decl_rights{$q_index} = $q_right;}
}
else
{
$decl_lefts{$q_index} = $q_left;
$decl_rights{$q_index} = $q_right;
}
}
}
}
@decl_names = sys::lib::trim_sort(@decl_names);
 
 
 
 
 
#/**********************************************************************/
#/* */
#/* All port and signal info is now loaded in hashes */
#/* Resort on physical name */
#/* Print out module header , parameters and ports */
#/* */
#/**********************************************************************/
 
 
 
 
foreach my $decl_name (@decl_names)
 
{
 
my $phy_name = $decl_pnames{$decl_name};
 
unless ($phy_name) {$phy_name =$decl_name }
 
push ( @phy_names,$phy_name);
 
 
if($opt_debug ){print "XX-p $decl_name - $decl_vector{$decl_name} - $decl_lefts{$decl_name} - $decl_rights{$decl_name} -- $phy_name - $phy_vector{$phy_name} - $phy_lefts{$phy_name} - $phy_rights{$phy_name} \n ";}
 
 
if( $phy_dirs{$phy_name})
{
if( $phy_dirs{$phy_name} eq "node")
{
$phy_dirs{$phy_name} = "$decl_dirs{$decl_name}";
}
}
else
{
$phy_dirs{$phy_name} = "$decl_dirs{$decl_name}";
}
 
if( $phy_types{$phy_name})
{
if( $phy_types{$phy_name} eq "wire")
{
$phy_types{$phy_name} = "$decl_types{$decl_name}";
}
}
else
{
$phy_types{$phy_name} = "$decl_types{$decl_name}";
}
 
if( $phy_vector{$phy_name})
{ unless( $phy_vector{$phy_name} eq "vector"){ $phy_vector{$phy_name} = "$decl_vector{$decl_name}"; }}
else { $phy_vector{$phy_name} = "$decl_vector{$decl_name}"; }
 
if( $decl_vector{$decl_name} eq "vector" )
{
if ( defined $phy_lefts{$phy_name})
{
$_ = $phy_lefts{$phy_name};
if(/(\D+)/)
{
$_ = $phy_lefts{$phy_name};
if(/(\D+)/)
{
}
else
{
$phy_lefts{$phy_name} = $decl_lefts{$decl_name};
}
}
else
{
$_ = $phy_lefts{$phy_name};
if(/(\D+)/)
{
}
else
{
if($phy_lefts{$phy_name} <= $decl_lefts{$decl_name} ) {$phy_lefts{$phy_name} = $decl_lefts{$decl_name};}
}
}
unless ( defined $phy_rights{$phy_name}) {$phy_rights{$phy_name} = $decl_rights{$decl_name};}
if($phy_rights{$phy_name} >= $decl_rights{$decl_name} ) {$phy_rights{$phy_name} = $decl_rights{$decl_name};}
}
else
{
$phy_lefts{$phy_name} = $decl_lefts{$decl_name};
$phy_rights{$phy_name} = $decl_rights{$decl_name};
}
}
if($opt_debug ){print "XX-q $decl_name - $decl_vector{$decl_name} - $decl_lefts{$decl_name} - $decl_rights{$decl_name} -- $phy_name - $phy_vector{$phy_name} - $phy_lefts{$phy_name} - $phy_rights{$phy_name} \n ";}
 
 
}
 
 
 
 
@phy_names = sys::lib::trim_sort(@phy_names);
 
 
 
 
 
 
 
#/**********************************************************************/
#/* */
#/* Add any and all global parameters with their default values */
#/* */
#/**********************************************************************/
unless ($opt_local_parameters)
unless ($opt_local_parameters)
{
my $first = 1;
foreach my $parameter_name (@parameters)
602,41 → 302,47
}
 
#/**********************************************************************/
#/* */
#/* sort all ports with their type, size and direction */
#/* */
#/**********************************************************************/
#/**********************************************************************/
#/* */
#/* sort all ports with their type, size and direction */
#/* */
#/**********************************************************************/
 
my @port_list = ();
my @wire_nodes = ();
my $key;
my $value;
 
my @port_list = ();
foreach my $signal (@signals)
{
( ${port_name},${direction},${type},${vector},${left},${right}) = split ':', $signal;
 
if( $direction ne "node" )
{
my $q_width = " ";
if( ${vector} eq "vector" ) { $q_width = "[ ${left} : ${right}]"; }
push (@port_list, "${direction} ${type} $q_width ${port_name}");
}
else
{
my $q_width = " ";
if( ${vector} eq "vector" ) { $q_width = "[ $left : $right]";}
if( $direction eq "node" ) { push @wire_nodes, "$type $q_width ${port_name};";}
}
}
 
foreach $x_name (@phy_names)
{
my $q_width = " ";
if( $phy_vector{$x_name} eq "vector" ) { $q_width = "[ $phy_lefts{$x_name} : $phy_rights{$x_name}]"}
@port_list = sys::lib::trim_sort(@port_list);
 
if( $phy_dirs{$x_name} ne "node" )
{
push (@port_list, "$phy_dirs{$x_name} $phy_types{$x_name} $q_width ${x_name}");
}
}
#/**********************************************************************/
#/* */
#/* Now add all ports with their type, size and direction */
#/* */
#/**********************************************************************/
 
@port_list = sys::lib::trim_sort(@port_list);
 
 
#/**********************************************************************/
#/* */
#/* Now add all ports with their type, size and direction */
#/* */
#/**********************************************************************/
print DEST_FILE "\n ";
$first = 1;
print DEST_FILE "\n ";
$first = 1;
foreach $port_line (@port_list)
foreach $port_line (@port_list)
{
if($first)
{
650,560 → 356,46
}
 
if ($first == 0) { print DEST_FILE ");\n\n\n\n"; }
elsif ($opt_no_port) { print DEST_FILE "\n\n\n\n"; }
else { print DEST_FILE "();\n\n\n\n";}
if ($first == 0) { print DEST_FILE ");\n\n\n\n"; }
elsif ($opt_no_port) { print DEST_FILE "\n\n\n\n"; }
else { print DEST_FILE "();\n\n\n\n";}
 
 
 
 
 
#/**********************************************************************/
#/* */
#/* print wire decs for testbench */
#/* */
#/**********************************************************************/
 
 
foreach $x_name (@phy_names)
{
 
if( $phy_dirs{$x_name} ne "node" )
{
if ( $phy_vector{$x_name} eq "vector" )
{
push (@tb_adhoc_list, "<spirit:adHocConnection>\n<spirit:name>${x_name}<\/spirit:name>\n<spirit:externalPortReference spirit:portRef=\"${x_name}\" spirit:left=\"${phy_lefts{$x_name}}\" spirit:right=\"${phy_rights{$x_name}}\" \/>\n<spirit:internalPortReference spirit:componentRef=\"dut\" spirit:portRef=\"${x_name}\" \/>\n<\/spirit:adHocConnection>\n" );
}
else
{
push (@tb_adhoc_list, "<spirit:adHocConnection>\n<spirit:name>${x_name}<\/spirit:name>\n<spirit:externalPortReference spirit:portRef=\"${x_name}\" \/>\n<spirit:internalPortReference spirit:componentRef=\"dut\" spirit:portRef=\"${x_name}\" \/>\n<\/spirit:adHocConnection>\n" );
}
 
}
 
}
 
@tb_adhoc_list = sys::lib::trim_sort(@tb_adhoc_list);
print TB_DESIGN_FILE "<spirit:adHocConnections>\n\n";
 
foreach $adhoc_line (@tb_adhoc_list)
{
 
print TB_DESIGN_FILE "${adhoc_line}\n";
 
}
 
print TB_DESIGN_FILE "\n</spirit:adHocConnections>\n";
 
 
 
 
 
 
#/**********************************************************************/
#/* */
#/* interfaces for html */
#/* */
#/**********************************************************************/
 
 
foreach $x_name (@phy_names)
{
 
if( $phy_dirs{$x_name} ne "node" )
{
 
my $interface_name;
my $interface_description;
 
foreach my $socgen_cfg ($socgen_file->findnodes("//socgen:componentConfiguration/socgen:doc/socgen:interfaces/socgen:interface/socgen:name[text() = '$x_name']"))
{
$interface_description = $socgen_cfg->findnodes('../socgen:description/text()')->to_literal ;
}
 
 
 
 
if ( $phy_vector{$x_name} eq "vector" )
{ $interface_name = "${x_name}[${phy_lefts{$x_name}}:${phy_rights{$x_name}} ]" ; }
else
{ $interface_name = "${x_name}"; }
 
 
 
if( $phy_dirs{$x_name} eq "input" )
{ $interface_in_count = $interface_in_count +1 ;
if(length($interface_name) >= $interface_in_size ){$interface_in_size = length($interface_name) };
};
 
if( $phy_dirs{$x_name} eq "output" )
{ $interface_out_count = $interface_out_count +1 ;
if(length($interface_name) >= $interface_out_size ){$interface_out_size = length($interface_name) };
 
};
if( $phy_dirs{$x_name} eq "inout" )
{
$interface_out_count = $interface_out_count +1 ;
if(length($interface_name) >= $interface_out_size ){$interface_out_size = length($interface_name) };
 
};
 
 
 
 
 
 
 
push (@html_interface_list," <tr> \n <td style=\"vertical-align: top;\">${interface_name}<br> </td> \n <td style=\"vertical-align: top;\">$phy_dirs{$x_name}<br> </td> \n <td style=\"vertical-align: top;\">${interface_description}<br> </td> \n </tr> \n" );
 
 
 
 
}
 
}
 
 
 
 
 
 
 
 
 
 
 
 
#/**********************************************************************/
#/* */
#/* Add parameters to html file */
#/* */
#/**********************************************************************/
 
foreach my $parameter_name (@parameters)
{
my $parameter_value = $parameter_values{$parameter_name};
my $parameter_description = $parameter_descriptions{$parameter_name};
push (@html_parameter_list," <tr> \n <td style=\"vertical-align: top;\">${parameter_name}<br> </td> \n <td style=\"vertical-align: top;\">${parameter_value}<br> </td> \n <td style=\"vertical-align: top;\">${parameter_description}<br></td> \n </tr> \n");
}
 
 
 
 
 
 
 
#/**********************************************************************/
#/* */
#/* Add parameters to dut */
#/* */
#/**********************************************************************/
print TB_DESIGN_FILE "<spirit:componentInstances>\n\n";
 
 
 
 
print TB_DESIGN_FILE "<spirit:componentInstance>\n";
print TB_DESIGN_FILE "<spirit:instanceName>dut</spirit:instanceName>\n";
print TB_DESIGN_FILE "<spirit:componentRef spirit:vendor=\"${vendor}\" spirit:library=\"${project}\" spirit:name=\"$component\" spirit:version=\"${version}\" />\n";
print TB_DESIGN_FILE "<spirit:configurableElementValues>\n";
 
 
foreach my $parameter_name (@parameters)
{
print TB_DESIGN_FILE " <spirit:configurableElementValue spirit:referenceId=\"${parameter_name}\">${parameter_name}<\/spirit:configurableElementValue>\n";
}
#/**********************************************************************/
#/* */
#/* Add any and all local parameters with their default values */
#/* */
#/**********************************************************************/
print TB_DESIGN_FILE "</spirit:configurableElementValues>\n";
print TB_DESIGN_FILE "</spirit:componentInstance>\n";
print TB_DESIGN_FILE "</spirit:componentInstances>\n";
print TB_DESIGN_FILE "</spirit:design>\n";
 
 
 
 
#/**********************************************************************/
#/* */
#/* Add parameters to comp */
#/* */
#/**********************************************************************/
print TB_COMP_FILE "<spirit:model>\n\n";
print TB_COMP_FILE " <spirit:views> \n";
print TB_COMP_FILE " \n";
print TB_COMP_FILE " <spirit:view> \n";
print TB_COMP_FILE " <spirit:name>Dut</spirit:name> \n";
print TB_COMP_FILE " <spirit:envIdentifier></spirit:envIdentifier> \n";
print TB_COMP_FILE " <spirit:hierarchyRef spirit:vendor=\"${vendor}\" \n";
print TB_COMP_FILE " spirit:library=\"${project}\" \n";
print TB_COMP_FILE " spirit:name=\"${component}\" \n";
print TB_COMP_FILE " spirit:version=\"${version}_dutg.design\"/> \n";
print TB_COMP_FILE " </spirit:view> \n";
print TB_COMP_FILE " </spirit:views> \n";
print TB_COMP_FILE "<spirit:modelParameters>\n";
 
 
 
 
 
if ($opt_local_parameters)
{
foreach my $parameter_name (@parameters)
{
my $parameter_value = $parameter_values{$parameter_name};
print TB_COMP_FILE " <spirit:modelParameter><spirit:name>${parameter_name}</spirit:name><spirit:value>${parameter_value}</spirit:value></spirit:modelParameter>\n";
my $parameter_value = $parameter_values{${parameter_name}};
print DEST_FILE "parameter ${parameter_name} = ${parameter_value};\n";
}
print TB_COMP_FILE "</spirit:modelParameters>\n";
print TB_COMP_FILE "</spirit:model>\n";
print TB_COMP_FILE "</spirit:component>\n";
}
 
@wire_nodes = sys::lib::trim_sort(@wire_nodes);
 
 
 
 
 
 
 
 
if($opt_html )
{
print "Creating documentation for $vendor $project $component $version \n";
my $path ="${home}${projects_dir}/${vendor}/${project}${doc_library_path}";
mkdir $path,0755 unless( -e $path );
 
 
my $path ="${home}${projects_dir}/${vendor}/${project}${doc_library_path}${autodoc}";
mkdir $path,0755 unless( -e $path );
 
 
 
$path ="${home}${projects_dir}/${vendor}/${project}${doc_library_path}${autodoc}/html";
mkdir $path,0755 unless( -e $path );
 
$path ="${home}${projects_dir}/${vendor}/${project}${doc_library_path}/html";
mkdir $path,0755 unless( -e $path );
 
 
 
$outfile ="${home}${projects_dir}/${vendor}/${project}${doc_library_path}/html/${main_module_name}.html";
 
unless( -e $outfile )
{
my $cmd = "cp ${home}/tools/documentation/template.html $outfile ";
if (system($cmd)) {}
};
 
$outfile ="${home}${projects_dir}/${vendor}/${project}${doc_library_path}${autodoc}/html/${main_module_name}.html";
open HTML_FILE,">$outfile" or die "unable to open $outfile";
 
 
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($interface_in_count >= $interface_out_count) {$max_lines = $interface_in_count }
else {$max_lines = $interface_out_count }
 
$scale = 1.0000;
$max_lines =(($max_lines *24)+110)* $scale;
$max_width = $interface_in_size + $interface_out_size;
$max_width =(($max_width * 10) + 343) * $scale ;
 
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 $html_line (@html_parameter_list)
{
print HTML_FILE "${html_line}\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 $html_line (@html_interface_list)
{
print HTML_FILE "${html_line}\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,$project,$component,$version);
 
foreach my $sd_file (@spirit_design_files)
unless ($opt_interface_only)
{
foreach my $wire_node (@wire_nodes)
{
print DEST_FILE "${wire_node}\n";
}
 
$_ = $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("//spirit:design/spirit:componentInstances/spirit:componentInstance/spirit:instanceName"))
{
#/**********************************************************************/
#/* */
#/* Lookup VLNV for each instantiated component */
#/* */
#/**********************************************************************/
 
 
my($instance_name) = $x_name ->findnodes('./text()')->to_literal ;
my($vendor_name) = $x_name ->findnodes('../spirit:componentRef/@spirit:vendor')->to_literal ;
my($library_name) = $x_name ->findnodes('../spirit:componentRef/@spirit:library')->to_literal ;
my($component_name) = $x_name ->findnodes('../spirit:componentRef/@spirit:name')->to_literal ;
my($version_name) = $x_name ->findnodes('../spirit:componentRef/@spirit: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";
 
}
 
 
 
 
 
 
 
 
#/**********************************************************************/
#/* */
#/* Add any and all local parameters with their default values */
#/* Dump everything from the ip-xact files into component */
#/* */
#/**********************************************************************/
if ($opt_local_parameters)
{
foreach my $parameter_name (@parameters)
{
my $parameter_value = $parameter_values{${parameter_name}};
print DEST_FILE "parameter ${parameter_name} = ${parameter_value};\n";
}
}
#/**********************************************************************/
#/* */
#/* Add all internal wires and regs with their sizes */
#/* */
#/**********************************************************************/
my @wire_nodes = ();
 
 
foreach $x_name (@phy_names)
{
my $q_width = " ";
if( $phy_vector{$x_name} eq "vector" ){ $q_width = "[ $phy_lefts{$x_name} : $phy_rights{$x_name}]"}
if( $phy_dirs{$x_name} eq "node" ) { push @wire_nodes, "$phy_types{$x_name} $q_width ${x_name};";}
}
 
@wire_nodes = sys::lib::trim_sort(@wire_nodes);
 
 
unless ($opt_interface_only)
{
foreach my $wire_node (@wire_nodes)
{
print DEST_FILE "${wire_node}\n";
}
 
print DEST_FILE "\n\n\n";
 
while( my $line_out = shift(@instantiations)) { print DEST_FILE "$line_out";}
 
 
 
 
#/**********************************************************************/
#/* */
#/* After all the data from the ip-xact file has been entered we now */
1221,7 → 413,7
if(($file_type eq "fragment")&& (($view_file eq $view_fileset_name)))
{
$SRCFILE ="${home}${prefix}/${vendor}__${project}${lib_comp_sep}${component}${comp_xml_sep}/${rtl_file}";
$SRCFILE ="${home}${prefix}/${vendor}__${library}${lib_comp_sep}${component}${comp_xml_sep}/${rtl_file}";
open(SRCFILE) or die("Could not open src file. $SRCFILE ");
foreach $line (<SRCFILE>)
{
1230,11 → 422,7
}
}
}
 
}
 
 
 
}
unless ($opt_fragment ) {print DEST_FILE "\n\n\n endmodule\n\n";}
}
1243,19 → 431,11
 
 
 
 
 
 
 
 
 
#/*********************************************************************************************/
#/ */
#/ this routine does not follow busses down into componentRef */
#/ */
#/ */
#/ */
#/ */
#/*********************************************************************************************/
 
 
1268,7 → 448,7
my $busref = pop(@params);
my $version = pop(@params);
my $component = pop(@params);
my $project = pop(@params);
my $library = pop(@params);
my $vendor = pop(@params);
 
my $home = cwd();
1275,7 → 455,7
 
my @out_stack = ();
 
if($opt_verbose){print "parse_busInterface $vendor $project $component $version \n"; }
if($opt_verbose){print "parse_busInterface $vendor $library $component $version \n"; }
 
 
 
1284,7 → 464,7
 
 
 
my @filelist = yp::lib::parse_component_brothers("$vendor","$project","$component","$version");
my @filelist = yp::lib::parse_component_brothers("$vendor","$library","$component","$version");
 
foreach $line (@filelist)
{
1291,14 → 471,14
$_ = $line;
if(/::(\S+)::(\S+)::(\S+)::(\S+)::/)
{
$new_project = $2;
$new_library = $2;
$new_component = $3;
$new_vendor = $1;
$new_version = $4;
 
# print " FFFFFFFFFFFFFFFF Brother $new_vendor $new_project $new_component $new_version \n" ;
# print " FFFFFFFFFFFFFFFF Brother $new_vendor $new_library $new_component $new_version \n" ;
 
my $spirit_component_file = $parser->parse_file(yp::lib::find_ipxact_component($new_vendor,$new_project,$new_component,$new_version));
my $spirit_component_file = $parser->parse_file(yp::lib::find_ipxact_component($new_vendor,$new_library,$new_component,$new_version));
 
 
my @mas_slave;
1308,6 → 488,7
foreach my $seek_type (@mas_slave)
{
 
#print "XXXXCX Component $new_vendor $new_library $new_component $new_version $seek_type \n";
 
foreach my $bus_iface ($spirit_component_file->findnodes("//spirit:component/spirit:busInterfaces/spirit:busInterface/spirit:${seek_type}"))
{
1318,69 → 499,63
my($fff_version) = $bus_iface->findnodes('../spirit:abstractionType/@spirit:version')->to_literal ;
 
 
if( $busref eq $fff_cname )
{
my $absDef_filename = yp::lib::get_absDef_db_filename($fff_vendor,$fff_library,$fff_name,$fff_version);
$absDef_db = new BerkeleyDB::Hash( -Filename => $absDef_filename, -Flags => DB_CREATE ) or die "Cannot open ${absDef_filename}: $!";
 
 
foreach my $port_face ($spirit_component_file->findnodes('//spirit:component/spirit:busInterfaces/spirit:busInterface/spirit:portMaps/spirit:portMap/spirit:logicalPort'))
{
 
my($fff_xxx_name) = $port_face->findnodes('../../../spirit:name/text()')->to_literal ;
 
my($fff_log_name) = $port_face->findnodes('./spirit:name/text()')->to_literal ;
my($fff_int_name) = $port_face->findnodes('../../../spirit:name/text()')->to_literal ;
my($fff_phy_name) = $port_face->findnodes('../spirit:physicalPort/spirit:name/text()')->to_literal ;
my($fff_type_name) = $port_face->findnodes('../spirit:physicalPort/spirit:wireTypeDefs/spirit:wireTypeDef/spirit:typeName/text()')->to_literal ;
my($fff_int_name) = $port_face->findnodes('../../../spirit:name/text()')->to_literal ;
 
my($fff_left_value) = $port_face->findnodes('../spirit:physicalPort/spirit:wire/spirit:vector/spirit:left/text()')->to_literal ;
my($fff_right_value) = $port_face->findnodes('../spirit:physicalPort/spirit:wire/spirit:vector/spirit:right/text()')->to_literal ;
 
unless ($fff_type_name) {$fff_type_name = "wire";};
 
if( ( $fff_xxx_name eq $busref) && ( $busref eq $fff_cname ) )
 
 
my $abs_data;
$absDef_db->db_get("${seek_type}__${fff_log_name}", $abs_data );
 
( $berk_name, $berk_presence,$berk_width,$fff_direction ) = split ':', $abs_data;
 
if( ( $fff_int_name eq $busref) )
{
$busInterfaceTest = 1;
# print "XXXCXX $fff_log_name $seek_type $fff_direction \n";
 
if($fff_left_value ne "")
{ push @out_stack, ":::${depth}:::${fff_log_name}:::${fff_phy_name}:::${fff_direction}:::${fff_type_name}:::vector:::${fff_left_value}:::${$fff_right_value}:::"; }
else
{ push @out_stack, ":::${depth}:::${fff_log_name}:::${fff_phy_name}:::${fff_direction}:::${fff_type_name}:::scaler:::none:::none:::"; }
 
}
 
my $spirit_abstractor_filename = yp::lib::find_ipxact_abstractionDefinition($fff_vendor,$fff_library,$fff_name,$fff_version);
}
 
unless($spirit_abstractor_filename){ print " $fff_vendor $fff_library $fff_name $fff_version \n"; }
# print "XXXCXX CLOSE ${fff_vendor}_${fff_library}_${fff_name}_${fff_version} \n";
 
 
my $spirit_abstractor_file = ($parser->parse_file($spirit_abstractor_filename ) ) || die "(OOPs $fff_vendor $fff_library $fff_name $fff_version )";
 
 
 
foreach my $abstr_view ($spirit_abstractor_file->findnodes("//spirit:abstractionDefinition/spirit:ports/spirit:port/spirit:logicalName[text() = '$fff_log_name']"))
{
 
my $fff_direction = "";
if ( $seek_type eq "master")
{
my($sss_m_dir) = $abstr_view->findnodes('../spirit:wire/spirit:onMaster/spirit:direction/text()')->to_literal ;
if ($sss_m_dir eq "in") { $sss_m_dir = "input";}
elsif ($sss_m_dir eq "out") { $sss_m_dir = "output";}
$fff_direction = $sss_m_dir;
}
$absDef_db->db_close();
 
elsif ( $seek_type eq "slave" )
{
my($sss_s_dir) = $abstr_view->findnodes('../spirit:wire/spirit:onSlave/spirit:direction/text()')->to_literal ;
if ($sss_s_dir eq "in") { $sss_s_dir = "input";}
elsif ($sss_s_dir eq "out") { $sss_s_dir = "output";}
}
 
$fff_direction = $sss_s_dir;
}
 
if($fff_left_value ne "")
{ push @out_stack, ":::${depth}:::${fff_log_name}:::${fff_phy_name}:::${fff_direction}:::${fff_type_name}:::vector:::${fff_left_value}:::${$fff_right_value}:::"; }
else
{ push @out_stack, ":::${depth}:::${fff_log_name}:::${fff_phy_name}:::${fff_direction}:::${fff_type_name}:::scaler:::none:::none:::"; }
 
}
}
 
}
}
 
 
}
 
}
 
 
1395,7 → 570,7
}
 
 
my @spirit_design_files = yp::lib::find_ipxact_design_files($vendor,$project,$component,$version);
my @spirit_design_files = yp::lib::find_ipxact_design_files($vendor,$library,$component,$version);
 
foreach my $sd_file (@spirit_design_files)
{
1430,6 → 605,7
my($component_name) = $x_name ->findnodes('../spirit:componentRef/@spirit:name')->to_literal ;
my($version_name) = $x_name ->findnodes('../spirit:componentRef/@spirit:version')->to_literal ;
$depth = $depth +1;
if($depth eq "3") {$depth = 2;}
@out_stack = parse_busInterface ($vendor_name, $library_name,$component_name,$version_name,$hierConn_busref_name,$depth );
}
}
1437,9 → 613,6
 
}
 
 
 
 
@out_stack = sys::lib::trim_sort(@out_stack);
return(@out_stack);
1476,13 → 649,9
my @params = @_;
my $spirit_component_file = pop(@params);
 
#print "\n";
 
 
 
 
 
 
foreach my $new_comp ($spirit_component_file->findnodes("//spirit:component/spirit:model/spirit:views/spirit:view/spirit:vendorExtensions/spirit:componentRef"))
{
my($new_vendor) = $new_comp->findnodes('./@spirit:vendor')->to_literal ;
1505,11 → 674,6
{
parse_design_file($parser->parse_file(yp::lib::find_ipxact_design($new_vendor,$new_library,$new_name,$new_version )) );
}
 
 
 
 
 
}
 
}
1623,20 → 787,8
#/* */
#/**********************************************************************/
foreach my $i_name ($spirit_design_file->findnodes("//spirit:design/spirit:vendorExtensions/socgen:nodes/socgen:node/spirit:name"))
{
my($node_name) = $i_name ->findnodes('./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_right) = $i_name ->findnodes('../spirit:wire/spirit:vector/spirit:right/text()')->to_literal ;
my($node_type) = $i_name ->findnodes('../spirit:typeName/text()')->to_literal ;
unless($node_busdef){ $node_busdef = $node_name; }
 
if( $node_left ne "" ) { push @wire_decs , ":::${node_busdef}:::${node_name}:::node:::${node_type}:::vector:::${node_left}:::${$node_right}:::none:::0:::${node_name}:::XXX:::${node_name}:::"; }
else { push @wire_decs , ":::${node_busdef}:::${node_name}:::node:::${node_type}:::scaler:::none:::none:::none:::0:::${node_name}:::XXX:::${node_name}:::"; }
 
}
 
 
 
1644,7 → 796,6
 
 
 
 
#/**********************************************************************/
#/* */
#/* Read each hierConnection and enter signals into wire_decs */
1665,37 → 816,67
#/**********************************************************************/
 
my($instance_name) = $x_name ->findnodes('./text()')->to_literal ;
my($vendor_name) = $x_name ->findnodes('../spirit:componentRef/@spirit:vendor')->to_literal ;
my($library_name) = $x_name ->findnodes('../spirit:componentRef/@spirit:library')->to_literal ;
my($component_name) = $x_name ->findnodes('../spirit:componentRef/@spirit:name')->to_literal ;
my($version_name) = $x_name ->findnodes('../spirit:componentRef/@spirit:version')->to_literal ;
my($vendor_name) = $x_name ->findnodes('../spirit:componentRef/@spirit:vendor')->to_literal ;
my($library_name) = $x_name ->findnodes('../spirit:componentRef/@spirit:library')->to_literal ;
my($component_name) = $x_name ->findnodes('../spirit:componentRef/@spirit:name')->to_literal ;
my($version_name) = $x_name ->findnodes('../spirit:componentRef/@spirit:version')->to_literal ;
 
if( "$instance_name" eq "$hierConn_comref_name" )
{
my @filelist_sub = parse_busInterface($vendor_name, $library_name,$component_name,$version_name,$hierConn_busref_name,"1" );
#/**********************************************************************/
#/* */
#/* follow bus all the way to it's source */
#/* */
#/**********************************************************************/
 
foreach $xxline (@filelist_sub)
{
$_ = $xxline;
if(/:::(\S+):::(\S+):::(\S+):::(\S+):::(\S+):::(\S+):::(\S+):::(\S+):::/)
{
$k_depth = $1;
$k_log_name = $2;
$k_phy_name = $3;
$k_direction = $4;
$k_type = $5;
$k_vector = $6;
$k_left = $7;
$k_right = $8;
push @wire_decs,":::${hierConn_name}_${k_log_name}:::${hierConn_name}_${k_log_name}:::${k_direction}:::wire:::${k_vector}:::${k_left}:::${k_right}:::${hierConn_comref_name}:::${k_depth}:::${k_phy_name}:::${hierConn_busref_name}:::${k_log_name}:::";
}
}
 
my @busses = yp::lib::get_busses($vendor_name,$library_name,$component_name,$version_name);
 
foreach $line (@busses)
{
my $x_name;
my $depth;
my $busref;
my $conn;
my $phy_name;
my $log_name;
my $direction;
my $type;
my $vector;
my $left;
my $right;
 
 
( ${busref},${conn},${phy_name},${log_name},${direction},${type},${vector},${left},${right}) = split ':::', $line;
 
if(${busref} eq ${hierConn_busref_name} )
{
 
if("${hierConn_name}_${log_name}" eq ${phy_name})
 
{
$depth = 2;
$x_name = $conn;
}
else
{
$depth = 1;
$x_name = $phy_name;
}
 
 
# print "QQQQQQQQD:::${phy_name}:::${phy_name}:::${direction}:::${type}:::${vector}:::${left}:::${right}:::${hierConn_comref_name}:::3:::${log_name}:::${busref}:::${conn}::: \n";
 
# print "QQQQQQQQF:::${hierConn_name}_${log_name}:::${hierConn_name}_${log_name}:::${direction}:::wire:::${vector}:::${left}:::${right}:::${hierConn_comref_name}:::${depth}:::${x_name}:::${hierConn_busref_name}:::${log_name}::: \n";
 
 
push @wire_decs,":::${hierConn_name}_${log_name}:::${hierConn_name}_${log_name}:::${direction}:::wire:::${vector}:::${left}:::${right}:::${hierConn_comref_name}:::${depth}:::${x_name}:::${hierConn_busref_name}:::${log_name}:::";
 
}
}
 
 
 
 
 
}
}
}
 
1732,41 → 913,47
my($component_name) = $x_name ->findnodes('../spirit:componentRef/@spirit:name')->to_literal ;
my($version_name) = $x_name ->findnodes('../spirit:componentRef/@spirit:version')->to_literal ;
 
 
 
if( "$instance_name" eq "$hierConn_comref_name" )
{
my @busses = yp::lib::get_busses($vendor_name,$library_name,$component_name,$version_name);
 
foreach $line (@busses)
{
# print "YTYTYT $line \n";
my $x_name;
my $depth;
my $busref;
my $conn;
my $phy_name;
my $log_name;
my $direction;
my $type;
my $vector;
my $left;
my $right;
 
 
#/**********************************************************************/
#/* */
#/* follow bus all the way to it's source */
#/* */
#/**********************************************************************/
( ${busref},${conn},${phy_name},${log_name},${direction},${type},${vector},${left},${right}) = split ':::', $line;
 
if(${busref} eq ${hierConn_busref_name} )
{
 
my @filelist_sub = parse_busInterface($vendor_name, $library_name,$component_name,$version_name,$hierConn_busref_name,"1" );
foreach $xxline (@filelist_sub)
{
if("${hierConn_name}_${log_name}" eq ${phy_name})
 
{
$depth = 2;
$x_name = $conn;
}
else
{
$depth = 1;
$x_name = $phy_name;
}
push @wire_decs,":::${hierConn_name}_${log_name}:::${hierConn_name}_${log_name}:::node:::wire:::${vector}:::${left}:::${right}:::${hierConn_comref_name}:::${depth}:::${x_name}:::${hierConn_busref_name}:::${log_name}:::";
 
$_ = $xxline;
if(/:::(\S+):::(\S+):::(\S+):::(\S+):::(\S+):::(\S+):::(\S+):::(\S+):::/)
{
$k_depth = $1;
$k_log_name = $2;
$k_phy_name = $3;
$k_direction = $4;
$k_type = $5;
$k_vector = $6;
$k_left = $7;
$k_right = $8;
push @wire_decs,":::${hierConn_name}_${k_log_name}:::${hierConn_name}_${k_log_name}:::node:::wire:::${k_vector}:::${k_left}:::${k_right}:::${hierConn_comref_name}:::${k_depth}:::${k_phy_name}:::${hierConn_busref_name}:::${k_log_name}:::";
}
}
}
}
 
}
}
}
1850,12 → 1037,11
elsif($vec_left ne "")
{
push @inst_conns , ":::${comp_name}:::adhoc:::${int_name}:::${int_value}:::vector:::${vec_left}:::${vec_right}:::";
push @wire_decs , ":::${vec_name}:::${int_value}:::node:::wire:::vector:::${vec_left}:::${$vec_right}:::none:::0:::${int_value}:::XXX:::${vec_name}:::";
 
}
else
{
push @inst_conns , ":::${comp_name}:::adhoc:::${int_name}:::${int_value}:::scaler:::none:::none:::";
push @wire_decs , ":::${vec_name}:::${int_value}:::node:::wire:::scaler:::none:::none:::none:::0:::${int_value}:::XXX:::${vec_name}:::";
}
 
 
1902,7 → 1088,9
{
$_ = $line;
 
# print "WD $line \n";
 
 
if(/:::(\S+):::(\S+):::(\S+):::(\S+):::(\S+):::(\S+):::(\S+):::(\S+):::(\S+):::(\S+):::(\S+):::(\S+):::/)
{
my $t_index = $1;
1918,9 → 1106,6
my $t_busref_name = $11;
my $t_abslog_name = $12;
 
if( 1)
{
 
push ( @inst_names, "${t_instance}_${t_busref_name}_${t_index}");
 
$inst_Inames{"${t_instance}_${t_busref_name}_${t_index}"} = "${t_instance}";
1948,8 → 1133,14
else
{$inst_vector{"${t_instance}_${t_busref_name}_${t_index}"} = "${t_vector}";}
 
 
 
 
unless( $inst_left{"${t_instance}_${t_busref_name}_${t_index}"} eq '')
{
 
 
 
if( $inst_left{"${t_instance}_${t_busref_name}_${t_index}"} eq "none")
{
$inst_left{"${t_instance}_${t_busref_name}_${t_index}"} = "${t_left}";
1964,6 → 1155,10
$inst_left{"${t_instance}_${t_busref_name}_${t_index}"} = "${t_left}";
}
 
 
 
 
 
unless( $inst_right{"${t_instance}_${t_busref_name}_${t_index}"} eq '')
{
if( $inst_right{"${t_instance}_${t_busref_name}_${t_index}"} eq "none")
1977,7 → 1172,7
}
else {$inst_right{"${t_instance}_${t_busref_name}_${t_index}"} = "${t_right}";}
 
}
}
}
@inst_names = sys::lib::trim_sort(@inst_names);
2056,11 → 1251,14
 
@inst_conns = sys::lib::trim_sort(@inst_conns);
 
foreach $Iconn( @inst_conns)
{
# print "IC $Iconn \n";
 
}
 
 
 
 
foreach my $i_name ($spirit_design_file->findnodes("//spirit:design/spirit:componentInstances/spirit:componentInstance/spirit:instanceName"))
{
my($instance_name) = $i_name ->findnodes('./text()')->to_literal ;
2127,8 → 1325,15
else {$z_signal_name = "${z_signal_name}[${z_left}:${z_right}]" ;}
}
 
if ($z_signal_name eq "_DUMMY_") {$z_signal_name = " ";}
unless ($z_signal_name eq "_DUMMY_")
 
 
{
 
 
 
 
 
if($instance_name eq $z_instance_name )
{
if($first)
2138,6 → 1343,11
}
else { push @instantiations , ",\n .${z_port_name} (${z_signal_name})";}
}
 
}
 
 
 
}
}
 
2239,113 → 1449,10
 
 
 
#/**********************************************************************/
#/* */
#/* Read each busInterface and save master/slave direction */
#/* */
#/**********************************************************************/
 
my @mas_slave;
 
push @mas_slave , "master";
push @mas_slave , "slave";
 
foreach $seek_type (@mas_slave)
{
 
foreach my $bus_iface ($spirit_component_file->findnodes("//spirit:component/spirit:busInterfaces/spirit:busInterface/spirit:${seek_type}"))
{
my($mmm_cname) = $bus_iface->findnodes('../spirit:name/text()')->to_literal ;
my($mmm_vendor) = $bus_iface->findnodes('../spirit:abstractionType/@spirit:vendor')->to_literal ;
my($mmm_library) = $bus_iface->findnodes('../spirit:abstractionType/@spirit:library')->to_literal ;
my($mmm_name) = $bus_iface->findnodes('../spirit:abstractionType/@spirit:name')->to_literal ;
my($mmm_version) = $bus_iface->findnodes('../spirit:abstractionType/@spirit:version')->to_literal ;
foreach my $port_face ($spirit_component_file->findnodes('//spirit:component/spirit:busInterfaces/spirit:busInterface/spirit:portMaps/spirit:portMap/spirit:logicalPort'))
{
my($rrr_log_name) = $port_face->findnodes('./spirit:name/text()')->to_literal ;
my($rrr_phy_name) = $port_face->findnodes('../spirit:physicalPort/spirit:name/text()')->to_literal ;
my($rrr_type_name) = $port_face->findnodes('../spirit:physicalPort/spirit:wireTypeDefs/spirit:wireTypeDef/spirit:typeName/text()')->to_literal ;
my($rrr_int_name) = $port_face->findnodes('../../../spirit:name/text()')->to_literal ;
my($rrr_left_value) = $port_face->findnodes('../spirit:physicalPort/spirit:wire/spirit:vector/spirit:left/text()')->to_literal ;
my($rrr_right_value) = $port_face->findnodes('../spirit:physicalPort/spirit:wire/spirit:vector/spirit:right/text()')->to_literal ;
unless ($rrr_type_name) {$rrr_type_name = "wire";}
if( $mmm_cname eq $rrr_int_name )
{
my $spirit_abstractor_filename = yp::lib::find_ipxact_abstractionDefinition($mmm_vendor,$mmm_library,$mmm_name,$mmm_version);
 
unless($spirit_abstractor_filename) {print " $mmm_vendor $mmm_library $mmm_name $mmm_version \n" }
 
my $spirit_abstractor_file = ($parser->parse_file($spirit_abstractor_filename)
 
) || die "(OOPs $mmm_vendor $mmm_library $mmm_name $mmm_version )";
 
 
 
foreach my $abstr_view ($spirit_abstractor_file->findnodes("//spirit:abstractionDefinition/spirit:ports/spirit:port/spirit:logicalName[text() = '$rrr_log_name']"))
{
my $rrr_direction = "";
if( $seek_type eq "master")
{
my($sss_m_dir) = $abstr_view->findnodes('../spirit:wire/spirit:onMaster/spirit:direction/text()')->to_literal ;
if ($sss_m_dir eq "in") { $sss_m_dir = "input";}
elsif ($sss_m_dir eq "out") { $sss_m_dir = "output";}
$rrr_direction = $sss_m_dir;
 
}
else
{
my($sss_s_dir) = $abstr_view->findnodes('../spirit:wire/spirit:onSlave/spirit:direction/text()')->to_literal ;
if ($sss_s_dir eq "in") { $sss_s_dir = "input";}
elsif ($sss_s_dir eq "out") { $sss_s_dir = "output";}
$rrr_direction = $sss_s_dir;
 
}
 
 
if($rrr_left_value ne "")
{
push @wire_decs , ":::${mmm_cname}_${rrr_log_name}:::${rrr_phy_name}:::${rrr_direction}:::${rrr_type_name}:::vector:::${rrr_left_value}:::${$rrr_right_value}:::none:::0:::${rrr_phy_name}:::XXX:::${rrr_log_name}:::";
}
else
{
push @wire_decs , ":::${mmm_cname}_${rrr_log_name}:::${rrr_phy_name}:::${rrr_direction}:::${rrr_type_name}:::scaler:::none:::none:::none:::0:::${rrr_phy_name}:::XXX:::${rrr_log_name}:::";
}
}
}
}
}
}
 
 
 
 
#/**********************************************************************/
#/* */
#/* 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"))
{
my($port_name) = $i_name ->findnodes('./text()')->to_literal ;
my($direction) = $i_name ->findnodes('../spirit:wire/spirit:direction/text()')->to_literal ;
my($left) = $i_name ->findnodes('../spirit:wire/spirit:vector/spirit:left/text()')->to_literal ;
my($right) = $i_name ->findnodes('../spirit:wire/spirit:vector/spirit:right/text()')->to_literal ;
my($type) = $i_name ->findnodes('../spirit:wireTypeDefs/spirit:wireTypeDef/spirit:typeName/text()')->to_literal ;
 
 
if ($direction eq "in") { $direction = "input";}
elsif ($direction eq "out") { $direction = "output";}
 
 
if($left ne "") { push @wire_decs , ":::${port_name}:::${port_name}:::${direction}:::${type}:::vector:::${left}:::${right}:::none:::0:::${port_name}:::XXX:::${port_name}:::"; }
else { push @wire_decs , ":::${port_name}:::${port_name}:::${direction}:::${type}:::scaler:::none:::none:::none:::0:::${port_name}:::XXX:::${port_name}:::"; }
}
 
 
 
/verilog/gen_ports
0,0 → 1,998
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",
"vendor=s" => \$vendor,
"library=s" => \$library,
"version=s" => \$version,
"component=s" => \$component,
"debug","verbose"
) || die "(use '$program_name -h' for help)";
 
 
##############################################################################
## Help option
##############################################################################
if ( $opt_h or $opt_help )
{ print "\n gen_ports - -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}";}
 
 
my $main_module_name = yp::lib::get_module_name($vendor,$library,$component,$version) ;
my $parser = XML::LibXML->new();
 
 
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";
 
 
 
my $io_ports = yp::lib::get_io_ports() ;
 
 
 
 
my $path = "${home}/${io_ports}";
mkdir $path,0755 unless( -e $path );
$path = "${home}/${io_ports}/${vendor}__${library}";
mkdir $path,0755 unless( -e $path );
$path = "${home}/${io_ports}/${vendor}__${library}/${component}";
mkdir $path,0755 unless( -e $path );
$outfile ="${path}/${main_module_name}";
 
if(-e ${outfile} )
{
# print " $outfile Exists, exiting \n";
exit 0
}
 
# print " $outfile Does not Exist, creating \n";
open DEST_FILE,">$outfile" or die "unable to open $outfile";
 
$outfile = yp::lib::get_io_busses_db_filename($vendor,$library,$component,$version);
$busses_db = new BerkeleyDB::Hash( -Filename => $outfile, -Flags => DB_CREATE ) or die "Cannot open ${outfile}: $!";
 
 
 
# print "XXXXXXXX $outfile GEN_PORTS CREATE \n";
process_design_files($spirit_component_file);
parse_component_file($spirit_component_file);
 
my $key;
my $value;
 
 
my @bus_list;
 
 
my $cursor = $busses_db ->db_cursor() ;
while ($cursor->c_get($key, $value, DB_NEXT) == 0)
{
 
( ${key_type},${busref},${conn}) = split( /\./ , $key);
( ${log_name},${direction},${type},${vector},${left},${right},${phy_name}) = split ':', $value;
if(($key_type eq "BusRef"))
{
push (@bus_list, "${busref}_${conn} ${phy_name} ${log_name} ${direction} ${type} ${vector} ${left}:${right} ");
}
else
{
 
}
 
}
 
my $status = $cursor->c_close() ;
 
 
$busses_db -> db_close();
 
 
 
 
@bus_list = sys::lib::trim_sort(@bus_list);
 
foreach $list (@bus_list)
{ print DEST_FILE "${list}\n";}
 
 
# print "XXXXXXXX $outfile GEN_PORTS CLOSED \n";
 
 
#/*********************************************************************************************/
#/ */
#/ */
#/ */
#/ */
#/ */
#/ */
#/*********************************************************************************************/
 
 
 
 
sub parse_component_file
{
my @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"))
{
my($new_vendor) = $new_comp->findnodes('./@spirit:vendor')->to_literal ;
my($new_library) = $new_comp->findnodes('./@spirit:library')->to_literal ;
my($new_name) = $new_comp->findnodes('./@spirit:name')->to_literal ;
my($new_version) = $new_comp->findnodes('./@spirit:version')->to_literal ;
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)) );
}
}
 
 
 
 
 
#/**********************************************************************/
#/* */
#/* */
#/* */
#/**********************************************************************/
 
foreach my $bus_iface ($spirit_component_file->findnodes("//spirit:component/spirit:busInterfaces/spirit:busInterface/spirit:slave"))
{
my $busInterface_name = $bus_iface->findnodes('../spirit:name/text()')->to_literal ;
my $memMap_name = $bus_iface->findnodes('./spirit:memoryMapRef/@spirit:memoryMapRef')->to_literal ;
 
 
foreach my $bus_iface ($spirit_component_file->findnodes("//spirit:busInterface[spirit:name/text() = '$busInterface_name']/spirit:slave/spirit:bridge"))
{
my($bridge_map) = $bus_iface->findnodes('./@spirit: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"))
{
# my $xxx = $mem_map->findnodes('../spirit:subspaceMap/@spirit:masterRef')->to_literal ;
my $add = $mem_map->findnodes('./text()')->to_literal ;
my $int_base_addr = hex($add);
 
my $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}" );
 
# 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"))
{
my $range = $addSpace_map->findnodes('./text()')->to_literal ;
my $int_range = hex($range);
$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";
}
 
}
 
}
 
 
 
foreach my $mem_map ($spirit_component_file->findnodes("//spirit:component/spirit:memoryMaps/spirit:memoryMap[spirit:name/text() = '$memMap_name']/spirit:bank/spirit:addressBlock"))
{
my($addB_name) = $mem_map->findnodes('./spirit:name/text()')->to_literal ;
my($baseAdd) = $mem_map->findnodes('../spirit:baseAddress/text()')->to_literal ;
my($range) = $mem_map->findnodes('./spirit:range/text()')->to_literal ;
my($width) = $mem_map->findnodes('./spirit:width/text()')->to_literal ;
my $int_baseAdd = hex($baseAdd);
my $int_range = hex($range);
$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"))
{
my($reg_name) = $mem_map->findnodes('./spirit:name/text()')->to_literal ;
my($bank_name) = $mem_map->findnodes('../../../spirit:name/text()')->to_literal ;
my($reg_offset) = $mem_map->findnodes('./spirit:addressOffset/text()')->to_literal ;
my($reg_size) = $mem_map->findnodes('./spirit:size/text()')->to_literal ;
my($reg_access) = $mem_map->findnodes('./spirit:access/text()')->to_literal ;
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}" );
# print "FFFFFFF REGISTER ${bank_name}.${reg_name} ${reg_offset}::${reg_size}::${reg_access} \n";
}
 
 
 
 
 
 
 
 
 
 
 
 
 
}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
#/**********************************************************************/
#/* */
#/* Read each busInterface and save master/slave direction */
#/* */
#/**********************************************************************/
 
 
my @mas_slave;
 
push @mas_slave , "master";
push @mas_slave , "slave";
 
foreach $seek_type (@mas_slave)
{
 
foreach my $bus_iface ($spirit_component_file->findnodes("//spirit:component/spirit:busInterfaces/spirit:busInterface/spirit:${seek_type}"))
{
my($mmm_cname) = $bus_iface->findnodes('../spirit:name/text()')->to_literal ;
my($mmm_vendor) = $bus_iface->findnodes('../spirit:abstractionType/@spirit:vendor')->to_literal ;
my($mmm_library) = $bus_iface->findnodes('../spirit:abstractionType/@spirit:library')->to_literal ;
my($mmm_name) = $bus_iface->findnodes('../spirit:abstractionType/@spirit:name')->to_literal ;
my($mmm_version) = $bus_iface->findnodes('../spirit:abstractionType/@spirit:version')->to_literal ;
 
 
if($mmm_cname)
{
$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'))
{
my($rrr_log_name) = $port_face->findnodes('./spirit:name/text()')->to_literal ;
my($rrr_int_name) = $port_face->findnodes('../../../spirit:name/text()')->to_literal ;
my($rrr_phy_name) = $port_face->findnodes('../spirit:physicalPort/spirit:name/text()')->to_literal ;
my($rrr_type_name) = $port_face->findnodes('../spirit:physicalPort/spirit:wireTypeDefs/spirit:wireTypeDef/spirit:typeName/text()')->to_literal ;
my($rrr_left_value) = $port_face->findnodes('../spirit:physicalPort/spirit:wire/spirit:vector/spirit:left/text()')->to_literal ;
my($rrr_right_value) = $port_face->findnodes('../spirit:physicalPort/spirit:wire/spirit:vector/spirit:right/text()')->to_literal ;
unless ($rrr_type_name) {$rrr_type_name = "wire";}
unless ($rrr_phy_name) {$rrr_phy_name = ${rrr_log_name} ;}
if( $mmm_cname eq $rrr_int_name )
{
my $absDef_filename = yp::lib::get_absDef_db_filename($mmm_vendor,$mmm_library,$mmm_name,$mmm_version);
$absDef_db = new BerkeleyDB::Hash( -Filename => $absDef_filename, -Flags => DB_CREATE ) or die "Cannot open ${absDef_filename}: $!";
 
my $abs_data;
$absDef_db->db_get("${seek_type}__${rrr_log_name}", $abs_data );
 
( $berk_name, $berk_presence,$berk_width,$berk_direction ) = split ':', $abs_data;
my $rrr_direction = $berk_direction;
 
 
 
if($rrr_left_value ne "")
{
$berk_vector = "vector";
}
else
{
$berk_vector = "scaler";
$rrr_left_value = "none";
$rrr_right_value = "none";
}
 
 
 
uplift_busref(${mmm_cname},${rrr_log_name},${rrr_direction},${rrr_type_name},${berk_vector},${rrr_left_value},${rrr_right_value},${rrr_phy_name});
 
 
 
$absDef_db->db_close();
}
}
}
}
 
 
 
 
#/**********************************************************************/
#/* */
#/* 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"))
{
my($port_name) = $i_name ->findnodes('./text()')->to_literal ;
my($direction) = $i_name ->findnodes('../spirit:wire/spirit:direction/text()')->to_literal ;
my($left) = $i_name ->findnodes('../spirit:wire/spirit:vector/spirit:left/text()')->to_literal ;
my($right) = $i_name ->findnodes('../spirit:wire/spirit:vector/spirit:right/text()')->to_literal ;
my($type) = $i_name ->findnodes('../spirit:wireTypeDefs/spirit:wireTypeDef/spirit:typeName/text()')->to_literal ;
 
 
if ($direction eq "in") { $direction = "input";}
elsif ($direction eq "out") { $direction = "output";}
 
 
my $vector;
$vector ="vector";
 
if($left ne "")
{
 
}
else
{
$vector = "scaler";
$left = "none";
$right = "none";
}
 
 
uplift_busref("adhoc", ${port_name} , ${direction}, ${type} , ${vector},${left},${right},${port_name} );
 
 
}
}
 
 
 
 
 
#/*********************************************************************************************/
#/ */
#/ */
#/ */
#/ */
#/ */
#/ */
#/*********************************************************************************************/
 
 
 
 
sub process_design_files
{
my @params = @_;
my $spirit_component_file = pop(@params);
 
#print "\n";
 
 
foreach my $new_comp ($spirit_component_file->findnodes("//spirit:component/spirit:model/spirit:views/spirit:view/spirit:vendorExtensions/spirit:componentRef"))
{
my($new_vendor) = $new_comp->findnodes('./@spirit:vendor')->to_literal ;
my($new_library) = $new_comp->findnodes('./@spirit:library')->to_literal ;
my($new_name) = $new_comp->findnodes('./@spirit:name')->to_literal ;
my($new_version) = $new_comp->findnodes('./@spirit:version')->to_literal ;
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"))
{
my($new_vendor) = $new_comp->findnodes('./@spirit:vendor')->to_literal ;
my($new_library) = $new_comp->findnodes('./@spirit:library')->to_literal ;
my($new_name) = $new_comp->findnodes('./@spirit:name')->to_literal ;
my($new_version) = $new_comp->findnodes('./@spirit:version')->to_literal ;
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"; }
process_design_file($parser->parse_file(yp::lib::find_ipxact_design($new_vendor,$new_library,$new_name,$new_version )) );
}
}
}
 
 
#/*********************************************************************************************/
#/ */
#/ */
#/ */
#/ */
#/ */
#/ */
#/*********************************************************************************************/
 
 
sub process_design_file
{
my @params = @_;
my $spirit_design_file = pop(@params);
 
foreach my $new_comp ($spirit_design_file->findnodes("//spirit:design/spirit:vendor"))
{
my($new_vendor) = $new_comp->findnodes('./text()')->to_literal ;
my($new_library) = $new_comp->findnodes('../spirit:library/text()')->to_literal ;
my($new_name) = $new_comp->findnodes('../spirit:name/text()')->to_literal ;
my($new_version) = $new_comp->findnodes('../spirit:version/text()')->to_literal ;
# 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"))
{
my($instance_name) = $i_name ->findnodes('./text()')->to_literal ;
my($vendor_name) = $i_name ->findnodes('../spirit:componentRef/@spirit:vendor')->to_literal ;
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 ;
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 $file = "$inst_path/${module_name}";
if(-e $file) { # print "XXXXXXXX $file Exists \n";
}
else
{
# print "XXXXXXXX $file Doesn't Exist \n";
$cmd = "./tools/verilog/gen_ports -vendor $vendor_name -library $library_name -component $component_name -version $version_name ";
if (system($cmd)) {}
 
 
}
 
}
 
 
#/**********************************************************************/
#/* */
#/* 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 */
#/* */
#/**********************************************************************/
 
my($vendor_name) = $i_name ->findnodes('../spirit:componentRef/@spirit:vendor')->to_literal ;
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);
$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}");
}
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}::" );
}
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}::" );
}
 
 
 
 
 
}
 
my $status = $child_cursor->c_close() ;
$child_ports_db -> db_close();
}
}
 
 
 
 
 
 
 
#/*******************************************************************************/
#/* */
#/* Read each interconnection */
#/* */
#/*******************************************************************************/
 
 
 
 
 
foreach my $i_name ($spirit_design_file->findnodes('//spirit:interconnections/spirit:interconnection/spirit:activeInterface'))
{
my($lp_componentref_name) = $i_name ->findnodes('./@spirit:componentRef')->to_literal ;
my($lp_busref_name) = $i_name ->findnodes('./@spirit:busRef')->to_literal ;
my($lp_interconnect_name) = $i_name ->findnodes('../spirit:name/text()')->to_literal ;
 
my $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( "Instance.${lp_componentref_name}.${lp_busref_name}","${lp_interconnect_name}" );
 
}
 
 
 
 
 
 
 
 
#/**************************************************************************/
#/* */
#/* Read each interconnection and enter sub signals into wire_decs */
#/* */
#/**************************************************************************/
 
 
 
 
foreach my $i_name ($spirit_design_file->findnodes('//spirit:interconnections/spirit:interconnection/spirit:activeInterface/@spirit:componentRef'))
{
my($hierConn_comref_name) = $i_name ->to_literal;
my($hierConn_busref_name) = $i_name ->findnodes('../@spirit:busRef')->to_literal ;
my($hierConn_name) = $i_name ->findnodes('../../spirit:name/text()')->to_literal ;
 
 
 
 
 
 
 
 
 
#/*******************************************************************************/
#/* */
#/* Read each interconnection and enter modified signals into wire_decs */
#/* */
#/*******************************************************************************/
 
 
 
 
 
foreach my $i_name ($spirit_design_file->findnodes('//spirit:interconnections/spirit:interconnection/spirit:activeInterface/spirit:portMaps/spirit:portMap/spirit:logicalPort/spirit:name'))
{
my($lp_name) = $i_name ->to_literal;
my($lp_pname) = $i_name ->findnodes('../../spirit:physicalPort/spirit:name/text()')->to_literal ;
my($lp_left) = $i_name ->findnodes('../../spirit:physicalPort/spirit:wire/spirit:vector/spirit:left/text()')->to_literal ;
my($lp_right) = $i_name ->findnodes('../../spirit:physicalPort/spirit:wire/spirit:vector/spirit:right/text()')->to_literal ;
my($lp_componentref_name) = $i_name ->findnodes('../../../../@spirit:componentRef')->to_literal ;
my($lp_busref_name) = $i_name ->findnodes('../../../../@spirit:busRef')->to_literal ;
my($lp_interconnect_name) = $i_name ->findnodes('../../../../../spirit:name/text()')->to_literal ;
$lp_vector = "vector";
 
 
if ( $lp_pname eq '' ) { $lp_pname ="${lp_interconnect_name}_${lp_name}";}
if ( $lp_left eq '' )
{
$lp_left ="none";
$lp_vector = "scaler";
}
if ( $lp_right eq '' )
{
$lp_right ="none";
$lp_vector = "scaler";
}
 
 
 
if( ($hierConn_name eq $lp_interconnect_name) && ( $hierConn_comref_name eq $lp_componentref_name ) )
{
# print "TTTTTTTTTTTT ${lp_pname}_${lp_name} => ${lp_interconnect_name}_${lp_name} ${lp_pname} $lp_left $lp_right $lp_busref_name \n";
 
if(${lp_vector} eq "vector")
{
unless( looks_like_number($lp_left) ) { $lp_left=0;}
}
 
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']"))
{
#/**********************************************************************/
#/* */
#/* Lookup VLNV for each instantiated component */
#/* */
#/**********************************************************************/
 
my($vendor_name) = $i_name ->findnodes('../spirit:componentRef/@spirit:vendor')->to_literal ;
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 INTERCONN 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);
$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}"))
{
# print "INTERCONN ${hierConn_name}_${log_name} $direction , $vector, $left , $right \n";
uplift_busref(${hierConn_name},${log_name},"node","wire",${vector},${left},${right},"${hierConn_name}_${log_name}");
}
elsif(($key eq "AbsDef.${hierConn_busref_name}.master"))
{
$busses_db->db_put( "AbsDef.${hierConn_name}.node","$value" );
}
elsif(($key eq "AbsDef.${hierConn_busref_name}.slave"))
{
$busses_db->db_put( "AbsDef.${hierConn_name}.node","$value" );
}
 
 
}
my $status = $child_cursor->c_close() ;
$child_ports_db -> db_close();
}
 
 
foreach my $i_name ($spirit_design_file->findnodes("//spirit:design/spirit:componentInstances/spirit:componentInstance/spirit:instanceName"))
{
#/**********************************************************************/
#/* */
#/* Lookup VLNV for each instantiated component */
#/* */
#/**********************************************************************/
 
my($instance_name) = $i_name ->findnodes('./text()')->to_literal ;
my($vendor_name) = $i_name ->findnodes('../spirit:componentRef/@spirit:vendor')->to_literal ;
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 ;
 
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";
}
}
}
 
#/**********************************************************************/
#/* */
#/* Read all wires and store into array */
#/* */
#/**********************************************************************/
 
 
 
foreach my $i_name ($spirit_design_file->findnodes("//spirit:design/spirit:vendorExtensions/socgen:nodes/socgen:node/spirit:name"))
{
my($node_name) = $i_name ->findnodes('./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_right) = $i_name ->findnodes('../spirit:wire/spirit:vector/spirit:right/text()')->to_literal ;
my($node_type) = $i_name ->findnodes('../spirit:typeName/text()')->to_literal ;
unless($node_busdef){ $node_busdef = $node_name; }
 
if( $node_left ne "" )
{
if( $node_right eq "" ){ $node_right = $node_left; }
$node_vector = "vector";
}
else
{
$node_vector = "scaler";
$node_left = "none";
$node_right = "none";
}
 
# print "WIRE_NODE ${node_name} node , $node_type , $node_vector, $node_left , $node_right $node_busdef \n";
uplift_busref("adhoc", "${node_name}" , "node" , ${node_type} , ${node_vector}, ${node_left} , ${node_right},${node_name});
}
 
 
#/**********************************************************************/
#/* */
#/* Read all adHocConnections and load instance connect info into array*/
#/* */
#/**********************************************************************/
 
foreach my $i_name ($spirit_design_file->findnodes('//spirit:adHocConnections/spirit:adHocConnection/spirit:internalPortReference/@spirit:componentRef'))
{
my($componentRef_name) = $i_name ->to_literal;
my($int_portRef_name) = $i_name ->findnodes('../@spirit:portRef')->to_literal ;
my($adhocConnection_name) = $i_name ->findnodes('../../spirit:name/text()')->to_literal ;
my($ext_portRef_name) = $i_name ->findnodes('../../spirit:externalPortReference/@spirit:portRef')->to_literal ;
my($left) = $i_name ->findnodes('../../spirit:externalPortReference/@spirit:left')->to_literal ;
my($right) = $i_name ->findnodes('../../spirit:externalPortReference/@spirit:right')->to_literal ;
 
if( $left ne "" )
{
if( $right eq "" ){ $right = $left; }
$vector = "vector";
}
else
{
$vector = "scaler";
$left = "none";
$right = "none";
}
 
$_ = ${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});
}
}
}
}
 
 
 
 
 
 
#/*********************************************************************************************/
#/ */
#/ */
#/ */
#/ */
#/ */
#/ */
#/*********************************************************************************************/
 
 
 
 
sub uplift_busref
{
my @params = @_;
my $phy_name = pop(@params);
my $right = pop(@params);
my $left = pop(@params);
my $vector = pop(@params);
my $type = pop(@params);
my $direction = pop(@params);
my $log_name = pop(@params);
my $busref_name = pop(@params);
# print "BUS_UPLIFT $busref_name $log_name $direction $type $vector $left $right $phy_name \n";
$busses_db->db_put( "","${log_name}:${direction}:${type}:${vector}:${left}:${right}:${phy_name}" );
 
my $uplift_data;
my $uplift_log_name ;
my $uplift_phy_name ;
my $uplift_direction ;
my $uplift_type;
my $uplift_vector;
my $uplift_left;
my $uplift_right;
 
 
$busses_db->db_get("BusRef.${busref_name}.$log_name", $uplift_data );
(${uplift_log_name},${uplift_direction},${uplift_type},${uplift_vector},${uplift_left},${uplift_right},${uplift_phy_name} ) = split ':', $uplift_data;
 
$busses_db->db_get("", $uplift_data );
(${log_name},${direction},${type},${vector},${left},${right},${phy_name} ) = split ':', $uplift_data;
$busses_db->db_del("");
 
 
if(${uplift_phy_name} ne "")
{
if(${uplift_phy_name} ne "${busref_name}_${uplift_log_name}" )
{
${phy_name}= ${uplift_phy_name};
# print "SET |${uplift_phy_name}|${busref_name}_${uplift_log_name}| \n";
}
 
}
 
 
 
if(${uplift_log_name})
{
# print "REPLACING ${busref_name} ${uplift_log_name} ${uplift_direction} ${uplift_type} ${uplift_vector} ${uplift_left} ${uplift_right} ${uplift_phy_name} \n";
if(${uplift_direction} ne "node" ) { $direction =${uplift_direction};}
 
if(${type} eq "wire" ) { $type =${uplift_type};}
 
if(${uplift_vector} eq "vector")
{
if( $vector eq "vector" )
{
if( looks_like_number($uplift_left))
{
if( looks_like_number($left) )
{
if($uplift_left > $left ) {$left = $uplift_left;}
}
}
else
{
if( looks_like_number($left) ) {$left = ${uplift_left}; }
unless(${direction} ne "node") {$left = ${uplift_left}; }
}
if( looks_like_number($uplift_right) && looks_like_number($right) ) { if($uplift_right < $right ) {$right = $uplift_right;}}
}
else
{
$vector = "vector";
$left = ${uplift_left};
$right = ${uplift_right};
}
}
}
# print "WITH ${busref_name} $log_name $direction $type $vector $left $right $phy_name \n";
 
$busses_db->db_put( "BusRef.${busref_name}.$log_name","${log_name}:${direction}:${type}:${vector}:${left}:${right}:${phy_name}" );
}
 
 
 
 
 
 
 
 
 
 
 
1
verilog/gen_ports Property changes : Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Index: verilog/gen_auxiliary =================================================================== --- verilog/gen_auxiliary (nonexistent) +++ verilog/gen_auxiliary (revision 131) @@ -0,0 +1,2247 @@ +eval 'exec `which perl` -S $0 ${1+"$@"}' + if 0; +#/**********************************************************************/ +#/* */ +#/* ------- */ +#/* / SOC \ */ +#/* / GEN \ */ +#/* / TOOL \ */ +#/* ============== */ +#/* | | */ +#/* |____________| */ +#/* */ +#/* */ +#/* */ +#/* */ +#/* Author(s): */ +#/* - John Eaton, jt_eaton@opencores.org */ +#/* */ +#/**********************************************************************/ +#/* */ +#/* Copyright (C) <2010-2011> */ +#/* */ +#/* 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, + "destination=s" => \$destination, + "configuration=s" => \$configuration, + "autodoc=s" => \$autodoc, + "fragment","no_port","local_parameters","tb","debug","verbose","interface_only","html","top" +) || die "(use '$program_name -h' for help)"; + + +############################################################################## +## Help option +############################################################################## +if ( $opt_h or $opt_help ) + { print "\n gen_auxiliary -envidentifier {sim/syn} -prefix /work -vendor vendor_name -library library_name -component component_name -version version_name -fragment -no_port -local_parameters -destination destination -configuration configuration -dest_dir ../verilog"; + print "\n"; + exit 1; + } + +my $main_module_name = yp::lib::get_module_name($vendor,$library,$component,$version) ; + +############################################################################# +## +## +############################################################################# + +$home = cwd(); + + + +my $repo = yp::lib::find_component_repo($vendor,$library,$component) ; + + +my $variant; +my $view; + + +my $interface_in_count =0; +my $interface_out_count =0; +my $interface_in_size =0; +my $interface_out_size =0; + +if($version) {$variant = "${component}_${version}";} +else {$variant = "${component}";} + +unless($destination) { $destination = $variant;} +unless($autodoc) { $autodoc = "/Geda";} + +print "\n GEN_auxiliary $prefix $vendor $library $component $version $configuration $dest_dir $destination \n"; + +my $lib_comp_sep = yp::lib::find_lib_comp_sep($vendor,$library,$component); +my $comp_xml_sep = yp::lib::find_comp_xml_sep($vendor,$library,$component,$version); + +my $parser = XML::LibXML->new(); + +my $socgen_file = $parser->parse_file(yp::lib::find_componentConfiguration($vendor,$library,$component)); +my $spirit_component_file = $parser->parse_file(yp::lib::find_ipxact_component($vendor,$library,$component,$version)); +my $doc_library_path = $socgen_file->findnodes("//socgen:componentConfiguration/socgen:doc/socgen:library_path/text()")->to_literal; + + +my $sim_library_path ; + +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')) + { + my($Xview_name) = $X_view->findnodes('./spirit:name/text()')->to_literal ; + my($Xview_envidentifier) = $X_view->findnodes('./spirit:envIdentifier/text()')->to_literal ; + + + if($envidentifier eq $Xview_envidentifier ) + { + $view = $Xview_name; + } + } + + +my $path = "${home}${prefix}/${vendor}__${library}${lib_comp_sep}${component}${comp_xml_sep}/${dest_dir}"; +mkdir $path,0755 unless( -e $path ); + +my $path = "${home}${prefix}/${vendor}__${library}${lib_comp_sep}${component}${comp_xml_sep}/${dest_dir}/${view}"; +mkdir $path,0755 unless( -e $path ); + +my @filelist_hier = (); +my @instantiations = (); +my @parameters = (); +my %parameter_values = (); +my %parameter_descriptions = (); + + + + +if($opt_tb ) +{ + print "Creating testbench for $vendor $library $component $version \n"; + + + my $path ="${home}${repo}/${vendor}/${library}${sim_library_path}"; + mkdir $path,0755 unless( -e $path ); + + my $path ="${home}${repo}/${vendor}/${library}${sim_library_path}/testbenches"; + mkdir $path,0755 unless( -e $path ); + + $path ="${home}${repo}/${vendor}/${library}${sim_library_path}/testbenches/xml"; + mkdir $path,0755 unless( -e $path ); + + + $outfile ="${home}${repo}/${vendor}/${library}${sim_library_path}/testbenches/xml/${variant}_dut.params.xml"; + 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 "\n"; + print TB_COMP_FILE "${vendor}\n"; + print TB_COMP_FILE "${library}\n"; + print TB_COMP_FILE "${component}\n"; + print TB_COMP_FILE "${version}_dut.params\n"; + + + $outfile ="${home}${repo}/${vendor}/${library}${sim_library_path}/testbenches/xml/${variant}_dutg.design.xml"; + open TB_DESIGN_FILE,">$outfile" or die "unable to open $outfile"; + + + print TB_DESIGN_FILE "\n"; + print TB_DESIGN_FILE " \n"; + print TB_DESIGN_FILE "\n"; + print TB_DESIGN_FILE "${vendor}\n"; + print TB_DESIGN_FILE "${library}\n"; + print TB_DESIGN_FILE "${component}\n"; + print TB_DESIGN_FILE "${version}_dutg.design\n"; + +} + #/**********************************************************************/ + #/* */ + #/* if configuration set then read parameters from socgen:componentConfiguration file */ + #/* */ + #/**********************************************************************/ + + if($configuration) + { + # print "XXX Reading configuration $configuration \n"; + unless ($socgen_file) { print "No socgen ip file \n";}; + + foreach my $socgen_cfg ($socgen_file->findnodes("//socgen:componentConfiguration/socgen:configurations/socgen:configuration/socgen:parameters/socgen:parameter/socgen:name")) + { + my($param_name) = $socgen_cfg->findnodes('./text()')->to_literal ; + my($param_value) = $socgen_cfg->findnodes('../socgen:value/text()')->to_literal ; + my($config_name) = $socgen_cfg->findnodes('../../../socgen:name/text()')->to_literal ; + if($config_name eq $configuration ) + { + unless(defined $parameter_values{$param_name}) {push ( @parameters, "$param_name");}; + $parameter_values{$param_name} = ${param_value}; + } + } + } + +#/**********************************************************************/ +#/* */ +#/* Every hier cell is constructed from the ipxact file with seperate */ +#/* version for each view */ +#/* */ +#/* Start by opening the output file */ +#/* get fileset name */ +#/* check that requested view exists */ +#/* */ +#/**********************************************************************/ + +foreach my $comp_view ($spirit_component_file->findnodes("//spirit:component/spirit:model/spirit:views/spirit:view/spirit:name[text() = '$view']" )) + { + my($view_fileset_name) = $comp_view->findnodes('../spirit:fileSetRef/spirit:localName/text()')->to_literal ; + $outfile ="${home}${prefix}/${vendor}__${library}${lib_comp_sep}${component}${comp_xml_sep}/${dest_dir}/${view}/${destination}"; + open DEST_FILE,">$outfile" or die "unable to open $outfile"; + +# /* Test benches do not need to generate a io_ports database + + { + my $io_ports_file = yp::lib::get_io_ports_db_filename($vendor,$library,$component,$version); +# print "XXXXXXXX $io_ports_file GEN_VERILOG calling GEN_PORTS \n"; + $cmd = "./tools/verilog/gen_ports -vendor $vendor -library $library -component $component -version $version "; + if (system($cmd)) {} + $cmd = "./tools/verilog/gen_signals -vendor $vendor -library $library -component $component -version $version "; + if (system($cmd)) {} + + +# print "XXXXXXXX $io_ports_file GEN_PORTS returning to GEN_VERILOG \n"; + $ports_db = new BerkeleyDB::Hash( -Filename => $io_ports_file, -Flags => DB_CREATE ) or die "Cannot open ${io_ports_file}: $!"; + + } + + + unless ($opt_fragment){ print DEST_FILE "\n module \n\n $main_module_name \n ";} + + #/*****************************************************************************/ + #/* wire_decs array holds all port and signal declarations */ + #/* :::name:::node_input_output:::wire_reg:::scaler_vector:::left:::right::: */ + #/*****************************************************************************/ + + @wire_decs = ( ); + + + #/**********************************************************************/ + #/* inst_conns holds all instance connections */ + #/**********************************************************************/ + + @inst_conns = ( ); + + my @decl_names = (); + my %decl_dirs = (); + my %decl_types = (); + my %decl_vector = (); + my %decl_lefts = (); + my %decl_rights = (); + + # component file + + parse_component_file($spirit_component_file); + if($opt_verbose){print "parse design files \n"; } + parse_design_files($spirit_component_file); + if($opt_verbose){print "process design files \n"; } + process_design_files($spirit_component_file); + if($opt_verbose){print "process wire_decs \n"; } + + #/**********************************************************************/ + #/* */ + #/* pack ports and nodes into hashes */ + #/* */ + #/**********************************************************************/ + + + @wire_decs = sys::lib::trim_sort(@wire_decs); + foreach $line (@wire_decs) + { + $_ = $line; + if(/:::(\S+):::(\S+):::(\S+):::(\S+):::(\S+):::(\S+):::(\S+):::(\S+):::(\S+):::(\S+):::(\S+):::(\S+):::/) + { + $q_index = $1; + $q_node_name = $2; + $q_direction = $3; + $q_type = $4; + $q_vector = $5; + $q_left = $6; + $q_right = $7; + $q_instance = $8; + $q_depth = $9; + $q_phy_name = $10; + $q_busref_name = $11; + $q_abslog_name = $12; + + + if($opt_debug ){print "XXXXX-- $line \n ";} + + push ( @decl_names,$q_index); + + + if( $decl_pnames{$q_index}) + { + if( $decl_pnames{$q_index} eq ${q_index}) + { + $decl_pnames{$q_index} = "${q_node_name}"; + } + } + else + { + $decl_pnames{$q_index} = "${q_node_name}"; + } + + + if( $decl_dirs{$q_index}) + { + if( $decl_dirs{$q_index} eq "node") + { + $decl_dirs{$q_index} = "${q_direction}"; + } + } + else + { + $decl_dirs{$q_index} = "${q_direction}"; + } + + + + if( $decl_types{$q_index}) + { + if( $decl_types{$q_index} eq "wire") + { + $decl_types{$q_index} = "${q_type}"; + } + } + else + { + $decl_types{$q_index} = "${q_type}"; + } + + + + + + if( $decl_vector{$q_index}) + { unless( $decl_vector{$q_index} eq "vector"){ $decl_vector{$q_index} = "${q_vector}"; }} + else { $decl_vector{$q_index} = "${q_vector}"; } + + if( $q_vector eq "vector" ) + { + if ( defined $decl_lefts{$q_index}) + { + + + $_ = $q_left; + if(/(\D+)/) + { + $_ = $decl_lefts{$q_index}; + if(/(\D+)/) + { +# print "Info: $variant :: $q_node_name : $q_left is NOT a number $decl_lefts{$q_index} is NOT a number \n"; + #if($decl_lefts{$q_index} <= $q_left ) {$decl_lefts{$q_index} = $q_left;} + } + else + { + $decl_lefts{$q_index} = $q_left; + } + } + else + + { + + $_ = $decl_lefts{$q_index}; + if(/(\D+)/) + { + #print "WARNING $variant :: $q_node_name : $q_left is a number $decl_lefts{$q_index} is NOT a number \n"; + #if($decl_lefts{$q_index} <= $q_left ) {$decl_lefts{$q_index} = $q_left;} + } + else + { + #print "WARNING $variant :: $q_node_name : $q_left is a number $decl_lefts{$q_index} is a number \n"; + if($decl_lefts{$q_index} <= $q_left ) {$decl_lefts{$q_index} = $q_left;} + } + } + unless (defined $decl_rights{$q_index}) {$decl_rights{$q_index} = $q_right;} + if($decl_rights{$q_index} >= $q_right ) {$decl_rights{$q_index} = $q_right;} + } + else + { + $decl_lefts{$q_index} = $q_left; + $decl_rights{$q_index} = $q_right; + } + } + } + } + @decl_names = sys::lib::trim_sort(@decl_names); + + + + + + #/**********************************************************************/ + #/* */ + #/* All port and signal info is now loaded in hashes */ + #/* Resort on physical name */ + #/* Print out module header , parameters and ports */ + #/* */ + #/**********************************************************************/ + + + + + foreach my $decl_name (@decl_names) + + { + + my $phy_name = $decl_pnames{$decl_name}; + + unless ($phy_name) {$phy_name =$decl_name } + + push ( @phy_names,$phy_name); + + + if($opt_debug ){print "XX-p $decl_name - $decl_vector{$decl_name} - $decl_lefts{$decl_name} - $decl_rights{$decl_name} -- $phy_name - $phy_vector{$phy_name} - $phy_lefts{$phy_name} - $phy_rights{$phy_name} \n ";} + + + if( $phy_dirs{$phy_name}) + { + if( $phy_dirs{$phy_name} eq "node") + { + $phy_dirs{$phy_name} = "$decl_dirs{$decl_name}"; + } + } + else + { + $phy_dirs{$phy_name} = "$decl_dirs{$decl_name}"; + } + + if( $phy_types{$phy_name}) + { + if( $phy_types{$phy_name} eq "wire") + { + $phy_types{$phy_name} = "$decl_types{$decl_name}"; + } + } + else + { + $phy_types{$phy_name} = "$decl_types{$decl_name}"; + } + + if( $phy_vector{$phy_name}) + { unless( $phy_vector{$phy_name} eq "vector"){ $phy_vector{$phy_name} = "$decl_vector{$decl_name}"; }} + else { $phy_vector{$phy_name} = "$decl_vector{$decl_name}"; } + + if( $decl_vector{$decl_name} eq "vector" ) + { + if ( defined $phy_lefts{$phy_name}) + { + $_ = $phy_lefts{$phy_name}; + if(/(\D+)/) + { + $_ = $phy_lefts{$phy_name}; + if(/(\D+)/) + { + } + else + { + $phy_lefts{$phy_name} = $decl_lefts{$decl_name}; + } + } + else + { + $_ = $phy_lefts{$phy_name}; + if(/(\D+)/) + { + } + else + { + if($phy_lefts{$phy_name} <= $decl_lefts{$decl_name} ) {$phy_lefts{$phy_name} = $decl_lefts{$decl_name};} + } + } + unless ( defined $phy_rights{$phy_name}) {$phy_rights{$phy_name} = $decl_rights{$decl_name};} + if($phy_rights{$phy_name} >= $decl_rights{$decl_name} ) {$phy_rights{$phy_name} = $decl_rights{$decl_name};} + } + else + { + $phy_lefts{$phy_name} = $decl_lefts{$decl_name}; + $phy_rights{$phy_name} = $decl_rights{$decl_name}; + } + } + if($opt_debug ){print "XX-q $decl_name - $decl_vector{$decl_name} - $decl_lefts{$decl_name} - $decl_rights{$decl_name} -- $phy_name - $phy_vector{$phy_name} - $phy_lefts{$phy_name} - $phy_rights{$phy_name} \n ";} + + } + + + @phy_names = sys::lib::trim_sort(@phy_names); + + #/**********************************************************************/ + #/* */ + #/* Add any and all global parameters with their default values */ + #/* */ + #/**********************************************************************/ + + unless ($opt_local_parameters) + { + my $first = 1; + foreach my $parameter_name (@parameters) + { + my $parameter_value = $parameter_values{$parameter_name}; + if($first) + { + print DEST_FILE " #( parameter \n ${parameter_name}=${parameter_value}"; + $first=0; + } + else { print DEST_FILE ",\n ${parameter_name}=${parameter_value}";} + } + + if ($first == 0) { print DEST_FILE ")\n"; } + } + + + #/**********************************************************************/ + #/* */ + #/* sort all ports with their type, size and direction */ + #/* */ + #/**********************************************************************/ + + my @port_list = (); + my @wire_nodes = (); + { + + my $key; + my $value; + + my $port_cursor = $ports_db->db_cursor() ; + while ($port_cursor->c_get($key, $value, DB_NEXT) == 0) + { + ( ${key_type},${busref},${conn}) = split( /\./ , $key); + ( ${port_name},${direction},${type},${vector},${left},${right}) = split ':', $value; + + if( ($key eq $port_name) and ($direction ne "node" ) ) + { + print DEST_FILE "//// $key ${port_name} ${direction} ${type} ${vector} ${left} ${right} \n"; + my $q_width = " "; + if( ${vector} eq "vector" ) { $q_width = "[ ${left} : ${right}]"; } + push (@port_list, "${direction} ${type} $q_width ${key}"); + } + } + my $status = $port_cursor->c_close() ; + + + @port_list = sys::lib::trim_sort(@port_list); + + + #/**********************************************************************/ + #/* */ + #/* Now add all ports with their type, size and direction */ + #/* */ + #/**********************************************************************/ + + print DEST_FILE "\n "; + $first = 1; + + foreach $port_line (@port_list) + { + if($first) + { + print DEST_FILE " (\n ${port_line}"; + $first=0; + } + else + { + print DEST_FILE ",\n ${port_line}"; + } + + } + + if ($first == 0) { print DEST_FILE ");\n\n\n\n"; } + elsif ($opt_no_port) { print DEST_FILE "\n\n\n\n"; } + else { print DEST_FILE "();\n\n\n\n";} + + + + + + #/**********************************************************************/ + #/* */ + #/* print wire decs for testbench */ + #/* */ + #/**********************************************************************/ + + + foreach $x_name (@phy_names) + { + + if( $phy_dirs{$x_name} ne "node" ) + { + if ( $phy_vector{$x_name} eq "vector" ) + { + push (@tb_adhoc_list, "\n${x_name}<\/spirit:name>\n\n\n<\/spirit:adHocConnection>\n" ); + } + else + { + push (@tb_adhoc_list, "\n${x_name}<\/spirit:name>\n\n\n<\/spirit:adHocConnection>\n" ); + } + } + } + + @tb_adhoc_list = sys::lib::trim_sort(@tb_adhoc_list); + print TB_DESIGN_FILE "\n\n"; + + foreach $adhoc_line (@tb_adhoc_list) + { + + print TB_DESIGN_FILE "${adhoc_line}\n"; + + + } + + print TB_DESIGN_FILE "\n\n"; + + + + + + + #/**********************************************************************/ + #/* */ + #/* interfaces for html */ + #/* */ + #/**********************************************************************/ + + + foreach $x_name (@phy_names) + { + + if( $phy_dirs{$x_name} ne "node" ) + { + + my $interface_name; + my $interface_description; + + foreach my $socgen_cfg ($socgen_file->findnodes("//socgen:componentConfiguration/socgen:doc/socgen:interfaces/socgen:interface/socgen:name[text() = '$x_name']")) + { + $interface_description = $socgen_cfg->findnodes('../socgen:description/text()')->to_literal ; + } + + if ( $phy_vector{$x_name} eq "vector" ) + { $interface_name = "${x_name}[${phy_lefts{$x_name}}:${phy_rights{$x_name}} ]" ; } + else + { $interface_name = "${x_name}"; } + + + if( $phy_dirs{$x_name} eq "input" ) + { $interface_in_count = $interface_in_count +1 ; + if(length($interface_name) >= $interface_in_size ){$interface_in_size = length($interface_name) }; + }; + + if( $phy_dirs{$x_name} eq "output" ) + { $interface_out_count = $interface_out_count +1 ; + if(length($interface_name) >= $interface_out_size ){$interface_out_size = length($interface_name) }; + + }; + if( $phy_dirs{$x_name} eq "inout" ) + { + $interface_out_count = $interface_out_count +1 ; + if(length($interface_name) >= $interface_out_size ){$interface_out_size = length($interface_name) }; + + }; + + + + + + + + push (@html_interface_list," \n ${interface_name}
\n $phy_dirs{$x_name}
\n ${interface_description}
\n \n" ); + + } + + } + + #/**********************************************************************/ + #/* */ + #/* Add parameters to html file */ + #/* */ + #/**********************************************************************/ + + foreach my $parameter_name (@parameters) + { + my $parameter_value = $parameter_values{$parameter_name}; + my $parameter_description = $parameter_descriptions{$parameter_name}; + push (@html_parameter_list," \n ${parameter_name}
\n ${parameter_value}
\n ${parameter_description}
\n \n"); + } + + #/**********************************************************************/ + #/* */ + #/* Add parameters to dut */ + #/* */ + #/**********************************************************************/ +print TB_DESIGN_FILE "\n\n"; + + + + +print TB_DESIGN_FILE "\n"; +print TB_DESIGN_FILE "dut\n"; +print TB_DESIGN_FILE "\n"; +print TB_DESIGN_FILE "\n"; + + + foreach my $parameter_name (@parameters) + { + print TB_DESIGN_FILE " ${parameter_name}<\/spirit:configurableElementValue>\n"; + } + +print TB_DESIGN_FILE "\n"; +print TB_DESIGN_FILE "\n"; +print TB_DESIGN_FILE "\n"; +print TB_DESIGN_FILE "\n"; + + + + + #/**********************************************************************/ + #/* */ + #/* Add parameters to comp */ + #/* */ + #/**********************************************************************/ +print TB_COMP_FILE "\n\n"; +print TB_COMP_FILE " \n"; +print TB_COMP_FILE " \n"; +print TB_COMP_FILE " \n"; +print TB_COMP_FILE " Dut \n"; +print TB_COMP_FILE " \n"; +print TB_COMP_FILE " \n"; +print TB_COMP_FILE " \n"; +print TB_COMP_FILE " \n"; +print TB_COMP_FILE "\n"; + + + + + + foreach my $parameter_name (@parameters) + { + my $parameter_value = $parameter_values{$parameter_name}; + print TB_COMP_FILE " ${parameter_name}${parameter_value}\n"; + } + + print TB_COMP_FILE "\n"; + print TB_COMP_FILE "\n"; + print TB_COMP_FILE "\n"; + + +if($opt_html ) +{ + print "Creating documentation for $vendor $library $component $version \n"; + my $path ="${home}${repo}/${vendor}/${library}${doc_library_path}"; + mkdir $path,0755 unless( -e $path ); + + + my $path ="${home}${repo}/${vendor}/${library}${doc_library_path}${autodoc}"; + mkdir $path,0755 unless( -e $path ); + + + + $path ="${home}${repo}/${vendor}/${library}${doc_library_path}${autodoc}/html"; + mkdir $path,0755 unless( -e $path ); + + $path ="${home}${repo}/${vendor}/${library}${doc_library_path}/html"; + mkdir $path,0755 unless( -e $path ); + + + + $outfile ="${home}${repo}/${vendor}/${library}${doc_library_path}/html/${main_module_name}.html"; + + unless( -e $outfile ) + { + my $cmd = "cp ${home}/tools/documentation/template.html $outfile "; + if (system($cmd)) {} + }; + + $outfile ="${home}${repo}/${vendor}/${library}${doc_library_path}${autodoc}/html/${main_module_name}.html"; + open HTML_FILE,">$outfile" or die "unable to open $outfile"; + + + print HTML_FILE " \n"; + print HTML_FILE " \n"; + print HTML_FILE " \n"; + print HTML_FILE " \n"; + print HTML_FILE " start \n"; + print HTML_FILE " \n"; + print HTML_FILE " \n"; + print HTML_FILE " \n"; + print HTML_FILE " \n"; + print HTML_FILE " \n"; + print HTML_FILE " \n"; + print HTML_FILE " \n"; + print HTML_FILE " \n"; + print HTML_FILE " \n"; + print HTML_FILE " \n"; + print HTML_FILE "

SOCGEN Datasheet:
\n"; + print HTML_FILE "

\n"; + print HTML_FILE "
\n"; + print HTML_FILE " \n"; + print HTML_FILE " \n"; + print HTML_FILE " \n"; + print HTML_FILE "
\n"; + + if($interface_in_count >= $interface_out_count) {$max_lines = $interface_in_count } + else {$max_lines = $interface_out_count } + + $scale = 1.0000; + $max_lines =(($max_lines *24)+110)* $scale; + $max_width = $interface_in_size + $interface_out_size; + $max_width =(($max_width * 10) + 343) * $scale ; + + print HTML_FILE " \"\"
\n"; + print HTML_FILE "
\n"; + + print HTML_FILE "

Parameters

\n"; + print HTML_FILE "
\n"; + print HTML_FILE "
\n"; + print HTML_FILE "
\n"; + print HTML_FILE " \n"; + print HTML_FILE " \n"; + + print HTML_FILE " \n"; + print HTML_FILE " \n"; + print HTML_FILE " \n"; + print HTML_FILE " \n"; + print HTML_FILE " \n"; + + + + foreach $html_line (@html_parameter_list) + { + print HTML_FILE "${html_line}\n"; + } + + + + print HTML_FILE " \n"; + print HTML_FILE "
Name
default
Description
\n"; + print HTML_FILE "


\n"; + print HTML_FILE "

\n"; + print HTML_FILE "


\n"; + print HTML_FILE "

\n"; + print HTML_FILE "


\n"; + print HTML_FILE "

\n"; + print HTML_FILE "


\n"; + + print HTML_FILE "
\n"; + print HTML_FILE "

\n"; + + print HTML_FILE "

Interface 
\n"; + print HTML_FILE "

\n"; + print HTML_FILE "

\n"; + print HTML_FILE "
\n"; + print HTML_FILE "
\n"; + print HTML_FILE "
\n"; + + + print HTML_FILE " \n"; + print HTML_FILE " \n"; + print HTML_FILE " \n"; + print HTML_FILE " \n"; + print HTML_FILE " \n"; + print HTML_FILE " \n"; + print HTML_FILE " \n"; + foreach $html_line (@html_interface_list) + { + print HTML_FILE "${html_line}\n"; + } + print HTML_FILE " \n"; + print HTML_FILE "
NAME
Type
Description
\n"; + print HTML_FILE "


\n"; + print HTML_FILE "

\n"; + + + + print HTML_FILE "

Children

\n"; + print HTML_FILE "
\n"; + print HTML_FILE "
\n"; + print HTML_FILE " \n"; + print HTML_FILE " \n"; + + print HTML_FILE " \n"; + print HTML_FILE " \n"; + print HTML_FILE " \n"; + print HTML_FILE " \n"; + print HTML_FILE " \n"; + print HTML_FILE " \n"; + print HTML_FILE " \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("//spirit:design/spirit:componentInstances/spirit:componentInstance/spirit:instanceName")) + { + #/**********************************************************************/ + #/* */ + #/* Lookup VLNV for each instantiated component */ + #/* */ + #/**********************************************************************/ + + + my($instance_name) = $x_name ->findnodes('./text()')->to_literal ; + my($vendor_name) = $x_name ->findnodes('../spirit:componentRef/@spirit:vendor')->to_literal ; + my($library_name) = $x_name ->findnodes('../spirit:componentRef/@spirit:library')->to_literal ; + my($component_name) = $x_name ->findnodes('../spirit:componentRef/@spirit:name')->to_literal ; + my($version_name) = $x_name ->findnodes('../spirit:componentRef/@spirit:version')->to_literal ; + + print HTML_FILE " \n"; + print HTML_FILE " \n"; + print HTML_FILE " \n"; + print HTML_FILE " \n"; + print HTML_FILE " \n"; + print HTML_FILE " \n"; + print HTML_FILE " \n"; + } + } + + print HTML_FILE " \n"; + print HTML_FILE "
Instance
Vendor
Library
Component
Version
$instance_name
$vendor_name
$library_name
$component_name
$version_name
\n"; + print HTML_FILE "


\n"; + print HTML_FILE "

\n"; + print HTML_FILE "
\n"; + print HTML_FILE "
\n"; + print HTML_FILE "
\n"; + print HTML_FILE "
\n"; + print HTML_FILE "
\n"; + print HTML_FILE "
\n"; + print HTML_FILE "
\n"; + print HTML_FILE "
\n"; + print HTML_FILE " \"\"
\n"; + print HTML_FILE "
\n"; + print HTML_FILE "
\n"; + print HTML_FILE "
\n"; + print HTML_FILE "
\n"; + print HTML_FILE "
\n"; + print HTML_FILE "
\n"; + print HTML_FILE "
\n"; + print HTML_FILE "
\n"; + print HTML_FILE "
\n"; + print HTML_FILE "
\n"; + print HTML_FILE "
\n"; + print HTML_FILE "
\n"; + print HTML_FILE "
\n"; + print HTML_FILE "
\n"; + print HTML_FILE "
\n"; + print HTML_FILE "
\n"; + print HTML_FILE "
\n"; + print HTML_FILE "
\n"; + print HTML_FILE "
\n"; + print HTML_FILE "
\n"; + print HTML_FILE "
\n"; + print HTML_FILE "
\n"; + print HTML_FILE "
\n"; + print HTML_FILE "
\n"; + print HTML_FILE "
\n"; + print HTML_FILE " \n"; + print HTML_FILE " \n"; +} + + #/**********************************************************************/ + #/* */ + #/* Add any and all local parameters with their default values */ + #/* */ + #/**********************************************************************/ + + if ($opt_local_parameters) + { + foreach my $parameter_name (@parameters) + { + my $parameter_value = $parameter_values{${parameter_name}}; + print DEST_FILE "parameter ${parameter_name} = ${parameter_value};\n"; + } + } + + #/**********************************************************************/ + #/* */ + #/* Add all internal wires and regs with their sizes */ + #/* */ + #/**********************************************************************/ + + my $port_cursor = $ports_db->db_cursor() ; + while ($port_cursor->c_get($key, $value, DB_NEXT) == 0) + { + ( ${key_type},${busref},${conn}) = split( /\./ , $key); + ( ${port_name},${direction},${type},${vector},${left},${right}) = split ':', $value; + + if( ($key eq $port_name) and ($direction eq "node" ) ) + { + my $q_width = " "; + if( ${vector} eq "vector" ) { $q_width = "[ $left : $right]";} + if( $direction eq "node" ) { push @wire_nodes, "$type $q_width ${port_name};";} + } + } + + my $status = $port_cursor->c_close() ; + } + + @wire_nodes = sys::lib::trim_sort(@wire_nodes); + + unless ($opt_interface_only) + { + foreach my $wire_node (@wire_nodes) + { + print DEST_FILE "${wire_node}\n"; + } + + print DEST_FILE "\n\n\n"; + while( my $line_out = shift(@instantiations)) { print DEST_FILE "$line_out";} + + + #/**********************************************************************/ + #/* */ + #/* After all the data from the ip-xact file has been entered we now */ + #/* insert any and all verilog fragments at the end before closing */ + #/* the module */ + #/* */ + #/**********************************************************************/ + + + foreach my $i_name ($spirit_component_file->findnodes("//spirit:fileSets/spirit:fileSet/spirit:file/spirit:name")) + { + my($rtl_file) = $i_name ->findnodes('./text()')->to_literal; + my($file_type) = $i_name ->findnodes('../spirit:userFileType/text()')->to_literal; + my($view_file) = $i_name ->findnodes('../../spirit:name/text()')->to_literal ; + + if(($file_type eq "fragment")&& (($view_file eq $view_fileset_name))) + { + $SRCFILE ="${home}${prefix}/${vendor}__${library}${lib_comp_sep}${component}${comp_xml_sep}/${rtl_file}"; + open(SRCFILE) or die("Could not open src file. $SRCFILE "); + foreach $line () + { + chomp($line); + print DEST_FILE "${line}\n"; + } + } + } + } + unless ($opt_fragment ) {print DEST_FILE "\n\n\n endmodule\n\n";} + + } + + + + + + + + + + + +#/*********************************************************************************************/ +#/ */ +#/ this routine does not follow busses down into componentRef */ +#/ */ +#/ */ +#/ */ +#/ */ +#/*********************************************************************************************/ + + + + +sub parse_busInterface + { + my @params = @_; + my $depth = pop(@params); + my $busref = pop(@params); + my $version = pop(@params); + my $component = pop(@params); + my $library = pop(@params); + my $vendor = pop(@params); + + my $home = cwd(); + + my @out_stack = (); + + if($opt_verbose){print "parse_busInterface $vendor $library $component $version \n"; } + + + + my $busInterfaceTest = 0; + + + + +my @filelist = yp::lib::parse_component_brothers("$vendor","$library","$component","$version"); + +foreach $line (@filelist) + { + $_ = $line; + if(/::(\S+)::(\S+)::(\S+)::(\S+)::/) + { + $new_library = $2; + $new_component = $3; + $new_vendor = $1; + $new_version = $4; + +# print " FFFFFFFFFFFFFFFF Brother $new_vendor $new_library $new_component $new_version \n" ; + + my $spirit_component_file = $parser->parse_file(yp::lib::find_ipxact_component($new_vendor,$new_library,$new_component,$new_version)); + + + my @mas_slave; + push @mas_slave , "master"; + push @mas_slave , "slave"; + + foreach my $seek_type (@mas_slave) + { + +#print "XXXXCX Component $new_vendor $new_library $new_component $new_version $seek_type \n"; + + foreach my $bus_iface ($spirit_component_file->findnodes("//spirit:component/spirit:busInterfaces/spirit:busInterface/spirit:${seek_type}")) + { + my($fff_cname) = $bus_iface->findnodes('../spirit:name/text()')->to_literal ; + my($fff_vendor) = $bus_iface->findnodes('../spirit:abstractionType/@spirit:vendor')->to_literal ; + my($fff_library) = $bus_iface->findnodes('../spirit:abstractionType/@spirit:library')->to_literal ; + my($fff_name) = $bus_iface->findnodes('../spirit:abstractionType/@spirit:name')->to_literal ; + my($fff_version) = $bus_iface->findnodes('../spirit:abstractionType/@spirit:version')->to_literal ; + + + if( $busref eq $fff_cname ) + { + my $absDef_filename = yp::lib::get_absDef_db_filename($fff_vendor,$fff_library,$fff_name,$fff_version); + $absDef_db = new BerkeleyDB::Hash( -Filename => $absDef_filename, -Flags => DB_CREATE ) or die "Cannot open ${absDef_filename}: $!"; + + + foreach my $port_face ($spirit_component_file->findnodes('//spirit:component/spirit:busInterfaces/spirit:busInterface/spirit:portMaps/spirit:portMap/spirit:logicalPort')) + { + my($fff_log_name) = $port_face->findnodes('./spirit:name/text()')->to_literal ; + my($fff_int_name) = $port_face->findnodes('../../../spirit:name/text()')->to_literal ; + my($fff_phy_name) = $port_face->findnodes('../spirit:physicalPort/spirit:name/text()')->to_literal ; + my($fff_type_name) = $port_face->findnodes('../spirit:physicalPort/spirit:wireTypeDefs/spirit:wireTypeDef/spirit:typeName/text()')->to_literal ; + my($fff_left_value) = $port_face->findnodes('../spirit:physicalPort/spirit:wire/spirit:vector/spirit:left/text()')->to_literal ; + my($fff_right_value) = $port_face->findnodes('../spirit:physicalPort/spirit:wire/spirit:vector/spirit:right/text()')->to_literal ; + + unless ($fff_type_name) {$fff_type_name = "wire";}; + + + + my $abs_data; + $absDef_db->db_get("${seek_type}__${fff_log_name}", $abs_data ); + + ( $berk_name, $berk_presence,$berk_width,$fff_direction ) = split ':', $abs_data; + + if( ( $fff_int_name eq $busref) ) + { + $busInterfaceTest = 1; +# print "XXXCXX $fff_log_name $seek_type $fff_direction \n"; + + if($fff_left_value ne "") + { push @out_stack, ":::${depth}:::${fff_log_name}:::${fff_phy_name}:::${fff_direction}:::${fff_type_name}:::vector:::${fff_left_value}:::${$fff_right_value}:::"; } + else + { push @out_stack, ":::${depth}:::${fff_log_name}:::${fff_phy_name}:::${fff_direction}:::${fff_type_name}:::scaler:::none:::none:::"; } + + + } + + } + +# print "XXXCXX CLOSE ${fff_vendor}_${fff_library}_${fff_name}_${fff_version} \n"; + + + + + + + $absDef_db->db_close(); + + } + + + + + + + } + +} + + +} + +} + + + if ( $busInterfaceTest){ + @out_stack = sys::lib::trim_sort(@out_stack); + return(@out_stack); + } + + + 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('//spirit:hierConnections/spirit:hierConnection/@spirit:interfaceRef')) + { + my($hierConn_name) = $x_name ->to_literal ; + my($hierConn_comref_name) = $x_name ->findnodes('../spirit:interface/@spirit:componentRef')->to_literal ; + my($hierConn_busref_name) = $x_name ->findnodes('../spirit:interface/@spirit:busRef')->to_literal ; + if($busref eq $hierConn_name) + { + foreach my $x_name ($sd_file->findnodes("//spirit:design/spirit:componentInstances/spirit:componentInstance/spirit:instanceName[text() = '$hierConn_comref_name']")) + { + #/**********************************************************************/ + #/* */ + #/* Lookup VLNV for each instantiated component */ + #/* */ + #/**********************************************************************/ + + my($vendor_name) = $x_name ->findnodes('../spirit:componentRef/@spirit:vendor')->to_literal ; + my($library_name) = $x_name ->findnodes('../spirit:componentRef/@spirit:library')->to_literal ; + my($component_name) = $x_name ->findnodes('../spirit:componentRef/@spirit:name')->to_literal ; + my($version_name) = $x_name ->findnodes('../spirit:componentRef/@spirit:version')->to_literal ; + $depth = $depth +1; + @out_stack = parse_busInterface ($vendor_name, $library_name,$component_name,$version_name,$hierConn_busref_name,$depth ); + } + } + } + + } + + + + + @out_stack = sys::lib::trim_sort(@out_stack); + return(@out_stack); + + + } + + + + + + + + + + + + + + +#/*********************************************************************************************/ +#/ */ +#/ */ +#/ */ +#/ */ +#/ */ +#/ */ +#/*********************************************************************************************/ + + + + +sub parse_design_files + { + my @params = @_; + my $spirit_component_file = pop(@params); + + #print "\n"; + + + + + + + foreach my $new_comp ($spirit_component_file->findnodes("//spirit:component/spirit:model/spirit:views/spirit:view/spirit:vendorExtensions/spirit:componentRef")) + { + my($new_vendor) = $new_comp->findnodes('./@spirit:vendor')->to_literal ; + my($new_library) = $new_comp->findnodes('./@spirit:library')->to_literal ; + my($new_name) = $new_comp->findnodes('./@spirit:name')->to_literal ; + my($new_version) = $new_comp->findnodes('./@spirit:version')->to_literal ; + parse_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")) + { + my($new_vendor) = $new_comp->findnodes('./@spirit:vendor')->to_literal ; + my($new_library) = $new_comp->findnodes('./@spirit:library')->to_literal ; + my($new_name) = $new_comp->findnodes('./@spirit:name')->to_literal ; + my($new_version) = $new_comp->findnodes('./@spirit:version')->to_literal ; + if(yp::lib::find_ipxact_design($new_vendor,$new_library,$new_name,$new_version )) + { + parse_design_file($parser->parse_file(yp::lib::find_ipxact_design($new_vendor,$new_library,$new_name,$new_version )) ); + } + + + + + + } + +} + + + + + + + +#/*********************************************************************************************/ +#/ */ +#/ */ +#/ */ +#/ */ +#/ */ +#/ */ +#/*********************************************************************************************/ + + + + +sub process_design_files + { + my @params = @_; + my $spirit_component_file = pop(@params); + + #print "\n"; + + + + + + + + foreach my $new_comp ($spirit_component_file->findnodes("//spirit:component/spirit:model/spirit:views/spirit:view/spirit:vendorExtensions/spirit:componentRef")) + { + my($new_vendor) = $new_comp->findnodes('./@spirit:vendor')->to_literal ; + my($new_library) = $new_comp->findnodes('./@spirit:library')->to_literal ; + my($new_name) = $new_comp->findnodes('./@spirit:name')->to_literal ; + my($new_version) = $new_comp->findnodes('./@spirit:version')->to_literal ; + 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")) + { + my($new_vendor) = $new_comp->findnodes('./@spirit:vendor')->to_literal ; + my($new_library) = $new_comp->findnodes('./@spirit:library')->to_literal ; + my($new_name) = $new_comp->findnodes('./@spirit:name')->to_literal ; + my($new_version) = $new_comp->findnodes('./@spirit:version')->to_literal ; + 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"; } + process_design_file($parser->parse_file(yp::lib::find_ipxact_design($new_vendor,$new_library,$new_name,$new_version )) ); + } + } + +} + + + + + + + + + + +#/*********************************************************************************************/ +#/ */ +#/ */ +#/ */ +#/ */ +#/ */ +#/ */ +#/*********************************************************************************************/ + + + + +sub parse_design_file + { + my @params = @_; + my $spirit_design_file = pop(@params); + + + + + +#print "\n"; +foreach my $new_comp ($spirit_design_file->findnodes("//spirit:design/spirit:vendor")) + { + my($new_vendor) = $new_comp->findnodes('./text()')->to_literal ; + my($new_library) = $new_comp->findnodes('../spirit:library/text()')->to_literal ; + my($new_name) = $new_comp->findnodes('../spirit:name/text()')->to_literal ; + my($new_version) = $new_comp->findnodes('../spirit:version/text()')->to_literal ; + #print "WARNING $new_vendor $new_library $new_name $new_version DESIGN \n"; + } + + + + + #/**********************************************************************/ + #/* */ + #/* Add all internal wires and regs with their sizes */ + #/* */ + #/**********************************************************************/ + + foreach my $i_name ($spirit_design_file->findnodes("//spirit:design/spirit:vendorExtensions/socgen:nodes/socgen:node/spirit:name")) + { + my($node_name) = $i_name ->findnodes('./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_right) = $i_name ->findnodes('../spirit:wire/spirit:vector/spirit:right/text()')->to_literal ; + my($node_type) = $i_name ->findnodes('../spirit:typeName/text()')->to_literal ; + + unless($node_busdef){ $node_busdef = $node_name; } + + if( $node_left ne "" ) { push @wire_decs , ":::${node_busdef}:::${node_name}:::node:::${node_type}:::vector:::${node_left}:::${$node_right}:::none:::0:::${node_name}:::XXX:::${node_name}:::"; } + else { push @wire_decs , ":::${node_busdef}:::${node_name}:::node:::${node_type}:::scaler:::none:::none:::none:::0:::${node_name}:::XXX:::${node_name}:::"; } + + } + + + + + + + + + #/**********************************************************************/ + #/* */ + #/* Read each hierConnection and enter signals into wire_decs */ + #/* */ + #/**********************************************************************/ + foreach my $x_name ($spirit_design_file->findnodes('//spirit:hierConnections/spirit:hierConnection/@spirit:interfaceRef')) + { + my($hierConn_name) = $x_name ->to_literal ; + my($hierConn_comref_name) = $x_name ->findnodes('../spirit:interface/@spirit:componentRef')->to_literal ; + my($hierConn_busref_name) = $x_name ->findnodes('../spirit:interface/@spirit:busRef')->to_literal ; + + foreach my $x_name ($spirit_design_file->findnodes("//spirit:design/spirit:componentInstances/spirit:componentInstance/spirit:instanceName")) + { + #/**********************************************************************/ + #/* */ + #/* Lookup VLNV for each instantiated component */ + #/* */ + #/**********************************************************************/ + + my($instance_name) = $x_name ->findnodes('./text()')->to_literal ; + my($vendor_name) = $x_name ->findnodes('../spirit:componentRef/@spirit:vendor')->to_literal ; + my($library_name) = $x_name ->findnodes('../spirit:componentRef/@spirit:library')->to_literal ; + my($component_name) = $x_name ->findnodes('../spirit:componentRef/@spirit:name')->to_literal ; + my($version_name) = $x_name ->findnodes('../spirit:componentRef/@spirit:version')->to_literal ; + + if( "$instance_name" eq "$hierConn_comref_name" ) + { + my @filelist_sub = parse_busInterface($vendor_name, $library_name,$component_name,$version_name,$hierConn_busref_name,"1" ); + #/**********************************************************************/ + #/* */ + #/* follow bus all the way to it's source */ + #/* */ + #/**********************************************************************/ + + foreach $xxline (@filelist_sub) + { + $_ = $xxline; + if(/:::(\S+):::(\S+):::(\S+):::(\S+):::(\S+):::(\S+):::(\S+):::(\S+):::/) + { + $k_depth = $1; + $k_log_name = $2; + $k_phy_name = $3; + $k_direction = $4; + $k_type = $5; + $k_vector = $6; + $k_left = $7; + $k_right = $8; + push @wire_decs,":::${hierConn_name}_${k_log_name}:::${hierConn_name}_${k_log_name}:::${k_direction}:::wire:::${k_vector}:::${k_left}:::${k_right}:::${hierConn_comref_name}:::${k_depth}:::${k_phy_name}:::${hierConn_busref_name}:::${k_log_name}:::"; + } + } + } + } + } + + + + + + #/**************************************************************************/ + #/* */ + #/* Read each interconnection and enter sub signals into wire_decs */ + #/* */ + #/**************************************************************************/ + + + + + foreach my $x_name ($spirit_design_file->findnodes('//spirit:interconnections/spirit:interconnection/spirit:activeInterface/@spirit:componentRef')) + { + my($hierConn_comref_name) = $x_name ->to_literal; + my($hierConn_busref_name) = $x_name ->findnodes('../@spirit:busRef')->to_literal ; + my($hierConn_name) = $x_name ->findnodes('../../spirit:name/text()')->to_literal ; + + foreach my $x_name ($spirit_design_file->findnodes("//spirit:design/spirit:componentInstances/spirit:componentInstance/spirit:instanceName")) + { + #/**********************************************************************/ + #/* */ + #/* Lookup VLNV for each instantiated component */ + #/* */ + #/**********************************************************************/ + + my($instance_name) = $x_name ->findnodes('./text()')->to_literal ; + my($vendor_name) = $x_name ->findnodes('../spirit:componentRef/@spirit:vendor')->to_literal ; + my($library_name) = $x_name ->findnodes('../spirit:componentRef/@spirit:library')->to_literal ; + my($component_name) = $x_name ->findnodes('../spirit:componentRef/@spirit:name')->to_literal ; + my($version_name) = $x_name ->findnodes('../spirit:componentRef/@spirit:version')->to_literal ; + + + + if( "$instance_name" eq "$hierConn_comref_name" ) + { + + + + #/**********************************************************************/ + #/* */ + #/* follow bus all the way to it's source */ + #/* */ + #/**********************************************************************/ + + + my @filelist_sub = parse_busInterface($vendor_name, $library_name,$component_name,$version_name,$hierConn_busref_name,"1" ); + foreach $xxline (@filelist_sub) + { + + + $_ = $xxline; + if(/:::(\S+):::(\S+):::(\S+):::(\S+):::(\S+):::(\S+):::(\S+):::(\S+):::/) + { + $k_depth = $1; + $k_log_name = $2; + $k_phy_name = $3; + $k_direction = $4; + $k_type = $5; + $k_vector = $6; + $k_left = $7; + $k_right = $8; + + + push @wire_decs,":::${hierConn_name}_${k_log_name}:::${hierConn_name}_${k_log_name}:::node:::wire:::${k_vector}:::${k_left}:::${k_right}:::${hierConn_comref_name}:::${k_depth}:::${k_phy_name}:::${hierConn_busref_name}:::${k_log_name}:::"; + } + } + } + } + } + + + + #/*******************************************************************************/ + #/* */ + #/* Read each interconnection and enter modified signals into wire_decs */ + #/* */ + #/*******************************************************************************/ + + + + + + foreach my $k_name ($spirit_design_file->findnodes('//spirit:interconnections/spirit:interconnection/spirit:activeInterface/spirit:portMaps/spirit:portMap/spirit:logicalPort/spirit:name')) + { + my($lp_name) = $k_name ->to_literal; + my($lp_pname) = $k_name ->findnodes('../../spirit:physicalPort/spirit:name/text()')->to_literal ; + my($lp_left) = $k_name ->findnodes('../../spirit:physicalPort/spirit:wire/spirit:vector/spirit:left/text()')->to_literal ; + my($lp_right) = $k_name ->findnodes('../../spirit:physicalPort/spirit:wire/spirit:vector/spirit:right/text()')->to_literal ; + my($lp_componentref_name) = $k_name ->findnodes('../../../../@spirit:componentRef')->to_literal ; + my($lp_busref_name) = $k_name ->findnodes('../../../../@spirit:busRef')->to_literal ; + my($lp_interconnect_name) = $k_name ->findnodes('../../../../../spirit:name/text()')->to_literal ; + + + if ( $lp_pname eq '' ) { $lp_pname ="${lp_interconnect_name}_${lp_name}";} + if ( $lp_left eq '' ) { $lp_left ="none";} + if ( $lp_right eq '' ) { $lp_right ="none";} + + + + if ( $lp_left eq 'none' ) + { + push @wire_decs,":::${lp_interconnect_name}_${lp_name}:::${lp_pname}:::node:::wire:::scaler:::none:::none:::${lp_componentref_name}:::0:::${lp_interconnect_name}_${lp_name}:::${lp_busref_name}:::${lp_pname}:::"; + } + else + { + push @wire_decs,":::${lp_interconnect_name}_${lp_name}:::${lp_pname}:::node:::wire:::vector:::${lp_left}:::${lp_right}:::${lp_componentref_name}:::0:::${lp_interconnect_name}_${lp_name}:::${lp_busref_name}:::${lp_pname}:::"; + } + } + + + + + + + + + #/**********************************************************************/ + #/* */ + #/* Read all adHocConnections and load instance connect info into array*/ + #/* */ + #/**********************************************************************/ + + + foreach my $i_xame ($spirit_design_file->findnodes('//spirit:adHocConnections/spirit:adHocConnection/spirit:internalPortReference/@spirit:componentRef')) + { + my($comp_name) = $i_xame ->to_literal; + my($int_value) = $i_xame ->findnodes('../../spirit:name/text()')->to_literal ; + my($tied_value) = $i_xame ->findnodes('../../@spirit:tiedValue')->to_literal ; + my($int_name) = $i_xame ->findnodes('../@spirit:portRef')->to_literal ; + my($vec_name) = $i_xame ->findnodes('../../spirit:externalPortReference/@spirit:portRef')->to_literal ; + my($vec_left) = $i_xame ->findnodes('../../spirit:externalPortReference/@spirit:left')->to_literal ; + my($vec_right) = $i_xame ->findnodes('../../spirit:externalPortReference/@spirit:right')->to_literal ; + + +# print "XXXXXX $comp_name $int_name ( $int_value $tied_value ) $vec_name $vec_left $vec_right \n"; + + + unless ($int_value) + {$int_value = "_DUMMY_"; + } + + + if($tied_value ) + { + push @inst_conns , ":::${comp_name}:::adhoc:::${int_name}:::${tied_value}:::scaler:::none:::none:::"; + } + elsif($vec_left ne "") + { + push @inst_conns , ":::${comp_name}:::adhoc:::${int_name}:::${int_value}:::vector:::${vec_left}:::${vec_right}:::"; + push @wire_decs , ":::${vec_name}:::${int_value}:::node:::wire:::vector:::${vec_left}:::${$vec_right}:::none:::0:::${int_value}:::XXX:::${vec_name}:::"; + } + else + { + push @inst_conns , ":::${comp_name}:::adhoc:::${int_name}:::${int_value}:::scaler:::none:::none:::"; + push @wire_decs , ":::${vec_name}:::${int_value}:::node:::wire:::scaler:::none:::none:::none:::0:::${int_value}:::XXX:::${vec_name}:::"; + } + + + } + + + + + + + + + + + + + + + + + + + + #/**********************************************************************/ + #/* */ + #/* extract bus instance connections from wire_decs */ + #/* */ + #/**********************************************************************/ + + #print "+-+"; + + + + my @inst_names = (); + my @inst_Inames = (); + my %inst_ports = (); + my %inst_sigs = (); + my %inst_vector = (); + my %inst_left = (); + my %inst_right = (); + + + foreach $line (@wire_decs) + { + $_ = $line; + + + if(/:::(\S+):::(\S+):::(\S+):::(\S+):::(\S+):::(\S+):::(\S+):::(\S+):::(\S+):::(\S+):::(\S+):::(\S+):::/) + { + my $t_index = $1; + my $t_node_name = $2; + my $t_direction = $3; + my $t_type = $4; + my $t_vector = $5; + my $t_left = $6; + my $t_right = $7; + my $t_instance = $8; + my $t_depth = $9; + my $t_phy_name = $10; + my $t_busref_name = $11; + my $t_abslog_name = $12; + + if( 1) + { + + push ( @inst_names, "${t_instance}_${t_busref_name}_${t_index}"); + + $inst_Inames{"${t_instance}_${t_busref_name}_${t_index}"} = "${t_instance}"; + + if( $inst_sigs{"${t_instance}_${t_busref_name}_${t_index}"}) + { + if( $inst_sigs{"${t_instance}_${t_busref_name}_${t_index}"} eq ${t_index}) + { + $inst_sigs{"${t_instance}_${t_busref_name}_${t_index}"} = "${t_node_name}"; + } + } + else + { + $inst_sigs{"${t_instance}_${t_busref_name}_${t_index}"} = "${t_node_name}"; + } + + if ($t_depth >= 2 ) { $inst_ports{"${t_instance}_${t_busref_name}_${t_index}"} = "${t_busref_name}_${t_abslog_name}" ;} + elsif($t_depth == 1 ) { $inst_ports{"${t_instance}_${t_busref_name}_${t_index}"} = "${t_phy_name}";} + + if( $inst_vector{"${t_instance}_${t_busref_name}_${t_index}"}) + { + if( $inst_vector{"${t_instance}_${t_busref_name}_${t_index}"} eq "scaler") + {$inst_vector{"${t_instance}_${t_busref_name}_${t_index}"} = "${t_vector}";} + } + else + {$inst_vector{"${t_instance}_${t_busref_name}_${t_index}"} = "${t_vector}";} + + unless( $inst_left{"${t_instance}_${t_busref_name}_${t_index}"} eq '') + { + if( $inst_left{"${t_instance}_${t_busref_name}_${t_index}"} eq "none") + { + $inst_left{"${t_instance}_${t_busref_name}_${t_index}"} = "${t_left}"; + } + elsif( $inst_left{"${t_instance}_${t_busref_name}_${t_index}"} < ${t_left}) + { + $inst_left{"${t_instance}_${t_busref_name}_${t_index}"} = "${t_left}"; + } + } + else + { + $inst_left{"${t_instance}_${t_busref_name}_${t_index}"} = "${t_left}"; + } + + unless( $inst_right{"${t_instance}_${t_busref_name}_${t_index}"} eq '') + { + if( $inst_right{"${t_instance}_${t_busref_name}_${t_index}"} eq "none") + { + $inst_right{"${t_instance}_${t_busref_name}_${t_index}"} = "${t_right}"; + } + elsif( $inst_right{"${t_instance}_${t_busref_name}_${t_index}"} < ${t_right}) + { + $inst_right{"${t_instance}_${t_busref_name}_${t_index}"} = "${t_right}"; + } + } + else {$inst_right{"${t_instance}_${t_busref_name}_${t_index}"} = "${t_right}";} + + } + } + } + @inst_names = sys::lib::trim_sort(@inst_names); + foreach $i_name (@inst_names) + { + unless($inst_Inames{$i_name} eq "none") + { + if($inst_vector{$i_name} eq "vector" ) + { + push @inst_conns ,":::$inst_Inames{$i_name}:::adhoc:::$inst_ports{$i_name}:::$inst_sigs{$i_name}:::vector:::$inst_left{$i_name}:::$inst_right{$i_name}:::"; + } + else + { + push @inst_conns ,":::$inst_Inames{$i_name}:::adhoc:::$inst_ports{$i_name}:::$inst_sigs{$i_name}:::scaler:::none:::none:::"; + + } + } + } + } + + + + + + + + + +#/*********************************************************************************************/ +#/ */ +#/ */ +#/ */ +#/ */ +#/ */ +#/ */ +#/*********************************************************************************************/ + + + + +sub process_design_file + { + my @params = @_; + my $spirit_design_file = pop(@params); + + + + + +#print "\n"; +foreach my $new_comp ($spirit_design_file->findnodes("//spirit:design/spirit:vendor")) + { + my($new_vendor) = $new_comp->findnodes('./text()')->to_literal ; + my($new_library) = $new_comp->findnodes('../spirit:library/text()')->to_literal ; + my($new_name) = $new_comp->findnodes('../spirit:name/text()')->to_literal ; + my($new_version) = $new_comp->findnodes('../spirit:version/text()')->to_literal ; +# print "XXXXXX- $new_vendor $new_library $new_name $new_version DESIGN \n"; + } + + + + + + #/**********************************************************************/ + #/* */ + #/* Instantiate each component with parameters and port connections */ + #/* */ + #/* If the component doesn't have a instance name then this is skipped */ + #/* */ + #/**********************************************************************/ + + #print "+-+"; + + push @instantiations , "////////////////////////////////////////////////////////////////\n"; + + + @inst_conns = sys::lib::trim_sort(@inst_conns); + + + + + + + foreach my $i_name ($spirit_design_file->findnodes("//spirit:design/spirit:componentInstances/spirit:componentInstance/spirit:instanceName")) + { + my($instance_name) = $i_name ->findnodes('./text()')->to_literal ; + my($vendor_name) = $i_name ->findnodes('../spirit:componentRef/@spirit:vendor')->to_literal ; + 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 ; + + my $module_name = yp::lib::get_module_name($vendor_name,$library_name,$component_name,$version_name) ; + + + + + + + + if($instance_name) + { + push @instantiations , "$module_name\n"; + $first = 1; + + foreach my $i_parameter ($spirit_design_file->findnodes("//spirit:componentInstance[spirit:instanceName/text() = '$instance_name']/spirit:configurableElementValues/spirit:configurableElementValue/\@spirit:referenceId")) + { + my($foo_name) = $i_parameter ->to_literal ; + my($foo_value) = $i_parameter ->findnodes('../text()')->to_literal ; + + + + + 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 , "$instance_name \n (\n "; + $first = 1; + + + + + foreach $line (@inst_conns) + { + $_ = $line; + + if(/:::(\S+):::(\S+):::(\S+):::(\S+):::(\S+):::(\S+):::(\S+):::/) + { + my $z_instance_name = $1; + my $z_busRef_name = $2; + my $z_port_name = $3; + my $z_signal_name = $4; + my $z_vecscal = $5; + my $z_left = $6; + my $z_right = $7; + + if($opt_debug ){print "YYYYYY-- $line \n";} + + if($z_vecscal eq "vector") + { + if($z_left eq $z_right){$z_signal_name = "${z_signal_name}[${z_left}]" ;} + else {$z_signal_name = "${z_signal_name}[${z_left}:${z_right}]" ;} + } + + if ($z_signal_name eq "_DUMMY_") {$z_signal_name = " ";} + + if($instance_name eq $z_instance_name ) + { + if($first) + { + push @instantiations , " .${z_port_name} (${z_signal_name})"; + $first =0; + } + else { push @instantiations , ",\n .${z_port_name} (${z_signal_name})";} + } + } + } + + #print "."; + push @instantiations , ");\n\n"; + } + } + } + + + + + + + + + +#/*********************************************************************************************/ +#/ */ +#/ */ +#/ */ +#/ */ +#/ */ +#/ */ +#/*********************************************************************************************/ + + + + +sub parse_component_file + { + my @params = @_; + my $spirit_component_file = pop(@params); + + +#print "\n"; +foreach my $new_comp ($spirit_component_file->findnodes("//spirit:component/spirit:vendor")) + { + my($new_vendor) = $new_comp->findnodes('./text()')->to_literal ; + my($new_library) = $new_comp->findnodes('../spirit:library/text()')->to_literal ; + my($new_name) = $new_comp->findnodes('../spirit:name/text()')->to_literal ; + my($new_version) = $new_comp->findnodes('../spirit:version/text()')->to_literal ; + if($opt_verbose){print "parse_component_file $new_vendor $new_library $new_name $new_version COMPONENT \n";} + } + + + + + #/**********************************************************************/ + #/* */ + #/* parse parameters and values */ + #/* */ + #/**********************************************************************/ + + foreach my $i_name ($spirit_component_file->findnodes('//spirit:model/spirit:modelParameters/spirit:modelParameter/spirit:name')) + { + my($parameter_name) = $i_name ->to_literal; + my($parameter_default) = $i_name ->findnodes('../spirit:value/text()')->to_literal ; + + unless(defined $parameter_values{$parameter_name}) + { + push ( @parameters, "$parameter_name"); + $parameter_values{$parameter_name} = ${parameter_default}; +# $parameter_descriptions{$parameter_name} = "Duhkkk"; + + + foreach my $socgen_cfg ($socgen_file->findnodes("//socgen:componentConfiguration/socgen:doc/socgen:parameters/socgen:parameter/socgen:name[text() = '$parameter_name']")) + { + my($param_description) = $socgen_cfg->findnodes('../socgen:description/text()')->to_literal ; + $parameter_descriptions{$parameter_name} = $param_description ; + } + + + + }; + + } + + + + + + + +foreach my $new_comp ($spirit_component_file->findnodes("//spirit:component/spirit:model/spirit:views/spirit:view/spirit:vendorExtensions/spirit:componentRef")) + { + my($new_vendor) = $new_comp->findnodes('./@spirit:vendor')->to_literal ; + my($new_library) = $new_comp->findnodes('./@spirit:library')->to_literal ; + my($new_name) = $new_comp->findnodes('./@spirit:name')->to_literal ; + my($new_version) = $new_comp->findnodes('./@spirit:version')->to_literal ; + 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)) ); + } + + } + + + + + + #/**********************************************************************/ + #/* */ + #/* Read each busInterface and save master/slave direction */ + #/* */ + #/**********************************************************************/ + + my @mas_slave; + + push @mas_slave , "master"; + push @mas_slave , "slave"; + + foreach $seek_type (@mas_slave) + { + + foreach my $bus_iface ($spirit_component_file->findnodes("//spirit:component/spirit:busInterfaces/spirit:busInterface/spirit:${seek_type}")) + { + my($mmm_cname) = $bus_iface->findnodes('../spirit:name/text()')->to_literal ; + my($mmm_vendor) = $bus_iface->findnodes('../spirit:abstractionType/@spirit:vendor')->to_literal ; + my($mmm_library) = $bus_iface->findnodes('../spirit:abstractionType/@spirit:library')->to_literal ; + my($mmm_name) = $bus_iface->findnodes('../spirit:abstractionType/@spirit:name')->to_literal ; + my($mmm_version) = $bus_iface->findnodes('../spirit:abstractionType/@spirit:version')->to_literal ; + + foreach my $port_face ($spirit_component_file->findnodes('//spirit:component/spirit:busInterfaces/spirit:busInterface/spirit:portMaps/spirit:portMap/spirit:logicalPort')) + { + my($rrr_log_name) = $port_face->findnodes('./spirit:name/text()')->to_literal ; + my($rrr_int_name) = $port_face->findnodes('../../../spirit:name/text()')->to_literal ; + my($rrr_phy_name) = $port_face->findnodes('../spirit:physicalPort/spirit:name/text()')->to_literal ; + my($rrr_type_name) = $port_face->findnodes('../spirit:physicalPort/spirit:wireTypeDefs/spirit:wireTypeDef/spirit:typeName/text()')->to_literal ; + my($rrr_left_value) = $port_face->findnodes('../spirit:physicalPort/spirit:wire/spirit:vector/spirit:left/text()')->to_literal ; + my($rrr_right_value) = $port_face->findnodes('../spirit:physicalPort/spirit:wire/spirit:vector/spirit:right/text()')->to_literal ; + + unless ($rrr_type_name) {$rrr_type_name = "wire";} + + if( $mmm_cname eq $rrr_int_name ) + { + my $absDef_filename = yp::lib::get_absDef_db_filename($mmm_vendor,$mmm_library,$mmm_name,$mmm_version); + $absDef_db = new BerkeleyDB::Hash( -Filename => $absDef_filename, -Flags => DB_CREATE ) or die "Cannot open ${absDef_filename}: $!"; + + my $abs_data; + $absDef_db->db_get("${seek_type}__${rrr_log_name}", $abs_data ); + + ( $berk_name, $berk_presence,$berk_width,$berk_direction ) = split ':', $abs_data; + + my $rrr_direction = $berk_direction; + if($rrr_left_value ne "") + { + push @wire_decs , ":::${mmm_cname}_${rrr_log_name}:::${rrr_phy_name}:::${rrr_direction}:::${rrr_type_name}:::vector:::${rrr_left_value}:::${$rrr_right_value}:::none:::0:::${rrr_phy_name}:::XXX:::${rrr_log_name}:::"; + } + else + { + push @wire_decs , ":::${mmm_cname}_${rrr_log_name}:::${rrr_phy_name}:::${rrr_direction}:::${rrr_type_name}:::scaler:::none:::none:::none:::0:::${rrr_phy_name}:::XXX:::${rrr_log_name}:::"; + } + + + $absDef_db->db_close(); + } + } + } + } + + + + + #/**********************************************************************/ + #/* */ + #/* 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")) + { + my($port_name) = $i_name ->findnodes('./text()')->to_literal ; + my($direction) = $i_name ->findnodes('../spirit:wire/spirit:direction/text()')->to_literal ; + my($left) = $i_name ->findnodes('../spirit:wire/spirit:vector/spirit:left/text()')->to_literal ; + my($right) = $i_name ->findnodes('../spirit:wire/spirit:vector/spirit:right/text()')->to_literal ; + my($type) = $i_name ->findnodes('../spirit:wireTypeDefs/spirit:wireTypeDef/spirit:typeName/text()')->to_literal ; + + + if ($direction eq "in") { $direction = "input";} + elsif ($direction eq "out") { $direction = "output";} + + + if($left ne "") { push @wire_decs , ":::${port_name}:::${port_name}:::${direction}:::${type}:::vector:::${left}:::${right}:::none:::0:::${port_name}:::XXX:::${port_name}:::"; } + else { push @wire_decs , ":::${port_name}:::${port_name}:::${direction}:::${type}:::scaler:::none:::none:::none:::0:::${port_name}:::XXX:::${port_name}:::"; } + } + + + + +} + + +1 +
verilog/gen_auxiliary Property changes : Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Index: verilog/read_ports =================================================================== --- verilog/read_ports (nonexistent) +++ verilog/read_ports (revision 131) @@ -0,0 +1,197 @@ +eval 'exec `which perl` -S $0 ${1+"$@"}' + if 0; +#/**********************************************************************/ +#/* */ +#/* ------- */ +#/* / SOC \ */ +#/* / GEN \ */ +#/* / TOOL \ */ +#/* ============== */ +#/* | | */ +#/* |____________| */ +#/* */ +#/* */ +#/* */ +#/* */ +#/* Author(s): */ +#/* - John Eaton, jt_eaton@opencores.org */ +#/* */ +#/**********************************************************************/ +#/* */ +#/* Copyright (C) <2010-2011> */ +#/* */ +#/* 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", + "vendor=s" => \$vendor, + "library=s" => \$library, + "version=s" => \$version, + "component=s" => \$component, + "debug","verbose" +) || die "(use '$program_name -h' for help)"; + + +############################################################################## +## Help option +############################################################################## +if ( $opt_h or $opt_help ) + { print "\n read_ports -vendor vendor_name -library library_name -component component_name -version version_name "; + print "\n"; + exit 1; + } + + + + + + +############################################################################# +## +## +############################################################################# + + +$home = cwd(); + + +my $variant; + +if($version) {$variant = "${component}_${version}";} +else {$variant = "${component}";} + + +my $main_module_name = yp::lib::get_module_name($vendor,$library,$component,$version) ; +my $parser = XML::LibXML->new(); + + +my $spirit_component_file = $parser->parse_file(yp::lib::find_ipxact_component($vendor,$library,$component,$version)); + +print "\n READ_ports $vendor $library $component $version \n"; + + + +my $io_ports = yp::lib::get_io_ports() ; + + my $gen_port_outfile = yp::lib::get_io_ports_db_filename($vendor,$library,$component,$version); + $ports_db = new BerkeleyDB::Hash( -Filename => $gen_port_outfile, -Flags => DB_CREATE ) or die "Cannot open ${gen_port_outfile}: $!"; +# print "XXXXXXXX $gen_port_outfile READ PORTS \n"; + + + my $gen_bus_outfile = yp::lib::get_io_busses_db_filename($vendor,$library,$component,$version); + $busses_db = new BerkeleyDB::Hash( -Filename => $gen_bus_outfile, -Flags => DB_CREATE ) or die "Cannot open ${gen_bus_outfile}: $!"; +# print "XXXXXXXX $gen_bus_outfile READ PORTS \n"; + + + + my $key; + my $value; + + + + my @bus_list; + my @adhoc_list; + + my $cursor = $busses_db ->db_cursor() ; + while ($cursor->c_get($key, $value, DB_NEXT) == 0) + { +# print "INPUT $key, $value \n"; + ( ${key_type},${busref},${conn}) = split( /\./ , $key); + ( ${log_name},${direction},${type},${vector},${left},${right},${phy_name}) = split ':', $value; + if(($key_type eq "BusRef")) + { + push (@bus_list, "${busref}_${conn} ${phy_name} ${log_name} ${direction} ${type} ${vector} ${left}:${right} "); + + } + else + { + + } + + } + + my $status = $cursor->c_close() ; + + + + $cursor = $ports_db ->db_cursor() ; + while ($cursor->c_get($key, $value, DB_NEXT) == 0) + { + ( ${key_type},${busref},${conn}) = split( /\./ , $key); + ( ${log_name},${direction},${type},${vector},${left},${right},${phy_name}) = split ':', $value; + print "OUTPUT $key, $value \n"; + if(($key_type eq "BusRef")) + { + } + else + { + push (@adhoc_list," ${log_name} ${direction} ${type} ${vector} ${left}:${right} "); + } + } + + my $status = $cursor->c_close() ; + + + $ports_db -> db_close(); + $busses_db -> db_close(); + + + + @bus_list = sys::lib::trim_sort(@bus_list); + @adhoc_list = sys::lib::trim_sort(@adhoc_list); + + foreach $list (@bus_list) { print "${list}\n";} +# + + +my @busses = yp::lib::get_busses($vendor,$library,$component,$version); + + foreach $list (@busses) { print "${list}\n"; } + + + + +1 \ No newline at end of file
verilog/read_ports Property changes : Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Index: verilog/gen_vhdl =================================================================== --- verilog/gen_vhdl (nonexistent) +++ verilog/gen_vhdl (revision 131) @@ -0,0 +1,253 @@ +eval 'exec `which perl` -S $0 ${1+"$@"}' + if 0; +#/**********************************************************************/ +#/* */ +#/* ------- */ +#/* / SOC \ */ +#/* / GEN \ */ +#/* / TOOL \ */ +#/* ============== */ +#/* | | */ +#/* |____________| */ +#/* */ +#/* */ +#/* */ +#/* Author(s): */ +#/* - John Eaton, jt_eaton@opencores.org */ +#/* */ +#/**********************************************************************/ +#/* */ +#/* Copyright (C) <2010-2012> */ +#/* */ +#/* 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 XML::LibXML; +use lib './tools'; +use sys::lib; +use yp::lib; + + +$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, + "component=s" => \$component, + "version=s" => \$version, + "dest_dir=s" => \$dest_dir, + "view=s" => \$view +) || die "(use '$program_name -h' for help)"; + + +############################################################################## +## Help option +############################################################################## +if ( $opt_h or ($opt_help) ) + { + print "\n gen_verilogLib -envidentifier *simulation* -prefix /work -vendor vendor_name -library library_name -component component_name -version version_name -dest_dir dest_dir"; + print "\n"; + exit 1; + } + + +############################################################################## +## +############################################################################## + +my $parser = XML::LibXML->new(); + +my $socgen_file = $parser->parse_file(yp::lib::find_componentConfiguration($vendor,$library,$component)); +my $ip_name_base_macro = $socgen_file->findnodes("//socgen:componentConfiguration/socgen:ip_name_base_macro/text()")->to_literal; + + + + +$home = cwd(); +my @search_paths = (); +my $variant; + + + if($version) {$variant = "${component}_${version}";} + else {$variant = "${component}";} + +my $lib_comp_sep = yp::lib::find_lib_comp_sep($vendor,$library,$component); +my $comp_xml_sep = yp::lib::find_comp_xml_sep($vendor,$library,$component,$version); +my $module_name = yp::lib::get_module_name($vendor,$library,$component,$version); + + + + + + + + +my $parser = XML::LibXML->new(); +my $spirit_component_file = $parser->parse_file(yp::lib::find_ipxact_component($vendor,$library,$component,$version)); + + + + +#print "\n XXXXXXXXX Building $view VHDL RTL for $prefix $library $component $verison $variant $dest_dir \n" ; + +my $path = "${home}${prefix}/${vendor}__${library}${lib_comp_sep}${component}${comp_xml_sep}/${dest_dir}"; +mkdir $path,0755 unless( -e $path ); + + + +my $path = "${home}${prefix}/${vendor}__${library}${lib_comp_sep}${component}${comp_xml_sep}/${dest_dir}/../filelists"; +mkdir $path,0755 unless( -e $path ); + + +my $outfile ="${home}${prefix}/${vendor}__${library}${lib_comp_sep}${component}${comp_xml_sep}/${dest_dir}/../filelists/${variant}.VHDL"; +open FILELIST,">$outfile" or die "unable to open $outfile"; + + +my @filelist = yp::lib::parse_component_brothers("$vendor","$library","$component","$version"); + +foreach $line (@filelist) + { + $_ = $line; + if(/::(\S+)::(\S+)::(\S+)::(\S+)::/) + { + $new_library = $2; + $new_component = $3; + $new_vendor = $1; + $new_version = $4; + +# print " FFFFFFFFFFFFFFFF Brother $new_vendor $new_library $new_component $new_version \n" ; + + my $spirit_component_file = $parser->parse_file(yp::lib::find_ipxact_component($new_vendor,$new_library,$new_component,$new_version)); + + foreach my $comp_view ($spirit_component_file->findnodes("//spirit:component/spirit:model/spirit:views/spirit:view/spirit:envIdentifier[./text() = '$envidentifier']")) + { + my($view_name) = $comp_view->findnodes('../spirit:name/text()')->to_literal ; + my($view_fileset) = $comp_view->findnodes('../spirit:fileSetRef/spirit:localName/text()')->to_literal ; +# print " FFFFFFFFFFFFFFFF Found $view_name $view_fileset \n" ; + + + + + + #/**********************************************************************/ + #/* */ + #/* build a fileset in the following order */ + #/* */ + #/* deflist for module names */ + #/* all include files */ + #/* all module files */ + #/* */ + #/* */ + #/**********************************************************************/ + + + + foreach my $i_name ($spirit_component_file->findnodes("//spirit:fileSets/spirit:fileSet/spirit:file/spirit:name")) + { + my($file_name) = $i_name ->findnodes('./text()')->to_literal ; + my($file_logicalname) = $i_name ->findnodes('../spirit:logicalName/text()')->to_literal ; + my($file_type) = $i_name ->findnodes('../spirit:fileType/text()')->to_literal ; + my($file_usertype) = $i_name ->findnodes('../spirit:userFileType/text()')->to_literal ; + my($view_file) = $i_name ->findnodes('../../spirit:name/text()')->to_literal ; + + + if(($file_usertype eq "module") && ($view_file eq $view_fileset) && ($file_type eq "vhdlSource") ) + { + print FILELIST "${home}${prefix}/${vendor}__${library}${lib_comp_sep}${component}${comp_xml_sep}/${file_name}\n"; + }; + + + } + + + + + foreach my $i_name ($spirit_component_file->findnodes("//spirit:fileSets/spirit:fileSet/spirit:file/spirit:name")) + { + my($file_name) = $i_name ->findnodes('./text()')->to_literal ; + my($file_logicalname) = $i_name ->findnodes('../spirit:logicalName/text()')->to_literal ; + my($file_type) = $i_name ->findnodes('../spirit:fileType/text()')->to_literal ; + my($file_usertype) = $i_name ->findnodes('../spirit:userFileType/text()')->to_literal ; + my($view_file) = $i_name ->findnodes('../../spirit:name/text()')->to_literal ; + + + + if(($file_usertype eq "module") && ($view_file eq $view_fileset) && ($file_type eq "vhdlSource") ) + { + + + my $file_out = "${home}${prefix}/${vendor}__${library}${lib_comp_sep}${component}${comp_xml_sep}/${dest_dir}/${file_logicalname}.v"; + + + $cmd ="repeater filelist $outfile out $file_out top $file_logicalname \n"; + + print $cmd; + + + if (system($cmd)) {} + + }; + + + } + + + } + } + } + + + +1 + + + + + + + + + + + + + + +
verilog/gen_vhdl Property changes : Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Index: verilog/gen_verilogLib =================================================================== --- verilog/gen_verilogLib (revision 130) +++ verilog/gen_verilogLib (revision 131) @@ -69,7 +69,7 @@ "envidentifier=s" => \$envidentifier, "prefix=s" => \$prefix, "vendor=s" => \$vendor, - "project=s" => \$project, + "library=s" => \$library, "component=s" => \$component, "version=s" => \$version, "dest_dir=s" => \$dest_dir, @@ -82,7 +82,7 @@ ############################################################################## if ( $opt_h or ($opt_help) ) { - print "\n gen_verilogLib -envidentifier *simulation* -prefix /work -vendor vendor_name -project project_name -component component_name -version version_name -dest_dir dest_dir"; + print "\n gen_verilogLib -envidentifier *simulation* -prefix /work -vendor vendor_name -library library_name -component component_name -version version_name -dest_dir dest_dir"; print "\n"; exit 1; } @@ -94,7 +94,7 @@ my $parser = XML::LibXML->new(); -my $socgen_file = $parser->parse_file(yp::lib::find_componentConfiguration($vendor,$project,$component)); +my $socgen_file = $parser->parse_file(yp::lib::find_componentConfiguration($vendor,$library,$component)); my $ip_name_base_macro = $socgen_file->findnodes("//socgen:componentConfiguration/socgen:ip_name_base_macro/text()")->to_literal; @@ -108,9 +108,9 @@ if($version) {$variant = "${component}_${version}";} else {$variant = "${component}";} -my $lib_comp_sep = yp::lib::find_lib_comp_sep($vendor,$project,$component); -my $comp_xml_sep = yp::lib::find_comp_xml_sep($vendor,$project,$component,$version); -my $module_name = yp::lib::get_module_name($vendor,$project,$component,$version); +my $lib_comp_sep = yp::lib::find_lib_comp_sep($vendor,$library,$component); +my $comp_xml_sep = yp::lib::find_comp_xml_sep($vendor,$library,$component,$version); +my $module_name = yp::lib::get_module_name($vendor,$library,$component,$version); @@ -120,25 +120,25 @@ my $parser = XML::LibXML->new(); -my $spirit_component_file = $parser->parse_file(yp::lib::find_ipxact_component($vendor,$project,$component,$version)); +my $spirit_component_file = $parser->parse_file(yp::lib::find_ipxact_component($vendor,$library,$component,$version)); -print "\n Building $view Verilog Lib RTL for $prefix $project $component $verison $variant $dest_dir \n" ; +print "\n Building $view Verilog Lib RTL for $prefix $library $component $verison $variant $dest_dir \n" ; -my $path = "${home}${prefix}/${vendor}__${project}${lib_comp_sep}${component}${comp_xml_sep}/${dest_dir}"; +my $path = "${home}${prefix}/${vendor}__${library}${lib_comp_sep}${component}${comp_xml_sep}/${dest_dir}"; mkdir $path,0755 unless( -e $path ); -my $path = "${home}${prefix}/${vendor}__${project}${lib_comp_sep}${component}${comp_xml_sep}/${dest_dir}/../defines"; +my $path = "${home}${prefix}/${vendor}__${library}${lib_comp_sep}${component}${comp_xml_sep}/${dest_dir}/../defines"; mkdir $path,0755 unless( -e $path ); -my $path = "${home}${prefix}/${vendor}__${project}${lib_comp_sep}${component}${comp_xml_sep}/${dest_dir}/../filelists"; +my $path = "${home}${prefix}/${vendor}__${library}${lib_comp_sep}${component}${comp_xml_sep}/${dest_dir}/../filelists"; 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}__${library}${lib_comp_sep}${component}${comp_xml_sep}/${dest_dir}/${view}"; mkdir $path,0755 unless( -e $path ); @@ -152,17 +152,17 @@ #/* */ #/**********************************************************************/ - my $outfile ="${home}${prefix}/${vendor}__${project}${lib_comp_sep}${component}${comp_xml_sep}/${dest_dir}/../defines/${variant}.v"; + my $outfile ="${home}${prefix}/${vendor}__${library}${lib_comp_sep}${component}${comp_xml_sep}/${dest_dir}/../defines/${variant}.v"; open DEFLIST,">$outfile" or die "unable to open $outfile"; print DEFLIST " \`define $ip_name_base_macro ${module_name} \n"; - my $outfile ="${home}${prefix}/${vendor}__${project}${lib_comp_sep}${component}${comp_xml_sep}/${dest_dir}/../filelists/${variant}.MOD"; + my $outfile ="${home}${prefix}/${vendor}__${library}${lib_comp_sep}${component}${comp_xml_sep}/${dest_dir}/../filelists/${variant}.MOD"; open FILELIST,">$outfile" or die "unable to open $outfile"; - my $outfile ="${home}${prefix}/${vendor}__${project}${lib_comp_sep}${component}${comp_xml_sep}/${dest_dir}/../filelists/${variant}.INC"; + my $outfile ="${home}${prefix}/${vendor}__${library}${lib_comp_sep}${component}${comp_xml_sep}/${dest_dir}/../filelists/${variant}.INC"; open INCLIST,">$outfile" or die "unable to open $outfile"; - print INCLIST "${home}${prefix}/${vendor}__${project}${lib_comp_sep}${component}${comp_xml_sep}/${dest_dir}/../defines/${variant}.v\n"; + print INCLIST "${home}${prefix}/${vendor}__${library}${lib_comp_sep}${component}${comp_xml_sep}/${dest_dir}/../defines/${variant}.v\n"; @@ -171,7 +171,7 @@ #print " FFFFFFFFFFFFFFFF $envidentifier $view \n" ; -my @filelist = yp::lib::parse_component_brothers("$vendor","$project","$component","$version"); +my @filelist = yp::lib::parse_component_brothers("$vendor","$library","$component","$version"); foreach $line (@filelist) { @@ -178,14 +178,14 @@ $_ = $line; if(/::(\S+)::(\S+)::(\S+)::(\S+)::/) { - $new_project = $2; + $new_library = $2; $new_component = $3; $new_vendor = $1; $new_version = $4; -# print " FFFFFFFFFFFFFFFF Brother $new_vendor $new_project $new_component $new_version \n" ; +# print " FFFFFFFFFFFFFFFF Brother $new_vendor $new_library $new_component $new_version \n" ; - my $spirit_component_file = $parser->parse_file(yp::lib::find_ipxact_component($new_vendor,$new_project,$new_component,$new_version)); + my $spirit_component_file = $parser->parse_file(yp::lib::find_ipxact_component($new_vendor,$new_library,$new_component,$new_version)); foreach my $comp_view ($spirit_component_file->findnodes("//spirit:component/spirit:model/spirit:views/spirit:view/spirit:envIdentifier[./text() = '$envidentifier']")) { @@ -223,19 +223,19 @@ if(($file_usertype eq "include")&& ($view_file eq $view_fileset) && ($file_type eq "verilogSource") ) { - print INCLIST "${home}${prefix}/${vendor}__${project}${lib_comp_sep}${component}${comp_xml_sep}/${file_name}\n"; + print INCLIST "${home}${prefix}/${vendor}__${library}${lib_comp_sep}${component}${comp_xml_sep}/${file_name}\n"; }; if(($file_usertype eq "libraryDir")&& ($view_file eq $view_fileset) && ($file_type eq "verilogSource") ) { - push @search_paths, "${home}${prefix}/${vendor}__${project}${lib_comp_sep}${component}${comp_xml_sep}/${file_name}"; + push @search_paths, "${home}${prefix}/${vendor}__${library}${lib_comp_sep}${component}${comp_xml_sep}/${file_name}"; }; if(($file_usertype eq "module") && ($view_file eq $view_fileset) && ($file_type eq "verilogSource") ) { - print FILELIST "${home}${prefix}/${vendor}__${project}${lib_comp_sep}${component}${comp_xml_sep}/${file_name}\n"; + print FILELIST "${home}${prefix}/${vendor}__${library}${lib_comp_sep}${component}${comp_xml_sep}/${file_name}\n"; if($file_logicalname ) { print DEFLIST sprintf( "\`define %s _%s\n", uc($file_logicalname) , $file_logicalname ); @@ -264,7 +264,7 @@ #/**********************************************************************/ - my $file_out = "${home}${prefix}/${vendor}__${project}${lib_comp_sep}${component}${comp_xml_sep}/${dest_dir}/${view}/${variant}.v"; + my $file_out = "${home}${prefix}/${vendor}__${library}${lib_comp_sep}${component}${comp_xml_sep}/${dest_dir}/${view}/${variant}.v"; if( -e $file_out ) { @@ -281,7 +281,7 @@ - $cmd ="vppreproc --noline --noblank $cmd_path -f ${home}${prefix}/${vendor}__${project}${lib_comp_sep}${component}${comp_xml_sep}/${dest_dir}/../filelists/${variant}.INC -f ${home}${prefix}/${vendor}__${project}${lib_comp_sep}${component}${comp_xml_sep}/${dest_dir}/../filelists/${variant}.MOD >> $file_out \n"; + $cmd ="vppreproc --noline --noblank $cmd_path -f ${home}${prefix}/${vendor}__${library}${lib_comp_sep}${component}${comp_xml_sep}/${dest_dir}/../filelists/${variant}.INC -f ${home}${prefix}/${vendor}__${library}${lib_comp_sep}${component}${comp_xml_sep}/${dest_dir}/../filelists/${variant}.MOD >> $file_out \n"; if (system($cmd)) {}
/verilog/trace_bus
0,0 → 1,486
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,
"component=s" => \$component,
"version=s" => \$version,
"path=s" => \$path,
"bus_name=s" => \$bus_name,
"test_name=s" => \$test_name
 
) || die "(use '$program_name -h' for help)";
 
 
##############################################################################
## Help option
##############################################################################
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 \n";
exit 1;
}
 
 
 
#############################################################################
##
##
#############################################################################
 
$home = cwd();
 
unless ($prefix)
{
$prefix = yp::lib::get_workspace();
$prefix = "/${prefix}";
}
 
 
unless ($path)
{
$path = "root";
}
 
 
 
 
 
my $variant;
my $dest_dir = "elab";
my $destination = "${component}_${version}";
 
if($test_name){ $destination = "${component}_${version}_${test_name}";}
 
my @reg_list ="";
my @param_list ="";
 
my $root = "root";
 
if($version) {$variant = "${component}_${version}";}
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";
 
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 $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 $root_path = "${home}${prefix}/${vendor}__${library}${lib_comp_sep}${component}${comp_xml_sep}/../${dest_dir}/${destination}";
 
 
my $sw_dir = "${root_path}/sw";
mkdir $sw_dir,0755 unless( -e $sw_dir );
 
 
my $output_file = "${sw_dir}/${path}_${bus_name}.v";
$output_file =~s/root.dut.//;
open PARAM_FILE,">$output_file" or die "unable to open $output_file";
 
my $output_file = "${sw_dir}/${path}_${bus_name}.h";
$output_file =~s/root.dut.//;
open PARAMH_FILE,">$output_file" or die "unable to open $output_file";
 
 
my $report_dir = "${root_path}/memmaps";
mkdir $report_dir,0755 unless( -e $report_dir );
 
$output_file = "${report_dir}/${path}_${bus_name}.txt";
$output_file =~s/root.dut.//;
 
open DEST_FILE,">$output_file" or die "unable to open $output_file";
 
 
my $data_db_file = "${root_path}/root.db";
 
 
unless(-e $data_db_file )
{
print "$data_db_file root file does not exist \n";
}
 
my $root_db = new BerkeleyDB::Hash( -Filename => "$data_db_file", -Flags => DB_CREATE ) or die "Cannot open $data_db_file: $!";
 
 
my $comp_data;
 
my $bd_vendor;
my $bd_library;
my $bd_component;
my $bd_version;
 
 
 
 
#print "STARTING $path :: $bus_name \n";
 
 
$root_db->db_get("component___${path}", $comp_data );
( $vendor,$library,$component,$version) = split( /\:/ , $comp_data);
 
#print "XXXXX $path $vendor $library $component $version $bus_name \n";
 
my $instance_path = yp::lib::get_io_ports;
 
my $main_module_name = yp::lib::get_module_name($vendor,$library,$component,$version);
 
my $instance_db_file = "${instance_path}/${vendor}__${library}/${component}/${main_module_name}_BUSSES.dbm";
 
 
 
unless(-e $instance_db_file )
{
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 $base_addr = hex(0x0000);
 
 
my $repo_data;
 
$instance_db->db_get("AbsDef.${bus_name}.master", $repo_data );
 
 
 
if($repo_data)
{
( $bd_vendor,$bd_library,$bd_component,$bd_version) = split( /\:/ , $repo_data);
# print "MASTER $bd_vendor $bd_library $bd_component $bd_version \n";
$repo_data = "";
 
 
$_ = "$path";
if(/(\S+)\.(\S+)/)
{
$path = $1;
}
follow_bus("${path}",$bus_name,$base_addr);
}
 
 
$instance_db->db_get("AbsDef.${bus_name}.slave", $repo_data );
$instance_db->db_close();
 
if($repo_data)
{
( $bd_vendor,$bd_library,$bd_component,$bd_version) = split( /\:/ , $repo_data);
# print "SLAVE $bd_vendor $bd_library $bd_component $bd_version \n";
$repo_data = "";
follow_bus("${path}",$bus_name,$base_addr);
}
 
 
 
$root_db->db_close();
 
@reg_list = sys::lib::trim_sort(@reg_list);
 
foreach my $reg_line (@reg_list)
{
print DEST_FILE "$reg_line \n";
}
 
 
 
@param_list = sys::lib::trim_sort(@param_list);
 
foreach my $param_line (@param_list)
{
 
( $address,$parameter) = split( /\:/ , $param_line);
 
if($parameter)
{
print PARAM_FILE "parameter $parameter = $address ; \n";
print PARAMH_FILE "$parameter = $address ; \n";
}
}
 
#print "FINISHED \n";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
sub follow_bus
{
my @params = @_;
my $base_addr = pop(@params);
my $bus_name = pop(@params);
my $path = pop(@params);
 
my $vendor;
my $library;
my $component;
my $version;
my $comp_data;
my $bd_vendor;
my $bd_library;
my $bd_component;
my $bd_version;
my $repo_data;
 
# print "START_FOLLOW $path == $bus_name \n";
 
$root_db->db_get("component___${path}", $comp_data );
( $vendor,$library,$component,$version) = split( /\:/ , $comp_data);
 
# print "QQQQQQ $path || $vendor $library $component $version == $bus_name \n";
 
my $main_module_name = yp::lib::get_module_name($vendor,$library,$component,$version);
 
my $instance_path = yp::lib::get_io_ports;
my $instance_db_file = "${instance_path}/${vendor}__${library}/${component}/${main_module_name}_BUSSES.dbm";
 
unless(-e $instance_db_file )
{
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: $!";
 
 
 
$instance_db->db_get("AbsDef.${bus_name}.master", $repo_data );
 
 
 
if($repo_data)
{
( $bd_vendor,$bd_library,$bd_component,$bd_version) = split( /\:/ , $repo_data);
# print "MASTER $bd_vendor $bd_library $bd_component $bd_version \n";
$repo_data = "";
}
 
 
$instance_db->db_get("AbsDef.${bus_name}.interconnect", $repo_data );
if($repo_data)
{
my @couples = split( /\:/ , $repo_data);
foreach my $pair (@couples)
{
my $new_instance;
my $new_bus_name;
($new_instance,$new_bus_name) = split( /\.\./ , $pair);
# print "INTC $path $new_instance == $new_bus_name \n";
follow_bus("${path}.${new_instance}",$new_bus_name,$base_addr);
return(1);
}
$repo_data = "";
}
 
$instance_db->db_get("AbsDef.${bus_name}.slave", $repo_data );
 
 
if($repo_data)
{
( $bd_vendor,$bd_library,$bd_component,$bd_version) = split( /\:/ , $repo_data);
# print "SLAVE $bd_vendor $bd_library $bd_component $bd_version \n";
$repo_data = "";
$instance_db->db_get("AbsDef.${bus_name}.bridge", $repo_data );
if($repo_data)
{
$_ = "$path";
if(/(\S+)\.(\S+)/)
{
$path = $1;
}
 
 
my @couples = split( /\::/ , $repo_data);
foreach my $pair (@couples)
{
my $new_bus_name;
my $new_base_addr;
 
($new_bus_name,$new_base_addr) = split( /\.\./ , $pair);
my $mapped_addr = $base_addr + $new_base_addr;
# print "BRIDGE $path == ${bus_name} $new_bus_name $mapped_addr \n";
$instance_db->db_get("BlkDef.${bus_name}.${new_bus_name}", $Repo_data );
# print "BlkDef.${bus_name}.${new_bus_name} $Repo_data \n";
( $Base,$Range) = split( /\::/ , $Repo_data);
$Saddr = $Base + $base_addr;
$Eaddr = $Base + $base_addr + $Range-1;
# print "FRRRRRRRR $base_addr $Base $Range $Saddr $Eaddr \n";
my $hex = sprintf("0x%04x",$Saddr);
push @reg_list ,"$hex ${component}.${path} ($component) ${bus_name} Start " ;
$hex = sprintf("0x%04x",$Eaddr);
push @reg_list ,"$hex ${bus_name} End " ;
follow_bus( "${path}",$new_bus_name,$mapped_addr);
}
$repo_data = "";
}
else
{
# print "Now dump registers for $path $bus_name $base_addr\n";
my $hex = sprintf("0x%04x",$base_addr);
 
 
my $key;
my $value;
my $RegDef;
my $reg_bus;
my $reg_name;
 
my $cursor = $instance_db ->db_cursor() ;
while ($cursor->c_get($key, $value, DB_NEXT) == 0)
{
($RegDef,$reg_bus,$reg_name) = split( /\./ , $key);
# print " $key $value \n";
 
if( ($RegDef eq "RegDef") && ($reg_bus eq $bus_name))
{
( $Xoffset,$Xname,$Xsize,$Xaccess) = split( /\::/ , $value);
$addr = $base_addr + $Xoffset;
my $hex = sprintf("0x%04x %16s ",$addr, $Xname);
push @reg_list ,"$hex $Xsize $Xaccess";
my $temp = "${path}_${Xname}";
$temp =~s/root.dut.//;
$temp =~s/\./_/g;
$hex = sprintf("'h%04x:%16s ",$addr, $temp);
if($hex) {push @param_list ,"$hex";}
# print " $addr $Xname $Xsize $Xaccess \n";
}
 
 
if( ($RegDef eq "BlkDef") && ($reg_bus eq $bus_name))
{
( $Base,$Range) = split( /\::/ , $value);
 
$Saddr = $Base + $base_addr;
$Eaddr = $Base + $base_addr + $Range-1;
#print "FRRRRRRRR $base_addr $Base $Range $Saddr $Eaddr \n";
 
my $hex = sprintf("0x%04x",$Saddr);
push @reg_list ,"$hex ${component}.${path} ($component) ${bus_name} Start " ;
$hex = sprintf("0x%04x",$Eaddr);
push @reg_list ,"$hex ${bus_name} End " ;
}
 
}
my $status = $cursor->c_close() ;
 
}
}
 
 
$instance_db->db_get("AbsDef.${bus_name}.node", $repo_data );
if($repo_data)
{
( $bd_vendor,$bd_library,$bd_component,$bd_version) = split( /\:/ , $repo_data);
# print "NODE $bd_vendor $bd_library $bd_component $bd_version \n";
$repo_data = "";
$instance_db->db_get("AbsDef.${bus_name}.interconnect", $repo_data );
if($repo_data)
{
# print "INTC $repo_data \n";
my @couples = split( /\:/ , $repo_data);
foreach my $pair (@couples)
{
my $new_instance;
my $new_bus_name;
($new_instance,$new_bus_name) = split( /\.\./ , $pair);
 
# print "NODE $path $new_instance == $new_bus_name \n";
follow_bus("${path}.${new_instance}",$new_bus_name,$base_addr);
return(1);
}
}
}
 
$instance_db->db_close();
return(0);
}
 
1
 
verilog/trace_bus Property changes : Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Index: verilog/gen_signals =================================================================== --- verilog/gen_signals (nonexistent) +++ verilog/gen_signals (revision 131) @@ -0,0 +1,281 @@ +eval 'exec `which perl` -S $0 ${1+"$@"}' + if 0; +#/**********************************************************************/ +#/* */ +#/* ------- */ +#/* / SOC \ */ +#/* / GEN \ */ +#/* / TOOL \ */ +#/* ============== */ +#/* | | */ +#/* |____________| */ +#/* */ +#/* */ +#/* */ +#/* */ +#/* Author(s): */ +#/* - John Eaton, jt_eaton@opencores.org */ +#/* */ +#/**********************************************************************/ +#/* */ +#/* Copyright (C) <2010-2011> */ +#/* */ +#/* 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", + "vendor=s" => \$vendor, + "library=s" => \$library, + "version=s" => \$version, + "component=s" => \$component, + "verbose" +) || die "(use '$program_name -h' for help)"; + + +############################################################################## +## Help option +############################################################################## +if ( $opt_h or $opt_help ) + { print "\n read_ports -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}";} + + +my $main_module_name = yp::lib::get_module_name($vendor,$library,$component,$version) ; +my $parser = XML::LibXML->new(); + + +my $spirit_component_file = $parser->parse_file(yp::lib::find_ipxact_component($vendor,$library,$component,$version)); + +if($opt_verbose) {print "\n READ_ports $vendor $library $component $version \n";} + + + +my $io_ports = yp::lib::get_io_ports() ; + + my $gen_port_outfile = yp::lib::get_io_ports_db_filename($vendor,$library,$component,$version); + $ports_db = new BerkeleyDB::Hash( -Filename => $gen_port_outfile, -Flags => DB_CREATE ) or die "Cannot open ${gen_port_outfile}: $!"; +# print "XXXXXXXX $gen_port_outfile READ PORTS \n"; + + + my $gen_bus_outfile = yp::lib::get_io_busses_db_filename($vendor,$library,$component,$version); + $busses_db = new BerkeleyDB::Hash( -Filename => $gen_bus_outfile, -Flags => DB_CREATE ) or die "Cannot open ${gen_bus_outfile}: $!"; +# print "XXXXXXXX $gen_bus_outfile READ PORTS \n"; + + + + my $key; + my $value; + + + + my @bus_list; + my @adhoc_list; + + my $cursor = $busses_db ->db_cursor() ; + while ($cursor->c_get($key, $value, DB_NEXT) == 0) + { +# print "INPUT $key, $value \n"; + ( ${key_type},${busref},${conn}) = split( /\./ , $key); + ( ${log_name},${direction},${type},${vector},${left},${right},${phy_name}) = split ':', $value; + if(($key_type eq "BusRef")) + { + push (@bus_list, "${busref}_${conn} ${phy_name} ${log_name} ${direction} ${type} ${vector} ${left}:${right} "); + uplift_port( ${phy_name} , ${direction}, ${type} , ${vector}, ${left} , ${right} ); + } + else + { + + } + + } + + my $status = $cursor->c_close() ; + + + + $cursor = $ports_db ->db_cursor() ; + while ($cursor->c_get($key, $value, DB_NEXT) == 0) + { + ( ${key_type},${busref},${conn}) = split( /\./ , $key); + ( ${log_name},${direction},${type},${vector},${left},${right},${phy_name}) = split ':', $value; +# print "OUTPUT $key, $value \n"; + if(($key_type eq "BusRef")) + { + } + else + { + push (@adhoc_list," ${log_name} ${direction} ${type} ${vector} ${left}:${right} "); + } + } + + my $status = $cursor->c_close() ; + + + $ports_db -> db_close(); + $busses_db -> db_close(); + + + + @bus_list = sys::lib::trim_sort(@bus_list); + @adhoc_list = sys::lib::trim_sort(@adhoc_list); +my @busses = yp::lib::get_busses($vendor,$library,$component,$version); + +if($opt_verbose) + { + foreach $list (@bus_list) { print "${list}\n"; } + foreach $list (@adhoc_list) { print "${list}\n"; } + foreach $list (@busses) { print "${list}\n"; } + } + + + +#/*********************************************************************************************/ +#/ */ +#/ */ +#/ */ +#/ */ +#/ */ +#/ */ +#/*********************************************************************************************/ + + +sub uplift_port + { + my @params = @_; + my $right = pop(@params); + my $left = pop(@params); + my $vector = pop(@params); + my $type = pop(@params); + my $direction = pop(@params); + my $log_name = pop(@params); + +if($opt_verbose){ print "PORT_UPLIFT $log_name $direction $type $vector $left $right \n";} + $ports_db->db_put( "kxcd","${log_name}:${direction}:${type}:${vector}:${left}:${right}:HIER_HOLD" ); + + + my $uplift_data; + my $uplift_log_name ; + my $uplift_direction ; + my $uplift_type; + my $uplift_vector; + my $uplift_left; + my $uplift_right; + + $ports_db->db_get("$log_name", $uplift_data ); + (${uplift_log_name},${uplift_direction},${uplift_type},${uplift_vector},${uplift_left},${uplift_right} ) = split ':', $uplift_data; + + $ports_db->db_get("kxcd", $uplift_data ); + (${log_name},${direction},${type},${vector},${left},${right} ) = split ':', $uplift_data; + $ports_db->db_del("kxcd"); + + if(${uplift_log_name}) + { +# print "REPLACING ${uplift_log_name} ${uplift_direction} ${uplift_type} ${uplift_vector} ${uplift_left} ${uplift_right} \n"; + if(${uplift_direction} ne "node" ) { $direction =${uplift_direction};} + + if(${type} eq "wire" ) { $type =${uplift_type};} + + if(${uplift_vector} eq "vector") + { + if( $vector eq "vector" ) + { + if( looks_like_number($uplift_left)) + { + if( looks_like_number($left) ) + { + if($uplift_left > $left ) {$left = $uplift_left;} + } + + } + else + { + if( looks_like_number($left) ) {$left = ${uplift_left}; } + unless(${direction} ne "node") {$left = ${uplift_left}; } + } + if( looks_like_number($uplift_right) && looks_like_number($right) ) { if($uplift_right < $right ) {$right = $uplift_right;}} + } + else + { + $vector = "vector"; + $left = ${uplift_left}; + $right = ${uplift_right}; + } + } + } +# print "WITH $log_name $direction $type $vector $left $right \n"; + $ports_db->db_put( "${log_name}","${log_name}:${direction}:${type}:${vector}:${left}:${right}" ); +if($opt_verbose) { print "XXXXXXXX WROTE ${log_name} ${log_name}:${direction}:${type}:${vector}:${left}:${right} \n";} + } + + + + + + + + + +1 \ No newline at end of file
verilog/gen_signals Property changes : Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Index: verilog/elab_verilog =================================================================== --- verilog/elab_verilog (nonexistent) +++ verilog/elab_verilog (revision 131) @@ -0,0 +1,745 @@ +eval 'exec `which perl` -S $0 ${1+"$@"}' + if 0; +#/**********************************************************************/ +#/* */ +#/* ------- */ +#/* / SOC \ */ +#/* / GEN \ */ +#/* / TOOL \ */ +#/* ============== */ +#/* | | */ +#/* |____________| */ +#/* */ +#/* */ +#/* */ +#/* */ +#/* Author(s): */ +#/* - John Eaton, jt_eaton@opencores.org */ +#/* */ +#/**********************************************************************/ +#/* */ +#/* Copyright (C) <2010-2011> */ +#/* */ +#/* 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, + "component=s" => \$component, + "version=s" => \$version, + "env=s" => \$env, + "tool=s" => \$tool, + "unit=s" => \$unit, + "name=s" => \$name + +) || die "(use '$program_name -h' for help)"; + + +############################################################################## +## Help option +############################################################################## +if ( $opt_h or $opt_help ) + { print "\n elab_verilog -envidentifier {sim/syn} -prefix /work -vendor vendor_name -library library_name -component component_name -version version_name -env env -tool tool -unit unit -name name \n"; + exit 1; + } + + + +############################################################################# +## +## +############################################################################# + +$home = cwd(); + +unless ($prefix) + { + $prefix = yp::lib::get_workspace(); + $prefix = "/${prefix}"; + } + + +my $variant; +my $configuration; + +my $dest_dir = "elab"; +my $destination = "${component}_${version}"; + +unless ($env ) {$env = "none";} +unless ($tool ){$tool = "none";} +unless ($unit ){$unit = "none";} + +if($name) + { + $destination = "${destination}_${name}"; + } +else + { + $name = $version; + $destination = "${destination}"; + } + + + + +my $root = "root"; + +if($version) {$variant = "${component}_${version}";} +else {$variant = "${component}";} + +#print "elab_verilog -prefix $prefix -vendor $vendor -library $library -component $component -version $version -env $env -tool $tool -unit $unit -name $name \n"; + + +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 $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); + + +#print "lib_comp_sep $lib_comp_sep \n"; +#print "comp_xml_sep $comp_xml_sep \n"; + + + + +my $path = "${home}${prefix}/${vendor}__${library}${lib_comp_sep}${component}${comp_xml_sep}/../${dest_dir}"; + +unless( -e $path ) + { + print "$path does not exist... creating \n"; + my $cmd = "mkdir $path \n"; + if(system($cmd)){}; + } + + + +$data_db_dir = "${path}/${destination}"; + + + + +unless(-e $data_db_dir ) + { + my $cmd = "mkdir $data_db_dir \n"; + if(system($cmd)){}; + } + + +$data_db_file = "${path}/${destination}/${root}.db"; + + + + +if(-e $data_db_file ) + { + print "$data_db_file does exist... removing \n"; + my $cmd = "rm $data_db_file \n"; + if(system($cmd)){}; + } + + +print "ELAB $data_db_file \n"; + + +my $elab_db = new BerkeleyDB::Hash( -Filename => "$data_db_file", -Flags => DB_CREATE ) or die "Cannot open $data_db_file: $!"; +$elab_db->db_put( "component_${root}","${vendor}:${library}:${component}:${version}" ); +$elab_db->db_put( "component___root" ,"${vendor}:${library}:${component}:${version}" ); + + + +foreach my $socgen_cfg ($socgen_file->findnodes("//socgen:componentConfiguration/socgen:${env}/socgen:${tool}/socgen:${unit}/socgen:parameters/socgen:parameter")) + { + my($ise_param) = $socgen_cfg ->findnodes('./socgen:value/text()')->to_literal ; + my($ise_param_name) = $socgen_cfg ->findnodes('./socgen:name/text()')->to_literal ; + my($ise_new_name ) = $socgen_cfg ->findnodes('../../socgen:name/text()')->to_literal ; + if($name eq "${ise_new_name}") + { + if($ise_param_name) + { + $elab_db->db_put( "parameter_${root}__${ise_param_name}","${ise_param}" ); + #print "XXXXXXXA $ise_param_name $ise_param $ise_new_name \n"; + } + } + } + + + + +foreach my $socgen_cfg ($socgen_file->findnodes("//socgen:componentConfiguration/socgen:${env}/socgen:${tool}/socgen:${unit}/socgen:variant")) + { + my($variant_name) = $socgen_cfg->findnodes('./text()')->to_literal ; + $configuration = $socgen_cfg->findnodes('../socgen:configuration/text()')->to_literal ; + + #/**********************************************************************/ + #/* */ + #/* if configuration set then read parameters from socgen:componentConfiguration file */ + #/* */ + #/**********************************************************************/ + if($variant_name eq $variant) + { + #print "XXXXXXXQ $variant_name configuration $configuration \n"; + foreach my $socgen_cfg ($socgen_file->findnodes("//socgen:componentConfiguration/socgen:configurations/socgen:configuration/socgen:parameters/socgen:parameter/socgen:name")) + { + my($param_name) = $socgen_cfg->findnodes('./text()')->to_literal ; + my($param_value) = $socgen_cfg->findnodes('../socgen:value/text()')->to_literal ; + my($config_name) = $socgen_cfg->findnodes('../../../socgen:name/text()')->to_literal ; + #print "XXXXXXXQQ $config_name $param_name $param_value \n"; + + + if($config_name eq $configuration ) + { + my $repo_data; + $elab_db->db_get("parameter_${root}__${param_name}", $repo_data ); + unless ($repo_data) + { + #print "XXXXXXXB $param_name ${param_value} \n"; + $elab_db->db_put( "parameter_${root}__${param_name}","${param_value}" ); + } + } + } + } +} + + + + + + +elaborate( "${root}","${vendor}","${library}","${component}","${version}" ); + +my $root = "root"; + +my $key; +my $value; + + +my @elab_list; + +my $cursor = $elab_db ->db_cursor() ; +while ($cursor->c_get($key, $value, DB_NEXT) == 0) + { + #print "ELAB $key, $value \n"; + ( ${key_type},@elab_list) = split( /\./ , $key); + + if(($key_type eq "component___${root}")) + { + #print "Component $key -- $value @elab_list \n"; + build_hierarchy ($value,"${path}/${destination}",$root,@elab_list); + } + } +my $status = $cursor->c_close() ; + + + + +$cursor = $elab_db ->db_cursor() ; +while ($cursor->c_get($key, $value, DB_NEXT) == 0) + { + $_ = $key; + if(/parameter_${root}(\S+)__(\S+)/) + { + my $xpath = $1; + my $parname = $2; + $xpath =~ s/\./\//g; + my $file_name = "${path}/${destination}/${root}/${xpath}/Index.db"; + my $param_db = new BerkeleyDB::Hash( -Filename => "$file_name", -Flags => DB_CREATE ) or die "Cannot open ${file_name}: $!"; + $param_db->db_put( "$key","${value}"); + $param_db->db_close(); + #print "Parameter $key --- ${file_name} $parname $value \n"; + } + } +$status = $cursor->c_close() ; + + + +$cursor = $elab_db ->db_cursor() ; +while ($cursor->c_get($key, $value, DB_NEXT) == 0) + { + $_ = $key; + if(/busInterface_${root}(\S+)__(\S+)/) + { + my $xpath = $1; + my $parname = $2; + $xpath =~ s/\./\//g; + my $file_name = "${path}/${destination}/${root}/${xpath}/Index.db"; + my $param_db = new BerkeleyDB::Hash( -Filename => "$file_name", -Flags => DB_CREATE ) or die "Cannot open ${file_name}: $!"; + $param_db->db_put( "$key","${value}"); + $param_db->db_close(); + #print "busInterface $key --- ${file_name} $parname $value \n"; + } + } +$status = $cursor->c_close() ; + + + + + + + + + + + + + + + +$elab_db->db_close(); + + + + + + + + + + + +#/*********************************************************************************************/ +#/ */ +#/ Recursive entry point for all lower levels */ +#/ */ +#/ */ +#/ */ +#/ */ +#/*********************************************************************************************/ + +sub elaborate + { + my @params = @_; + my $elab_version = pop(@params); + my $elab_component = pop(@params); + my $elab_library = pop(@params); + my $elab_vendor = pop(@params); + my $elab_root = pop(@params); + + my $spirit_component_file = $parser->parse_file(yp::lib::find_ipxact_component($elab_vendor,$elab_library,$elab_component,$elab_version)); + + #print "ELABORATING $elab_root $elab_vendor $elab_library $elab_component $elab_version \n"; + parse_component_file($spirit_component_file,$elab_root); + parse_design_files($spirit_component_file,$elab_root); + #print "Exit $elab_root \n"; + return; +} + + + + +#/*********************************************************************************************/ +#/ */ +#/ */ +#/ */ +#/ */ +#/ */ +#/ */ +#/*********************************************************************************************/ + + + + +sub parse_component_file + { + my @params = @_; + my $elab_root = pop(@params); + my $spirit_component_file = pop(@params); + + + +foreach my $new_comp ($spirit_component_file->findnodes("//spirit:component/spirit:vendor")) + { + my($new_vendor) = $new_comp->findnodes('./text()')->to_literal ; + my($new_library) = $new_comp->findnodes('../spirit:library/text()')->to_literal ; + my($new_name) = $new_comp->findnodes('../spirit:name/text()')->to_literal ; + my($new_version) = $new_comp->findnodes('../spirit:version/text()')->to_literal ; + # print "PARSE component file $elab_root $new_vendor $new_library $new_name $new_version \n"; + + + + + + #/**********************************************************************/ + #/* */ + #/* parse parameters and values */ + #/* */ + #/**********************************************************************/ + + foreach my $i_name ($spirit_component_file->findnodes('//spirit:model/spirit:modelParameters/spirit:modelParameter/spirit:name')) + { + my($parameter_name) = $i_name ->to_literal; + my($parameter_default) = $i_name ->findnodes('../spirit:value/text()')->to_literal ; + my $repo_data; + $elab_db->db_get("parameter_${elab_root}__${parameter_name}", $repo_data ); + unless ($repo_data) + { + #print "XXXXXXXC $parameter_name ${parameter_default} \n"; + $elab_db->db_put( "parameter_${elab_root}__${parameter_name}","${parameter_default}" ); + } + } + + + + #/**********************************************************************/ + #/* */ + #/* parse businterfaces */ + #/* */ + #/**********************************************************************/ + + + my $main_module_name = yp::lib::get_module_name($new_vendor,$new_library,$new_name,$new_version); + + if($main_module_name) + { + my $io_busses_filename = yp::lib::get_io_busses_db_filename($new_vendor,$new_library,$new_name,$new_version); + $comp_io_busses_db = new BerkeleyDB::Hash( -Filename => "$io_busses_filename", -Flags => DB_CREATE ) or die "Cannot open $io_busses_filename : $!"; + my $cursor = $comp_io_busses_db ->db_cursor() ; + while ($cursor->c_get($key, $value, DB_NEXT) == 0) + { + ( ${key_type},${name},${sense}) = split( /\./ , $key); + if($key_type eq "AbsDef") + { +# print "BUS-- ${elab_root} ||| $name $sense === $value \n"; + my $repo_data; + $elab_db->db_get("businterface_${elab_root}__${name}", $repo_data ); + unless ($repo_data) + { +# print "BUS--::: \n"; + $elab_db->db_put( "busInterface_${elab_root}__${name}","busInterface:${sense}:${value}" ); + } + } + } + my $status = $cursor->c_close() ; + } + + + + + + } + + + + + + + + +foreach my $new_comp ($spirit_component_file->findnodes("//spirit:component/spirit:model/spirit:views/spirit:view/spirit:vendorExtensions/spirit:componentRef")) + { + my($new_vendor) = $new_comp->findnodes('./@spirit:vendor')->to_literal ; + my($new_library) = $new_comp->findnodes('./@spirit:library')->to_literal ; + my($new_name) = $new_comp->findnodes('./@spirit:name')->to_literal ; + my($new_version) = $new_comp->findnodes('./@spirit:version')->to_literal ; + if(yp::lib::find_ipxact_component($new_vendor,$new_library,$new_name,$new_version)) + { + parse_component_file($parser->parse_file(yp::lib::find_ipxact_component($new_vendor,$new_library,$new_name,$new_version)),$elab_root ); + } + + } +} + + + + + + +#/*********************************************************************************************/ +#/ */ +#/ */ +#/ */ +#/ */ +#/ */ +#/ */ +#/*********************************************************************************************/ + + + + +sub parse_design_files + { + my @params = @_; + my $elab_root = 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")) + { + my($new_vendor) = $new_comp->findnodes('./@spirit:vendor')->to_literal ; + my($new_library) = $new_comp->findnodes('./@spirit:library')->to_literal ; + my($new_name) = $new_comp->findnodes('./@spirit:name')->to_literal ; + my($new_version) = $new_comp->findnodes('./@spirit:version')->to_literal ; + #print "PARSE design files $elab_root $new_vendor $new_library $new_name $new_version \n"; + parse_design_files($parser->parse_file(yp::lib::find_ipxact_component($new_vendor,$new_library,$new_name,$new_version )),$elab_root ); + } + + + + + foreach my $new_comp ($spirit_component_file->findnodes("//spirit:component/spirit:model/spirit:views/spirit:view/spirit:hierarchyRef")) + { + my($new_vendor) = $new_comp->findnodes('./@spirit:vendor')->to_literal ; + my($new_library) = $new_comp->findnodes('./@spirit:library')->to_literal ; + my($new_name) = $new_comp->findnodes('./@spirit:name')->to_literal ; + my($new_version) = $new_comp->findnodes('./@spirit:version')->to_literal ; + if(yp::lib::find_ipxact_design($new_vendor,$new_library,$new_name,$new_version )) + { + #print "PARSE DESIGN file $elab_root $new_vendor $new_library $new_name $new_version \n"; + parse_design_file($parser->parse_file(yp::lib::find_ipxact_design($new_vendor,$new_library,$new_name,$new_version )),$elab_root ); + } + } + +} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +#/*********************************************************************************************/ +#/ */ +#/ */ +#/ */ +#/ */ +#/ */ +#/ */ +#/*********************************************************************************************/ + + + + +sub parse_design_file + { + my @params = @_; + my $elab_root = pop(@params); + my $spirit_design_file = pop(@params); + + foreach my $new_comp ($spirit_design_file->findnodes("//spirit:design/spirit:vendor")) + { + my($new_vendor) = $new_comp->findnodes('./text()')->to_literal ; + my($new_library) = $new_comp->findnodes('../spirit:library/text()')->to_literal ; + my($new_name) = $new_comp->findnodes('../spirit:name/text()')->to_literal ; + my($new_version) = $new_comp->findnodes('../spirit:version/text()')->to_literal ; + #print "WARNING $new_vendor $new_library $new_name $new_version DESIGN \n"; + + foreach my $x_name ($spirit_design_file->findnodes("//spirit:design/spirit:componentInstances/spirit:componentInstance/spirit:instanceName")) + { + #/**********************************************************************/ + #/* */ + #/* Lookup VLNV for each instantiated component */ + #/* */ + #/**********************************************************************/ + my($instance_name) = $x_name ->findnodes('./text()')->to_literal ; + my($vendor_name) = $x_name ->findnodes('../spirit:componentRef/@spirit:vendor')->to_literal ; + my($library_name) = $x_name ->findnodes('../spirit:componentRef/@spirit:library')->to_literal ; + my($component_name) = $x_name ->findnodes('../spirit:componentRef/@spirit:name')->to_literal ; + my($version_name) = $x_name ->findnodes('../spirit:componentRef/@spirit:version')->to_literal ; + #print "INSTANCED $instance_name $vendor_name $library_name $component_name $version_name \n"; + $elab_db->db_put( "component___${elab_root}.${instance_name}","${vendor_name}:${library_name}:${component_name}:${version_name}" ); + + if ($instance_name) + { + + + + foreach my $i_parameter ($spirit_design_file->findnodes("//spirit:componentInstance[spirit:instanceName/text() = '$instance_name']/spirit:configurableElementValues/spirit:configurableElementValue/\@spirit:referenceId")) + { + my($foo_name) = $i_parameter ->to_literal ; + my($foo_value) = $i_parameter ->findnodes('../text()')->to_literal ; + my $repo_data; + $elab_db->db_get("parameter_${elab_root}__${foo_value}", $repo_data ); + unless ($repo_data) {$repo_data = $foo_value}; + #print "PARAMETERE $foo_name $foo_value $repo_data \n"; + $elab_db->db_put( "parameter_${elab_root}.${instance_name}__${foo_name}","${repo_data}" ); + } + + elaborate( "${elab_root}.${instance_name}","${vendor_name}","${library_name}","${component_name}","${version_name}" ); + + } + + + } + } + } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +#/*********************************************************************************************/ +#/ */ +#/ */ +#/ */ +#/ */ +#/ */ +#/ */ +#/*********************************************************************************************/ + +sub build_hierarchy + { + my @params = @_; + my $vlnv = shift(@params); + my $path = shift(@params); + my $root = shift(@params); + my $top = shift(@params); + my $new_elab_db ; + my $new_elab_db_file_name ; + + + + #print "Hier $path \nHier- $root $top --- @params \n"; + $path ="${path}/${root}"; + unless(-e $path) + { + $cmd ="mkdir ${path} \n"; + if(system($cmd)){} + #print "Create Dir ${path} \n"; + } + + unless (-e "${path}/${top}") + { + $cmd ="mkdir ${path}/${top} \n"; + if(system($cmd)){} + } + + $new_elab_db_file_name = "${path}/${top}/Index.db"; + + if(@params) + { + build_hierarchy ("$vlnv","${path}","${top}",@params); + } + else + { + #print "CREATE $new_elab_db_file_name \n"; + $new_elab_db = new BerkeleyDB::Hash( -Filename => "$new_elab_db_file_name", -Flags => DB_CREATE ) or die "Cannot open $new_elab_db_file_name : $!"; + $new_elab_db->db_put( "VLNV","${vlnv}" ); +# print "VLNV $vlnv \nVLNV -> $new_elab_db_file_name \n"; + } + + return(0); + + } + + + + +1 \ No newline at end of file
verilog/elab_verilog Property changes : Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Index: verilog/read_elab =================================================================== --- verilog/read_elab (nonexistent) +++ verilog/read_elab (revision 131) @@ -0,0 +1,278 @@ +eval 'exec `which perl` -S $0 ${1+"$@"}' + if 0; +#/**********************************************************************/ +#/* */ +#/* ------- */ +#/* / SOC \ */ +#/* / GEN \ */ +#/* / TOOL \ */ +#/* ============== */ +#/* | | */ +#/* |____________| */ +#/* */ +#/* */ +#/* */ +#/* */ +#/* Author(s): */ +#/* - John Eaton, jt_eaton@opencores.org */ +#/* */ +#/**********************************************************************/ +#/* */ +#/* Copyright (C) <2010-2011> */ +#/* */ +#/* 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", + "prefix=s" => \$prefix, + "vendor=s" => \$vendor, + "library=s" => \$library, + "version=s" => \$version, + "component=s" => \$component, + "verbose" +) || die "(use '$program_name -h' for help)"; + + +############################################################################## +## Help option +############################################################################## +if ( $opt_h or $opt_help ) + { print "\n read_elab -prefix prefix -vendor vendor -library library -component component -version version \n"; + exit 1; + } + + + + + + +############################################################################# +## +## +############################################################################# + +$home = cwd(); + +unless ($prefix) + { + $prefix = yp::lib::get_workspace(); + $prefix = "/${prefix}"; + } +my $variant; +my $configuration; + +my $dest_dir = "elab"; +my $destination = "${component}_${version}"; + +unless ($env ) {$env = "none";} +unless ($tool ){$tool = "none";} +unless ($unit ){$unit = "none";} + +if($name) + { + $destination = "${destination}_${name}"; + } +else + { + $name = $version; + $destination = "${destination}"; + } + + +my $root = "root"; + +if($version) {$variant = "${component}_${version}";} +else {$variant = "${component}";} + +print "read_elab -prefix prefix -vendor $vendor -library $library -component $component -version $version -env $env -tool $tool -unit $unit -name $name \n"; + + +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 $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); + + +#print "lib_comp_sep $lib_comp_sep \n"; +#print "comp_xml_sep $comp_xml_sep \n"; + + + + +my $path = "${home}${prefix}/${vendor}__${library}${lib_comp_sep}${component}${comp_xml_sep}/../${dest_dir}/${destination}"; + +unless( -e $path ) + { + print "$path does not exist \n"; + return(1); + } + + + + +$data_db_file = "${path}/${root}.db"; + +if(-e $data_db_file ) + { + print "$data_db_file does exist \n"; + } + + +my $elab_db = new BerkeleyDB::Hash( -Filename => "$data_db_file", -Flags => DB_CREATE ) or die "Cannot open ${data_db_file}: $!"; + + + + + + my $key; + my $value; + + + + my @elab_list; + + my $cursor = $elab_db ->db_cursor() ; + while ($cursor->c_get($key, $value, DB_NEXT) == 0) + { +# print "ELAB $key, $value \n"; + ( ${key_type},@elab_list) = split( /\./ , $key); +# ( ${log_name},${direction},${type},${vector},${left},${right},${phy_name}) = split ':', $value; + if(($key_type eq "component___${root}")) + { + print "Component $key -- $value @elab_list \n"; + build_hierarchy ($value,$path,$root,@elab_list); + } + else + { + + } + + } + + my $status = $cursor->c_close() ; + + + + $elab_db -> db_close(); + +# @bus_list = sys::lib::trim_sort(@bus_list); + + +# foreach $list (@bus_list) { print "${list}\n";} +# + + +#my @busses = yp::lib::get_busses($vendor,$library,$component,$version); + +# foreach $list (@busses) { print "${list}\n"; } + + + + +#/*********************************************************************************************/ +#/ */ +#/ */ +#/ */ +#/ */ +#/ */ +#/ */ +#/*********************************************************************************************/ + +sub build_hierarchy + { + my @params = @_; + my $vlnv = shift(@params); + my $path = shift(@params); + my $root = shift(@params); + my $top = shift(@params); + my $new_elab_db ; + my $new_elab_db_file_name ; + + + + print "Hier $path \nHier- $root $top --- @params \n"; + $path ="${path}/${root}"; + unless(-e $path) + { + $cmd ="mkdir ${path} \n"; + if(system($cmd)){} + print "Create Dir ${path} \n"; + } + + unless (-e "${path}/${top}") + { + $cmd ="mkdir ${path}/${top} \n"; + if(system($cmd)){} + } + + $new_elab_db_file_name = "${path}/${top}/Index.db"; + + if(@params) + { + build_hierarchy ("$vlnv","${path}","${top}",@params); + } + else + { + print "CREATE $new_elab_db_file_name \n"; + $new_elab_db = new BerkeleyDB::Hash( -Filename => "$new_elab_db_file_name", -Flags => DB_CREATE ) or die "Cannot open $new_elab_db_file_name : $!"; + $new_elab_db->db_put( "VLNV","${vlnv}" ); + print "VLNV $vlnv \nVLNV -> $new_elab_db_file_name \n"; + } + + return(0); + + } + + + + +1 \ No newline at end of file
verilog/read_elab Property changes : Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Index: bin/Makefile.root =================================================================== --- bin/Makefile.root (revision 130) +++ bin/Makefile.root (revision 131) @@ -65,15 +65,30 @@ +PHONY: xst +xst: + (\ + xst -ifn ./Yst -ofn $(Design).log;\ + ) + + + + + PHONY: fpga fpga: (\ - xst -ifn ./Yst -ofn $(Design).log;\ ngdbuild -dd _ngo -nt timestamp -p $(Part) -uc ./target/Pad_Ring.ucf $(Design) >>$(Design).log ;\ map -p $(Part) -cm area -ir off -pr off -c 100 -o $(Design)_map.ncd $(Design).ngd $(Design).pcf >>$(Design).log ;\ par -w -ol std -t 1 $(Design)_map.ncd $(Design).ncd $(Design).pcf >>$(Design).log ;\ trce -e 3 -s 5 -xml $(Design) $(Design).ncd -o $(Design).twr $(Design).pcf -ucf ../target/Pad_Ring.ucf >>$(Design).log ;\ netgen -s 5 -pcf $(Design).pcf -sdf_anno true -sdf_path "./gate_sims/par" -insert_glbl true -insert_pp_buffers true -w -dir ./gate_sims/par -ofmt verilog -sim $(Design).ncd $(Design).v >>$(Design).log ;\ + ) + + +PHONY: bitgen +bitgen: + (\ bitgen -f ./target/cclk.ut $(Design).ncd >>$(Design).log ;\ mv $(Design).bit Board_Design_cclk.bit ;\ promgen -w -u 0 Board_Design_cclk >>$(Design).log ; \
/fizzim/gen_fizzim
70,7 → 70,7
"envidentifier=s" => \$envidentifier,
"prefix=s" => \$prefix,
"vendor=s" => \$vendor,
"project=s" => \$project,
"library=s" => \$library,
"version=s" => \$version,
"component=s" => \$component,
"encoding=s" => \$encoding,
83,7 → 83,7
##############################################################################
if ( $opt_h or $opt_help )
{
print "\n gen_fizzim -work_site /work/ -project project -component component -version version -encoding [onehot] -terse source_file destination_file";
print "\n gen_fizzim -work_site /work/ -library library -component component -version version -encoding [onehot] -terse source_file destination_file";
print "\n";
exit 1;
}
105,7 → 105,7
 
 
 
my $lib_comp_sep = yp::lib::find_lib_comp_sep($vendor,$project,$component);
my $lib_comp_sep = yp::lib::find_lib_comp_sep($vendor,$library,$component);
 
 
 
121,14 → 121,14
##
#############################################################################
 
$cmd = "${home}${prefix}/${vendor}__${project}/bin/fizzim";
$cmd = "${home}${prefix}/${vendor}__${library}/bin/fizzim";
if ($encoding ) {$cmd = "$cmd -encoding $encoding";}
if ($opt_terse ) {$cmd = "$cmd -terse";}
$cmd = "$cmd <${home}${prefix}/${vendor}__${project}${lib_comp_sep}${component}/${source}";
$cmd = "$cmd >${home}${prefix}/${vendor}__${project}${lib_comp_sep}${component}/${destination}";
$cmd = "$cmd <${home}${prefix}/${vendor}__${library}${lib_comp_sep}${component}/${source}";
$cmd = "$cmd >${home}${prefix}/${vendor}__${library}${lib_comp_sep}${component}/${destination}";
$cmd = "${cmd}\n";
if (system($cmd)) {
print "build_fizzim ${vendor}__${project}${lib_comp_sep}${component}/${destination} finished\n";
print "build_fizzim ${vendor}__${library}${lib_comp_sep}${component}/${destination} finished\n";
}
1
 
/documentation/create_busdefs_doc
65,8 → 65,8
#/*********************************************************************************************/
 
my $home = cwd();
my $projects = "/projects";
 
 
my $vendor_check = $ARGV[0];
 
 
90,7 → 90,10
my @libraries = yp::lib::find_libraries($vendor);
foreach my $library (@libraries)
{
my $repo = yp::lib::find_library_repo($vendor,$library);
 
 
 
my @components = yp::lib::find_components($vendor,$library);
foreach my $component (@components)
{
101,17 → 104,17
my $doc_library_path = $socgen_file->findnodes("//socgen:componentConfiguration/socgen:doc/socgen:library_path/text()")->to_literal;
my $lib_comp_sep = yp::lib::find_lib_comp_sep($vendor,$library,$component);
 
my $path = "${home}${projects}/${vendor}/${library}${doc_library_path}";
my $path = "${home}${repo}/${vendor}/${library}${doc_library_path}";
mkdir $path,0755 unless( -e $path );
 
 
$doc_library_path = "${doc_library_path}/Heda";
 
my $path = "${home}${projects}/${vendor}/${library}${doc_library_path}";
my $path = "${home}${repo}/${vendor}/${library}${doc_library_path}";
mkdir $path,0755 unless( -e $path );
 
 
my $path = "${home}${projects}/${vendor}/${library}${doc_library_path}/busDef";
my $path = "${home}${repo}/${vendor}/${library}${doc_library_path}/busDef";
mkdir $path,0755 unless( -e $path );
 
 
127,7 → 130,7
 
foreach my $version (@versions)
{
my $path = "${home}${projects}/${vendor}/${library}${doc_library_path}/busDef/${component}_${version}";
my $path = "${home}${repo}/${vendor}/${library}${doc_library_path}/busDef/${component}_${version}";
open(FILE,">${path}.txt") or die "No busDef directory";
 
 
200,17 → 203,17
my $doc_library_path = $socgen_file->findnodes("//socgen:componentConfiguration/socgen:doc/socgen:library_path/text()")->to_literal;
my $lib_comp_sep = yp::lib::find_lib_comp_sep($vendor,$library,$component);
 
my $path = "${home}${projects}/${vendor}/${library}${doc_library_path}";
my $path = "${home}${repo}/${vendor}/${library}${doc_library_path}";
mkdir $path,0755 unless( -e $path );
 
 
$doc_library_path = "${doc_library_path}/Heda";
 
my $path = "${home}${projects}/${vendor}/${library}${doc_library_path}";
my $path = "${home}${repo}/${vendor}/${library}${doc_library_path}";
mkdir $path,0755 unless( -e $path );
 
 
my $path = "${home}${projects}/${vendor}/${library}${doc_library_path}/absDef";
my $path = "${home}${repo}/${vendor}/${library}${doc_library_path}/absDef";
mkdir $path,0755 unless( -e $path );
 
 
219,7 → 222,7
foreach my $version (@versions)
{
 
my $path = "${home}${projects}/${vendor}/${library}${doc_library_path}/absDef/${component}_${version}";
my $path = "${home}${repo}/${vendor}/${library}${doc_library_path}/absDef/${component}_${version}";
open(FILE,">${path}.txt") or die "No sch directory";
 
 
/documentation/create_lib_doc
89,23 → 89,29
my $parser = XML::LibXML->new();
 
$home = cwd();
my $projects = "/projects";
 
 
#############################################################################
##
##
#############################################################################
 
my $vendor = $ARGV[0];
my $library = $ARGV[1];
my $work_dir = $ARGV[2];
my $vendor = $ARGV[0];
my $library = $ARGV[1];
my $work_dir = $ARGV[2];
my $repo = yp::lib::find_library_repo($vendor,$library);
 
 
my $doc_dir = yp::lib::get_doc_dir();
 
 
if(defined $work_dir)
{chomp($work_dir);}
else
{$work_dir ="/doc_dir";}
{$work_dir ="/${doc_dir}";}
 
 
 
my $path = "${home}${work_dir}";
mkdir $path,0755 unless( -e $path );
my $path = "${home}${work_dir}/${vendor}__${library}";
113,7 → 119,7
 
 
 
$root = "${home}${projects}/${vendor}/${library}";
$root = "${home}${repo}/${vendor}/${library}";
$dest = "${home}${work_dir}/${vendor}__${library}";
&sys::lib::link_dir( "$root", "$dest" );
 
120,31 → 126,43
my @components = yp::lib::find_components($vendor,$library);
 
foreach my $component (@components)
{
unless (yp::lib::find_componentConfiguration($vendor,$library,$component)) {print "Missing ComponentCfg $vendor, $library, $component \n"; }
 
my $socgen_filename = yp::lib::find_componentConfiguration($vendor,$library,$component);
 
if($socgen_filename)
 
{
unless (yp::lib::find_componentConfiguration($vendor,$library,$component)) {print "Missing ComponentCfg $vendor, $library, $component \n"; }
my $socgen_file = $parser->parse_file(yp::lib::find_componentConfiguration($vendor,$library,$component));
 
 
 
 
my $socgen_file = $parser->parse_file($socgen_filename);
 
 
 
my $doc_library_path = $socgen_file->findnodes("//socgen:componentConfiguration/socgen:doc/socgen:library_path/text()")->to_literal;
my $lib_comp_sep = yp::lib::find_lib_comp_sep($vendor,$library,$component);
 
my $path = "${home}${projects}/${vendor}/${library}${doc_library_path}";
my $path = "${home}${repo}/${vendor}/${library}${doc_library_path}";
mkdir $path,0755 unless( -e $path );
 
$doc_library_path = "${doc_library_path}/Geda";
 
my $path = "${home}${projects}/${vendor}/${library}${doc_library_path}";
my $path = "${home}${repo}/${vendor}/${library}${doc_library_path}";
mkdir $path,0755 unless( -e $path );
 
my $path = "${home}${projects}/${vendor}/${library}${doc_library_path}/sym";
my $path = "${home}${repo}/${vendor}/${library}${doc_library_path}/sym";
mkdir $path,0755 unless( -e $path );
 
my $path = "${home}${projects}/${vendor}/${library}${doc_library_path}/sch";
my $path = "${home}${repo}/${vendor}/${library}${doc_library_path}/sch";
mkdir $path,0755 unless( -e $path );
 
my $path = "${home}${projects}/${vendor}/${library}${doc_library_path}/png";
my $path = "${home}${repo}/${vendor}/${library}${doc_library_path}/png";
mkdir $path,0755 unless( -e $path );
 
my $path = "${home}${projects}/${vendor}/${library}${doc_library_path}/src";
my $path = "${home}${repo}/${vendor}/${library}${doc_library_path}/src";
mkdir $path,0755 unless( -e $path );
 
my @versions = yp::lib::find_component_versions($vendor,$library,$component);
172,12 → 190,12
$_ = $line;
if(/::(\S+)::(\S+)::(\S+)::(\S+)::/)
{
$new_project = $2;
$new_library = $2;
$new_component = $3;
$new_vendor = $1;
$new_version = $4;
print "Seeking $new_vendor $new_project $new_component $new_version \n";
my $spirit_component_file = $parser->parse_file(yp::lib::find_ipxact_component($new_vendor,$new_project,$new_component,$new_version));
print "Seeking $new_vendor $new_library $new_component $new_version \n";
my $spirit_component_file = $parser->parse_file(yp::lib::find_ipxact_component($new_vendor,$new_library,$new_component,$new_version));
 
foreach my $i_name ($spirit_component_file->findnodes("//spirit:componentGenerator/spirit:name"))
{
189,24 → 207,24
 
if($gen_envidentifier eq ":*Documentation:*" )
{
my $cmd = "./tools/sys/build_generate -prefix /doc_dir -vendor $vendor -project $library -component $component -version $version \n";
my $cmd = "./tools/sys/build_generate -prefix /doc_dir -vendor $vendor -library $library -component $component -version $version \n";
if (system($cmd)) {}
my $filename = find_filename("fs-sim", ${vendor}, ${library} , ${component} , ${version} );
my $cmd = "cp ${home}${work_dir}/${filename}.v ${home}${projects}/${vendor}/${library}${doc_library_path}/src/${module_name}.v \n";
my $cmd = "cp ${home}${work_dir}/${filename}.v ${home}${repo}/${vendor}/${library}${doc_library_path}/src/${module_name}.v \n";
if (system($cmd)) {}
my $filename = find_filename("fs-doc", ${vendor}, ${library} , ${component} , ${version} );
my $outfile ="${home}${projects}/${vendor}/${library}${doc_library_path}/sym/";
my $outfile ="${home}${repo}/${vendor}/${library}${doc_library_path}/sym/";
my $cmd = "./tools/documentation/ver2gedasym ${home}${work_dir}/${filename} $outfile \n";
if (system($cmd)) {}
my $outfile ="${home}${projects}/${vendor}/${library}${doc_library_path}/sch/";
my $outfile ="${home}${repo}/${vendor}/${library}${doc_library_path}/sch/";
my $cmd = "./tools/documentation/ver2gedasch ${home}${work_dir}/${filename} $outfile \n";
if (system($cmd)) {}
my $symfile ="${home}${projects}/${vendor}/${library}${doc_library_path}/sym/${module_name}.sym";
my $pngfile ="${home}${projects}/${vendor}/${library}${doc_library_path}/png/${module_name}_sym.png";
my $symfile ="${home}${repo}/${vendor}/${library}${doc_library_path}/sym/${module_name}.sym";
my $pngfile ="${home}${repo}/${vendor}/${library}${doc_library_path}/png/${module_name}_sym.png";
my $cmd ="gaf export -c -s auto -m 5px --dpi 600 --no-color -o $pngfile $symfile \n";
if (system($cmd)) {}
my $schfile ="${home}${projects}/${vendor}/${library}${doc_library_path}/sch/${module_name}.sch";
my $pngfile ="${home}${projects}/${vendor}/${library}${doc_library_path}/png/${module_name}_sch.png";
my $schfile ="${home}${repo}/${vendor}/${library}${doc_library_path}/sch/${module_name}.sch";
my $pngfile ="${home}${repo}/${vendor}/${library}${doc_library_path}/png/${module_name}_sch.png";
my $cmd ="gaf export -c -s auto -m 5px --dpi 600 --no-color -o $pngfile $schfile \n";
if (system($cmd)) {}
}
221,9 → 239,11
 
}
 
}
 
 
 
 
#/*********************************************************************************************/
#/ find filename */
#/ */
237,7 → 257,7
my @params = @_;
my $version = pop(@params);
my $component = pop(@params);
my $project = pop(@params);
my $library = pop(@params);
my $vendor = pop(@params);
my $filesetref_name = pop(@params);
 
246,9 → 266,9
if($version) {$variant = "${component}_${version}";}
else {$variant = "${component}";}
 
my @filelist = yp::lib::parse_component_brothers("$vendor","$project","$component","$version");
my $comp_xml_sep = yp::lib::find_comp_xml_sep($vendor,$project,$component,$version);
my $lib_comp_sep = yp::lib::find_lib_comp_sep($vendor,$project,$component);
my @filelist = yp::lib::parse_component_brothers("$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 $library_path = "${lib_comp_sep}${component}${comp_xml_sep}";
 
 
258,10 → 278,10
if(/::(\S+)::(\S+)::(\S+)::(\S+)::/)
{
$new_vendor = $1;
$new_project = $2;
$new_library = $2;
$new_component = $3;
$new_version = $4;
my $spirit_component_file = $parser->parse_file(yp::lib::find_ipxact_component($new_vendor,$new_project,$new_component,$new_version));
my $spirit_component_file = $parser->parse_file(yp::lib::find_ipxact_component($new_vendor,$new_library,$new_component,$new_version));
 
foreach my $i_name ($spirit_component_file->findnodes("//spirit:fileSets/spirit:fileSet/spirit:file/spirit:name"))
{
271,7 → 291,7
my($view_file) = $i_name ->findnodes('../../spirit:name/text()')->to_literal ;
if(($file_type eq "libraryDir") && ($logical_name eq "dest_dir") )
{
if( $view_file eq $filesetref_name ) { return ("${vendor}__${project}${library_path}/${file_name}${variant}"); };
if( $view_file eq $filesetref_name ) { return ("${vendor}__${library}${library_path}/${file_name}${variant}"); };
}
}
}
/synthesys/build_fpgas
55,6 → 55,7
use lib './tools';
use sys::lib;
use yp::lib;
use Parallel::ForkManager;
 
$OUTPUT_AUTOFLUSH = 1; # set autoflush of stdout to TRUE.
 
73,7 → 74,7
## Help option
##############################################################################
if ( $opt_h or $opt_help )
{ print "\n build_fpgas project_name project_vendor";
{ print "\n build_fpgas vendor__library";
print "\n";
exit 1;
}
80,7 → 81,7
 
 
#/**********************************************************************/
#/* Process each project by finding any ip-xact file in any component */
#/* Process each library by finding any ip-xact file in any component */
#/* */
#/* Each ip-xact file is parsed and it's filename and the names of any*/
#/* modules that it uses are saved. */
88,8 → 89,11
#/* */
#/**********************************************************************/
 
my $prefix = yp::lib::get_workspace();
 
 
my $vendor ;
my $project ;
my $library ;
 
$_ = $ARGV[0];
 
96,47 → 100,87
if(/(\S+)__(\S+)/)
{
$vendor = $1;
$project = $2;
$library = $2;
}
 
my $home = cwd();
my $work_site = $ARGV[1];
 
 
my $parser = XML::LibXML->new();
 
 
my @components = yp::lib::find_components($vendor,$project);
my @components = yp::lib::find_components($vendor,$library);
 
foreach my $component (@components)
{
my $socgen_file = $parser->parse_file(yp::lib::find_componentConfiguration($vendor,$project,$component));
my $socgen_filename = yp::lib::find_componentConfiguration($vendor,$library,$component);
 
if($socgen_filename)
 
{
my $socgen_file = $parser->parse_file($socgen_filename);
 
 
my $syn_library_path ;
my $lib_comp_sep = yp::lib::find_lib_comp_sep($vendor,$library,$component);
my $syn_comp_path = $socgen_file->findnodes("//socgen:componentConfiguration/socgen:syn/socgen:comp_path/text()")->to_literal;
 
if ($syn_comp_path)
{
$syn_library_path ="${lib_comp_sep}${syn_comp_path}";
}
else
{
$syn_library_path = $socgen_file->findnodes("//socgen:componentConfiguration/socgen:syn/socgen:library_path/text()")->to_literal;
}
 
print "XXXX- $vendor $library $component $syn_library_path \n";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
#/*********************************************************************************************/
#/ files for simulation */
#/ */
#/*********************************************************************************************/
my $cmd;
my @cmds =();
my $manager = new Parallel::ForkManager( 6 );
 
foreach my $i_name ($socgen_file->findnodes("//socgen:componentConfiguration/socgen:syn/socgen:ise/socgen:variant"))
 
foreach my $i_name ($socgen_file->findnodes("//socgen:componentConfiguration/socgen:syn/socgen:ise/socgen:chip/socgen:variant"))
{
my($chip_name) = $i_name ->findnodes('./text()')->to_literal ;
my($chip_target) = $i_name ->findnodes('../socgen:target/socgen:library/text()')->to_literal ;
my($chip_part) = $i_name ->findnodes('../socgen:target/socgen:part/text()')->to_literal ;
print " FPGAs $chip_name $chip_part \n";
$cmd ="./tools/synthesys/run_ise $vendor $library $syn_library_path $chip_name $chip_part \n";
push @cmds,$cmd;
}
 
print " FPGAs $chip_name $chip_target $chip_part \n";
chdir ".${work_site}/${vendor}__${project}/ip/${component}/syn/ise/${chip_name}";
foreach $cmd (@cmds)
{
$manager->start and next;
system($cmd);
$manager->finish;
}
 
$cmd ="echo \"run -ifn ./filelists/${chip_name}.ISE -ifmt mixed -top $chip_name -ofn ${chip_name}.ngc -ofmt NGC -p $chip_part -opt_mode Speed -opt_level 1 \" > Yst; \n";
if (system($cmd)) {}
$manager->wait_all_children;
print "build_fpgas COMPLETE \n";
 
$cmd ="make fpga \n";
if (system($cmd)) {}
chdir $home;
}
 
}
 
}
 
}
 
 
 
/synthesys/run_ise
0,0 → 1,127
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 XML::LibXML;
use lib './tools';
use sys::lib;
use yp::lib;
 
$OUTPUT_AUTOFLUSH = 1; # set autoflush of stdout to TRUE.
 
 
############################################################################
### Process the options
############################################################################
Getopt::Long::config("require_order", "prefix=-");
GetOptions("h","help",
) || die "(use '$program_name -h' for help)";
 
 
 
 
##############################################################################
## Help option
##############################################################################
if ( $opt_h or $opt_help )
{ print "\n run_ise vendor__library syn_library_path chip_name chip_part";
print "\n";
exit 1;
}
 
 
#/**********************************************************************/
#/* Process each library by finding any ip-xact file in any component */
#/* */
#/* Each ip-xact file is parsed and it's filename and the names of any*/
#/* modules that it uses are saved. */
#/* */
#/* */
#/**********************************************************************/
 
my $home = cwd();
my $prefix = yp::lib::get_workspace();
 
 
my $vendor = $ARGV[0];
my $library = $ARGV[1];
my $syn_library_path = $ARGV[2];
my $chip_name = $ARGV[3];
my $chip_part = $ARGV[4];
 
chdir "./${prefix}/${vendor}__${library}${syn_library_path}/ise/${chip_name}";
 
$cmd ="echo \"run -ifn ./filelists/${chip_name}.ISE -ifmt mixed -top $chip_name -ofn ${chip_name}.ngc -ofmt NGC -p $chip_part -opt_mode Speed -opt_level 1 \" > Yst; \n";
if (system($cmd)) {}
 
 
$cmd ="make xst \n";
if (system($cmd)) {}
 
 
$cmd ="make fpga \n";
if (system($cmd)) {}
 
 
$cmd ="make bitgen \n";
if (system($cmd)) {}
 
chdir "$home";
 
 
 
 
 
 
 
 
synthesys/run_ise Property changes : Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Index: synthesys/build_fpga_master =================================================================== --- synthesys/build_fpga_master (nonexistent) +++ synthesys/build_fpga_master (revision 131) @@ -0,0 +1,135 @@ +eval 'exec `which perl` -S $0 ${1+"$@"}' + if 0; + +#/**********************************************************************/ +#/* */ +#/* ------- */ +#/* / SOC \ */ +#/* / GEN \ */ +#/* / TOOL \ */ +#/* ============== */ +#/* | | */ +#/* |____________| */ +#/* */ +#/* */ +#/* */ +#/* Author(s): */ +#/* - John Eaton, jt_eaton@opencores.org */ +#/* */ +#/**********************************************************************/ +#/* */ +#/* Copyright (C) <2010-2013> */ +#/* */ +#/* 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 XML::LibXML; +use lib './tools'; +use sys::lib; +use yp::lib; + +$OUTPUT_AUTOFLUSH = 1; # set autoflush of stdout to TRUE. + + +############################################################################ +### Process the options +############################################################################ +Getopt::Long::config("require_order", "prefix=-"); +GetOptions("h","help", +) || die "(use '$program_name -h' for help)"; + + + + +############################################################################## +## Help option +############################################################################## +if ( $opt_h or $opt_help ) + { print "\n build_master"; + print "\n"; + exit 1; + } + + +my $parser = XML::LibXML->new(); + + +my @kids = ( ); +my @filelist = ( ); + + + +#/**********************************************************************/ +#/* Process each library by finding any ip-xact file in any component */ +#/* */ +#/* Each ip-xact file is parsed and it's filename and the names of any*/ +#/* modules that it uses are saved. */ +#/* */ +#/* */ +#/**********************************************************************/ + +my $home = cwd(); + +my $prefix = yp::lib::get_workspace(); + $prefix = "/${prefix}"; + +my @vendors = yp::lib::find_vendors(); + +foreach my $vendor (@vendors) + { + my $vendor_status = yp::lib::get_vendor_status($vendor); + if($vendor_status eq "active") + { + my @libraries = yp::lib::find_libraries($vendor); + foreach my $library (@libraries) + { + my $library_status = yp::lib::get_library_status($vendor,$library); + if($library_status eq "active") + { + run_vendor_library ( $vendor , $library) + } + } + } + } + + + + +sub run_vendor_library + { + my @params = @_; + my $library = pop(@params); + my $vendor = pop(@params); + my $cmd ="./tools/synthesys/build_fpgas ${vendor}__${library} \n"; + print "$cmd"; + if(system($cmd)){} + return(0); + }
synthesys/build_fpga_master Property changes : Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Index: regtool/gen_header =================================================================== --- regtool/gen_header (revision 130) +++ regtool/gen_header (nonexistent) @@ -1,420 +0,0 @@ -eval 'exec `which perl` -S $0 ${1+"$@"}' - if 0; - -#/**********************************************************************/ -#/* */ -#/* ------- */ -#/* / SOC \ */ -#/* / GEN \ */ -#/* / TOOL \ */ -#/* ============== */ -#/* | | */ -#/* |____________| */ -#/* */ -#/* */ -#/* */ -#/* Author(s): */ -#/* - John Eaton, jt_eaton@opencores.org */ -#/* */ -#/**********************************************************************/ -#/* */ -#/* Copyright (C) <2010-2012> */ -#/* */ -#/* 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 XML::LibXML; -use lib './tools'; -use sys::lib; -use yp::lib; - -$OUTPUT_AUTOFLUSH = 1; # set autoflush of stdout to TRUE. - - -############################################################################ -### Process the options -############################################################################ - -Getopt::Long::config("require_order", "prefix=-"); -GetOptions("h", - "envidentifier=s" => \$envidentifier, - "prefix=s" => \$prefix, - "vendor=s" => \$vendor, - "project=s" => \$project, - "version=s" => \$version, - "component=s" => \$component, - "dest_dir=s" => \$dest_dir, - "inst_path=s" => \$inst_path -) || die "(use '$program_name -h' for help)"; - - -############################################################################## -## Help option -############################################################################## -if ( $opt_h ) - { - print "\n gen_header -envidentifier {sim|syn} -prefix /work -project project_name -component comp_name -version version_name -inst_path a.b.c -dest_dir dest_dir \n"; - exit 1; - } - - -############################################################################## -## -############################################################################## - - - -$home = cwd(); - - -my $rtl_xml_sep = "/rtl/xml/"; - -my $parser = XML::LibXML->new(); - -my $lib_comp_sep = yp::lib::find_lib_comp_sep($vendor,$project,$component); -my $comp_xml_sep = yp::lib::find_comp_xml_sep($vendor,$project,$component,$version); - -my $variant; - if($version) {$variant = "${component}_${version}";} - else {$variant = "${component}";} - - - - -############################################################################# -## -## -############################################################################# - -print " Building Headers for $prefix $project $component $variant in $dest_dir\n" ; - -my $path = "${home}${prefix}/${vendor}__${project}${lib_comp_sep}${component}${comp_xml_sep}/${dest_dir}"; -mkdir $path,0755 unless( -e $path ); - - - - - #/**********************************************************************/ - #/* */ - #/* Print header, module name and start parameters */ - #/* */ - #/* */ - #/**********************************************************************/ - - my $outfile ="${home}${prefix}/${vendor}__${project}${lib_comp_sep}${component}${comp_xml_sep}/${dest_dir}/${variant}_${inst_path}.h"; - open OUTFILE,">$outfile" or die "unable to open $outfile"; - - print OUTFILE " /*********************************************/ \n"; - print OUTFILE sprintf(" /* project: %24s */ \n",$project); - print OUTFILE sprintf(" /* component: %24s */ \n",$component); - print OUTFILE sprintf(" /* variant: %24s */ \n",$variant); - print OUTFILE sprintf(" /* inst_path: %24s */ \n",$inst_path); - print OUTFILE " /*********************************************/ \n"; - - - - - my $inst_name; - my $remainder; - - $_ = $inst_path; - if(/(\w+)\.(\S+)/) - { - $inst_name = $1; - $remainder = $2; - print OUTFILE " /* INST = $inst_name then $remainder */ \n"; - } - else - { - print OUTFILE " /* ERROR no inst_path */ \n"; - } - - - my @spirit_design_files = yp::lib::find_ipxact_design_files($vendor,$project,$component,$version); - - - - - foreach my $spirit_design_file (@spirit_design_files) - { - - - $_ = $spirit_design_file; - if(/:::(\S+):::(\S+):::(\S+):::(\S+):::/) - { - $q_vendor = $1; - $q_library = $2; - $q_design = $3; - $q_version = $4; - $spirit_design_file = $parser->parse_file(yp::lib::find_ipxact_design($q_vendor,$q_library,$q_design,$q_version)); - } - - foreach my $x_name ($spirit_design_file->findnodes("//spirit:design/spirit:componentInstances/spirit:componentInstance/spirit:instanceName")) - { - #/**********************************************************************/ - #/* */ - #/* Lookup VLNV for each instantiated component */ - #/* */ - #/**********************************************************************/ - - my($instance_name) = $x_name ->findnodes('./text()')->to_literal ; - my($vendor_name) = $x_name ->findnodes('../spirit:componentRef/@spirit:vendor')->to_literal ; - my($library_name) = $x_name ->findnodes('../spirit:componentRef/@spirit:library')->to_literal ; - my($component_name) = $x_name ->findnodes('../spirit:componentRef/@spirit:name')->to_literal ; - my($version_name) = $x_name ->findnodes('../spirit:componentRef/@spirit:version')->to_literal ; - - my $variant = "${component_name}_${version_name}"; - - if($inst_name eq $instance_name) - { - print OUTFILE " /* $instance_name $vendor_name $library_name $component_name $version_name \n"; - $_ = $remainder; - parse_hier($vendor_name , $library_name , $component_name,$version_name, $variant, $remainder, $inst_name); - } - - } - - - - -} - - - - - - close OUTFILE ; - - - - - - - - - - -#/*********************************************************************************************/ -#/ */ -#/ */ -#/ */ -#/ */ -#/ */ -#/ */ -#/*********************************************************************************************/ - -sub parse_hier - { - my @params = @_; - my $top_name = pop(@params); - my $inst_path = pop(@params); - my $variant = pop(@params); - my $version = pop(@params); - my $component = pop(@params); - my $project = pop(@params); - my $vendor = pop(@params); - - $home = cwd(); - - my $spirit_component_file = $parser->parse_file(yp::lib::find_ipxact_component($vendor,$project,$component,$version)); - - my $inst_name; - my $remainder; - - $_ = $inst_path; - if(/(\w+)\.(\S+)/) - { - $inst_name = $1; - $remainder = $2; - print OUTFILE " /* INST = $inst_name then $remainder */ \n"; - } - else - { - print_map($spirit_component_file, $top_name); - } - - - my @spirit_design_files = yp::lib::find_ipxact_design_files($vendor,$project,$component,$version); - - - - foreach my $spirit_design_file (@spirit_design_files) - { - $_ = $spirit_design_file; - if(/:::(\S+):::(\S+):::(\S+):::(\S+):::/) - { - $q_vendor = $1; - $q_library = $2; - $q_design = $3; - $q_version = $4; - $spirit_design_file = $parser->parse_file(yp::lib::find_ipxact_design($q_vendor,$q_library,$q_design,$q_version)); - } - - foreach my $x_name ($spirit_design_file->findnodes("//spirit:design/spirit:componentInstances/spirit:componentInstance/spirit:instanceName")) - { - #/**********************************************************************/ - #/* */ - #/* Lookup VLNV for each instantiated component */ - #/* */ - #/**********************************************************************/ - - my($instance_name) = $x_name ->findnodes('./text()')->to_literal ; - my($vendor_name) = $x_name ->findnodes('../spirit:componentRef/@spirit:vendor')->to_literal ; - my($library_name) = $x_name ->findnodes('../spirit:componentRef/@spirit:library')->to_literal ; - my($component_name) = $x_name ->findnodes('../spirit:componentRef/@spirit:name')->to_literal ; - my($version_name) = $x_name ->findnodes('../spirit:componentRef/@spirit:version')->to_literal ; - - my $variant = "${component_name}_${version_name}"; - - if($inst_name eq $instance_name) - { - print OUTFILE " /* $instance_name $vendor_name $library_name $component_name $version_name \n"; - my $spirit_component_file = $parser->parse_file(yp::lib::find_ipxact_component($vendor_name,$library_name,$component_name,$version_name)); - - $_ = $remainder; - if(/(\w+)\.(\S+)/) - { - parse_hier($vendor_name , $library_name , $component_name, $variant, $remainder, $top_name); - } - else - { - print OUTFILE " /* mem_map $remainder */ \n"; - print_map($spirit_component_file,$top_name); - } - } - } - - } -} - - - -sub print_map - { - my @params = @_; - my $inst_name = pop(@params); - my $spirit_component_file = pop(@params); - - - -#/**********************************************************************/ -#/* */ -#/* Parse register block info from ip-xact file */ -#/* */ -#/* */ -#/**********************************************************************/ - -my $byte_size=32; - - $name = $spirit_component_file->findnodes('//spirit:component/spirit:name/text()')->to_literal; - $version = $spirit_component_file->findnodes('//spirit:component/spirit:version/text()')->to_literal ; - $vendor = $spirit_component_file->findnodes('//spirit:component/spirit:vendor/text()')->to_literal ; - $library = $spirit_component_file->findnodes('//spirit:component/spirit:library/text()')->to_literal ; - - -foreach my $comp_view ($spirit_component_file->findnodes('//spirit:component/spirit:memoryMaps/spirit:memoryMap/spirit:bank/spirit:name')) - { - $memmap_name = $comp_view->findnodes('../spirit:name/text()')->to_literal ; - $memmap_base = $comp_view->findnodes('../spirit:baseAddress/text()')->to_literal ; - - #/**********************************************************************/ - #/* */ - #/* Print header, module name and start parameters */ - #/* */ - #/* */ - #/**********************************************************************/ - - print OUTFILE " /***********************************************/ \n"; - print OUTFILE " /* Register module */ \n"; - print OUTFILE sprintf(" /* Vendor: %24s */ \n",$vendor); - print OUTFILE sprintf(" /* Library: %24s */ \n",$library); - print OUTFILE sprintf(" /* Component: %24s */ \n",$name); - print OUTFILE sprintf(" /* Version: %24s */ \n",$version); - print OUTFILE sprintf(" /* Module: %24s */ \n",$memmap_name); - print OUTFILE sprintf(" /* Base: %24s */ \n",$memmap_base); - - $memmap_base = hex($memmap_base); - - foreach my $comp_view ($spirit_component_file->findnodes('//spirit:component/spirit:memoryMaps/spirit:memoryMap/spirit:bank/spirit:addressBlock/spirit:name')) - { - my($bank_name) = $comp_view->findnodes('../../spirit:name/text()')->to_literal; - $addblk_name = $comp_view->findnodes('../spirit:name/text()')->to_literal; - $addblk_range = $comp_view->findnodes('../spirit:range/text()')->to_literal; - $addblk_width = $comp_view->findnodes('../spirit:width/text()')->to_literal; - $addblk_drange = hex($addblk_range); - - - if($bank_name eq $memmap_name) - { -# print OUTFILE sprintf(" /*: %14s %8s %16x */ \n",$addblk_name,$addblk_drange,$memmap_base); - my $block_full_name = "${inst_name}_${memmap_name}_${addblk_name}"; - print OUTFILE sprintf("parameter %32s = %16s ; /* %s */ \n",$block_full_name, $memmap_base , $addblk_drange ); - $memmap_base = $memmap_base + $addblk_drange; - - - foreach my $comp_view ($spirit_component_file->findnodes('//spirit:component/spirit:memoryMaps/spirit:memoryMap/spirit:bank/spirit:addressBlock/spirit:register/spirit:name')) - { - my($bank_name) = $comp_view->findnodes('../../../spirit:name/text()')->to_literal; - my($block_name) = $comp_view->findnodes('../../spirit:name/text()')->to_literal; - my($register_name) = $comp_view->findnodes('../spirit:name/text()')->to_literal; - my($register_addressOffset) = $comp_view->findnodes('../spirit:addressOffset/text()')->to_literal; - my($register_size) = $comp_view->findnodes('../spirit:size/text()')->to_literal; - my($register_access) = $comp_view->findnodes('../spirit:access/text()')->to_literal; - $register_addressOffset = hex($register_addressOffset); - - my $full_name = "${inst_name}_${bank_name}_${block_name}_${register_name}"; - - - if(($block_name eq $addblk_name) && ($bank_name eq $memmap_name)) - { - print OUTFILE sprintf("parameter %32s = %16s +%8s ; /* %14s %14s */ \n",$full_name,$block_full_name, $register_addressOffset, $register_size, $register_access ); - } - } - } - - - - - - - - - } - -} - - - - } - 1 - -
regtool/gen_header Property changes : Deleted: svn:executable ## -1 +0,0 ## -* \ No newline at end of property Index: regtool/gen_registers =================================================================== --- regtool/gen_registers (revision 130) +++ regtool/gen_registers (revision 131) @@ -70,7 +70,7 @@ "envidentifier=s" => \$envidentifier, "prefix=s" => \$prefix, "vendor=s" => \$vendor, - "project=s" => \$project, + "library=s" => \$library, "version=s" => \$version, "component=s" => \$component, "dest_dir=s" => \$dest_dir, @@ -83,7 +83,7 @@ ############################################################################## if ( $opt_h ) { - print "\n build_registers -envidentifier {sim|syn} -prefix /work -project project_name -component comp_name -version version_name -bus_intf bus_interface -dest_dir dest_dir"; + print "\n build_registers -envidentifier {sim|syn} -prefix /work -library library_name -component comp_name -version version_name -bus_intf bus_interface -dest_dir dest_dir"; print "\n"; exit 1; } @@ -99,7 +99,7 @@ $home = cwd(); -my $socgen_file = $parser->parse_file(yp::lib::find_componentConfiguration($vendor,$project,$component)); +my $socgen_file = $parser->parse_file(yp::lib::find_componentConfiguration($vendor,$library,$component)); my $ip_name_base_macro = $socgen_file->findnodes("//socgen:componentConfiguration/socgen:ip_name_base_macro/text()")->to_literal; @@ -113,8 +113,8 @@ if($version) {$variant = "${component}_${version}";} else {$variant = "${component}";} -my $lib_comp_sep = yp::lib::find_lib_comp_sep($vendor,$project,$component); -my $comp_xml_sep = yp::lib::find_comp_xml_sep($vendor,$project,$component,$version); +my $lib_comp_sep = yp::lib::find_lib_comp_sep($vendor,$library,$component); +my $comp_xml_sep = yp::lib::find_comp_xml_sep($vendor,$library,$component,$version); ############################################################################# ## @@ -121,17 +121,17 @@ ## ############################################################################# -print " Building RTL Registers for $prefix $vendor $project $component $variant in $dest_dir\n" ; +print " Building RTL Registers for $prefix $vendor $library $component $variant in $dest_dir\n" ; -my $path = "${home}${prefix}/${vendor}__${project}${lib_comp_sep}${component}${comp_xml_sep}/${dest_dir}"; +my $path = "${home}${prefix}/${vendor}__${library}${lib_comp_sep}${component}${comp_xml_sep}/${dest_dir}"; mkdir $path,0755 unless( -e $path ); my $name; -my $library; + my $memmap_name; my $memmap_base; my $addblk_name; @@ -182,7 +182,7 @@ -my $spirit_component_file = $parser->parse_file(yp::lib::find_ipxact_component($vendor,$project,$component,$version)); +my $spirit_component_file = $parser->parse_file(yp::lib::find_ipxact_component($vendor,$library,$component,$version)); $name = $spirit_component_file->findnodes('//spirit:component/spirit:name/text()')->to_literal ; $version = $spirit_component_file->findnodes('//spirit:component/spirit:version/text()')->to_literal ; @@ -226,7 +226,7 @@ #/* */ #/**********************************************************************/ - my $outfile ="${home}${prefix}/${vendor}__${project}${lib_comp_sep}${component}${comp_xml_sep}/${dest_dir}/${name}_${version}_${memmap_name}"; + my $outfile ="${home}${prefix}/${vendor}__${library}${lib_comp_sep}${component}${comp_xml_sep}/${dest_dir}/${name}_${version}_${memmap_name}"; open OUTFILE,">$outfile" or die "unable to open $outfile"; print OUTFILE " /*********************************************/ \n";
/firmware/gen_crasm
0,0 → 1,135
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,
"output=s" => \$output,
"destination=s" => \$destination,
) || die "(use '$program_name -h' for help)";
 
 
##############################################################################
## Help option
##############################################################################
if ( $opt_h or $opt_help )
{ print "\n gen_crasm -envidentifier {sim/syn} -prefix /work -vendor vendor_name -library library_name -component component_name -version version_name -destination destination -dest_dir ../verilog \n";
exit 1;
}
 
 
 
 
#############################################################################
##
##
#############################################################################
 
$home = cwd();
 
my $source = $ARGV[0];
 
 
 
print "GEN_crasm -envidentifier $envidentifier -prefix $prefix -vendor $vendor -library $library -component $component -version $version -destination $destination -output $output $source \n";
 
 
 
my $lib_comp_sep = yp::lib::find_lib_comp_sep($vendor,$library,$component);
my $comp_xml_sep = yp::lib::find_comp_xml_sep($vendor,$library,$component,$version);
 
#my $parser = XML::LibXML->new();
 
 
#my $spirit_component_file = $parser->parse_file(yp::lib::find_ipxact_component($vendor,$library,$component,$version));
 
 
#print ".${prefix}/${vendor}__${library}/${lib_comp_sep}/${component}/ \n";
 
 
 
$cmd ="cd .${prefix}/${vendor}__${library}/${lib_comp_sep}/${component}/; crasm $source -o $output >${component}.lst ;${home}/tools/bin/hex2abs16 $component ; ${home}/tools/bin/hex2abs $component ; ${home}/tools/bin/hex2abs_split $component ; \n";
if (system($cmd)) {}
 
 
 
 
 
 
 
 
 
 
1
 
firmware/gen_crasm Property changes : Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Index: sys/build_child_filelist =================================================================== --- sys/build_child_filelist (revision 130) +++ sys/build_child_filelist (nonexistent) @@ -1,329 +0,0 @@ -eval 'exec `which perl` -S $0 ${1+"$@"}' - if 0; - -#/**********************************************************************/ -#/* */ -#/* ------- */ -#/* / SOC \ */ -#/* / GEN \ */ -#/* / TOOL \ */ -#/* ============== */ -#/* | | */ -#/* |____________| */ -#/* */ -#/* */ -#/* */ -#/* Author(s): */ -#/* - John Eaton, jt_eaton@opencores.org */ -#/* */ -#/**********************************************************************/ -#/* */ -#/* Copyright (C) <2010-2011> */ -#/* */ -#/* 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 XML::LibXML; -use lib './tools'; -use sys::lib; -use yp::lib; - -$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, - "project=s" => \$project, - "component=s" => \$component, - "version=s" => \$version, - "top_file=s" => \$top_file, - "suffix=s" => \$suffix, - "leader=s" => \$leader, - "overlay_src_ven=s" => \$overlay_src_ven, - "overlay_src_lib=s" => \$overlay_src_lib, - "overlay_des_ven=s" => \$overlay_des_ven, - "overlay_des_lib=s" => \$overlay_des_lib, - "top","top_lib" -) || die "(use '$program_name -h' for help)"; - - - -############################################################################## -## Help option -############################################################################## -if ( $opt_h or $opt_help) - { print "\n build_child_filelist -prefix /work -envidentifier *simulation* -vendor vendor_name -project project_name -component component_name -version version_name "; - print "\n"; - exit 1; - } - - -############################################################################## -## -############################################################################## - -$home = cwd(); -my $variant; -my $view; -my $filesetref_name; - -if($version) {$variant = "${component}_${version}";} -else {$variant = "${component}";} - -my $parser = XML::LibXML->new(); -my $spirit_component_file = $parser->parse_file(yp::lib::find_ipxact_component($vendor,$project,$component,$version)); -my $comp_xml_sep = yp::lib::find_comp_xml_sep($vendor,$project,$component,$version); -my $lib_comp_sep = yp::lib::find_lib_comp_sep($vendor,$project,$component); - - -#print "XXXXXS $vendor,$project,$component,$version \n"; - -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_envidentifier) = $X_view->findnodes('./spirit:envIdentifier/text()')->to_literal ; - my($Xview_filesetref_name) = $X_view->findnodes('./spirit:fileSetRef/spirit:localName/text()')->to_literal ; - -#print "XXXXX $Xview_name || $Xview_envidentifier || $Xview_filesetref_name \n"; - - if($envidentifier eq $Xview_envidentifier ) - { - $view = $Xview_name; - $filesetref_name = $Xview_filesetref_name; - } - } - -#print "XXXXZ $view || view_filesetref_name \n"; - - - - -unless($suffix) { $suffix = $view }; - - - -if($suffix) -{ - -$path ="${home}${prefix}/${vendor}__${project}${lib_comp_sep}${component}${comp_xml_sep}/../filelists"; -mkdir $path,0755 unless( -e $path ); -my $outfile ="${home}${prefix}/${vendor}__${project}${lib_comp_sep}${component}${comp_xml_sep}/../filelists/${variant}.${suffix}\n"; -open SIMFILE,">$outfile" or die "unable to open $outfile"; -#print "OUT $outfile \n"; -if($top_file) {print SIMFILE "$top_file \n";} - -#/*********************************************************************************************/ -#/ */ -#/ Create filelists for simulation, synthesis and linting */ -#/ */ -#/ */ -#/*********************************************************************************************/ - -@filelist_sim = ( ); - -my @filelist = yp::lib::parse_component_file("$vendor","$project","$component","$version"); - - - - -foreach $line (@filelist) - { - $_ = $line; - if(/::(\S+)::(\S+)::(\S+)::(\S+)::/) - { - $new_proj = $2; - $new_comp = $3; - $new_vendor = $1; - $new_version = $4; - } - ############################################################################# - ## Read destination from source xml file - ## - ############################################################################# - - my $spirit_component_file = $parser->parse_file(yp::lib::find_ipxact_component($new_vendor,$new_proj,$new_comp,$new_version)); - - if($new_version){$new_variant = "${new_comp}_${new_version}"} - else {$new_variant = $new_comp} - - if($opt_top_lib) - { - my $fileXX = find_filename($filesetref_name ,$new_vendor,$new_proj,$new_comp,$new_version); - if($fileXX){push(@filelist_sim,"${home}${prefix}/${fileXX}\n")}; - } - else - { - if(($new_vendor eq $vendor ) && ($new_proj eq $project ) && ($new_comp eq $component ) && ($new_version eq $version ) ) - { - if($opt_top) - { - my $fileXX = find_filename($filesetref_name ,$new_vendor,$new_proj,$new_comp,$new_version); - if($fileXX){push(@filelist_sim,"${home}${prefix}/${fileXX}\n")}; - } - } - else - { - if(($new_proj eq $overlay_src_lib ) & ($new_vendor eq $overlay_src_ven)) - { - if(yp::lib::find_ipxact_component($overlay_des_ven,$overlay_des_lib,$new_comp,$new_version ) ) - { - $new_vendor = $overlay_des_ven; - $new_proj = $overlay_des_lib; - - } - } - - - my $fileXX = find_filename($filesetref_name ,$new_vendor,$new_proj,$new_comp,$new_version); - if($fileXX){push(@filelist_sim,"${home}${prefix}/${vendor}__${project}/children/${fileXX}\n");} - } - } - - - - - - - - - - - - - } - -############################################################################# -## -## -############################################################################# - -print "Building ALL filelists for $prefix $vendor $project $component $version $variant \n" ; - @filelist_sim = sys::lib::trim_sort(@filelist_sim); - foreach my $i_line (@filelist_sim) - { -#print "$i_line \n"; - - - if($leader) - { - print SIMFILE "${leader}${i_line}"; - } - else - { - print SIMFILE "$i_line"; - } - - - - } -} - - - -#/*********************************************************************************************/ -#/ find filename */ -#/ */ -#/ returns gloabal name of the file */ -#/ */ -#/ */ -#/*********************************************************************************************/ - -sub find_filename - { - my @params = @_; - my $version = pop(@params); - my $component = pop(@params); - my $project = pop(@params); - my $vendor = pop(@params); - my $filesetref_name = pop(@params); - -#print "find_filename $vendor $project $component $version \n"; - my $variant; - if($version) {$variant = "${component}_${version}";} - else {$variant = "${component}";} - -my @filelist = yp::lib::parse_component_brothers("$vendor","$project","$component","$version"); - - - - - - - -my $comp_xml_sep = yp::lib::find_comp_xml_sep($vendor,$project,$component,$version); -my $lib_comp_sep = yp::lib::find_lib_comp_sep($vendor,$project,$component); -my $library_path = "${lib_comp_sep}${component}${comp_xml_sep}"; - - - -foreach $line (@filelist) - { - $_ = $line; - if(/::(\S+)::(\S+)::(\S+)::(\S+)::/) - { - $new_project = $2; - $new_component = $3; - $new_vendor = $1; - $new_version = $4; - - my $spirit_component_file = $parser->parse_file(yp::lib::find_ipxact_component($new_vendor,$new_project,$new_component,$new_version)); - - - foreach my $i_name ($spirit_component_file->findnodes("//spirit:fileSets/spirit:fileSet/spirit:file/spirit:name")) - { - my($file_name) = $i_name ->findnodes('./text()')->to_literal ; - my($file_type) = $i_name ->findnodes('../spirit:userFileType/text()')->to_literal ; - my($logical_name) = $i_name ->findnodes('../spirit:logicalName/text()')->to_literal ; - my($view_file) = $i_name ->findnodes('../../spirit:name/text()')->to_literal ; - if(($file_type eq "libraryDir") && ($logical_name eq "dest_dir") ) - { -#print "222 | $view_file | $filesetref_name | \n"; - if( $view_file eq $filesetref_name ) - { - return ("${vendor}__${project}${library_path}/${file_name}${variant}.v"); - }; - } - } - } -} -} - - -1 -
sys/build_child_filelist Property changes : Deleted: svn:executable ## -1 +0,0 ## -* \ No newline at end of property Index: sys/build_sw_master =================================================================== --- sys/build_sw_master (nonexistent) +++ sys/build_sw_master (revision 131) @@ -0,0 +1,170 @@ +eval 'exec `which perl` -S $0 ${1+"$@"}' + if 0; + +#/**********************************************************************/ +#/* */ +#/* ------- */ +#/* / SOC \ */ +#/* / GEN \ */ +#/* / TOOL \ */ +#/* ============== */ +#/* | | */ +#/* |____________| */ +#/* */ +#/* */ +#/* */ +#/* Author(s): */ +#/* - John Eaton, jt_eaton@opencores.org */ +#/* */ +#/**********************************************************************/ +#/* */ +#/* Copyright (C) <2010-2013> */ +#/* */ +#/* 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 XML::LibXML; +use lib './tools'; +use sys::lib; +use yp::lib; + +$OUTPUT_AUTOFLUSH = 1; # set autoflush of stdout to TRUE. + + +############################################################################ +### Process the options +############################################################################ +Getopt::Long::config("require_order", "prefix=-"); +GetOptions("h","help", +) || die "(use '$program_name -h' for help)"; + + + + +############################################################################## +## Help option +############################################################################## +if ( $opt_h or $opt_help ) + { print "\n build_master"; + print "\n"; + exit 1; + } + + +my $parser = XML::LibXML->new(); + + + + +#/**********************************************************************/ +#/* Process each library by finding any ip-xact file in any component */ +#/* */ +#/* Each ip-xact file is parsed and it's filename and the names of any*/ +#/* modules that it uses are saved. */ +#/* */ +#/* */ +#/**********************************************************************/ + +my $home = cwd(); + +my $prefix = yp::lib::get_workspace(); + $prefix = "/${prefix}"; + +my @vendors = yp::lib::find_vendors(); + +foreach my $vendor (@vendors) + { + print "$vendor \n "; + my $vendor_status = yp::lib::get_vendor_status($vendor); + if($vendor_status eq "active") + { + my @libraries = yp::lib::find_libraries($vendor); + foreach my $library (@libraries) + { + print "$vendor $library \n "; + my $library_status = yp::lib::get_library_status($vendor,$library); + if($library_status eq "active") + { + print "$vendor $library \n "; + run_vendor_library ( $vendor , $library) + } + } + } + } + + + + +sub run_vendor_library + { + my @params = @_; + my $library = pop(@params); + my $vendor = pop(@params); + + +my @components = yp::lib::find_components($vendor,$library); + +foreach my $component (@components) + { + my $socgen_filename = yp::lib::find_componentConfiguration($vendor,$library,$component); + if($socgen_filename) + { + my $socgen_file = $parser->parse_file($socgen_filename); + + #/*********************************************************************************************/ + #/ files for simulation */ + #/ */ + #/*********************************************************************************************/ + + foreach my $i_name ($socgen_file->findnodes("//socgen:codeSets/socgen:codeSet/socgen:name")) + { + my $codeSet_name = $i_name ->findnodes('./text()')->to_literal ; + my $codeSet_vendor = $i_name ->findnodes('../socgen:vendor/text()')->to_literal ; + my $codeSet_library = $i_name ->findnodes('../socgen:library/text()')->to_literal ; + my $codeSet_component = $i_name ->findnodes('../socgen:component/text()')->to_literal ; + my $codeSet_version = $i_name ->findnodes('../socgen:version/text()')->to_literal ; + + print "$codeSet_name $codeSet_vendor $codeSet_library $codeSet_component $codeSet_version \n "; + + $cmd ="./tools/sys/build_generate -prefix ${prefix}/${vendor}__${library}/children -vendor ${codeSet_vendor} -library ${codeSet_library} -component ${codeSet_component} -version ${codeSet_version} \n"; + if (system($cmd)) {} + + } + +} + +} + + + + return(0); + } +
sys/build_sw_master Property changes : Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Index: sys/soc_link_child =================================================================== --- sys/soc_link_child (revision 130) +++ sys/soc_link_child (revision 131) @@ -11,7 +11,7 @@ #/* | | */ #/* |____________| */ #/* */ -#/* Traverse a socgen project and link it */ +#/* Traverse a socgen library and link it */ #/* */ #/* */ #/* Author(s): */ @@ -71,7 +71,7 @@ GetOptions("h","help", "prefix=s" => \$prefix, "vendor=s" => \$vendor, - "project=s" => \$project, + "library=s" => \$library, "component=s" => \$component, "version=s" => \$version @@ -83,7 +83,7 @@ ############################################################################## if ( $opt_h or $opt_help ) { - print "\n type soc_link_child -prefix /work -vendor vendor_name -project project_name -component component_name -version version_name projects_dir "; + print "\n type soc_link_child -prefix /work -vendor vendor_name -library library_name -component component_name -version version_name "; print "\n"; exit 1; } @@ -98,8 +98,7 @@ my $parser = XML::LibXML->new(); -my $projects_dir = $ARGV[0]; -chomp($projects_dir); + my $variant; if($version) {$variant = "${component}_${version}";} @@ -109,7 +108,7 @@ #/*********************************************************************************************/ #/ */ -#/ link overlay projects */ +#/ link overlay librarys */ #/ */ #/*********************************************************************************************/ @@ -116,10 +115,10 @@ -my $socgen_file = $parser->parse_file(yp::lib::find_componentConfiguration($vendor,$project,$component)); +my $socgen_file = $parser->parse_file(yp::lib::find_componentConfiguration($vendor,$library,$component)); -foreach my $i_name ($socgen_file->findnodes("//socgen:syn/socgen:ise[socgen:variant/text() = '$variant']")) +foreach my $i_name ($socgen_file->findnodes("//socgen:syn/socgen:ise/socgen:chip[socgen:variant/text() = '$variant']")) { my($replace_vendor) = $i_name ->findnodes('socgen:target/socgen:vendor/text()')->to_literal ; my($replace_library) = $i_name ->findnodes('socgen:target/socgen:library/text()')->to_literal ; @@ -127,7 +126,7 @@ foreach my $replace_component (@replace_components) { - &link_child($vendor, $project,$replace_component, $replace_library ,$replace_vendor); + &link_child($vendor, $library,$replace_component, $replace_library ,$replace_vendor); } } @@ -151,7 +150,7 @@ my @filelist = ( ); -@filelist = yp::lib::parse_component_file("$vendor","$project","$component","$version"); +@filelist = yp::lib::parse_component_file("$vendor","$library","$component","$version"); @@ -165,7 +164,7 @@ $new_proj = $2; $new_comp = $3; $new_version = $4; - &link_child( $vendor,$project,$new_comp, $new_proj ,$new_vendor); + &link_child( $vendor,$library,$new_comp, $new_proj ,$new_vendor); } } @@ -193,6 +192,7 @@ my $child_vendor = shift; my $lib_comp_sep = yp::lib::find_lib_comp_sep($child_vendor,$child_library,$child_component); + my $repo = yp::lib::find_component_repo($child_vendor,$child_library,$child_component); @@ -205,7 +205,7 @@ unless( -e $path ) { mkdir $path,0755; - $root = "${home}/${projects_dir}/${child_vendor}/${child_library}/bin"; + $root = "${home}/${repo}/${child_vendor}/${child_library}/bin"; $dest = "${home}${prefix}/${parent_vendor}__${parent_library}/children/${child_vendor}__${child_library}/bin"; &sys::lib::link_dir( "$root", "$dest" ); symlink( "${home}/tools/bin/Makefile.root", "${home}${prefix}/${parent_vendor}__${parent_library}/children/${child_vendor}__${child_library}/bin/Makefile.root"); @@ -224,7 +224,7 @@ { mkdir $path,0755; - $root = "${home}/${projects_dir}/${child_vendor}/${child_library}${lib_comp_sep}${child_component}"; + $root = "${home}/${repo}/${child_vendor}/${child_library}${lib_comp_sep}${child_component}"; $dest = ".${prefix}/${parent_vendor}__${parent_library}/children/${child_vendor}__${child_library}${lib_comp_sep}${child_component}"; &sys::lib::link_dir( "$root", "$dest" ); @@ -295,7 +295,7 @@ unless( -e $path ) { mkdir $path,0755; - $root = "${home}/${projects_dir}/${child_vendor}/${child_library}${lib_sw_dir}"; + $root = "${home}/${repo}/${child_vendor}/${child_library}${lib_sw_dir}"; $dest = "${home}${prefix}/${parent_vendor}__${parent_library}/children/${child_vendor}__${child_library}${lib_sw_dir}"; &sys::lib::link_dir( "$root", "$dest" ); }
/sys/elaborate_icarus
0,0 → 1,226
eval 'exec `which perl` -S $0 ${1+"$@"}'
if 0;
 
#/**********************************************************************/
#/* */
#/* ------- */
#/* / SOC \ */
#/* / GEN \ */
#/* / TOOL \ */
#/* ============== */
#/* | | */
#/* |____________| */
#/* */
#/* */
#/* */
#/* Author(s): */
#/* - John Eaton, jt_eaton@opencores.org */
#/* */
#/**********************************************************************/
#/* */
#/* Copyright (C) <2010-2014> <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 XML::LibXML;
use lib './tools';
use sys::lib;
use yp::lib;
 
$OUTPUT_AUTOFLUSH = 1; # set autoflush of stdout to TRUE.
 
 
############################################################################
### Process the options
############################################################################
Getopt::Long::config("require_order", "prefix=-");
GetOptions("h","help",
"prefix=s" => \$prefix,
"vendor=s" => \$vendor,
"library=s" => \$library
 
) || die "(use '$program_name -h' for help)";
 
 
 
 
##############################################################################
## Help option
##############################################################################
if ( $opt_h or $opt_help )
{ print "\n elaborate_icarus -prefix worksite -vendor vendor -library library ";
print "\n";
exit 1;
}
 
 
#/**********************************************************************/
#/* Process by finding any ip-xact componentCfgfile in any component */
#/* */
#/* */
#/* */
#/**********************************************************************/
 
my $home = cwd();
my $parser = XML::LibXML->new();
 
 
 
 
 
 
 
#############################################################################
##
##
#############################################################################
 
 
 
 
print "\nelaborate_icarus $prefix $vendor $library \n" ;
 
 
my @testbenches = ( );
my @tests = ( );
 
 
my @components = yp::lib::find_components("$vendor","$library");
foreach $component (@components)
{
chomp($component);
 
 
my $socgen_file = $parser->parse_file(yp::lib::find_componentConfiguration($vendor,$library,$component));
foreach my $i_name ($socgen_file->findnodes("//socgen:componentConfiguration/socgen:sim/socgen:icarus/socgen:test/socgen:name"))
{
my($sim_name) = $i_name ->findnodes('./text()')->to_literal ;
my($sim_configuration) = $i_name ->findnodes('../socgen:configuration/text()')->to_literal ;
my($sim_variant) = $i_name ->findnodes('../socgen:variant/text()')->to_literal ;
print "::: $vendor $library $component $sim_name $sim_configuration $sim_variant \n";
foreach my $i_name ($socgen_file->findnodes("//socgen:componentConfiguration/socgen:sim/socgen:testbenches/socgen:testbench[socgen:variant/text() = '$sim_variant']/./socgen:version"))
{
my($ver_name) = $i_name ->findnodes('./text()')->to_literal ;
print "::::: $prefix $vendor $library $component $sim_variant $ver_name $sim_configuration \n";
push @testbenches , "::${prefix}::${vendor}::${library}::${component}::${sim_variant}::${ver_name}::default::";
push @tests , "::${prefix}::${vendor}::${library}::${component}::${sim_variant}::${ver_name}::${sim_configuration}::";
}
}
 
 
}
 
 
 
 
@testbenches = sys::lib::trim_sort(@testbenches);
 
foreach my $testbench (@testbenches)
{
$_ = $testbench;
if(/::(\S+)::(\S+)::(\S+)::(\S+)::(\S+)::(\S+)::(\S+)::/)
{
my $kid_prefix = $1;
my $kid_vendor = $2;
my $kid_library = $3;
my $kid_component = $4;
my $kid_variant = $5;
my $kid_version = $6;
my $kid_configuration = $7;
print "-prefix ${kid_prefix} -vendor ${kid_vendor} -library ${kid_library} -component ${kid_component} -variant ${kid_variant} -version ${kid_version} -config $kid_configuration \n";
 
my $path = "${home}${kid_prefix}";
mkdir $path,0755 unless( -e $path );
$path = "${path}/${kid_vendor}";
mkdir $path,0755 unless( -e $path );
$path = "${path}/${kid_library}";
mkdir $path,0755 unless( -e $path );
$path = "${path}/${kid_component}";
mkdir $path,0755 unless( -e $path );
$path = "${path}/${kid_version}";
mkdir $path,0755 unless( -e $path );
$cmd ="./tools/sys/elaborate -prefix ${kid_prefix} -vendor ${kid_vendor} -library ${kid_library} -component ${kid_component} -version ${kid_version} -configuration $kid_configuration \n";
print " $cmd \n ";
if (system($cmd)) {}
}
}
 
 
 
@tests = sys::lib::trim_sort(@tests);
 
 
foreach my $test (@tests)
{
$_ = $test;
 
if(/::(\S+)::(\S+)::(\S+)::(\S+)::(\S+)::(\S+)::(\S+)::/)
{
my $kid_prefix = $1;
my $kid_vendor = $2;
my $kid_library = $3;
my $kid_component = $4;
my $kid_variant = $5;
my $kid_version = $6;
my $kid_configuration = $7;
my $path = "${home}${kid_prefix}";
$path = "${path}/${kid_vendor}";
$path = "${path}/${kid_library}";
$path = "${path}/${kid_component}";
$path = "${path}/${kid_version}";
 
my $spirit_component_file = yp::lib::find_ipxact_component($kid_vendor,$kid_library,$kid_component,$kid_version);
$cmd ="cp $spirit_component_file $path/${kid_configuration}.xml \n";
if (system($cmd)) {}
}
}
 
 
 
 
 
 
 
 
 
 
1;
 
 
 
 
 
 
 
 
sys/elaborate_icarus Property changes : Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Index: sys/gen_child_filelist =================================================================== --- sys/gen_child_filelist (nonexistent) +++ sys/gen_child_filelist (revision 131) @@ -0,0 +1,329 @@ +eval 'exec `which perl` -S $0 ${1+"$@"}' + if 0; + +#/**********************************************************************/ +#/* */ +#/* ------- */ +#/* / SOC \ */ +#/* / GEN \ */ +#/* / TOOL \ */ +#/* ============== */ +#/* | | */ +#/* |____________| */ +#/* */ +#/* */ +#/* */ +#/* Author(s): */ +#/* - John Eaton, jt_eaton@opencores.org */ +#/* */ +#/**********************************************************************/ +#/* */ +#/* Copyright (C) <2010-2011> */ +#/* */ +#/* 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 XML::LibXML; +use lib './tools'; +use sys::lib; +use yp::lib; + +$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, + "component=s" => \$component, + "version=s" => \$version, + "top_file=s" => \$top_file, + "suffix=s" => \$suffix, + "leader=s" => \$leader, + "overlay_src_ven=s" => \$overlay_src_ven, + "overlay_src_lib=s" => \$overlay_src_lib, + "overlay_des_ven=s" => \$overlay_des_ven, + "overlay_des_lib=s" => \$overlay_des_lib, + "top","top_lib" +) || die "(use '$program_name -h' for help)"; + + + +############################################################################## +## Help option +############################################################################## +if ( $opt_h or $opt_help) + { print "\n gen_child_filelist -prefix /work -envidentifier *simulation* -vendor vendor_name -library library_name -component component_name -version version_name "; + print "\n"; + exit 1; + } + + +############################################################################## +## +############################################################################## + +$home = cwd(); +my $variant; +my $view; +my $filesetref_name; + +if($version) {$variant = "${component}_${version}";} +else {$variant = "${component}";} + +my $parser = XML::LibXML->new(); +my $spirit_component_file = $parser->parse_file(yp::lib::find_ipxact_component($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); + + +#print "XXXXXS $vendor,$library,$component,$version \n"; + +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_envidentifier) = $X_view->findnodes('./spirit:envIdentifier/text()')->to_literal ; + my($Xview_filesetref_name) = $X_view->findnodes('./spirit:fileSetRef/spirit:localName/text()')->to_literal ; + +#print "XXXXX $Xview_name || $Xview_envidentifier || $Xview_filesetref_name \n"; + + if($envidentifier eq $Xview_envidentifier ) + { + $view = $Xview_name; + $filesetref_name = $Xview_filesetref_name; + } + } + +#print "XXXXZ $view || view_filesetref_name \n"; + + + + +unless($suffix) { $suffix = $view }; + + + +if($suffix) +{ + +$path ="${home}${prefix}/${vendor}__${library}${lib_comp_sep}${component}${comp_xml_sep}/../filelists"; +mkdir $path,0755 unless( -e $path ); +my $outfile ="${home}${prefix}/${vendor}__${library}${lib_comp_sep}${component}${comp_xml_sep}/../filelists/${variant}.${suffix}\n"; +open SIMFILE,">$outfile" or die "unable to open $outfile"; +#print "OUT $outfile \n"; +if($top_file) {print SIMFILE "$top_file \n";} + +#/*********************************************************************************************/ +#/ */ +#/ Create filelists for simulation, synthesis and linting */ +#/ */ +#/ */ +#/*********************************************************************************************/ + +@filelist_sim = ( ); + +my @filelist = yp::lib::parse_component_file("$vendor","$library","$component","$version"); + + + + +foreach $line (@filelist) + { + $_ = $line; + if(/::(\S+)::(\S+)::(\S+)::(\S+)::/) + { + $new_proj = $2; + $new_comp = $3; + $new_vendor = $1; + $new_version = $4; + } + ############################################################################# + ## Read destination from source xml file + ## + ############################################################################# + + my $spirit_component_file = $parser->parse_file(yp::lib::find_ipxact_component($new_vendor,$new_proj,$new_comp,$new_version)); + + if($new_version){$new_variant = "${new_comp}_${new_version}"} + else {$new_variant = $new_comp} + + if($opt_top_lib) + { + my $fileXX = find_filename($filesetref_name ,$new_vendor,$new_proj,$new_comp,$new_version); + if($fileXX){push(@filelist_sim,"${home}${prefix}/${fileXX}\n")}; + } + else + { + if(($new_vendor eq $vendor ) && ($new_proj eq $library ) && ($new_comp eq $component ) && ($new_version eq $version ) ) + { + if($opt_top) + { + my $fileXX = find_filename($filesetref_name ,$new_vendor,$new_proj,$new_comp,$new_version); + if($fileXX){push(@filelist_sim,"${home}${prefix}/${fileXX}\n")}; + } + } + else + { + if(($new_proj eq $overlay_src_lib ) & ($new_vendor eq $overlay_src_ven)) + { + if(yp::lib::find_ipxact_component($overlay_des_ven,$overlay_des_lib,$new_comp,$new_version ) ) + { + $new_vendor = $overlay_des_ven; + $new_proj = $overlay_des_lib; + + } + } + + + my $fileXX = find_filename($filesetref_name ,$new_vendor,$new_proj,$new_comp,$new_version); + if($fileXX){push(@filelist_sim,"${home}${prefix}/${vendor}__${library}/children/${fileXX}\n");} + } + } + + + + + + + + + + + + + } + +############################################################################# +## +## +############################################################################# + +print "Building ALL filelists for $prefix $vendor $library $component $version $variant \n" ; + @filelist_sim = sys::lib::trim_sort(@filelist_sim); + foreach my $i_line (@filelist_sim) + { +#print "$i_line \n"; + + + if($leader) + { + print SIMFILE "${leader}${i_line}"; + } + else + { + print SIMFILE "$i_line"; + } + + + + } +} + + + +#/*********************************************************************************************/ +#/ find filename */ +#/ */ +#/ returns gloabal name of the file */ +#/ */ +#/ */ +#/*********************************************************************************************/ + +sub find_filename + { + my @params = @_; + my $version = pop(@params); + my $component = pop(@params); + my $library = pop(@params); + my $vendor = pop(@params); + my $filesetref_name = pop(@params); + +#print "find_filename $vendor $library $component $version \n"; + my $variant; + if($version) {$variant = "${component}_${version}";} + else {$variant = "${component}";} + +my @filelist = yp::lib::parse_component_brothers("$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 $library_path = "${lib_comp_sep}${component}${comp_xml_sep}"; + + + +foreach $line (@filelist) + { + $_ = $line; + if(/::(\S+)::(\S+)::(\S+)::(\S+)::/) + { + $new_library = $2; + $new_component = $3; + $new_vendor = $1; + $new_version = $4; + + my $spirit_component_file = $parser->parse_file(yp::lib::find_ipxact_component($new_vendor,$new_library,$new_component,$new_version)); + + + foreach my $i_name ($spirit_component_file->findnodes("//spirit:fileSets/spirit:fileSet/spirit:file/spirit:name")) + { + my($file_name) = $i_name ->findnodes('./text()')->to_literal ; + my($file_type) = $i_name ->findnodes('../spirit:userFileType/text()')->to_literal ; + my($logical_name) = $i_name ->findnodes('../spirit:logicalName/text()')->to_literal ; + my($view_file) = $i_name ->findnodes('../../spirit:name/text()')->to_literal ; + if(($file_type eq "libraryDir") && ($logical_name eq "dest_dir") ) + { +#print "222 | $view_file | $filesetref_name | \n"; + if( $view_file eq $filesetref_name ) + { + return ("${vendor}__${library}${library_path}/${file_name}${variant}.v"); + }; + } + } + } +} +} + + +1 +
sys/gen_child_filelist Property changes : Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Index: sys/build_hw_master =================================================================== --- sys/build_hw_master (nonexistent) +++ sys/build_hw_master (revision 131) @@ -0,0 +1,135 @@ +eval 'exec `which perl` -S $0 ${1+"$@"}' + if 0; + +#/**********************************************************************/ +#/* */ +#/* ------- */ +#/* / SOC \ */ +#/* / GEN \ */ +#/* / TOOL \ */ +#/* ============== */ +#/* | | */ +#/* |____________| */ +#/* */ +#/* */ +#/* */ +#/* Author(s): */ +#/* - John Eaton, jt_eaton@opencores.org */ +#/* */ +#/**********************************************************************/ +#/* */ +#/* Copyright (C) <2010-2013> */ +#/* */ +#/* 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 XML::LibXML; +use lib './tools'; +use sys::lib; +use yp::lib; + +$OUTPUT_AUTOFLUSH = 1; # set autoflush of stdout to TRUE. + + +############################################################################ +### Process the options +############################################################################ +Getopt::Long::config("require_order", "prefix=-"); +GetOptions("h","help", +) || die "(use '$program_name -h' for help)"; + + + + +############################################################################## +## Help option +############################################################################## +if ( $opt_h or $opt_help ) + { print "\n build_master"; + print "\n"; + exit 1; + } + + +my $parser = XML::LibXML->new(); + + +my @kids = ( ); +my @filelist = ( ); + + + +#/**********************************************************************/ +#/* Process each library by finding any ip-xact file in any component */ +#/* */ +#/* Each ip-xact file is parsed and it's filename and the names of any*/ +#/* modules that it uses are saved. */ +#/* */ +#/* */ +#/**********************************************************************/ + +my $home = cwd(); + +my $prefix = yp::lib::get_workspace(); + $prefix = "/${prefix}"; + +my @vendors = yp::lib::find_vendors(); + +foreach my $vendor (@vendors) + { + my $vendor_status = yp::lib::get_vendor_status($vendor); + if($vendor_status eq "active") + { + my @libraries = yp::lib::find_libraries($vendor); + foreach my $library (@libraries) + { + my $library_status = yp::lib::get_library_status($vendor,$library); + if($library_status eq "active") + { + run_vendor_library ( $vendor , $library) + } + } + } + } + + + + +sub run_vendor_library + { + my @params = @_; + my $library = pop(@params); + my $vendor = pop(@params); + my $cmd ="./tools/sys/build_hw ${vendor} ${library} \n"; + print "$cmd"; + if(system($cmd)){} + return(0); + }
sys/build_hw_master Property changes : Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Index: sys/build_sw =================================================================== --- sys/build_sw (nonexistent) +++ sys/build_sw (revision 131) @@ -0,0 +1,160 @@ +eval 'exec `which perl` -S $0 ${1+"$@"}' + if 0; + +#/**********************************************************************/ +#/* */ +#/* ------- */ +#/* / SOC \ */ +#/* / GEN \ */ +#/* / TOOL \ */ +#/* ============== */ +#/* | | */ +#/* |____________| */ +#/* */ +#/* */ +#/* */ +#/* Author(s): */ +#/* - John Eaton, jt_eaton@opencores.org */ +#/* */ +#/**********************************************************************/ +#/* */ +#/* Copyright (C) <2010-2013> */ +#/* */ +#/* 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 XML::LibXML; +use lib './tools'; +use sys::lib; +use yp::lib; + +$OUTPUT_AUTOFLUSH = 1; # set autoflush of stdout to TRUE. + +############################################################################ +### Process the options +############################################################################ +Getopt::Long::config("require_order", "prefix=-"); +GetOptions("h","help", +) || die "(use '$program_name -h' for help)"; + + +############################################################################## +## Help option +############################################################################## +if ( $opt_h or $opt_help ) + { print "\n build_sw vendor__component worksite"; + print "\n"; + exit 1; + } + + +#/**********************************************************************/ +#/* Process each library by finding any ip-xact file in any component */ +#/* */ +#/* Each ip-xact file is parsed and it's filename and the names of any*/ +#/* modules that it uses are saved. */ +#/* */ +#/* */ +#/**********************************************************************/ + + + +my $home = cwd(); + +my $vendor; +my $library; + + + + +$_ = $ARGV[0]; +my $work_site = yp::lib::get_workspace(); + $work_site = "/${work_site}" ; + + + +if(/(\S+)__(\S+)/) + { + $vendor = $1; + $library = $2; + } + +my $parser = XML::LibXML->new(); + + +my @kids = ( ); +my @filelist = ( ); + + +my @components = yp::lib::find_components($vendor,$library); + +foreach my $component (@components) + { + + my $socgen_filename = yp::lib::find_componentConfiguration($vendor,$library,$component); + + if($socgen_filename) + { + + + my $socgen_file = $parser->parse_file($socgen_filename); + + + + #/*********************************************************************************************/ + #/ files for simulation */ + #/ */ + #/*********************************************************************************************/ + + + + + foreach my $i_name ($socgen_file->findnodes("//socgen:codeSets/socgen:codeSet/socgen:name")) + { + my $codeSet_name = $i_name ->findnodes('./text()')->to_literal ; + my $codeSet_vendor = $i_name ->findnodes('../socgen:vendor/text()')->to_literal ; + my $codeSet_library = $i_name ->findnodes('../socgen:library/text()')->to_literal ; + my $codeSet_component = $i_name ->findnodes('../socgen:component/text()')->to_literal ; + my $codeSet_version = $i_name ->findnodes('../socgen:version/text()')->to_literal ; + + print "$codeSet_name $codeSet_vendor $codeSet_library $codeSet_component $codeSet_version \n "; + + $cmd ="./tools/sys/build_generate -prefix ${work_site} -vendor ${codeSet_vendor} -library ${codeSet_library} -component ${codeSet_component} -version ${codeSet_version} \n"; + if (system($cmd)) {} + + + + + } + +} + +} \ No newline at end of file
sys/build_sw Property changes : Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Index: sys/build_generate =================================================================== --- sys/build_generate (revision 130) +++ sys/build_generate (revision 131) @@ -70,7 +70,7 @@ GetOptions("h","help", "prefix=s" => \$prefix, "vendor=s" => \$vendor, - "project=s" => \$project, + "library=s" => \$library, "component=s" => \$component, "version=s" => \$version ) || die "(use '$program_name -h' for help)"; @@ -79,7 +79,7 @@ ############################################################################## ## Help option ############################################################################## -if ( $opt_h or $opt_help ) { print "\n build_generate -prefix /work -vendor vendor_name -project project_name -component component_name -version version_name "; +if ( $opt_h or $opt_help ) { print "\n build_generate -prefix /work -vendor vendor_name -library library_name -component component_name -version version_name "; print "\n"; exit 1; } @@ -101,12 +101,12 @@ -print "\nGENERATE $prefix $vendor $project $component $version \n" ; +#print "\n FFFFFFFFFFFF GENERATE $prefix $vendor $library $component $version \n" ; my $parser = XML::LibXML->new(); -my $lib_comp_sep = yp::lib::find_lib_comp_sep($vendor,$project,$component); +my $lib_comp_sep = yp::lib::find_lib_comp_sep($vendor,$library,$component); @@ -123,7 +123,7 @@ #/ */ #/*********************************************************************************************/ -my @filelist = yp::lib::parse_component_brothers("$vendor","$project","$component","$version"); +my @filelist = yp::lib::parse_component_brothers("$vendor","$library","$component","$version"); foreach $line (@filelist) { @@ -130,13 +130,13 @@ $_ = $line; if(/::(\S+)::(\S+)::(\S+)::(\S+)::/) { - $new_project = $2; + $new_library = $2; $new_component = $3; $new_vendor = $1; $new_version = $4; -# print " FFFFFFFFFFFFFFFF Brother $new_vendor $new_project $new_component $new_version \n" ; +# print " FFFFFFFFFFFFFFFF Brother $new_vendor $new_library $new_component $new_version \n" ; - my $spirit_component_file = $parser->parse_file(yp::lib::find_ipxact_component($new_vendor,$new_project,$new_component,$new_version)); + my $spirit_component_file = $parser->parse_file(yp::lib::find_ipxact_component($new_vendor,$new_library,$new_component,$new_version)); foreach my $i_name ($spirit_component_file->findnodes("//spirit:componentGenerator/spirit:name")) { @@ -145,7 +145,7 @@ # print " FFFFFFFFFFFFFFFF $gen_name $gen_generatorExe \n" ; my $cmd; - $cmd = " -prefix $prefix -vendor $vendor -project $project -component $component -version $version "; + $cmd = " -prefix $prefix -vendor $vendor -library $library -component $component -version $version "; foreach my $i_name ($spirit_component_file->findnodes("//spirit:componentGenerator[spirit:name/text() = '$gen_name']/spirit:parameters/spirit:parameter")) { @@ -152,8 +152,8 @@ my($gen_param) = $i_name ->findnodes('./spirit:value/text()')->to_literal ; my($gen_param_name) = $i_name ->findnodes('./spirit:name/text()')->to_literal ; - if ($gen_param_name eq "in_pipe") {$cmd = "$cmd <${home}${prefix}/${vendor}__${project}${lib_comp_sep}${component}/${gen_param}";} - elsif($gen_param_name eq "out_pipe") {$cmd = "$cmd >${home}${prefix}/${vendor}__${project}${lib_comp_sep}${component}/${gen_param}";} + if ($gen_param_name eq "in_pipe") {$cmd = "$cmd <${home}${prefix}/${vendor}__${library}${lib_comp_sep}${component}/${gen_param}";} + elsif($gen_param_name eq "out_pipe") {$cmd = "$cmd >${home}${prefix}/${vendor}__${library}${lib_comp_sep}${component}/${gen_param}";} elsif($gen_param_name) {$cmd = "$cmd -${gen_param_name} $gen_param ";} else {$cmd = "$cmd $gen_param";} } @@ -164,7 +164,7 @@ my $New_cmd = " ${gen_generatorExe} -envidentifier $gen_envidentifier ${cmd}\n"; if(${gen_generatorExe} ) - { + { if (system($New_cmd)) {} } }
/sys/elaborate_icarus_lib
0,0 → 1,306
eval 'exec `which perl` -S $0 ${1+"$@"}'
if 0;
 
#/**********************************************************************/
#/* */
#/* ------- */
#/* / SOC \ */
#/* / GEN \ */
#/* / TOOL \ */
#/* ============== */
#/* | | */
#/* |____________| */
#/* */
#/* */
#/* */
#/* Author(s): */
#/* - John Eaton, jt_eaton@opencores.org */
#/* */
#/**********************************************************************/
#/* */
#/* Copyright (C) <2010-2014> <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 XML::LibXML;
use lib './tools';
use sys::lib;
use yp::lib;
 
$OUTPUT_AUTOFLUSH = 1; # set autoflush of stdout to TRUE.
 
 
############################################################################
### Process the options
############################################################################
Getopt::Long::config("require_order", "prefix=-");
GetOptions("h","help",
"prefix=s" => \$prefix,
"vendor=s" => \$vendor
 
 
) || die "(use '$program_name -h' for help)";
 
 
 
 
##############################################################################
## Help option
##############################################################################
if ( $opt_h or $opt_help )
{ print "\n elaborate_icarus_lib -prefix worksite -vendor vendor \n";
exit 1;
}
 
 
#/**********************************************************************/
#/* Process by finding any ip-xact componentCfgfile in any component */
#/* */
#/* */
#/* */
#/**********************************************************************/
 
my $home = cwd();
my $parser = XML::LibXML->new();
 
 
 
 
 
 
 
#############################################################################
##
##
#############################################################################
 
 
 
 
print "\nelaborate_icarus_lib $prefix $vendor \n" ;
 
 
 
 
 
 
my $library;
 
my @testbenches = ( );
my @tests = ( );
my @kids = ( );
my @filelist = ( );
 
 
 
 
my @libraries = yp::lib::find_libraries("$vendor");
 
 
foreach $library (@libraries)
{
 
 
my @components = yp::lib::find_components("$vendor","$library");
 
foreach $component (@components)
{
 
 
 
chomp($component);
 
 
my $socgen_file = $parser->parse_file(yp::lib::find_componentConfiguration($vendor,$library,$component));
foreach my $i_name ($socgen_file->findnodes("//socgen:componentConfiguration/socgen:sim/socgen:icarus/socgen:test/socgen:name"))
{
my($sim_name) = $i_name ->findnodes('./text()')->to_literal ;
my($sim_configuration) = $i_name ->findnodes('../socgen:configuration/text()')->to_literal ;
my($sim_variant) = $i_name ->findnodes('../socgen:variant/text()')->to_literal ;
print " $vendor $library $component $sim_name $sim_configuration $sim_variant \n";
foreach my $i_name ($socgen_file->findnodes("//socgen:componentConfiguration/socgen:sim/socgen:testbenches/socgen:testbench[socgen:variant/text() = '$sim_variant']/./socgen:version"))
{
my($ver_name) = $i_name ->findnodes('./text()')->to_literal ;
push @testbenches , "::${prefix}::${vendor}::${library}::${component}::${sim_variant}::${ver_name}::default::";
push @tests , "::${prefix}::${vendor}::${library}::${component}::${sim_variant}::${ver_name}::${sim_configuration}::";
}
}
 
 
}
 
}
 
 
 
 
@testbenches = sys::lib::trim_sort(@testbenches);
 
foreach my $testbench (@testbenches)
{
$_ = $testbench;
if(/::(\S+)::(\S+)::(\S+)::(\S+)::(\S+)::(\S+)::(\S+)::/)
{
my $kid_prefix = $1;
my $kid_vendor = $2;
my $kid_library = $3;
my $kid_component = $4;
my $kid_variant = $5;
my $kid_version = $6;
my $kid_configuration = $7;
 
my $path = "${home}${kid_prefix}";
mkdir $path,0755 unless( -e $path );
$path = "${path}/${kid_vendor}";
mkdir $path,0755 unless( -e $path );
$path = "${path}/${kid_library}";
mkdir $path,0755 unless( -e $path );
$path = "${path}/${kid_component}";
mkdir $path,0755 unless( -e $path );
$path = "${path}/${kid_version}";
mkdir $path,0755 unless( -e $path );
 
 
 
 
@filelist = yp::lib::parse_component_file("$kid_vendor","$kid_library","$kid_component","$kid_version");
 
 
foreach $line (@filelist)
{
$_ = $line;
 
if(/::(\S+)::(\S+)::(\S+)::(\S+)::/)
{
$new_vendor = $1;
$new_proj = $2;
$new_comp = $3;
$new_version = $4;
}
 
if( ($kid_vendor eq $new_vendor) && ( $kid_library eq $new_proj) && ( $kid_component eq $new_comp ) && ( $kid_version eq $new_version ) )
{
}
else
{
push @kids , "::${prefix}::${new_vendor}::${new_proj}::${new_comp}::${new_comp}_${new_version}::${new_version}::default::";
}
}
}
}
 
 
 
@tests = sys::lib::trim_sort(@tests);
 
 
foreach my $test (@tests)
{
$_ = $test;
 
if(/::(\S+)::(\S+)::(\S+)::(\S+)::(\S+)::(\S+)::(\S+)::/)
{
my $kid_prefix = $1;
my $kid_vendor = $2;
my $kid_library = $3;
my $kid_component = $4;
my $kid_variant = $5;
my $kid_version = $6;
my $kid_configuration = $7;
my $path = "${home}${kid_prefix}";
$path = "${path}/${kid_vendor}";
$path = "${path}/${kid_library}";
$path = "${path}/${kid_component}";
$path = "${path}/${kid_version}";
 
my $spirit_component_file = yp::lib::find_ipxact_component($kid_vendor,$kid_library,$kid_component,$kid_version);
$cmd ="cp $spirit_component_file $path/${kid_configuration}.xml \n";
if (system($cmd)) {}
}
}
 
 
 
 
 
@kids = sys::lib::trim_sort(@kids);
 
 
 
 
foreach my $kid (@kids)
{
$_ = $kid;
 
if(/::(\S+)::(\S+)::(\S+)::(\S+)::(\S+)::(\S+)::(\S+)::/)
{
my $kid_prefix = $1;
my $kid_vendor = $2;
my $kid_library = $3;
my $kid_component = $4;
my $kid_variant = $5;
my $kid_version = $6;
my $kid_configuration = $7;
 
my $path = "${home}${kid_prefix}";
mkdir $path,0755 unless( -e $path );
$path = "${path}/${kid_vendor}";
mkdir $path,0755 unless( -e $path );
$path = "${path}/${kid_library}";
mkdir $path,0755 unless( -e $path );
$path = "${path}/${kid_component}";
mkdir $path,0755 unless( -e $path );
$path = "${path}/${kid_version}";
mkdir $path,0755 unless( -e $path );
 
print " $kid_vendor $kid_library $kid_component $kid_version \n";
 
my $spirit_component_file = yp::lib::find_ipxact_component($kid_vendor,$kid_library,$kid_component,$kid_version);
$cmd ="cp $spirit_component_file $path/${kid_configuration}.xml \n";
if (system($cmd)) {}
}
}
 
 
 
 
1;
 
 
 
 
 
 
 
 
sys/elaborate_icarus_lib Property changes : Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Index: sys/build_hw =================================================================== --- sys/build_hw (revision 130) +++ sys/build_hw (revision 131) @@ -73,19 +73,14 @@ ## Help option ############################################################################## if ( $opt_h or $opt_help ) - { print "\n build_hw vendor__component worksite"; + { print "\n build_hw vendor__library "; print "\n"; exit 1; } - - - - - #/**********************************************************************/ -#/* Process each project by finding any ip-xact file in any component */ +#/* Process each library by finding any ip-xact file in any component */ #/* */ #/* Each ip-xact file is parsed and it's filename and the names of any*/ #/* modules that it uses are saved. */ @@ -93,30 +88,12 @@ #/* */ #/**********************************************************************/ +my $vendor = $ARGV[0]; +my $library = $ARGV[1]; +my $prefix = yp::lib::get_workspace(); + $prefix = "/${prefix}"; - - -my $home = cwd(); - -my $project_vendor; -my $project_library; - - - - -$_ = $ARGV[0]; -my $work_site = $ARGV[1]; - -if(/(\S+)__(\S+)/) - { - $project_vendor = $1; - $project_library = $2; - } - - - - my $parser = XML::LibXML->new(); @@ -124,41 +101,36 @@ my @filelist = ( ); -my @components = yp::lib::find_components($project_vendor,$project_library); +my @components = yp::lib::find_components($vendor,$library); -foreach my $project_component (@components) +foreach my $component (@components) { - my $socgen_file = $parser->parse_file(yp::lib::find_componentConfiguration($project_vendor,$project_library,$project_component)); + my $socgen_filename = yp::lib::find_componentConfiguration($vendor,$library,$component); + if($socgen_filename) + { + my $socgen_file = $parser->parse_file($socgen_filename); - #/*********************************************************************************************/ #/ files for simulation */ #/ */ #/*********************************************************************************************/ - - - foreach my $i_name ($socgen_file->findnodes("//socgen:sim/socgen:testbenches/socgen:testbench/socgen:version")) { my $tb_version = $i_name ->findnodes('./text()')->to_literal ; - my $tb_variant = "${project_component}_${tb_version}"; + my $tb_variant = "${component}_${tb_version}"; - - foreach my $i_name ($socgen_file->findnodes("//socgen:testbench[socgen:variant/text() = '$tb_variant']/socgen:tools/socgen:tool")) { my $tb_tool = $i_name ->findnodes('./text()')->to_literal ; - if( ($tb_tool eq "icarus") || ($tb_tool eq "verilator") || ($tb_tool eq "rtl_check")) { - @filelist = ( ); - @filelist = yp::lib::parse_component_file("$project_vendor","$project_library","$project_component","$tb_version"); + @filelist = yp::lib::parse_component_file("$vendor","$library","$component","$tb_version"); foreach $line (@filelist) { @@ -170,13 +142,13 @@ $new_comp = $3; $new_version = $4; } - if( ($project_vendor eq $new_vendor) && ( $project_library eq $new_proj) && ( $project_component eq $new_comp ) && ( $tb_version eq $new_version ) ) + if( ($vendor eq $new_vendor) && ( $library eq $new_proj) && ( $component eq $new_comp ) && ( $tb_version eq $new_version ) ) { - push @kids , "::${work_site}::${project_library}::${project_component}::${project_vendor}::${tb_version}::"; + push @kids , "::${prefix}::${library}::${component}::${vendor}::${tb_version}::"; } else { - push @kids , "::${work_site}/${project_vendor}__${project_library}/children::${new_proj}::${new_comp}::${new_vendor}::${new_version}::"; + push @kids , "::${prefix}/${vendor}__${library}/children::${new_proj}::${new_comp}::${new_vendor}::${new_version}::"; } } } @@ -184,26 +156,26 @@ if($tb_tool eq "coverage") { - print " SIM COVERAGE testbench $project_vendor $project_library $project_component $tb_variant \n"; - $cmd ="./tools/simulation/build_coverage -work_site $work_site -vendor $project_vendor -project $project_library -component $project_component -version $tb_version \n"; + print " SIM COVERAGE testbench $vendor $library $component $tb_variant \n"; + $cmd ="./tools/simulation/build_coverage -work_site $prefix -vendor $vendor -library $library -component $component -version $tb_version \n"; if (system($cmd)) {} } elsif($tb_tool eq "icarus") { - print " SIM ICARUS testbench $project_vendor $project_library $project_component $tb_variant \n"; - $cmd ="./tools/simulation/build_icarus_filelists -work_site $work_site -vendor $project_vendor -project $project_library -component $project_component -version $tb_version \n"; + print " SIM ICARUS testbench $vendor $library $component $tb_variant \n"; + $cmd ="./tools/simulation/build_icarus_filelists -work_site $prefix -vendor $vendor -library $library -component $component -version $tb_version \n"; if (system($cmd)) {} } elsif($tb_tool eq "verilator") { - print " SIM VERILATOR testbench $project_vendor $project_library $project_component $tb_variant \n"; - $cmd ="./tools/simulation/build_verilator_filelists -work_site $work_site -vendor $project_vendor -project $project_library -component $project_component -version $tb_version \n"; + print " SIM VERILATOR testbench $vendor $library $component $tb_variant \n"; + $cmd ="./tools/simulation/build_verilator_filelists -work_site $prefix -vendor $vendor -library $library -component $component -version $tb_version \n"; if (system($cmd)) {} } elsif($tb_tool eq "rtl_check") { - print " SIM RTL_CHECK testbench $project_vendor $project_library $project_component $tb_variant \n"; - $cmd ="./tools/simulation/build_lint_filelists -work_site $work_site -vendor $project_vendor -project $project_library -component $project_component -version $tb_version \n"; + print " SIM RTL_CHECK testbench $vendor $library $component $tb_variant \n"; + $cmd ="./tools/simulation/build_lint_filelists -work_site $prefix -vendor $vendor -library $library -component $component -version $tb_version \n"; if (system($cmd)) {} } } @@ -216,16 +188,13 @@ #/ */ #/*********************************************************************************************/ - - - - foreach my $i_name ($socgen_file->findnodes("//socgen:syn/socgen:ise/socgen:version")) + foreach my $i_name ($socgen_file->findnodes("//socgen:syn/socgen:ise/socgen:chip/socgen:version")) { my $ise_version = $i_name ->findnodes('./text()')->to_literal ; - print " SYN ISE $project_vendor $project_library $project_component $ise_version \n"; + print " SYN ISE $vendor $library $component $ise_version \n"; @filelist = ( ); - @filelist = yp::lib::parse_component_file("$project_vendor","$project_library","$project_component","$ise_version"); + @filelist = yp::lib::parse_component_file("$vendor","$library","$component","$ise_version"); foreach $line (@filelist) { @@ -238,21 +207,23 @@ $new_version = $4; } - if( ($project_vendor eq $new_vendor) && ( $project_library eq $new_proj) && ( $project_component eq $new_comp ) && ( $ise_version eq $new_version ) ) + if( ($vendor eq $new_vendor) && ( $library eq $new_proj) && ( $component eq $new_comp ) && ( $ise_version eq $new_version ) ) { - push @kids , "::${work_site}::${project_library}::${project_component}::${project_vendor}::${ise_version}::"; + push @kids , "::${prefix}::${library}::${component}::${vendor}::${ise_version}::"; } else { - push @kids , "::${work_site}/${project_vendor}__${project_library}/children::${new_proj}::${new_comp}::${new_vendor}::${new_version}::"; + push @kids , "::${prefix}/${vendor}__${library}/children::${new_proj}::${new_comp}::${new_vendor}::${new_version}::"; } - } - - + } } } +} + + + #/**********************************************************************/ #/* */ #/* Sort out the duplicate names and then build the rtl for every */ @@ -269,12 +240,12 @@ if(/::(\S+)::(\S+)::(\S+)::(\S+)::(\S+)::/) { my $kid_prefix = $1; - my $kid_project = $2; + my $kid_library = $2; my $kid_component = $3; my $kid_vendor = $4; my $kid_version = $5; - $cmd ="./tools/sys/build_generate -prefix ${kid_prefix} -vendor ${kid_vendor} -project ${kid_project} -component ${kid_component} -version ${kid_version} \n"; + $cmd ="./tools/sys/build_generate -prefix ${kid_prefix} -vendor ${kid_vendor} -library ${kid_library} -component ${kid_component} -version ${kid_version} \n"; if (system($cmd)) {} }
/sys/build_elab_master
0,0 → 1,201
eval 'exec `which perl` -S $0 ${1+"$@"}'
if 0;
 
#/**********************************************************************/
#/* */
#/* ------- */
#/* / SOC \ */
#/* / GEN \ */
#/* / TOOL \ */
#/* ============== */
#/* | | */
#/* |____________| */
#/* */
#/* */
#/* */
#/* Author(s): */
#/* - John Eaton, jt_eaton@opencores.org */
#/* */
#/**********************************************************************/
#/* */
#/* Copyright (C) <2010-2013> <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 XML::LibXML;
use lib './tools';
use sys::lib;
use yp::lib;
 
$OUTPUT_AUTOFLUSH = 1; # set autoflush of stdout to TRUE.
 
 
############################################################################
### Process the options
############################################################################
Getopt::Long::config("require_order", "prefix=-");
GetOptions("h","help",
) || die "(use '$program_name -h' for help)";
 
 
 
 
##############################################################################
## Help option
##############################################################################
if ( $opt_h or $opt_help )
{ print "\n build_master";
print "\n";
exit 1;
}
 
 
my $parser = XML::LibXML->new();
 
 
 
 
#/**********************************************************************/
#/* Process each library by finding any ip-xact file in any component */
#/* */
#/* Each ip-xact file is parsed and it's filename and the names of any*/
#/* modules that it uses are saved. */
#/* */
#/* */
#/**********************************************************************/
 
my $home = cwd();
 
my $prefix = yp::lib::get_workspace();
$prefix = "/${prefix}";
 
my @vendors = yp::lib::find_vendors();
 
foreach my $vendor (@vendors)
{
 
my $vendor_status = yp::lib::get_vendor_status($vendor);
if($vendor_status eq "active")
{
my @libraries = yp::lib::find_libraries($vendor);
foreach my $library (@libraries)
{
 
my $library_status = yp::lib::get_library_status($vendor,$library);
if($library_status eq "active")
{
print "$vendor $library \n ";
run_vendor_library ( $vendor , $library)
}
}
}
}
 
 
 
 
sub run_vendor_library
{
my @params = @_;
my $library = pop(@params);
my $vendor = pop(@params);
 
my @components = yp::lib::find_components($vendor,$library);
 
foreach my $component (@components)
{
my $socgen_filename = yp::lib::find_componentConfiguration($vendor,$library,$component);
if($socgen_filename)
{
my $socgen_file = $parser->parse_file($socgen_filename);
 
#/*********************************************************************************************/
#/ files for simulation */
#/ */
#/*********************************************************************************************/
 
foreach my $i_name ($socgen_file->findnodes("//socgen:componentConfiguration/socgen:sim/socgen:icarus/socgen:test/socgen:name"))
{
my $test_name = $i_name ->findnodes('./text()')->to_literal ;
my $test_variant = $i_name ->findnodes('../socgen:variant/text()')->to_literal ;
 
# print "XXXX $vendor $library $component $test_variant $test_name \n ";
 
 
foreach my $j_name ($socgen_file->findnodes("//socgen:componentConfiguration/socgen:sim/socgen:testbenches/socgen:testbench/socgen:variant"))
{
my $testbench_variant = $j_name ->findnodes('./text()')->to_literal ;
my $testbench_version = $j_name ->findnodes('../socgen:version/text()')->to_literal ;
my $testbench_instance = $j_name ->findnodes('../socgen:bus/socgen:instance/text()')->to_literal ;
my $testbench_bus_name = $j_name ->findnodes('../socgen:bus/socgen:bus_name/text()')->to_literal ;
 
 
if($test_variant eq $testbench_variant )
{
# print "YYYY $prefix $vendor $library $component $testbench_version $test_name \n ";
 
$cmd ="./tools/verilog/elab_verilog -prefix ${prefix} -vendor ${vendor} -library ${library} -component ${component} -version ${testbench_version} -env sim -tool icarus -unit test -name $test_name \n";
print "$cmd";
if (system($cmd)) {}
 
if ($testbench_instance)
{
 
$cmd ="./tools/verilog/trace_bus -prefix ${prefix} -vendor ${vendor} -library ${library} -component ${component} -version ${testbench_version} -path $testbench_instance -bus_name $testbench_bus_name -test_name $test_name ";
 
if (system($cmd)) {}
}
 
 
}
}
 
 
 
 
 
 
 
 
}
 
}
 
}
 
 
 
return(0);
}
 
sys/build_elab_master Property changes : Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Index: sys/workspace =================================================================== --- sys/workspace (revision 130) +++ sys/workspace (revision 131) @@ -65,56 +65,80 @@ #/*********************************************************************************************/ my $home = cwd(); -my $root = $ARGV[0]; -my $prefix = $ARGV[1]; -chomp($root); -chomp($prefix); -$_ = $root; -if(/\/(\S+)\/(\S+)\/(\S+)/) +my $prefix = yp::lib::get_workspace(); + $prefix = "/${prefix}"; + +my $path = "${home}${prefix}"; + +mkdir $path,0755 unless( -e $path ); + + +my $vendor = $ARGV[0]; +my $library = $ARGV[1]; + +chomp($vendor); +chomp($library); + + +$_ = $vendor; + +if(/(\S+)\/(\S+)/) { - $projects_dir = $1; - $vendor = $2; - $project = $3; + $vendor = $1; + $library = $2; } -$root = "${projects_dir}/${vendor}/${project}/"; +my $repo = yp::lib::find_library_repo($vendor,$library); +my $root = ".${repo}/${vendor}/${library}/"; + + unless ( -e $root ) { - print "ERROR: Project $root does not exist \n"; + print "ERROR: Library $vendor $library does not exist \n"; exit(0); } -unless ( $prefix ) - { - $prefix = "/work"; - } -my $path = "${home}${prefix}"; -mkdir $path,0755 unless( -e $path ); -$path = "${home}${prefix}/${vendor}__${project}"; + + +$path = "${home}${prefix}/${vendor}__${library}"; mkdir $path,0755 unless( -e $path ); +my $vendor_status = yp::lib::get_vendor_status($vendor); +my $library_status = yp::lib::get_library_status($vendor,$library); -print "Building Workspace ${prefix}/${vendor}__${project} from ./${projects_dir}/${vendor}/${project}/ \n"; +print "Building Workspace ${prefix}/${vendor}__${library} from .${repo}/${vendor}/${library}/ $vendor_status $library_status \n"; -&link_sub( $root,$root, ".${prefix}/${vendor}__${project}" ); + +$vendor_status = yp::lib::set_vendor_status($vendor,"active"); +$vendor_status = yp::lib::get_vendor_status($vendor); + +$library_status = yp::lib::set_library_status($vendor,$library,"active"); +$library_status = yp::lib::get_library_status($vendor,$library); + + +print "Vendor $vendor_status Library $library_status \n"; + +&link_sub( $root,$root, ".${prefix}/${vendor}__${library}" ); + + #/*********************************************************************************************/ #/ */ -#/ Each project is given access to the system tools by giving each of them a link to the */ +#/ Each library is given access to the system tools by giving each of them a link to the */ #/ Master Makefiles in tools/bin */ #/ */ #/ */ @@ -122,32 +146,42 @@ -if (system("chmod 755 ${home}/${projects_dir}/${vendor}/${project}/bin/* \n" )) {} +if (system("chmod 755 ${home}/${repo}/${vendor}/${library}/bin/* \n" )) {} -symlink( "${home}/tools/bin/Makefile.root", "${home}${prefix}/${vendor}__${project}/bin/Makefile.root"); -symlink( "${home}/tools/bin/Makefile", "${home}${prefix}/${vendor}__${project}/bin/Makefile"); +symlink( "${home}/tools/bin/Makefile.root", "${home}${prefix}/${vendor}__${library}/bin/Makefile.root"); +symlink( "${home}/tools/bin/Makefile", "${home}${prefix}/${vendor}__${library}/bin/Makefile"); -my $path = "${home}${prefix}/${vendor}__${project}/children"; +my $path = "${home}${prefix}/${vendor}__${library}/children"; mkdir $path,0755 unless( -e $path ); -my @components = yp::lib::find_components($vendor,$project); +my @components = yp::lib::find_components($vendor,$library); foreach my $component (@components) { my $parser = XML::LibXML->new(); - print " $vendor,$project,$component \n"; - my $socgen_file = $parser->parse_file(yp::lib::find_componentConfiguration($vendor,$project,$component)); - my @versions = yp::lib::find_component_versions($vendor,$project,$component); + print " $vendor,$library,$component \n"; + + my $socgen_filename = yp::lib::find_componentConfiguration($vendor,$library,$component); + if($socgen_filename) + { + + my $socgen_file = $parser->parse_file(yp::lib::find_componentConfiguration($vendor,$library,$component)); + + + + + my @versions = yp::lib::find_component_versions($vendor,$library,$component); + foreach $comp_version (@versions) { - $cmd ="./tools/sys/soc_link_child -prefix $prefix -vendor $vendor -project $project -component $component -version $comp_version $projects_dir \n"; + $cmd ="./tools/sys/soc_link_child -prefix $prefix -vendor $vendor -library $library -component $component -version $comp_version \n"; if (system($cmd)) {} } - print "Linking simulations for $vendor $project $component \n"; + print "Linking simulations for $vendor $library $component \n"; foreach my $i_name ($socgen_file->findnodes("//socgen:sim/socgen:testbenches/socgen:testbench/socgen:version")) { @@ -154,7 +188,7 @@ my($tb_version) = $i_name ->findnodes('./text()')->to_literal ; - $cmd ="./tools/sys/soc_link_child -prefix $prefix -vendor ${vendor} -project $project -component $component -version $tb_version $projects_dir \n"; + $cmd ="./tools/sys/soc_link_child -prefix $prefix -vendor ${vendor} -library $library -component $component -version $tb_version \n"; if (system($cmd)) {} } @@ -167,26 +201,28 @@ #/ */ #/*********************************************************************************************/ - print "Linking synthesys targets for $vendor $project $component \n"; - my $lib_comp_sep = yp::lib::find_lib_comp_sep($vendor,$project,$component); + print "Linking synthesys targets for $vendor $library $component \n"; + my $lib_comp_sep = yp::lib::find_lib_comp_sep($vendor,$library,$component); - foreach my $i_name ($socgen_file->findnodes("//socgen:syn/socgen:ise/socgen:variant")) + foreach my $i_name ($socgen_file->findnodes("//socgen:syn/socgen:ise/socgen:chip/socgen:variant")) { my($chip_name) = $i_name ->findnodes('./text()')->to_literal ; my($chip_target) = $i_name ->findnodes('../socgen:target/socgen:library/text()')->to_literal ; my($chip_part) = $i_name ->findnodes('../socgen:target/socgen:part/text()')->to_literal ; - $outfile ="${home}${prefix}/${vendor}__${project}${lib_comp_sep}${component}/syn/ise/${chip_name}/Makefile"; + $outfile ="${home}${prefix}/${vendor}__${library}${lib_comp_sep}${component}/syn/ise/${chip_name}/Makefile"; open MAKSYNFILE,">$outfile" or die "unable to open $outfile"; print MAKSYNFILE "include ${home}/tools/bin/Makefile.root\n"; print MAKSYNFILE "Part=${chip_part}\n"; print MAKSYNFILE "board=${chip_target}\n"; print MAKSYNFILE "Design=${chip_name}\n"; - my $path = "${home}${prefix}/${vendor}__${project}${lib_comp_sep}${component}/syn/ise/${chip_name}/target"; + my $path = "${home}${prefix}/${vendor}__${library}${lib_comp_sep}${component}/syn/ise/${chip_name}/target"; mkdir $path,0755 unless( -e $path ); - &sys::lib::link_dir( "${home}/tools/synthesys/targets/ip/${chip_target}", "${home}${prefix}/${vendor}__${project}${lib_comp_sep}${component}/syn/ise/${chip_name}/target" ); + &sys::lib::link_dir( "${home}/tools/synthesys/targets/ip/${chip_target}", "${home}${prefix}/${vendor}__${library}${lib_comp_sep}${component}/syn/ise/${chip_name}/target" ); } } + + }

powered by: WebSVN 2.1.0

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