Line 67... |
Line 67... |
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,
|
"component=s" => \$component,
|
"component=s" => \$component,
|
"version=s" => \$version,
|
"version=s" => \$version,
|
"dest_dir=s" => \$dest_dir,
|
"dest_dir=s" => \$dest_dir,
|
"view=s" => \$view
|
"view=s" => \$view
|
) || die "(use '$program_name -h' for help)";
|
) || die "(use '$program_name -h' for help)";
|
Line 80... |
Line 80... |
##############################################################################
|
##############################################################################
|
## Help option
|
## Help option
|
##############################################################################
|
##############################################################################
|
if ( $opt_h or ($opt_help) )
|
if ( $opt_h or ($opt_help) )
|
{
|
{
|
print "\n gen_verilogLib -envidentifier *simulation* -prefix /work -vendor vendor_name -project project_name -component component_name -version version_name -dest_dir dest_dir";
|
print "\n gen_verilogLib -envidentifier *simulation* -prefix /work -vendor vendor_name -library library_name -component component_name -version version_name -dest_dir dest_dir";
|
print "\n";
|
print "\n";
|
exit 1;
|
exit 1;
|
}
|
}
|
|
|
|
|
Line 92... |
Line 92... |
##
|
##
|
##############################################################################
|
##############################################################################
|
|
|
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 $ip_name_base_macro = $socgen_file->findnodes("//socgen:componentConfiguration/socgen:ip_name_base_macro/text()")->to_literal;
|
my $ip_name_base_macro = $socgen_file->findnodes("//socgen:componentConfiguration/socgen:ip_name_base_macro/text()")->to_literal;
|
|
|
|
|
|
|
|
|
Line 106... |
Line 106... |
|
|
|
|
if($version) {$variant = "${component}_${version}";}
|
if($version) {$variant = "${component}_${version}";}
|
else {$variant = "${component}";}
|
else {$variant = "${component}";}
|
|
|
my $lib_comp_sep = yp::lib::find_lib_comp_sep($vendor,$project,$component);
|
my $lib_comp_sep = yp::lib::find_lib_comp_sep($vendor,$library,$component);
|
my $comp_xml_sep = yp::lib::find_comp_xml_sep($vendor,$project,$component,$version);
|
my $comp_xml_sep = yp::lib::find_comp_xml_sep($vendor,$library,$component,$version);
|
my $module_name = yp::lib::get_module_name($vendor,$project,$component,$version);
|
my $module_name = yp::lib::get_module_name($vendor,$library,$component,$version);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
my $parser = XML::LibXML->new();
|
my $parser = XML::LibXML->new();
|
my $spirit_component_file = $parser->parse_file(yp::lib::find_ipxact_component($vendor,$project,$component,$version));
|
my $spirit_component_file = $parser->parse_file(yp::lib::find_ipxact_component($vendor,$library,$component,$version));
|
|
|
|
|
|
|
|
|
print "\n Building $view Verilog Lib RTL for $prefix $project $component $verison $variant $dest_dir \n" ;
|
print "\n Building $view Verilog Lib RTL for $prefix $library $component $verison $variant $dest_dir \n" ;
|
|
|
my $path = "${home}${prefix}/${vendor}__${project}${lib_comp_sep}${component}${comp_xml_sep}/${dest_dir}";
|
my $path = "${home}${prefix}/${vendor}__${library}${lib_comp_sep}${component}${comp_xml_sep}/${dest_dir}";
|
mkdir $path,0755 unless( -e $path );
|
mkdir $path,0755 unless( -e $path );
|
|
|
|
|
my $path = "${home}${prefix}/${vendor}__${project}${lib_comp_sep}${component}${comp_xml_sep}/${dest_dir}/../defines";
|
my $path = "${home}${prefix}/${vendor}__${library}${lib_comp_sep}${component}${comp_xml_sep}/${dest_dir}/../defines";
|
mkdir $path,0755 unless( -e $path );
|
mkdir $path,0755 unless( -e $path );
|
|
|
my $path = "${home}${prefix}/${vendor}__${project}${lib_comp_sep}${component}${comp_xml_sep}/${dest_dir}/../filelists";
|
my $path = "${home}${prefix}/${vendor}__${library}${lib_comp_sep}${component}${comp_xml_sep}/${dest_dir}/../filelists";
|
mkdir $path,0755 unless( -e $path );
|
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 );
|
|
|
|
|
|
|
#/**********************************************************************/
|
#/**********************************************************************/
|
Line 150... |
Line 150... |
#/* */
|
#/* */
|
#/* */
|
#/* */
|
#/* */
|
#/* */
|
#/**********************************************************************/
|
#/**********************************************************************/
|
|
|
my $outfile ="${home}${prefix}/${vendor}__${project}${lib_comp_sep}${component}${comp_xml_sep}/${dest_dir}/../defines/${variant}.v";
|
my $outfile ="${home}${prefix}/${vendor}__${library}${lib_comp_sep}${component}${comp_xml_sep}/${dest_dir}/../defines/${variant}.v";
|
open DEFLIST,">$outfile" or die "unable to open $outfile";
|
open DEFLIST,">$outfile" or die "unable to open $outfile";
|
print DEFLIST " \`define $ip_name_base_macro ${module_name} \n";
|
print DEFLIST " \`define $ip_name_base_macro ${module_name} \n";
|
|
|
my $outfile ="${home}${prefix}/${vendor}__${project}${lib_comp_sep}${component}${comp_xml_sep}/${dest_dir}/../filelists/${variant}.MOD";
|
my $outfile ="${home}${prefix}/${vendor}__${library}${lib_comp_sep}${component}${comp_xml_sep}/${dest_dir}/../filelists/${variant}.MOD";
|
open FILELIST,">$outfile" or die "unable to open $outfile";
|
open FILELIST,">$outfile" or die "unable to open $outfile";
|
|
|
my $outfile ="${home}${prefix}/${vendor}__${project}${lib_comp_sep}${component}${comp_xml_sep}/${dest_dir}/../filelists/${variant}.INC";
|
my $outfile ="${home}${prefix}/${vendor}__${library}${lib_comp_sep}${component}${comp_xml_sep}/${dest_dir}/../filelists/${variant}.INC";
|
open INCLIST,">$outfile" or die "unable to open $outfile";
|
open INCLIST,">$outfile" or die "unable to open $outfile";
|
|
|
print INCLIST "${home}${prefix}/${vendor}__${project}${lib_comp_sep}${component}${comp_xml_sep}/${dest_dir}/../defines/${variant}.v\n";
|
print INCLIST "${home}${prefix}/${vendor}__${library}${lib_comp_sep}${component}${comp_xml_sep}/${dest_dir}/../defines/${variant}.v\n";
|
|
|
|
|
|
|
|
|
|
|
#print " FFFFFFFFFFFFFFFF $envidentifier $view \n" ;
|
#print " FFFFFFFFFFFFFFFF $envidentifier $view \n" ;
|
|
|
|
|
my @filelist = yp::lib::parse_component_brothers("$vendor","$project","$component","$version");
|
my @filelist = yp::lib::parse_component_brothers("$vendor","$library","$component","$version");
|
|
|
foreach $line (@filelist)
|
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));
|
|
|
foreach my $comp_view ($spirit_component_file->findnodes("//spirit:component/spirit:model/spirit:views/spirit:view/spirit:envIdentifier[./text() = '$envidentifier']"))
|
foreach my $comp_view ($spirit_component_file->findnodes("//spirit:component/spirit:model/spirit:views/spirit:view/spirit:envIdentifier[./text() = '$envidentifier']"))
|
{
|
{
|
my($view_name) = $comp_view->findnodes('../spirit:name/text()')->to_literal ;
|
my($view_name) = $comp_view->findnodes('../spirit:name/text()')->to_literal ;
|
my($view_fileset) = $comp_view->findnodes('../spirit:fileSetRef/spirit:localName/text()')->to_literal ;
|
my($view_fileset) = $comp_view->findnodes('../spirit:fileSetRef/spirit:localName/text()')->to_literal ;
|
Line 221... |
Line 221... |
# print " FFFFFFFFFFFFFFFX $file_name $file_logicalname $file_type $file_usertype $view_file \n" ;
|
# print " FFFFFFFFFFFFFFFX $file_name $file_logicalname $file_type $file_usertype $view_file \n" ;
|
|
|
|
|
if(($file_usertype eq "include")&& ($view_file eq $view_fileset) && ($file_type eq "verilogSource") )
|
if(($file_usertype eq "include")&& ($view_file eq $view_fileset) && ($file_type eq "verilogSource") )
|
{
|
{
|
print INCLIST "${home}${prefix}/${vendor}__${project}${lib_comp_sep}${component}${comp_xml_sep}/${file_name}\n";
|
print INCLIST "${home}${prefix}/${vendor}__${library}${lib_comp_sep}${component}${comp_xml_sep}/${file_name}\n";
|
};
|
};
|
|
|
|
|
if(($file_usertype eq "libraryDir")&& ($view_file eq $view_fileset) && ($file_type eq "verilogSource") )
|
if(($file_usertype eq "libraryDir")&& ($view_file eq $view_fileset) && ($file_type eq "verilogSource") )
|
{
|
{
|
push @search_paths, "${home}${prefix}/${vendor}__${project}${lib_comp_sep}${component}${comp_xml_sep}/${file_name}";
|
push @search_paths, "${home}${prefix}/${vendor}__${library}${lib_comp_sep}${component}${comp_xml_sep}/${file_name}";
|
};
|
};
|
|
|
|
|
if(($file_usertype eq "module") && ($view_file eq $view_fileset) && ($file_type eq "verilogSource") )
|
if(($file_usertype eq "module") && ($view_file eq $view_fileset) && ($file_type eq "verilogSource") )
|
{
|
{
|
print FILELIST "${home}${prefix}/${vendor}__${project}${lib_comp_sep}${component}${comp_xml_sep}/${file_name}\n";
|
print FILELIST "${home}${prefix}/${vendor}__${library}${lib_comp_sep}${component}${comp_xml_sep}/${file_name}\n";
|
if($file_logicalname )
|
if($file_logicalname )
|
{
|
{
|
print DEFLIST sprintf( "\`define %s _%s\n", uc($file_logicalname) , $file_logicalname );
|
print DEFLIST sprintf( "\`define %s _%s\n", uc($file_logicalname) , $file_logicalname );
|
}
|
}
|
};
|
};
|
Line 262... |
Line 262... |
#/* */
|
#/* */
|
#/* */
|
#/* */
|
#/**********************************************************************/
|
#/**********************************************************************/
|
|
|
|
|
my $file_out = "${home}${prefix}/${vendor}__${project}${lib_comp_sep}${component}${comp_xml_sep}/${dest_dir}/${view}/${variant}.v";
|
my $file_out = "${home}${prefix}/${vendor}__${library}${lib_comp_sep}${component}${comp_xml_sep}/${dest_dir}/${view}/${variant}.v";
|
|
|
if( -e $file_out )
|
if( -e $file_out )
|
{
|
{
|
$cmd ="rm $file_out \n";
|
$cmd ="rm $file_out \n";
|
if (system($cmd)) {}
|
if (system($cmd)) {}
|
Line 279... |
Line 279... |
$cmd_path = " $cmd_path -I${search_path} " ;
|
$cmd_path = " $cmd_path -I${search_path} " ;
|
}
|
}
|
|
|
|
|
|
|
$cmd ="vppreproc --noline --noblank $cmd_path -f ${home}${prefix}/${vendor}__${project}${lib_comp_sep}${component}${comp_xml_sep}/${dest_dir}/../filelists/${variant}.INC -f ${home}${prefix}/${vendor}__${project}${lib_comp_sep}${component}${comp_xml_sep}/${dest_dir}/../filelists/${variant}.MOD >> $file_out \n";
|
$cmd ="vppreproc --noline --noblank $cmd_path -f ${home}${prefix}/${vendor}__${library}${lib_comp_sep}${component}${comp_xml_sep}/${dest_dir}/../filelists/${variant}.INC -f ${home}${prefix}/${vendor}__${library}${lib_comp_sep}${component}${comp_xml_sep}/${dest_dir}/../filelists/${variant}.MOD >> $file_out \n";
|
|
|
if (system($cmd)) {}
|
if (system($cmd)) {}
|
|
|
|
|
|
|