Line 62... |
Line 62... |
############################################################################
|
############################################################################
|
### Process the options
|
### Process the options
|
############################################################################
|
############################################################################
|
Getopt::Long::config("require_order", "prefix=-");
|
Getopt::Long::config("require_order", "prefix=-");
|
GetOptions("h","help",
|
GetOptions("h","help",
|
"view=s" => \$view,
|
"envidentifier=s" => \$envidentifier,
|
"prefix=s" => \$prefix,
|
"prefix=s" => \$prefix,
|
"vendor=s" => \$vendor,
|
"vendor=s" => \$vendor,
|
"project=s" => \$project,
|
"project=s" => \$project,
|
"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","debug","verbose"
|
"autodoc=s" => \$autodoc,
|
|
"fragment","no_port","local_parameters","tb","debug","verbose","interface_only","html"
|
) || 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 -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 -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";
|
print "\n";
|
exit 1;
|
exit 1;
|
}
|
}
|
|
|
#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 99... |
Line 100... |
#############################################################################
|
#############################################################################
|
|
|
|
|
$home = cwd();
|
$home = cwd();
|
my $variant;
|
my $variant;
|
|
my $view;
|
|
|
|
|
|
my $interface_in_count =0;
|
|
my $interface_out_count =0;
|
|
my $interface_in_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($autodoc) { $autodoc = "/Geda";}
|
|
|
|
#print "\n WARNING GEN_verilog $prefix $vendor $project $component $version $configuration $dest_dir $destination \n";
|
|
|
|
|
my $lib_comp_sep = yp::lib::find_lib_comp_sep($vendor,$project,$component);
|
my $lib_comp_sep = yp::lib::find_lib_comp_sep($vendor,$project,$component);
|
my $comp_xml_sep = yp::lib::find_ipxact_component_path("spirit:component",$vendor,$project,$component,$version);
|
my $comp_xml_sep = yp::lib::find_ipxact_component_path("spirit:component",$vendor,$project,$component,$version);
|
|
|
|
|
|
|
|
|
my $parser = XML::LibXML->new();
|
my $parser = XML::LibXML->new();
|
|
|
|
my $socgen_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 $sim_library_path = $socgen_file->findnodes("//socgen:componentConfiguration/socgen:sim/socgen:library_path/text()")->to_literal;
|
|
my $doc_library_path = $socgen_file->findnodes("//socgen:componentConfiguration/socgen:doc/socgen:library_path/text()")->to_literal;
|
|
|
|
|
|
|
|
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_envidentifier) = $X_view->findnodes('./spirit:envIdentifier/text()')->to_literal ;
|
|
|
|
|
|
if($envidentifier eq $Xview_envidentifier )
|
|
{
|
|
$view = $Xview_name;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
my $path = "${home}${prefix}/${vendor}__${project}${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}__${project}${lib_comp_sep}/${component}${comp_xml_sep}/${dest_dir}/${view}";
|
Line 124... |
Line 160... |
|
|
my @filelist_hier = ();
|
my @filelist_hier = ();
|
my @instantiations = ();
|
my @instantiations = ();
|
my @parameters = ();
|
my @parameters = ();
|
my %parameter_values = ();
|
my %parameter_values = ();
|
|
my %parameter_descriptions = ();
|
|
|
|
|
|
|
|
|
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 $sim_library_path = $sogen_file->findnodes("//socgen:componentConfiguration/socgen:sim/socgen:library_path/text()")->to_literal;
|
|
|
|
|
|
|
|
|
|
|
|
Line 156... |
Line 190... |
|
|
$path ="${home}/projects/${vendor}/${project}${sim_library_path}/testbenches/xml";
|
$path ="${home}/projects/${vendor}/${project}${sim_library_path}/testbenches/xml";
|
mkdir $path,0755 unless( -e $path );
|
mkdir $path,0755 unless( -e $path );
|
|
|
|
|
$outfile ="${home}/projects/${vendor}/${project}/ip/${component}/sim/testbenches/xml/${variant}_dut.params.xml";
|
$outfile ="${home}/projects/${vendor}/${project}${sim_library_path}/testbenches/xml/${variant}_dut.params.xml";
|
open TB_COMP_FILE,">$outfile" or die "unable to open $outfile";
|
open TB_COMP_FILE,">$outfile" or die "unable to open $outfile";
|
|
|
$outfile ="${home}/projects/${vendor}/${project}/ip/${component}/sim/testbenches/xml/${variant}_dutg.design.xml";
|
|
open TB_DESIGN_FILE,">$outfile" or die "unable to open $outfile";
|
|
|
|
|
|
print TB_COMP_FILE "\n";
|
print TB_COMP_FILE "\n";
|
print TB_COMP_FILE "
|