Line 71... |
Line 71... |
"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,
|
"fragment","no_port","local_parameters","tb"
|
"fragment","no_port","local_parameters","tb","debug","verbose"
|
) || die "(use '$program_name -h' for help)";
|
) || die "(use '$program_name -h' for help)";
|
|
|
|
|
##############################################################################
|
##############################################################################
|
## Help option
|
## Help option
|
Line 84... |
Line 84... |
{ print "\n gen_verilog -view {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 -view {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";
|
exit 1;
|
exit 1;
|
}
|
}
|
|
|
print "\n GEN_verilog $view $prefix $vendor $project $component $version $dest_dir $destination \n";
|
#print "\n WARNING GEN_verilog $view $prefix $vendor $project $component $version $configuration $dest_dir $destination \n";
|
|
|
my $main_module_name = yp::lib::get_module_name($vendor,$project,$component,$version) ;
|
my $main_module_name = yp::lib::get_module_name($vendor,$project,$component,$version) ;
|
|
|
|
|
|
|
Line 125... |
Line 125... |
my @filelist_hier = ();
|
my @filelist_hier = ();
|
my @instantiations = ();
|
my @instantiations = ();
|
my @parameters = ();
|
my @parameters = ();
|
my %parameter_values = ();
|
my %parameter_values = ();
|
|
|
print " Building verilog for ${project} ${component} ${variant} \n ";
|
|
my $sogen_file = $parser->parse_file(yp::lib::find_socgen("socgen:componentConfiguration",$vendor,$project,$component));
|
|
my $spirit_component_file = $parser->parse_file(yp::lib::find_ipxact("spirit:component",$vendor,$project,$component,$version));
|
|
|
|
|
|
|
|
|
my $sogen_file = $parser->parse_file(yp::lib::find_socgen("socgen:componentConfiguration",$vendor,$project,$component));
|
|
my $spirit_component_file = $parser->parse_file(yp::lib::find_ipxact("spirit:component",$vendor,$project,$component,$version));
|
my $lib_sim_sep = $sogen_file->findnodes("//socgen:componentConfiguration/socgen:sim/socgen:library_path/text()")->to_literal;
|
my $lib_sim_sep = $sogen_file->findnodes("//socgen:componentConfiguration/socgen:sim/socgen:library_path/text()")->to_literal;
|
|
|
#print "XXXXXXX \n";
|
|
#print "XXXXXXX. ${home}/projects/${vendor}/${project}/ip/${component}/sim \n";
|
|
#print "XXXXXXX ${home}/projects/${vendor}/${project}${lib_sim_sep} \n";
|
|
|
|
|
|
|
|
|
|
#if( ($prefix eq "/work") && ($lib_sim_sep) ){$opt_tb = 1;}
|
#if( ($prefix eq "/work") && ($lib_sim_sep) ){$opt_tb = 1;}
|
Line 275... |
Line 273... |
my %decl_vector = ();
|
my %decl_vector = ();
|
my %decl_lefts = ();
|
my %decl_lefts = ();
|
my %decl_rights = ();
|
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"; }
|
parse_design_files($spirit_component_file);
|
parse_design_files($spirit_component_file);
|
|
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"; }
|
|
|
#/**********************************************************************/
|
#/**********************************************************************/
|
#/* */
|
#/* */
|
#/* pack ports and nodes into hashes */
|
#/* pack ports and nodes into hashes */
|
#/* */
|
#/* */
|
Line 305... |
Line 307... |
$q_depth = $9;
|
$q_depth = $9;
|
$q_phy_name = $10;
|
$q_phy_name = $10;
|
$q_busref_name = $11;
|
$q_busref_name = $11;
|
$q_abslog_name = $12;
|
$q_abslog_name = $12;
|
|
|
|
|
|
if($opt_debug ){print "XXXXX-- $line \n ";}
|
|
|
push ( @decl_names,$q_index);
|
push ( @decl_names,$q_index);
|
|
|
|
|
if( $decl_pnames{$q_index})
|
if( $decl_pnames{$q_index})
|
{
|
{
|
Line 325... |
Line 330... |
|
|
if( $decl_dirs{$q_index})
|
if( $decl_dirs{$q_index})
|
{
|
{
|
if( $decl_dirs{$q_index} eq "node")
|
if( $decl_dirs{$q_index} eq "node")
|
{
|
{
|
$decl_types{$q_index} = "${q_type}";
|
|
$decl_dirs{$q_index} = "${q_direction}";
|
$decl_dirs{$q_index} = "${q_direction}";
|
}
|
}
|
}
|
}
|
else
|
else
|
{
|
{
|
$decl_types{$q_index} = "${q_type}";
|
|
$decl_dirs{$q_index} = "${q_direction}";
|
$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})
|
if( $decl_vector{$q_index})
|
{ unless( $decl_vector{$q_index} eq "vector"){ $decl_vector{$q_index} = "${q_vector}"; }}
|
{ unless( $decl_vector{$q_index} eq "vector"){ $decl_vector{$q_index} = "${q_vector}"; }}
|
else { $decl_vector{$q_index} = "${q_vector}"; }
|
else { $decl_vector{$q_index} = "${q_vector}"; }
|
|
|
if( $q_vector eq "vector" )
|
if( $q_vector eq "vector" )
|
{
|
{
|
if ( defined $decl_lefts{$q_index})
|
if ( defined $decl_lefts{$q_index})
|
{
|
{
|
|
|
|
|
|
$_ = $q_left;
|
|
if(/(\D+)/)
|
|
{
|
|
$_ = $decl_lefts{$q_index};
|
|
if(/(\D+)/)
|
|
{
|
|
print "WARNING $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
|
|
{
|
|
#print "WARNING $variant :: $q_node_name : $q_left is NOT a number $decl_lefts{$q_index} is a number \n";
|
|
#if($decl_lefts{$q_index} <= $q_left ) {$decl_lefts{$q_index} = $q_left;}
|
|
$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;}
|
if($decl_lefts{$q_index} <= $q_left ) {$decl_lefts{$q_index} = $q_left;}
|
|
}
|
|
}
|
|
|
|
|
if($decl_rights{$q_index} >= $q_right ) {$decl_rights{$q_index} = $q_right;}
|
if($decl_rights{$q_index} >= $q_right ) {$decl_rights{$q_index} = $q_right;}
|
}
|
}
|
else
|
else
|
{
|
{
|
$decl_lefts{$q_index} = $q_left;
|
$decl_lefts{$q_index} = $q_left;
|
Line 362... |
Line 418... |
|
|
|
|
|
|
#/**********************************************************************/
|
#/**********************************************************************/
|
#/* */
|
#/* */
|
#/* All port and signal info is now loaded in hashes, print out verilog*/
|
#/* All port and signal info is now loaded in hashes */
|
#/* */
|
#/* Resort on physical name */
|
#/* Print out module header , parameters and ports */
|
#/* 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( $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( $phy_vector{$phy_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};}
|
|
}
|
|
}
|
|
|
|
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};
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@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 407... |
Line 549... |
|
|
|
|
my @port_list = ();
|
my @port_list = ();
|
|
|
|
|
foreach $x_name (@decl_names)
|
foreach $x_name (@phy_names)
|
{
|
{
|
my $q_width = " ";
|
my $q_width = " ";
|
if( $decl_vector{$x_name} eq "vector" ) { $q_width = "[ $decl_lefts{$x_name} : $decl_rights{$x_name}]"}
|
if( $phy_vector{$x_name} eq "vector" ) { $q_width = "[ $phy_lefts{$x_name} : $phy_rights{$x_name}]"}
|
|
|
if( $decl_dirs{$x_name} ne "node" )
|
if( $phy_dirs{$x_name} ne "node" )
|
{
|
{
|
push (@port_list, "$decl_dirs{$x_name} $decl_types{$x_name} $q_width $decl_pnames{$x_name}");
|
push (@port_list, "$phy_dirs{$x_name} $phy_types{$x_name} $q_width ${x_name}");
|
}
|
}
|
}
|
}
|
|
|
@port_list = sys::lib::trim_sort(@port_list);
|
@port_list = sys::lib::trim_sort(@port_list);
|
|
|
Line 453... |
Line 595... |
|
|
|
|
|
|
|
|
|
|
|
|
#/**********************************************************************/
|
|
#/* */
|
|
#/* print wire decs for testbench */
|
|
#/* */
|
|
#/**********************************************************************/
|
|
|
|
my @tb_node_list = ();
|
|
|
|
|
|
foreach $x_name (@decl_names)
|
|
{
|
|
|
|
if( $decl_dirs{$x_name} ne "node" )
|
|
{
|
|
if ( $decl_vector{$x_name} eq "vector" )
|
|
{
|
|
push (@tb_node_list, "\n${decl_pnames{$x_name}}<\/spirit:name>\nwire<\/spirit:typeName><\/spirit:wireTypeDef><\/spirit:wireTypeDefs>\n${decl_lefts{$x_name}}<\/spirit:left>${decl_rights{$x_name}}<\/spirit:right><\/spirit:vector><\/spirit:wire>\n<\/node>\n" );
|
|
}
|
|
else
|
|
{
|
|
push (@tb_node_list, "\n${decl_pnames{$x_name}}<\/spirit:name>\nwire<\/spirit:typeName><\/spirit:wireTypeDef><\/spirit:wireTypeDefs>\n<\/node>\n" );
|
|
}
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@tb_node_list = sys::lib::trim_sort(@tb_node_list);
|
|
print TB_DESIGN_FILE "\n\n";
|
|
|
|
foreach $node_line (@tb_node_list)
|
|
{
|
|
|
|
print TB_DESIGN_FILE "${node_line}\n";
|
|
|
|
|
|
}
|
|
|
|
print TB_DESIGN_FILE "\n\n";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#/**********************************************************************/
|
#/**********************************************************************/
|
#/* */
|
#/* */
|
#/* print wire decs for testbench */
|
#/* print wire decs for testbench */
|
#/* */
|
#/* */
|
#/**********************************************************************/
|
#/**********************************************************************/
|
|
|
my @tb_node_list = ();
|
|
|
|
|
|
foreach $x_name (@decl_names)
|
foreach $x_name (@phy_names)
|
{
|
{
|
|
|
if( $decl_dirs{$x_name} ne "node" )
|
if( $phy_dirs{$x_name} ne "node" )
|
{
|
{
|
if ( $decl_vector{$x_name} eq "vector" )
|
if ( $phy_vector{$x_name} eq "vector" )
|
{
|
{
|
push (@tb_adhoc_list, "\n${decl_pnames{$x_name}}[${decl_lefts{$x_name}}:${decl_rights{$x_name}}]<\/spirit:name>\n\n<\/spirit:adHocConnection>\n" );
|
push (@tb_adhoc_list, "\n${x_name}<\/spirit:name>\n\n\n<\/spirit:adHocConnection>\n" );
|
}
|
}
|
else
|
else
|
{
|
{
|
|
push (@tb_adhoc_list, "\n${x_name}<\/spirit:name>\n\n\n<\/spirit:adHocConnection>\n" );
|
push (@tb_adhoc_list, "\n${decl_pnames{$x_name}}<\/spirit:name>\n\n<\/spirit:adHocConnection>\n" );
|
|
|
|
}
|
}
|
|
|
|
|
}
|
}
|
|
|
}
|
}
|
|
|
@tb_adhoc_list = sys::lib::trim_sort(@tb_adhoc_list);
|
@tb_adhoc_list = sys::lib::trim_sort(@tb_adhoc_list);
|
Line 646... |
Line 736... |
#/**********************************************************************/
|
#/**********************************************************************/
|
|
|
my @wire_nodes = ();
|
my @wire_nodes = ();
|
|
|
|
|
foreach $x_name (@decl_names)
|
foreach $x_name (@phy_names)
|
{
|
{
|
my $q_width = " ";
|
my $q_width = " ";
|
if( $decl_vector{$x_name} eq "vector" ){ $q_width = "[ $decl_lefts{$x_name} : $decl_rights{$x_name}]"}
|
if( $phy_vector{$x_name} eq "vector" ){ $q_width = "[ $phy_lefts{$x_name} : $phy_rights{$x_name}]"}
|
if( $decl_dirs{$x_name} eq "node" ) { push @wire_nodes, "$decl_types{$x_name} $q_width $decl_pnames{$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);
|
|
|
foreach my $wire_node (@wire_nodes)
|
foreach my $wire_node (@wire_nodes)
|
Line 731... |
Line 821... |
|
|
my $home = cwd();
|
my $home = cwd();
|
|
|
my @out_stack = ();
|
my @out_stack = ();
|
|
|
|
if($opt_verbose){print "parse_busInterface $vendor $project $component $version \n"; }
|
|
|
my $spirit_component_file = $parser->parse_file(yp::lib::find_ipxact("spirit:component",$vendor,$project,$component,$version));
|
my $spirit_component_file = $parser->parse_file(yp::lib::find_ipxact("spirit:component",$vendor,$project,$component,$version));
|
|
|
|
|
|
|
Line 779... |
Line 870... |
|
|
|
|
my $spirit_abstractor_filename = yp::lib::find_ipxact("spirit:abstractionDefinition",$fff_vendor,$fff_library,$fff_name,$fff_version);
|
my $spirit_abstractor_filename = yp::lib::find_ipxact("spirit:abstractionDefinition",$fff_vendor,$fff_library,$fff_name,$fff_version);
|
|
|
unless($spirit_abstractor_filename){
|
unless($spirit_abstractor_filename){
|
print " $fff_vendor $fff_library $fff_name $fff_version \n";
|
#print " $fff_vendor $fff_library $fff_name $fff_version \n";
|
|
|
}
|
}
|
|
|
|
|
my $spirit_abstractor_file = ($parser->parse_file(yp::lib::find_ipxact("spirit:abstractionDefinition",$fff_vendor,$fff_library,$fff_name,$fff_version))
|
my $spirit_abstractor_file = ($parser->parse_file(yp::lib::find_ipxact("spirit:abstractionDefinition",$fff_vendor,$fff_library,$fff_name,$fff_version))
|
Line 914... |
Line 1005... |
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";
|
#print "\n";
|
|
|
|
|
|
|
|
|
|
|
Line 1002... |
Line 1093... |
sub process_design_files
|
sub process_design_files
|
{
|
{
|
my @params = @_;
|
my @params = @_;
|
my $spirit_component_file = pop(@params);
|
my $spirit_component_file = pop(@params);
|
|
|
print "\n";
|
#print "\n";
|
|
|
|
|
|
|
|
|
|
|
Line 1059... |
Line 1150... |
}
|
}
|
|
|
|
|
if($hier_ref_type eq "spirit:design")
|
if($hier_ref_type eq "spirit:design")
|
{
|
{
|
|
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("spirit:design",$new_vendor,$new_library,$new_name,$new_version )) );
|
process_design_file($parser->parse_file(yp::lib::find_ipxact("spirit:design",$new_vendor,$new_library,$new_name,$new_version )) );
|
|
|
|
|
}
|
}
|
|
|
|
|
|
|
}
|
}
|
|
|
}
|
}
|
|
|
|
|
Line 1100... |
Line 1187... |
|
|
|
|
|
|
|
|
|
|
print "\n";
|
#print "\n";
|
foreach my $new_comp ($spirit_design_file->findnodes("//spirit:design/spirit:vendor"))
|
foreach my $new_comp ($spirit_design_file->findnodes("//spirit:design/spirit:vendor"))
|
{
|
{
|
my($new_vendor) = $new_comp->findnodes('./text()')->to_literal ;
|
my($new_vendor) = $new_comp->findnodes('./text()')->to_literal ;
|
my($new_library) = $new_comp->findnodes('../spirit:library/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_name) = $new_comp->findnodes('../spirit:name/text()')->to_literal ;
|
my($new_version) = $new_comp->findnodes('../spirit:version/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";
|
#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 */
|
#/* Read each hierConnection and enter signals into wire_decs */
|
Line 1287... |
Line 1400... |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#/**********************************************************************/
|
#/**********************************************************************/
|
#/* */
|
#/* */
|
#/* Read all adHocConnections and load instance connect info into array*/
|
#/* Read all adHocConnections and load instance connect info into array*/
|
#/* */
|
#/* */
|
#/**********************************************************************/
|
#/**********************************************************************/
|
Line 1301... |
Line 1411... |
|
|
foreach my $i_xame ($spirit_design_file->findnodes('//spirit:adHocConnections/spirit:adHocConnection/spirit:internalPortReference/@spirit:componentRef'))
|
foreach my $i_xame ($spirit_design_file->findnodes('//spirit:adHocConnections/spirit:adHocConnection/spirit:internalPortReference/@spirit:componentRef'))
|
{
|
{
|
my($comp_name) = $i_xame ->to_literal;
|
my($comp_name) = $i_xame ->to_literal;
|
my($int_value) = $i_xame ->findnodes('../../spirit:name/text()')->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($int_name) = $i_xame ->findnodes('../@spirit:portRef')->to_literal ;
|
my($vec_left) = $i_xame ->findnodes('../@spirit:left')->to_literal ;
|
my($vec_name) = $i_xame ->findnodes('../../spirit:externalPortReference/@spirit:portRef')->to_literal ;
|
my($vec_right) = $i_xame ->findnodes('../@spirit:right')->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 ;
|
|
|
|
|
unless ($int_value) {$int_value = "_DUMMY_";}
|
# print "XXXXXX $comp_name $int_name ( $int_value $tied_value ) $vec_name $vec_left $vec_right \n";
|
|
|
|
|
if($vec_left ne "")
|
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 "")
|
{
|
{
|
my $vecs = "";
|
|
if($vec_left ne $vec_right ){$vecs ="[${vec_left}:${vec_right}]";}
|
|
else {$vecs ="[${vec_right}]";}
|
|
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}:::";
|
}
|
}
|
|
|
|
|
}
|
}
|
|
|
|
|
|
|
#/**********************************************************************/
|
|
#/* */
|
|
#/* Add all internal wires and regs with their sizes */
|
|
#/* */
|
|
#/**********************************************************************/
|
|
|
|
foreach my $i_name ($spirit_design_file->findnodes("//spirit:design/nodes/node/spirit:name"))
|
|
{
|
|
my($node_name) = $i_name ->findnodes('./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:wireTypeDefs/spirit:wireTypeDef/spirit:typeName/text()')->to_literal ;
|
|
|
|
if( $node_left ne "" ) { push @wire_decs , ":::${node_name}:::${node_name}:::node:::${node_type}:::vector:::${node_left}:::${$node_right}:::none:::0:::${node_name}:::XXX:::${node_name}:::"; }
|
|
else { push @wire_decs , ":::${node_name}:::${node_name}:::node:::${node_type}:::scaler:::none:::none:::none:::0:::${node_name}:::XXX:::${node_name}:::"; }
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Line 1360... |
Line 1468... |
#/* */
|
#/* */
|
#/* extract bus instance connections from wire_decs */
|
#/* extract bus instance connections from wire_decs */
|
#/* */
|
#/* */
|
#/**********************************************************************/
|
#/**********************************************************************/
|
|
|
print "+-+";
|
#print "+-+";
|
|
|
|
|
|
|
my @inst_names = ();
|
my @inst_names = ();
|
my @inst_Inames = ();
|
my @inst_Inames = ();
|
Line 1460... |
Line 1568... |
{
|
{
|
unless($inst_Inames{$i_name} eq "none")
|
unless($inst_Inames{$i_name} eq "none")
|
{
|
{
|
if($inst_vector{$i_name} eq "vector" )
|
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}:::\n";
|
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
|
else
|
{
|
{
|
push @inst_conns ,":::$inst_Inames{$i_name}:::adhoc:::$inst_ports{$i_name}:::$inst_sigs{$i_name}:::scaler:::none:::none:::\n";
|
push @inst_conns ,":::$inst_Inames{$i_name}:::adhoc:::$inst_ports{$i_name}:::$inst_sigs{$i_name}:::scaler:::none:::none:::";
|
|
|
}
|
}
|
}
|
}
|
}
|
}
|
}
|
}
|
Line 1500... |
Line 1608... |
|
|
|
|
|
|
|
|
|
|
print "\n";
|
#print "\n";
|
foreach my $new_comp ($spirit_design_file->findnodes("//spirit:design/spirit:vendor"))
|
foreach my $new_comp ($spirit_design_file->findnodes("//spirit:design/spirit:vendor"))
|
{
|
{
|
my($new_vendor) = $new_comp->findnodes('./text()')->to_literal ;
|
my($new_vendor) = $new_comp->findnodes('./text()')->to_literal ;
|
my($new_library) = $new_comp->findnodes('../spirit:library/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_name) = $new_comp->findnodes('../spirit:name/text()')->to_literal ;
|
Line 1512... |
Line 1620... |
# print "XXXXXX- $new_vendor $new_library $new_name $new_version DESIGN \n";
|
# print "XXXXXX- $new_vendor $new_library $new_name $new_version DESIGN \n";
|
}
|
}
|
|
|
|
|
|
|
|
|
|
|
#/**********************************************************************/
|
#/**********************************************************************/
|
#/* */
|
#/* */
|
#/* Instantiate each component with parameters and port connections */
|
#/* Instantiate each component with parameters and port connections */
|
#/* */
|
#/* */
|
#/* If the component doesn't have a instance name then this is skipped */
|
#/* If the component doesn't have a instance name then this is skipped */
|
#/* */
|
#/* */
|
#/**********************************************************************/
|
#/**********************************************************************/
|
|
|
print "+-+";
|
#print "+-+";
|
|
|
push @instantiations , "////////////////////////////////////////////////////////////////\n";
|
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"))
|
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($instance_name) = $i_name ->findnodes('./text()')->to_literal ;
|
my($vendor_name) = $i_name ->findnodes('../spirit:componentRef/@spirit:vendor')->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($library_name) = $i_name ->findnodes('../spirit:componentRef/@spirit:library')->to_literal ;
|
Line 1535... |
Line 1653... |
my($version_name) = $i_name ->findnodes('../spirit:componentRef/@spirit:version')->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 $module_name = yp::lib::get_module_name($vendor_name,$library_name,$component_name,$version_name) ;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if($instance_name)
|
if($instance_name)
|
{
|
{
|
push @instantiations , "$module_name\n";
|
push @instantiations , "$module_name\n";
|
$first = 1;
|
$first = 1;
|
|
|
Line 1559... |
Line 1682... |
}
|
}
|
|
|
if($first == 0) { push @instantiations , ")\n";}
|
if($first == 0) { push @instantiations , ")\n";}
|
push @instantiations , "$instance_name \n (\n ";
|
push @instantiations , "$instance_name \n (\n ";
|
$first = 1;
|
$first = 1;
|
@per_inst = sys::lib::trim_sort(@inst_conns);
|
|
|
|
foreach $line (@per_inst)
|
|
|
|
|
|
|
foreach $line (@inst_conns)
|
{
|
{
|
$_ = $line;
|
$_ = $line;
|
|
|
if(/:::(\S+):::(\S+):::(\S+):::(\S+):::(\S+):::(\S+):::(\S+):::/)
|
if(/:::(\S+):::(\S+):::(\S+):::(\S+):::(\S+):::(\S+):::(\S+):::/)
|
{
|
{
|
Line 1574... |
Line 1699... |
my $z_port_name = $3;
|
my $z_port_name = $3;
|
my $z_signal_name = $4;
|
my $z_signal_name = $4;
|
my $z_vecscal = $5;
|
my $z_vecscal = $5;
|
my $z_left = $6;
|
my $z_left = $6;
|
my $z_right = $7;
|
my $z_right = $7;
|
|
|
|
if($opt_debug ){print "YYYYYY-- $line \n";}
|
|
|
if($z_vecscal eq "vector")
|
if($z_vecscal eq "vector")
|
{
|
{
|
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}]" ;}
|
}
|
}
|
Line 1594... |
Line 1722... |
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 1626... |
Line 1754... |
{
|
{
|
my @params = @_;
|
my @params = @_;
|
my $spirit_component_file = pop(@params);
|
my $spirit_component_file = pop(@params);
|
|
|
|
|
|
#print "\n";
|
|
|
print "\n";
|
|
foreach my $new_comp ($spirit_component_file->findnodes("//spirit:component/spirit:vendor"))
|
foreach my $new_comp ($spirit_component_file->findnodes("//spirit:component/spirit:vendor"))
|
{
|
{
|
my($new_vendor) = $new_comp->findnodes('./text()')->to_literal ;
|
my($new_vendor) = $new_comp->findnodes('./text()')->to_literal ;
|
my($new_library) = $new_comp->findnodes('../spirit:library/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_name) = $new_comp->findnodes('../spirit:name/text()')->to_literal ;
|
my($new_version) = $new_comp->findnodes('../spirit:version/text()')->to_literal ;
|
my($new_version) = $new_comp->findnodes('../spirit:version/text()')->to_literal ;
|
# print "XXXXXX $new_vendor $new_library $new_name $new_version COMPONENT \n";
|
if($opt_verbose){print "parse_component_file $new_vendor $new_library $new_name $new_version COMPONENT \n";}
|
}
|
}
|
|
|
|
|
|
|
|
|
Line 1728... |
Line 1854... |
|
|
my $spirit_abstractor_filename = yp::lib::find_ipxact("spirit:abstractionDefinition",$mmm_vendor,$mmm_library,$mmm_name,$mmm_version);
|
my $spirit_abstractor_filename = yp::lib::find_ipxact("spirit:abstractionDefinition",$mmm_vendor,$mmm_library,$mmm_name,$mmm_version);
|
|
|
unless($spirit_abstractor_filename)
|
unless($spirit_abstractor_filename)
|
|
|
{print " $mmm_vendor $mmm_library $mmm_name $mmm_version \n";
|
{#print " $mmm_vendor $mmm_library $mmm_name $mmm_version \n";
|
}
|
}
|
|
|
my $spirit_abstractor_file = ($parser->parse_file(yp::lib::find_ipxact("spirit:abstractionDefinition",$mmm_vendor,$mmm_library,$mmm_name,$mmm_version))
|
my $spirit_abstractor_file = ($parser->parse_file(yp::lib::find_ipxact("spirit:abstractionDefinition",$mmm_vendor,$mmm_library,$mmm_name,$mmm_version))
|
|
|
) || die "(OOPs $mmm_vendor $mmm_library $mmm_name $mmm_version )";
|
) || die "(OOPs $mmm_vendor $mmm_library $mmm_name $mmm_version )";
|