Line 114... |
Line 114... |
#/*********************************************************************************************/
|
#/*********************************************************************************************/
|
|
|
@filelist_sim = ( );
|
@filelist_sim = ( );
|
@filelist_ver = ( );
|
@filelist_ver = ( );
|
|
|
my @filelist_hier = ( );
|
my @filelist = yp::lib::parse_component_file("$vendor","$project","$component","$version");
|
|
|
|
|
push(@filelist_hier,"::${vendor}::${project}::${component}::${version}::");
|
|
my @filelist = parse_component_file("$vendor","$project","$component","$version");
|
|
@filelist = sys::lib::trim_sort(@filelist);
|
|
|
|
|
|
|
|
foreach $line (@filelist)
|
foreach $line (@filelist)
|
{
|
{
|
$_ = $line;
|
$_ = $line;
|
Line 285... |
Line 281... |
|
|
|
|
|
|
|
|
|
|
#/*********************************************************************************************/
|
|
#/ */
|
|
#/ */
|
|
#/ */
|
|
#/ */
|
|
#/ */
|
|
#/ */
|
|
#/*********************************************************************************************/
|
|
|
|
|
|
|
|
@wire_inst = ( );
|
|
|
|
foreach my $i_name ($spirit_component_file->findnodes("//spirit:component/spirit:model/spirit:ports/spirit:port/name"))
|
|
{
|
|
my($port_name) = $i_name ->findnodes('./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 ;
|
|
if($left) { push(@wire_inst,"wire [${left}:${right}] ${port_name};\n");}
|
|
else { push(@wire_inst,"wire ${port_name};\n");}
|
|
}
|
|
|
|
push(@wire_inst,"\n\n\n $variant \n ");
|
|
|
|
my $first = 1;
|
|
|
|
foreach my $parameter_name (@parameter_order)
|
|
{
|
|
if($first)
|
|
{
|
|
push(@wire_inst," #(.${parameter_name}(${parameter_name})");
|
|
$first=0;
|
|
}
|
|
else
|
|
{
|
|
push(@wire_inst,",\n .${parameter_name}(${parameter_name})");
|
|
}
|
|
}
|
|
|
|
if($first == 0){push(@wire_inst,")\n");}
|
|
push(@wire_inst," test \n ( \n");
|
|
|
|
$first = 1;
|
|
foreach my $i_name ($spirit_component_file->findnodes("//spirit:component/spirit:model/spirit:ports/spirit:port/name"))
|
|
{
|
|
my($port_name) = $i_name ->findnodes('./text()')->to_literal ;
|
|
if($first)
|
|
{
|
|
push(@wire_inst," .${port_name} (${port_name})");
|
|
$first=0;
|
|
}
|
|
else
|
|
{
|
|
push(@wire_inst,",\n .${port_name} (${port_name})");
|
|
}
|
|
}
|
|
|
|
push(@wire_inst,"\n );\n\n\n\n");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#/*********************************************************************************************/
|
#/*********************************************************************************************/
|
Line 371... |
Line 307... |
{
|
{
|
my($simulation) = $i_name ->findnodes('socgen:name/text()')->to_literal ;
|
my($simulation) = $i_name ->findnodes('socgen:name/text()')->to_literal ;
|
my($configuration) = $i_name ->findnodes('socgen:configuration/text()')->to_literal ;
|
my($configuration) = $i_name ->findnodes('socgen:configuration/text()')->to_literal ;
|
|
|
print " lint files for $project $component $variant $simulation $configuration \n";
|
print " lint files for $project $component $variant $simulation $configuration \n";
|
|
my $library_path = $sogen_file->findnodes("//socgen:componentConfiguration/socgen:sim/socgen:library_path/text()")->to_literal;
|
|
|
|
|
foreach my $i_name ($sogen_file->findnodes("//socgen:componentConfiguration/socgen:sim/socgen:library_path"))
|
|
{
|
|
my($library_path) = $i_name ->findnodes('./text()')->to_literal ;
|
|
|
|
my $path = "${home}${work_site}/${vendor}__${project}${library_path}/rtl_check";
|
my $path = "${home}${work_site}/${vendor}__${project}${library_path}/rtl_check";
|
|
|
mkdir $path,0755 unless (-e $path) ;
|
mkdir $path,0755 unless (-e $path) ;
|
|
|
Line 388... |
Line 319... |
mkdir $path,0755 unless (-e $path);
|
mkdir $path,0755 unless (-e $path);
|
|
|
my $outfile ="${home}${work_site}/${vendor}__${project}${library_path}/rtl_check/${simulation}/Makefile";
|
my $outfile ="${home}${work_site}/${vendor}__${project}${library_path}/rtl_check/${simulation}/Makefile";
|
open MAKSIMFILE,">$outfile" or die "unable to open $outfile";
|
open MAKSIMFILE,">$outfile" or die "unable to open $outfile";
|
|
|
|
$outfile ="${home}${work_site}/${vendor}__${project}${library_path}/rtl_check/${simulation}/filelist.ver";
|
|
open SIMFILE,">$outfile" or die "unable to open $outfile";
|
|
|
|
|
}
|
$outfile ="${home}${work_site}/${vendor}__${project}${library_path}/rtl_check/${simulation}/TestBench";
|
|
open SIM_PARM_FILE,">$outfile" or die "unable to open $outfile";
|
|
|
|
|
print MAKSIMFILE "include ../../../../../bin/Makefile.root\n";
|
print MAKSIMFILE "include ../../../../../bin/Makefile.root\n";
|
print MAKSIMFILE "comp=${variant}\n";
|
print MAKSIMFILE "comp=${variant}\n";
|
print MAKSIMFILE "test=${simulation}\n";
|
print MAKSIMFILE "test=${simulation}\n";
|
|
|
foreach my $i_name ($sogen_file->findnodes("//socgen:componentConfiguration/socgen:sim/socgen:library_path"))
|
|
{
|
|
my($library_path) = $i_name ->findnodes('./text()')->to_literal ;
|
|
my $outfile ="${home}${work_site}/${vendor}__${project}${library_path}/rtl_check/${simulation}/filelist.ver";
|
|
open SIMFILE,">$outfile" or die "unable to open $outfile";
|
|
}
|
|
|
|
foreach my $i_line (@filelist_sim){ print SIMFILE "$i_line";}
|
|
|
|
|
|
|
foreach my $i_line (@filelist_sim){ print SIMFILE "$i_line";}
|
|
|
my %local_parameters = %default_parameters;
|
my %local_parameters = %default_parameters;
|
my @local_order = @parameter_order;
|
my @local_order = @parameter_order;
|
|
|
foreach my $i_name ($sogen_file->findnodes("//socgen:configurations/socgen:configuration[socgen:name/text() = '$configuration']/./socgen:parameters/socgen:parameter/socgen:name"))
|
foreach my $i_name ($sogen_file->findnodes("//socgen:configurations/socgen:configuration[socgen:name/text() = '$configuration']/./socgen:parameters/socgen:parameter/socgen:name"))
|
Line 419... |
Line 346... |
my($par_value) = $i_name ->findnodes('../socgen:value/text()')->to_literal ;
|
my($par_value) = $i_name ->findnodes('../socgen:value/text()')->to_literal ;
|
if($local_parameters{$par_name} eq '' ) { push @local_order , $par_name; }
|
if($local_parameters{$par_name} eq '' ) { push @local_order , $par_name; }
|
$local_parameters{$par_name} = $par_value;
|
$local_parameters{$par_name} = $par_value;
|
}
|
}
|
|
|
|
|
foreach my $i_name ($sogen_file->findnodes("//socgen:componentConfiguration/socgen:sim/socgen:rtl_check/socgen:lint[socgen:name/text() = '$simulation']/./socgen:parameters/socgen:parameter/socgen:name"))
|
foreach my $i_name ($sogen_file->findnodes("//socgen:componentConfiguration/socgen:sim/socgen:rtl_check/socgen:lint[socgen:name/text() = '$simulation']/./socgen:parameters/socgen:parameter/socgen:name"))
|
{
|
{
|
my($par_name) = $i_name ->findnodes('./text()')->to_literal ;
|
my($par_name) = $i_name ->findnodes('./text()')->to_literal ;
|
my($par_value) = $i_name ->findnodes('../socgen:value/text()')->to_literal ;
|
my($par_value) = $i_name ->findnodes('../socgen:value/text()')->to_literal ;
|
if ( $local_parameters{$par_name} eq '' ) { push @local_order , $par_name; }
|
if ( $local_parameters{$par_name} eq '' ) { push @local_order , $par_name; }
|
$local_parameters{$par_name} = $par_value;
|
$local_parameters{$par_name} = $par_value;
|
}
|
}
|
|
|
foreach my $i_name ($sogen_file->findnodes("//socgen:componentConfiguration/socgen:sim/socgen:library_path"))
|
|
{
|
|
my($library_path) = $i_name ->findnodes('./text()')->to_literal ;
|
my $module_name = yp::lib::get_module_name($vendor,$project,$component,$version);
|
my $outfile ="${home}${work_site}/${vendor}__${project}${library_path}/rtl_check/${simulation}/TestBench";
|
|
open SIM_PARM_FILE,">$outfile" or die "unable to open $outfile";
|
|
}
|
|
print SIM_PARM_FILE "// Testbench for $project $component $variant $configuration $simulation\n";
|
print SIM_PARM_FILE "// Testbench for $project $component $variant $configuration $simulation\n";
|
print SIM_PARM_FILE " \n";
|
print SIM_PARM_FILE " \n";
|
print SIM_PARM_FILE " \n";
|
print SIM_PARM_FILE "module TB(input clk,input reset); \n";
|
print SIM_PARM_FILE "module TB(); \n";
|
print SIM_PARM_FILE " \n\n";
|
print SIM_PARM_FILE " \n";
|
print SIM_PARM_FILE " $module_name \n";
|
print SIM_PARM_FILE " $variant \n";
|
|
|
|
my $first =1;
|
my $first =1;
|
|
|
foreach my $parameter_name (@local_order)
|
foreach my $parameter_name (@local_order)
|
{
|
{
|
Line 460... |
Line 383... |
}
|
}
|
|
|
if($first) { print SIM_PARM_FILE " ";}
|
if($first) { print SIM_PARM_FILE " ";}
|
else { print SIM_PARM_FILE ") ";}
|
else { print SIM_PARM_FILE ") ";}
|
|
|
print SIM_PARM_FILE " test \n (); \n\n\n\n endmodule \n ";
|
print SIM_PARM_FILE " test \n (.clk(clk),.reset(reset)); \n\n\n\n endmodule \n ";
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#/*********************************************************************************************/
|
|
#/ */
|
|
#/ */
|
|
#/ */
|
|
#/ */
|
|
#/ */
|
|
#/ */
|
|
#/*********************************************************************************************/
|
|
|
|
|
|
|
|
|
|
sub parse_component_file
|
|
{
|
|
my @params = @_;
|
|
my $version = pop(@params);
|
|
my $component = pop(@params);
|
|
my $library = pop(@params);
|
|
my $vendor = pop(@params);
|
|
my $spirit_component_file = $parser->parse_file(yp::lib::find_ipxact("spirit:component",$vendor,$library,$component,$version ));
|
|
|
|
|
|
|
|
|
|
foreach my $new_comp ($spirit_component_file->findnodes("//spirit:component/spirit:model/spirit:views/spirit:view/spirit:hierarchyRef"))
|
|
{
|
|
my($new_vendor) = $new_comp->findnodes('./@spirit:vendor')->to_literal ;
|
|
my($new_library) = $new_comp->findnodes('./@spirit:library')->to_literal ;
|
|
my($new_name) = $new_comp->findnodes('./@spirit:name')->to_literal ;
|
|
my($new_version) = $new_comp->findnodes('./@spirit:version')->to_literal ;
|
|
my $hier_ref_type = yp::lib::find_file_type($new_vendor,$new_library,$new_name,$new_version) ;
|
|
|
|
if($hier_ref_type eq "spirit:component")
|
|
{
|
|
my @filelist_sub = parse_component_file($new_vendor,$new_library,$new_name,$new_version);
|
|
foreach $line (@filelist_sub) { push(@filelist_hier,"$line"); }
|
|
}
|
}
|
|
|
|
|
elsif($hier_ref_type eq "spirit:designConfiguration")
|
|
{
|
|
|
|
my $spirit_designCfg_file
|
|
= $parser->parse_file(yp::lib::find_ipxact("spirit:designConfiguration",$new_vendor,$new_library,$new_name,$new_version ));
|
|
|
|
foreach my $design_ref_view ($spirit_designCfg_file->findnodes('//spirit:designConfiguration'))
|
|
{
|
|
$new_vendor = $design_ref_view->findnodes('./spirit:designRef/@spirit:vendor')->to_literal ;
|
|
$new_library = $design_ref_view->findnodes('./spirit:designRef/@spirit:library')->to_literal ;
|
|
$new_name = $design_ref_view->findnodes('./spirit:designRef/@spirit:name')->to_literal ;
|
|
$new_version = $design_ref_view->findnodes('./spirit:designRef/@spirit:version')->to_literal ;
|
|
$hier_ref_type ="spirit:design";
|
|
}
|
|
}
|
|
|
|
if($hier_ref_type eq "spirit:design")
|
|
{
|
|
my @filelist_sub = parse_design_file($new_vendor,$new_library,$new_name,$new_version);
|
|
foreach $line (@filelist_sub) { push(@filelist_hier,"$line"); }
|
|
}
|
|
}
|
|
|
|
@filelist_hier = sys::lib::trim_sort(@filelist_hier);
|
|
return(@filelist_hier);
|
|
|
|
}
|
|
|
|
#/*********************************************************************************************/
|
|
#/ */
|
|
#/ */
|
|
#/ */
|
|
#/ */
|
|
#/ */
|
|
#/ */
|
|
#/*********************************************************************************************/
|
|
|
|
sub parse_design_file
|
|
{
|
|
my @params = @_;
|
|
my $version = pop(@params);
|
|
my $component = pop(@params);
|
|
my $library = pop(@params);
|
|
my $vendor = pop(@params);
|
|
|
|
$home = cwd();
|
|
|
|
my $spirit_design_file = $parser->parse_file(yp::lib::find_ipxact("spirit:design",$vendor,$library,$component,$version ));
|
|
#/*********************************************************************************************/
|
|
#/ */
|
|
#/ Create filelists for simulation , linting and synthesis */
|
|
#/ */
|
|
#/ */
|
|
#/*********************************************************************************************/
|
|
|
|
if($spirit_design_file)
|
|
{
|
|
foreach my $i_name ($spirit_design_file->findnodes("//spirit:design/spirit:componentInstances/spirit:componentInstance/spirit:componentRef/\@spirit:vendor"))
|
|
{
|
|
my($vendor_name) = $i_name ->to_literal ;
|
|
my($library_name) = $i_name ->findnodes('../@spirit:library')->to_literal ;
|
|
my($component_name) = $i_name ->findnodes('../@spirit:name')->to_literal ;
|
|
my($version_name) = $i_name ->findnodes('../@spirit:version')->to_literal ;
|
|
|
|
push(@filelist_hier,"::${vendor_name}::${library_name}::${component_name}::${version_name}::");
|
|
my @filelist_sub = parse_component_file($vendor_name,$library_name,$component_name,$version_name);
|
|
foreach $line (@filelist_sub) { push(@filelist_hier,"$line"); }
|
|
}
|
|
}
|
|
@filelist_hier = sys::lib::trim_sort(@filelist_hier);
|
|
return(@filelist_hier);
|
|
}
|
|
|
|
|
|
|
|