Line 49... |
Line 49... |
############################################################################
|
############################################################################
|
use Getopt::Long;
|
use Getopt::Long;
|
use English;
|
use English;
|
use File::Basename;
|
use File::Basename;
|
use Cwd;
|
use Cwd;
|
|
use Scalar::Util qw(looks_like_number);
|
use XML::LibXML;
|
use XML::LibXML;
|
use lib './tools';
|
use lib './tools';
|
use sys::lib;
|
use sys::lib;
|
use yp::lib;
|
use yp::lib;
|
|
use BerkeleyDB;
|
|
|
|
|
$OUTPUT_AUTOFLUSH = 1; # set autoflush of stdout to TRUE.
|
$OUTPUT_AUTOFLUSH = 1; # set autoflush of stdout to TRUE.
|
|
|
|
|
############################################################################
|
############################################################################
|
Line 65... |
Line 68... |
Getopt::Long::config("require_order", "prefix=-");
|
Getopt::Long::config("require_order", "prefix=-");
|
GetOptions("h","help",
|
GetOptions("h","help",
|
"envidentifier=s" => \$envidentifier,
|
"envidentifier=s" => \$envidentifier,
|
"prefix=s" => \$prefix,
|
"prefix=s" => \$prefix,
|
"vendor=s" => \$vendor,
|
"vendor=s" => \$vendor,
|
"project=s" => \$project,
|
"library=s" => \$library,
|
"version=s" => \$version,
|
"version=s" => \$version,
|
"component=s" => \$component,
|
"component=s" => \$component,
|
"dest_dir=s" => \$dest_dir,
|
"dest_dir=s" => \$dest_dir,
|
"destination=s" => \$destination,
|
"destination=s" => \$destination,
|
"configuration=s" => \$configuration,
|
"configuration=s" => \$configuration,
|
"autodoc=s" => \$autodoc,
|
"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)";
|
) || die "(use '$program_name -h' for help)";
|
|
|
|
|
##############################################################################
|
##############################################################################
|
## Help option
|
## Help option
|
##############################################################################
|
##############################################################################
|
if ( $opt_h or $opt_help )
|
if ( $opt_h or $opt_help )
|
{ print "\n 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 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";
|
print "\n";
|
|
exit 1;
|
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();
|
$home = cwd();
|
|
|
my $projects_dir = "/projects";
|
|
my $variant;
|
my $variant;
|
my $view;
|
my $view;
|
|
|
|
|
my $interface_in_count =0;
|
my $interface_in_count =0;
|
my $interface_out_count =0;
|
my $interface_out_count =0;
|
my $interface_in_size =0;
|
my $interface_in_size =0;
|
my $interface_out_size =0;
|
my $interface_out_size =0;
|
|
|
|
|
|
|
if($version) {$variant = "${component}_${version}";}
|
if($version) {$variant = "${component}_${version}";}
|
else {$variant = "${component}";}
|
else {$variant = "${component}";}
|
|
|
unless($destination) { $destination = $variant;}
|
unless($destination) { $destination = $variant;}
|
unless($autodoc) { $autodoc = "/Geda";}
|
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,$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);
|
|
|
my $parser = XML::LibXML->new();
|
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 $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));
|
my $doc_library_path = $socgen_file->findnodes("//socgen:componentConfiguration/socgen:doc/socgen:library_path/text()")->to_literal;
|
my $doc_library_path = $socgen_file->findnodes("//socgen:componentConfiguration/socgen:doc/socgen:library_path/text()")->to_literal;
|
|
|
|
|
my $sim_library_path ;
|
my $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;
|
my $sim_comp_path = $socgen_file->findnodes("//socgen:componentConfiguration/socgen:sim/socgen:comp_path/text()")->to_literal;
|
|
|
if ($sim_comp_path)
|
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;}
|
$sim_library_path ="${lib_comp_sep}${sim_comp_path}";
|
|
}
|
|
else
|
|
{
|
|
$sim_library_path = $socgen_file->findnodes("//socgen:componentConfiguration/socgen:sim/socgen:library_path/text()")->to_literal;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
foreach my $X_view ($spirit_component_file->findnodes('//spirit:component/spirit:model/spirit:views/spirit:view'))
|
foreach my $X_view ($spirit_component_file->findnodes('//spirit:component/spirit:model/spirit:views/spirit:view'))
|
{
|
{
|
my($Xview_name) = $X_view->findnodes('./spirit:name/text()')->to_literal ;
|
my($Xview_name) = $X_view->findnodes('./spirit:name/text()')->to_literal ;
|
my($Xview_envidentifier) = $X_view->findnodes('./spirit:envIdentifier/text()')->to_literal ;
|
my($Xview_envidentifier) = $X_view->findnodes('./spirit:envIdentifier/text()')->to_literal ;
|
Line 167... |
Line 144... |
$view = $Xview_name;
|
$view = $Xview_name;
|
}
|
}
|
}
|
}
|
|
|
|
|
|
my $path = "${home}${prefix}/${vendor}__${library}${lib_comp_sep}${component}${comp_xml_sep}/${dest_dir}";
|
|
|
|
|
my $path = "${home}${prefix}/${vendor}__${project}${lib_comp_sep}${component}${comp_xml_sep}/${dest_dir}";
|
|
mkdir $path,0755 unless( -e $path );
|
mkdir $path,0755 unless( -e $path );
|
|
|
my $path = "${home}${prefix}/${vendor}__${project}${lib_comp_sep}${component}${comp_xml_sep}/${dest_dir}/${view}";
|
my $path = "${home}${prefix}/${vendor}__${library}${lib_comp_sep}${component}${comp_xml_sep}/${dest_dir}/${view}";
|
mkdir $path,0755 unless( -e $path );
|
mkdir $path,0755 unless( -e $path );
|
|
|
my @filelist_hier = ();
|
my @filelist_hier = ();
|
my @instantiations = ();
|
my @instantiations = ();
|
my @parameters = ();
|
my @parameters = ();
|
my %parameter_values = ();
|
my %parameter_values = ();
|
my %parameter_descriptions = ();
|
my %parameter_descriptions = ();
|
|
|
|
|
|
|
|
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 */
|
|
#/* */
|
|
#/******************************************************************************************/
|
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 "\n";
|
|
print TB_COMP_FILE " \n";
|
|
print TB_COMP_FILE "
|
|
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 "${vendor}\n";
|
|
print TB_COMP_FILE "${project}\n";
|
|
print TB_COMP_FILE "${component}\n";
|
|
print TB_COMP_FILE "${version}_dut.params\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 "\n";
|
|
print TB_DESIGN_FILE " \n";
|
|
print TB_DESIGN_FILE "
|
|
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 "${vendor}\n";
|
|
print TB_DESIGN_FILE "${project}\n";
|
|
print TB_DESIGN_FILE "${component}\n";
|
|
print TB_DESIGN_FILE "${version}_dutg.design\n";
|
|
|
|
|
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;
|
|
}
|
}
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#/******************************************************************************************/
|
|
|
|
|
|
|
|
|
#/**********************************************************************/
|
|
#/* */
|
#/* */
|
#/* if configuration set then read parameters from socgen:componentConfiguration file */
|
#/* if configuration set then read parameters from socgen:componentConfiguration file */
|
#/* */
|
#/* */
|
#/**********************************************************************/
|
#/******************************************************************************************/
|
|
|
if($configuration)
|
if($configuration)
|
{
|
{
|
# print "XXX Reading configuration $configuration \n";
|
# 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"))
|
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_name) = $socgen_cfg->findnodes('./text()')->to_literal ;
|
my($param_value) = $socgen_cfg->findnodes('../socgen:value/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 ;
|
my($config_name) = $socgen_cfg->findnodes('../../../socgen:name/text()')->to_literal ;
|
if($config_name eq $configuration )
|
if($config_name eq $configuration )
|
{
|
{
|
unless(defined $parameter_values{$param_name}) {push ( @parameters, "$param_name");};
|
unless(defined $parameter_values{$param_name})
|
|
{
|
|
push ( @parameters, "$param_name");
|
$parameter_values{$param_name} = ${param_value};
|
$parameter_values{$param_name} = ${param_value};
|
}
|
}
|
|
|
}
|
}
|
|
|
}
|
}
|
|
}
|
|
|
|
|
|
my @signals = yp::lib::get_signals($vendor,$library,$component,$version);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#/**********************************************************************/
|
#/**********************************************************************/
|
Line 304... |
Line 245... |
#/**********************************************************************/
|
#/**********************************************************************/
|
|
|
foreach my $comp_view ($spirit_component_file->findnodes("//spirit:component/spirit:model/spirit:views/spirit:view/spirit:name[text() = '$view']" ))
|
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 ;
|
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";
|
open DEST_FILE,">$outfile" or die "unable to open $outfile";
|
|
|
unless ($opt_fragment){ print DEST_FILE "\n module \n\n $main_module_name \n ";}
|
unless ($opt_fragment){ print DEST_FILE "\n module \n\n $main_module_name \n ";}
|
|
|
#/*****************************************************************************/
|
#/*****************************************************************************/
|
#/* wire_decs array holds all port and signal declarations */
|
#/* wire_decs array holds all port and signal declarations */
|
#/* :::name:::node_input_output:::wire_reg:::scaler_vector:::left:::right::: */
|
#/* :::name:::node_input_output:::wire_reg:::scaler_vector:::left:::right::: */
|
Line 322... |
Line 264... |
#/* inst_conns holds all instance connections */
|
#/* inst_conns holds all instance connections */
|
#/**********************************************************************/
|
#/**********************************************************************/
|
|
|
@inst_conns = ( );
|
@inst_conns = ( );
|
|
|
my @decl_names = ();
|
|
my %decl_dirs = ();
|
|
my %decl_types = ();
|
|
my %decl_vector = ();
|
|
my %decl_lefts = ();
|
|
my %decl_rights = ();
|
|
|
|
# component file
|
# component file
|
|
|
parse_component_file($spirit_component_file);
|
parse_component_file($spirit_component_file);
|
if($opt_verbose){print "parse design files \n"; }
|
if($opt_verbose){print "parse design files \n"; }
|
parse_design_files($spirit_component_file);
|
parse_design_files($spirit_component_file);
|
if($opt_verbose){print "process design files \n"; }
|
if($opt_verbose){print "process design files \n"; }
|
process_design_files($spirit_component_file);
|
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 */
|
|
#/* */
|
|
#/**********************************************************************/
|
|
|
|
|
|
@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 */
|
#/* Add any and all global parameters with their default values */
|
#/* */
|
#/* */
|
Line 590... |
Line 290... |
foreach my $parameter_name (@parameters)
|
foreach my $parameter_name (@parameters)
|
{
|
{
|
my $parameter_value = $parameter_values{$parameter_name};
|
my $parameter_value = $parameter_values{$parameter_name};
|
if($first)
|
if($first)
|
{
|
{
|
print DEST_FILE " #( parameter \n ${parameter_name}=${parameter_value}";
|
print DEST_FILE " #( parameter \n ${parameter_name}=${parameter_value}";
|
$first=0;
|
$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 = ();
|
|
|
|
|
|
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} ne "node" )
|
|
{
|
|
push (@port_list, "$phy_dirs{$x_name} $phy_types{$x_name} $q_width ${x_name}");
|
|
}
|
|
}
|
|
|
|
@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 "
|
|
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 " \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 $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 " \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 "
|
|
print HTML_FILE " \n";
|
|
print HTML_FILE " ${main_module_name} \n";
|
|
print HTML_FILE " \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 " \n";
|
|
print HTML_FILE " $module_description \n";
|
|
print HTML_FILE " \n";
|
|
|
|
print HTML_FILE " \n";
|
|
print HTML_FILE " SourceCode \n";
|
|
print HTML_FILE " \n";
|
|
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 " Interface \n";
|
|
print HTML_FILE " \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 " Theory of Operation \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 " Name | \n";
|
|
print HTML_FILE " default | \n";
|
|
print HTML_FILE " Description
| \n";
|
|
print HTML_FILE "
| \n";
|
|
|
|
|
|
|
|
foreach $html_line (@html_parameter_list)
|
|
{
|
|
print HTML_FILE "${html_line}\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 " 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 "
|
print HTML_FILE " cellpadding=\"4\" cellspacing=\"4\"> \n";
|
|
print HTML_FILE " \n";
|
print HTML_FILE " \n";
|
print HTML_FILE " NAME | \n";
|
|
print HTML_FILE " Type | \n";
|
|
print HTML_FILE " Description | \n";
|
|
print HTML_FILE "
| \n";
|
|
foreach $html_line (@html_interface_list)
|
|
{
|
|
print HTML_FILE "${html_line}\n";
|
|
}
|
|
print HTML_FILE "
| \n";
|
|
print HTML_FILE "
| \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 " Instance | \n";
|
|
print HTML_FILE " Vendor | \n";
|
|
print HTML_FILE " Library
| \n";
|
|
print HTML_FILE " Component
| \n";
|
|
print HTML_FILE " Version
| \n";
|
|
print HTML_FILE "
| \n";
|
|
|
|
my @spirit_design_files = yp::lib::find_ipxact_design_files($vendor,$project,$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 " $instance_name | \n";
|
|
print HTML_FILE " $vendor_name | \n";
|
|
print HTML_FILE " $library_name
| \n";
|
|
print HTML_FILE " $component_name
| \n";
|
|
print HTML_FILE " $version_name
| \n";
|
|
print HTML_FILE "
| \n";
|
|
|
|
|
|
|
|
|
|
}
|
}
|
|
else { print DEST_FILE ",\n ${parameter_name}=${parameter_value}";}
|
|
|
}
|
}
|
|
|
print HTML_FILE "
| \n";
|
if ($first == 0) { print DEST_FILE ")\n"; }
|
print HTML_FILE "
| \n";
|
}
|
print HTML_FILE " \n";
|
|
print HTML_FILE " \n";
|
|
|
|
|
|
|
#/**********************************************************************/
|
|
#/* */
|
|
#/* sort all ports with their type, size and direction */
|
|
#/* */
|
|
#/**********************************************************************/
|
|
|
|
my @port_list = ();
|
|
my @wire_nodes = ();
|
|
my $key;
|
|
my $value;
|
|
|
print HTML_FILE " \n";
|
foreach my $signal (@signals)
|
print HTML_FILE " \n";
|
{
|
print HTML_FILE " \n";
|
( ${port_name},${direction},${type},${vector},${left},${right}) = split ':', $signal;
|
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";
|
|
|
|
|
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};";}
|
|
}
|
}
|
}
|
|
|
|
@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";}
|
|
|
|
|
#/**********************************************************************/
|
#/**********************************************************************/
|
#/* */
|
#/* */
|
#/* Add any and all local parameters with their default values */
|
#/* Add any and all local parameters with their default values */
|
Line 1168... |
Line 374... |
my $parameter_value = $parameter_values{${parameter_name}};
|
my $parameter_value = $parameter_values{${parameter_name}};
|
print DEST_FILE "parameter ${parameter_name} = ${parameter_value};\n";
|
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);
|
@wire_nodes = sys::lib::trim_sort(@wire_nodes);
|
|
|
|
|
unless ($opt_interface_only)
|
unless ($opt_interface_only)
|
{
|
{
|
foreach my $wire_node (@wire_nodes)
|
foreach my $wire_node (@wire_nodes)
|
{
|
{
|
print DEST_FILE "${wire_node}\n";
|
print DEST_FILE "${wire_node}\n";
|
}
|
}
|
|
|
print DEST_FILE "\n\n\n";
|
|
|
|
|
#/**********************************************************************/
|
|
#/* */
|
|
#/* Dump everything from the ip-xact files into component */
|
|
#/* */
|
|
#/**********************************************************************/
|
|
|
|
print DEST_FILE "\n\n\n";
|
while( my $line_out = shift(@instantiations)) { print DEST_FILE "$line_out";}
|
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 */
|
#/* 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 */
|
#/* insert any and all verilog fragments at the end before closing */
|
#/* the module */
|
#/* the module */
|
Line 1219... |
Line 411... |
my($file_type) = $i_name ->findnodes('../spirit:userFileType/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 ;
|
my($view_file) = $i_name ->findnodes('../../spirit:name/text()')->to_literal ;
|
|
|
if(($file_type eq "fragment")&& (($view_file eq $view_fileset_name)))
|
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 ");
|
open(SRCFILE) or die("Could not open src file. $SRCFILE ");
|
foreach $line ()
|
foreach $line ()
|
{
|
{
|
chomp($line);
|
chomp($line);
|
print DEST_FILE "${line}\n";
|
print DEST_FILE "${line}\n";
|
}
|
}
|
}
|
}
|
}
|
}
|
|
|
}
|
}
|
|
|
|
|
|
|
unless ($opt_fragment ) {print DEST_FILE "\n\n\n endmodule\n\n";}
|
unless ($opt_fragment ) {print DEST_FILE "\n\n\n endmodule\n\n";}
|
|
|
}
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#/*********************************************************************************************/
|
#/*********************************************************************************************/
|
#/ */
|
#/ */
|
#/ this routine does not follow busses down into componentRef */
|
|
#/ */
|
|
#/ */
|
#/ */
|
#/ */
|
#/ */
|
#/ */
|
#/ */
|
#/*********************************************************************************************/
|
#/*********************************************************************************************/
|
|
|
Line 1266... |
Line 446... |
my @params = @_;
|
my @params = @_;
|
my $depth = pop(@params);
|
my $depth = pop(@params);
|
my $busref = pop(@params);
|
my $busref = pop(@params);
|
my $version = pop(@params);
|
my $version = pop(@params);
|
my $component = pop(@params);
|
my $component = pop(@params);
|
my $project = pop(@params);
|
my $library = pop(@params);
|
my $vendor = pop(@params);
|
my $vendor = pop(@params);
|
|
|
my $home = cwd();
|
my $home = cwd();
|
|
|
my @out_stack = ();
|
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"; }
|
|
|
|
|
|
|
my $busInterfaceTest = 0;
|
my $busInterfaceTest = 0;
|
|
|
|
|
|
|
|
|
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)
|
foreach $line (@filelist)
|
{
|
{
|
$_ = $line;
|
$_ = $line;
|
if(/::(\S+)::(\S+)::(\S+)::(\S+)::/)
|
if(/::(\S+)::(\S+)::(\S+)::(\S+)::/)
|
{
|
{
|
$new_project = $2;
|
$new_library = $2;
|
$new_component = $3;
|
$new_component = $3;
|
$new_vendor = $1;
|
$new_vendor = $1;
|
$new_version = $4;
|
$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;
|
my @mas_slave;
|
push @mas_slave , "master";
|
push @mas_slave , "master";
|
push @mas_slave , "slave";
|
push @mas_slave , "slave";
|
|
|
foreach my $seek_type (@mas_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}"))
|
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_cname) = $bus_iface->findnodes('../spirit:name/text()')->to_literal ;
|
my($fff_vendor) = $bus_iface->findnodes('../spirit:abstractionType/@spirit:vendor')->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_library) = $bus_iface->findnodes('../spirit:abstractionType/@spirit:library')->to_literal ;
|
my($fff_name) = $bus_iface->findnodes('../spirit:abstractionType/@spirit:name')->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 ;
|
my($fff_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'))
|
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}: $!";
|
|
|
my($fff_xxx_name) = $port_face->findnodes('../../../spirit:name/text()')->to_literal ;
|
|
|
|
|
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_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_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_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_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 ;
|
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";};
|
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;
|
$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;
|
|
}
|
|
|
|
elsif ( $seek_type eq "slave" )
|
$absDef_db->db_close();
|
{
|
|
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:::"; }
|
|
|
|
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
}
|
}
|
|
|
}
|
}
|
|
|
|
|
Line 1393... |
Line 568... |
@out_stack = sys::lib::trim_sort(@out_stack);
|
@out_stack = sys::lib::trim_sort(@out_stack);
|
return(@out_stack);
|
return(@out_stack);
|
}
|
}
|
|
|
|
|
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)
|
foreach my $sd_file (@spirit_design_files)
|
{
|
{
|
|
|
$_ = $sd_file;
|
$_ = $sd_file;
|
Line 1428... |
Line 603... |
my($vendor_name) = $x_name ->findnodes('../spirit:componentRef/@spirit:vendor')->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($library_name) = $x_name ->findnodes('../spirit:componentRef/@spirit:library')->to_literal ;
|
my($component_name) = $x_name ->findnodes('../spirit:componentRef/@spirit:name')->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($version_name) = $x_name ->findnodes('../spirit:componentRef/@spirit:version')->to_literal ;
|
$depth = $depth +1;
|
$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 );
|
@out_stack = parse_busInterface ($vendor_name, $library_name,$component_name,$version_name,$hierConn_busref_name,$depth );
|
}
|
}
|
}
|
}
|
}
|
}
|
|
|
}
|
}
|
|
|
|
|
|
|
|
|
@out_stack = sys::lib::trim_sort(@out_stack);
|
@out_stack = sys::lib::trim_sort(@out_stack);
|
return(@out_stack);
|
return(@out_stack);
|
|
|
|
|
}
|
}
|
Line 1474... |
Line 647... |
sub parse_design_files
|
sub parse_design_files
|
{
|
{
|
my @params = @_;
|
my @params = @_;
|
my $spirit_component_file = pop(@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"))
|
foreach my $new_comp ($spirit_component_file->findnodes("//spirit:component/spirit:model/spirit:views/spirit:view/spirit:vendorExtensions/spirit:componentRef"))
|
{
|
{
|
Line 1503... |
Line 672... |
my($new_version) = $new_comp->findnodes('./@spirit:version')->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(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 )) );
|
parse_design_file($parser->parse_file(yp::lib::find_ipxact_design($new_vendor,$new_library,$new_name,$new_version )) );
|
}
|
}
|
|
|
|
|
|
|
|
|
|
|
}
|
}
|
|
|
}
|
}
|
|
|
|
|
Line 1621... |
Line 785... |
#/* */
|
#/* */
|
#/* Add all internal wires and regs with their sizes */
|
#/* 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}:::"; }
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Line 1670... |
Line 821... |
my($component_name) = $x_name ->findnodes('../spirit:componentRef/@spirit:name')->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($version_name) = $x_name ->findnodes('../spirit:componentRef/@spirit:version')->to_literal ;
|
|
|
if( "$instance_name" eq "$hierConn_comref_name" )
|
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)
|
|
|
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})
|
|
|
{
|
{
|
$_ = $xxline;
|
$depth = 2;
|
if(/:::(\S+):::(\S+):::(\S+):::(\S+):::(\S+):::(\S+):::(\S+):::(\S+):::/)
|
$x_name = $conn;
|
|
}
|
|
else
|
|
|
{
|
{
|
$k_depth = $1;
|
$depth = 1;
|
$k_log_name = $2;
|
$x_name = $phy_name;
|
$k_phy_name = $3;
|
}
|
$k_direction = $4;
|
|
$k_type = $5;
|
|
$k_vector = $6;
|
# print "QQQQQQQQD:::${phy_name}:::${phy_name}:::${direction}:::${type}:::${vector}:::${left}:::${right}:::${hierConn_comref_name}:::3:::${log_name}:::${busref}:::${conn}::: \n";
|
$k_left = $7;
|
|
$k_right = $8;
|
# 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}_${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}:::";
|
|
|
|
|
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}:::";
|
|
|
}
|
}
|
}
|
}
|
|
|
|
|
|
|
|
|
|
|
}
|
}
|
}
|
}
|
}
|
}
|
|
|
|
|
Line 1730... |
Line 911... |
my($vendor_name) = $x_name ->findnodes('../spirit:componentRef/@spirit:vendor')->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($library_name) = $x_name ->findnodes('../spirit:componentRef/@spirit:library')->to_literal ;
|
my($component_name) = $x_name ->findnodes('../spirit:componentRef/@spirit:name')->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($version_name) = $x_name ->findnodes('../spirit:componentRef/@spirit:version')->to_literal ;
|
|
|
|
|
|
|
if( "$instance_name" eq "$hierConn_comref_name" )
|
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;
|
|
|
|
|
#/**********************************************************************/
|
( ${busref},${conn},${phy_name},${log_name},${direction},${type},${vector},${left},${right}) = split ':::', $line;
|
#/* */
|
|
#/* 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" );
|
if(${busref} eq ${hierConn_busref_name} )
|
foreach $xxline (@filelist_sub)
|
|
{
|
{
|
|
|
|
if("${hierConn_name}_${log_name}" eq ${phy_name})
|
|
|
$_ = $xxline;
|
|
if(/:::(\S+):::(\S+):::(\S+):::(\S+):::(\S+):::(\S+):::(\S+):::(\S+):::/)
|
|
{
|
{
|
$k_depth = $1;
|
$depth = 2;
|
$k_log_name = $2;
|
$x_name = $conn;
|
$k_phy_name = $3;
|
}
|
$k_direction = $4;
|
else
|
$k_type = $5;
|
{
|
$k_vector = $6;
|
$depth = 1;
|
$k_left = $7;
|
$x_name = $phy_name;
|
$k_right = $8;
|
}
|
|
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}:::";
|
|
|
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}:::";
|
|
}
|
}
|
}
|
}
|
|
|
}
|
}
|
}
|
}
|
}
|
}
|
|
|
|
|
Line 1848... |
Line 1035... |
push @inst_conns , ":::${comp_name}:::adhoc:::${int_name}:::${tied_value}:::scaler:::none:::none:::";
|
push @inst_conns , ":::${comp_name}:::adhoc:::${int_name}:::${tied_value}:::scaler:::none:::none:::";
|
}
|
}
|
elsif($vec_left ne "")
|
elsif($vec_left ne "")
|
{
|
{
|
push @inst_conns , ":::${comp_name}:::adhoc:::${int_name}:::${int_value}:::vector:::${vec_left}:::${vec_right}:::";
|
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
|
else
|
{
|
{
|
push @inst_conns , ":::${comp_name}:::adhoc:::${int_name}:::${int_value}:::scaler:::none:::none:::";
|
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}:::";
|
|
}
|
}
|
|
|
|
|
}
|
}
|
|
|
Line 1900... |
Line 1086... |
|
|
foreach $line (@wire_decs)
|
foreach $line (@wire_decs)
|
{
|
{
|
$_ = $line;
|
$_ = $line;
|
|
|
|
# print "WD $line \n";
|
|
|
|
|
if(/:::(\S+):::(\S+):::(\S+):::(\S+):::(\S+):::(\S+):::(\S+):::(\S+):::(\S+):::(\S+):::(\S+):::(\S+):::/)
|
if(/:::(\S+):::(\S+):::(\S+):::(\S+):::(\S+):::(\S+):::(\S+):::(\S+):::(\S+):::(\S+):::(\S+):::(\S+):::/)
|
{
|
{
|
my $t_index = $1;
|
my $t_index = $1;
|
my $t_node_name = $2;
|
my $t_node_name = $2;
|
Line 1916... |
Line 1104... |
my $t_depth = $9;
|
my $t_depth = $9;
|
my $t_phy_name = $10;
|
my $t_phy_name = $10;
|
my $t_busref_name = $11;
|
my $t_busref_name = $11;
|
my $t_abslog_name = $12;
|
my $t_abslog_name = $12;
|
|
|
if( 1)
|
|
{
|
|
|
|
push ( @inst_names, "${t_instance}_${t_busref_name}_${t_index}");
|
push ( @inst_names, "${t_instance}_${t_busref_name}_${t_index}");
|
|
|
$inst_Inames{"${t_instance}_${t_busref_name}_${t_index}"} = "${t_instance}";
|
$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}"})
|
Line 1946... |
Line 1131... |
{$inst_vector{"${t_instance}_${t_busref_name}_${t_index}"} = "${t_vector}";}
|
{$inst_vector{"${t_instance}_${t_busref_name}_${t_index}"} = "${t_vector}";}
|
}
|
}
|
else
|
else
|
{$inst_vector{"${t_instance}_${t_busref_name}_${t_index}"} = "${t_vector}";}
|
{$inst_vector{"${t_instance}_${t_busref_name}_${t_index}"} = "${t_vector}";}
|
|
|
|
|
|
|
|
|
unless( $inst_left{"${t_instance}_${t_busref_name}_${t_index}"} eq '')
|
unless( $inst_left{"${t_instance}_${t_busref_name}_${t_index}"} eq '')
|
{
|
{
|
|
|
|
|
|
|
if( $inst_left{"${t_instance}_${t_busref_name}_${t_index}"} eq "none")
|
if( $inst_left{"${t_instance}_${t_busref_name}_${t_index}"} eq "none")
|
{
|
{
|
$inst_left{"${t_instance}_${t_busref_name}_${t_index}"} = "${t_left}";
|
$inst_left{"${t_instance}_${t_busref_name}_${t_index}"} = "${t_left}";
|
}
|
}
|
elsif( $inst_left{"${t_instance}_${t_busref_name}_${t_index}"} < ${t_left})
|
elsif( $inst_left{"${t_instance}_${t_busref_name}_${t_index}"} < ${t_left})
|
Line 1962... |
Line 1153... |
else
|
else
|
{
|
{
|
$inst_left{"${t_instance}_${t_busref_name}_${t_index}"} = "${t_left}";
|
$inst_left{"${t_instance}_${t_busref_name}_${t_index}"} = "${t_left}";
|
}
|
}
|
|
|
|
|
|
|
|
|
|
|
unless( $inst_right{"${t_instance}_${t_busref_name}_${t_index}"} eq '')
|
unless( $inst_right{"${t_instance}_${t_busref_name}_${t_index}"} eq '')
|
{
|
{
|
if( $inst_right{"${t_instance}_${t_busref_name}_${t_index}"} eq "none")
|
if( $inst_right{"${t_instance}_${t_busref_name}_${t_index}"} eq "none")
|
{
|
{
|
$inst_right{"${t_instance}_${t_busref_name}_${t_index}"} = "${t_right}";
|
$inst_right{"${t_instance}_${t_busref_name}_${t_index}"} = "${t_right}";
|
Line 1975... |
Line 1170... |
$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}";}
|
else {$inst_right{"${t_instance}_${t_busref_name}_${t_index}"} = "${t_right}";}
|
|
|
}
|
|
}
|
}
|
}
|
}
|
@inst_names = sys::lib::trim_sort(@inst_names);
|
@inst_names = sys::lib::trim_sort(@inst_names);
|
foreach $i_name (@inst_names)
|
foreach $i_name (@inst_names)
|
{
|
{
|
Line 2054... |
Line 1249... |
push @instantiations , "////////////////////////////////////////////////////////////////\n";
|
push @instantiations , "////////////////////////////////////////////////////////////////\n";
|
|
|
|
|
@inst_conns = sys::lib::trim_sort(@inst_conns);
|
@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"))
|
foreach my $i_name ($spirit_design_file->findnodes("//spirit:design/spirit:componentInstances/spirit:componentInstance/spirit:instanceName"))
|
{
|
{
|
Line 2125... |
Line 1323... |
{
|
{
|
if($z_left eq $z_right){$z_signal_name = "${z_signal_name}[${z_left}]" ;}
|
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}]" ;}
|
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($instance_name eq $z_instance_name )
|
{
|
{
|
if($first)
|
if($first)
|
{
|
{
|
push @instantiations , " .${z_port_name} (${z_signal_name})";
|
push @instantiations , " .${z_port_name} (${z_signal_name})";
|
$first =0;
|
$first =0;
|
}
|
}
|
else { push @instantiations , ",\n .${z_port_name} (${z_signal_name})";}
|
else { push @instantiations , ",\n .${z_port_name} (${z_signal_name})";}
|
}
|
}
|
|
|
|
}
|
|
|
|
|
|
|
}
|
}
|
}
|
}
|
|
|
#print ".";
|
#print ".";
|
push @instantiations , ");\n\n";
|
push @instantiations , ");\n\n";
|
Line 2237... |
Line 1447... |
|
|
|
|
|
|
|
|
|
|
#/**********************************************************************/
|
|
#/* */
|
|
#/* 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}:::"; }
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
}
|