Line 16... |
Line 16... |
#/* Author(s): */
|
#/* Author(s): */
|
#/* - John Eaton, jt_eaton@opencores.org */
|
#/* - John Eaton, jt_eaton@opencores.org */
|
#/* */
|
#/* */
|
#/**********************************************************************/
|
#/**********************************************************************/
|
#/* */
|
#/* */
|
#/* Copyright (C) <2010-2011> */
|
#/* Copyright (C) <2010-2013> */
|
#/* */
|
#/* */
|
#/* This source file may be used and distributed without */
|
#/* This source file may be used and distributed without */
|
#/* restriction provided that this copyright statement is not */
|
#/* restriction provided that this copyright statement is not */
|
#/* removed from the file and that any derivative work contains */
|
#/* removed from the file and that any derivative work contains */
|
#/* the original copyright notice and the associated disclaimer. */
|
#/* the original copyright notice and the associated disclaimer. */
|
Line 93... |
Line 93... |
|
|
|
|
|
|
my $home = cwd();
|
my $home = cwd();
|
my $prefix = "${work_site}/${vendor}__${project}";
|
my $prefix = "${work_site}/${vendor}__${project}";
|
|
my $library_path ;
|
|
|
|
|
|
|
print " Building Code Coverage and linting for $work_site $project $component \n" ;
|
print " Building Code Coverage and linting for $work_site $project $component \n" ;
|
|
|
|
|
my $parser = XML::LibXML->new();
|
my $parser = XML::LibXML->new();
|
|
|
my $socgen_ip_file = $parser->parse_file(yp::lib::find_socgen("socgen:ip",$vendor,$project,$component));
|
my $sogen_file = $parser->parse_file(yp::lib::find_socgen("socgen:componentConfiguration",$vendor,$project,$component));
|
|
|
|
|
|
foreach my $i_name ($sogen_file->findnodes("//socgen:componentConfiguration/socgen:sim/socgen:library_path"))
|
|
{
|
|
$library_path = $i_name ->findnodes('./text()')->to_literal ;
|
|
}
|
|
|
|
|
|
|
|
|
foreach my $comp ($socgen_ip_file->findnodes('//socgen:testbenches/socgen:testbench'))
|
foreach my $comp ($sogen_file->findnodes('//socgen:sim/socgen:testbenches/socgen:testbench'))
|
{
|
{
|
|
|
my($version) = $comp->findnodes('./socgen:version/text()')->to_literal ;
|
my($version) = $comp->findnodes('./socgen:version/text()')->to_literal ;
|
|
|
my $variant = "";
|
my $variant = "";
|
if($version) {$variant = "${component}_${version}"}
|
if($version) {$variant = "${component}_${version}"}
|
else {$variant = "${component}"}
|
else {$variant = "${component}"}
|
|
|
print " Code coverage directories for $project - $component . ${version}. - $variant \n";
|
|
|
|
|
|
#/*********************************************************************************************/
|
#/*********************************************************************************************/
|
#/ */
|
#/ */
|
#/ build directories and makefiles for code coverage */
|
#/ build directories and makefiles for code coverage */
|
#/ */
|
#/ */
|
#/ */
|
|
#/ */
|
|
#/ */
|
|
#/*********************************************************************************************/
|
#/*********************************************************************************************/
|
|
|
|
foreach my $i_name ($sogen_file->findnodes("//socgen:testbench[socgen:variant/text() = '$variant']/socgen:code_coverage"))
|
|
|
foreach my $i_name ($socgen_ip_file->findnodes("//socgen:ip/socgen:library_sim_path"))
|
|
{
|
{
|
my($library_path) = $i_name ->findnodes('./text()')->to_literal ;
|
print " Code coverage directories for $project - $component . ${version}. - $variant \n";
|
|
|
#/*********************************************************************************************/
|
|
#/ */
|
|
#/ build directories and makefiles for code coverage */
|
|
#/ */
|
|
#/*********************************************************************************************/
|
|
|
|
|
|
my $path = "${home}${work_site}/${vendor}__${project}${library_path}/cov";
|
my $path = "${home}${work_site}/${vendor}__${project}${library_path}/cov";
|
mkdir $path,0755 unless( -e $path );
|
mkdir $path,0755 unless( -e $path );
|
my $path = "${home}${work_site}/${vendor}__${project}${library_path}/cov/${variant}";
|
my $path = "${home}${work_site}/${vendor}__${project}${library_path}/cov/${variant}";
|
mkdir $path,0755 unless( -e $path );
|
mkdir $path,0755 unless( -e $path );
|
my $outfile ="${home}${work_site}/${vendor}__${project}${library_path}/cov/${variant}/Makefile";
|
my $outfile ="${home}${work_site}/${vendor}__${project}${library_path}/cov/${variant}/Makefile";
|
open MAKCOVFILE,">$outfile" or die "unable to open $outfile";
|
open MAKCOVFILE,">$outfile" or die "unable to open $outfile";
|
|
|
#/*********************************************************************************************/
|
|
#/ */
|
|
#/ build directories and makefiles for linting */
|
|
#/ */
|
|
#/*********************************************************************************************/
|
|
|
|
$path = "${home}${work_site}/${vendor}__${project}${library_path}/lint";
|
|
mkdir $path,0755 unless( -e $path );
|
|
|
|
$path = "${home}${work_site}/${vendor}__${project}${library_path}/lint/${variant}";
|
|
mkdir $path,0755 unless( -e $path );
|
|
|
|
symlink( "${home}/tools/bin/Makefile.lint",
|
|
"${home}${prefix}${library_path}/lint/${variant}/Makefile");
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
print MAKCOVFILE "SHELL=/bin/sh \n";
|
print MAKCOVFILE "SHELL=/bin/sh \n";
|
print MAKCOVFILE "MAKE=make \n";
|
print MAKCOVFILE "MAKE=make \n";
|
print MAKCOVFILE " \n";
|
print MAKCOVFILE " \n";
|
print MAKCOVFILE " \n";
|
print MAKCOVFILE " \n";
|
print MAKCOVFILE ".PHONY build_cdd:\n";
|
print MAKCOVFILE ".PHONY build_cdd:\n";
|
print MAKCOVFILE "build_cdd:\n";
|
print MAKCOVFILE "build_cdd:\n";
|
|
|
|
foreach my $i_name ($sogen_file->findnodes("//socgen:testbench[socgen:variant/text() = '$variant']/socgen:code_coverage/socgen:cover/socgen:name"))
|
foreach my $i_name ($socgen_ip_file->findnodes("//socgen:testbench[socgen:variant/text() = '$variant']/socgen:code_coverage/socgen:cover/socgen:name"))
|
|
{
|
{
|
my($cover_name) = $i_name ->findnodes('./text()')->to_literal ;
|
my($cover_name) = $i_name ->findnodes('./text()')->to_literal ;
|
my($cover_inst) = $i_name ->findnodes('../socgen:componentInstance/text()')->to_literal ;
|
my($cover_inst) = $i_name ->findnodes('../socgen:componentInstance/text()')->to_literal ;
|
print MAKCOVFILE "\tcovered score -f filelist.cov -i $cover_inst -t $cover_name -I ./ -v ./coverage.v -o ${cover_name}.cdd 2> ${cover_name}.log | tee >> ${cover_name}.log ;\\\n";
|
print MAKCOVFILE "\tcovered score -f filelist.cov -i $cover_inst -t $cover_name -I ./ -v ./coverage.v -o ${cover_name}.cdd 2> ${cover_name}.log | tee >> ${cover_name}.log ;\\\n";
|
}
|
}
|
|
|
print MAKCOVFILE " \n";
|
print MAKCOVFILE " \n";
|
print MAKCOVFILE ".PHONY score_cov:\n";
|
print MAKCOVFILE ".PHONY score_cov:\n";
|
print MAKCOVFILE "score_cov:\n";
|
print MAKCOVFILE "score_cov:\n";
|
|
|
foreach my $i_name ($socgen_ip_file->findnodes("//socgen:testbench[socgen:variant/text() = '$variant']/socgen:code_coverage/socgen:cover/socgen:name"))
|
foreach my $i_name ($sogen_file->findnodes("//socgen:testbench[socgen:variant/text() = '$variant']/socgen:code_coverage/socgen:cover/socgen:name"))
|
{
|
{
|
my($cover_name) = $i_name ->findnodes('./text()')->to_literal ;
|
my($cover_name) = $i_name ->findnodes('./text()')->to_literal ;
|
my($cover_inst) = $i_name ->findnodes('../componentInstance/text()')->to_literal ;
|
my($cover_inst) = $i_name ->findnodes('../componentInstance/text()')->to_literal ;
|
print MAKCOVFILE "\tcovered score -cdd ${cover_name}.cdd -vcd ../../icarus/\$(TEST)/TestBench.vcd 2>> ${cover_name}_sco_cov.log | tee >> ${cover_name}_sco_cov.log ;\\\n";
|
print MAKCOVFILE "\tcovered score -cdd ${cover_name}.cdd -vcd ../../icarus/\$(TEST)/TestBench.vcd 2>> ${cover_name}_sco_cov.log | tee >> ${cover_name}_sco_cov.log ;\\\n";
|
}
|
}
|
|
|
print MAKCOVFILE " \n";
|
print MAKCOVFILE " \n";
|
print MAKCOVFILE ".PHONY report_cov:\n";
|
print MAKCOVFILE ".PHONY report_cov:\n";
|
print MAKCOVFILE "report_cov:\n";
|
print MAKCOVFILE "report_cov:\n";
|
|
|
foreach my $i_name ($socgen_ip_file->findnodes("//socgen:testbench[socgen:variant/text() = '$variant']/socgen:code_coverage/socgen:cover/socgen:name"))
|
foreach my $i_name ($sogen_file->findnodes("//socgen:testbench[socgen:variant/text() = '$variant']/socgen:code_coverage/socgen:cover/socgen:name"))
|
{
|
{
|
my($cover_name) = $i_name ->findnodes('./text()')->to_literal ;
|
my($cover_name) = $i_name ->findnodes('./text()')->to_literal ;
|
my($cover_inst) = $i_name ->findnodes('../componentInstance/text()')->to_literal ;
|
my($cover_inst) = $i_name ->findnodes('../componentInstance/text()')->to_literal ;
|
print MAKCOVFILE "\tcovered report -cdd ${cover_name}.cdd 2> ${cover_name}_rep_cov.log | tee >> ${cover_name}_rep_cov.log ;\\\n";
|
print MAKCOVFILE "\tcovered report -cdd ${cover_name}.cdd 2> ${cover_name}_rep_cov.log | tee >> ${cover_name}_rep_cov.log ;\\\n";
|
}
|
}
|
|
}
|
|
|
|
|
|
|
}
|
}
|
|
|
|
|
|
|