eval 'exec `which perl` -S $0 ${1+"$@"}'
|
eval 'exec `which perl` -S $0 ${1+"$@"}'
|
if 0;
|
if 0;
|
#/**********************************************************************/
|
#/****************************************************************************/
|
#/* */
|
#/* */
|
#/* ------- */
|
#/* SOCGEN Design for Reuse toolset */
|
#/* / SOC \ */
|
|
#/* / GEN \ */
|
|
#/* / TOOL \ */
|
|
#/* ============== */
|
|
#/* | | */
|
|
#/* |____________| */
|
|
#/* */
|
#/* */
|
|
#/* Version 1.0.0 */
|
#/* */
|
#/* */
|
|
#/* Author(s): */
|
|
#/* - John Eaton, z3qmtr45@gmail.com */
|
#/* */
|
#/* */
|
|
#/****************************************************************************/
|
#/* */
|
#/* */
|
#/* Author(s): */
|
|
#/* - John Eaton, jt_eaton@opencores.org */
|
|
#/* */
|
#/* */
|
#/**********************************************************************/
|
#/* Copyright 2016 John T Eaton */
|
#/* */
|
#/* */
|
#/* Copyright (C) <2010-2011> */
|
#/* Licensed under the Apache License, Version 2.0 (the "License"); */
|
|
#/* you may not use this file except in compliance with the License. */
|
|
#/* You may obtain a copy of the License at */
|
#/* */
|
#/* */
|
#/* This source file may be used and distributed without */
|
#/* http://www.apache.org/licenses/LICENSE-2.0 */
|
#/* restriction provided that this copyright statement is not */
|
|
#/* removed from the file and that any derivative work contains */
|
|
#/* the original copyright notice and the associated disclaimer. */
|
|
#/* */
|
|
#/* This source file is free software; you can redistribute it */
|
|
#/* and/or modify it under the terms of the GNU Lesser General */
|
|
#/* Public License as published by the Free Software Foundation; */
|
|
#/* either version 2.1 of the License, or (at your option) any */
|
|
#/* later version. */
|
|
#/* */
|
|
#/* This source is distributed in the hope that it will be */
|
|
#/* useful, but WITHOUT ANY WARRANTY; without even the implied */
|
|
#/* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR */
|
|
#/* PURPOSE. See the GNU Lesser General Public License for more */
|
|
#/* details. */
|
|
#/* */
|
|
#/* You should have received a copy of the GNU Lesser General */
|
|
#/* Public License along with this source; if not, download it */
|
|
#/* from http://www.opencores.org/lgpl.shtml */
|
|
#/* */
|
#/* */
|
#/**********************************************************************/
|
#/* Unless required by applicable law or agreed to in writing, software */
|
|
#/* distributed under the License is distributed on an "AS IS" BASIS, */
|
|
#/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */
|
|
#/* See the License for the specific language governing permissions and */
|
|
#/* limitations under the License. */
|
|
#/* */
|
|
#/* */
|
|
#/****************************************************************************/
|
|
|
|
|
############################################################################
|
############################################################################
|
# General PERL config
|
# General PERL config
|
############################################################################
|
############################################################################
|
use Getopt::Long;
|
use Getopt::Long;
|
use English;
|
use English;
|
use File::Basename;
|
use File::Basename;
|
use Cwd;
|
use Cwd;
|
use Scalar::Util qw(looks_like_number);
|
use Scalar::Util qw(looks_like_number);
|
use XML::LibXML;
|
use XML::LibXML;
|
use lib './tools';
|
use lib './tools';
|
use sys::lib;
|
use sys::lib;
|
use yp::lib;
|
use yp::lib;
|
use math::lib;
|
use math::lib;
|
use BerkeleyDB;
|
use BerkeleyDB;
|
|
|
|
|
$OUTPUT_AUTOFLUSH = 1; # set autoflush of stdout to TRUE.
|
$OUTPUT_AUTOFLUSH = 1; # set autoflush of stdout to TRUE.
|
|
|
|
|
############################################################################
|
############################################################################
|
### Process the options
|
### Process the options
|
############################################################################
|
############################################################################
|
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,
|
"library=s" => \$library,
|
"library=s" => \$library,
|
"component=s" => \$component,
|
"component=s" => \$component,
|
"version=s" => \$version,
|
"version=s" => \$version,
|
"configuration=s" => \$configuration,
|
"configuration=s" => \$configuration,
|
"dest_dir=s" => \$dest_dir,
|
"dest_dir=s" => \$dest_dir,
|
"env=s" => \$env,
|
"env=s" => \$env,
|
"tool=s" => \$tool,
|
"tool=s" => \$tool,
|
"unit=s" => \$unit,
|
"unit=s" => \$unit,
|
"name=s" => \$name
|
"name=s" => \$name
|
|
|
) || 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 elab_verilog -envidentifier {sim/syn} -prefix /work -vendor vendor_name -library library_name -component component_name -version version_name -env env -tool tool -unit unit -name name \n";
|
{ print "\n elab_verilog -envidentifier {sim/syn} -prefix /work -vendor vendor_name -library library_name -component component_name -version version_name -env env -tool tool -unit unit -name name \n";
|
exit 1;
|
exit 1;
|
}
|
}
|
|
|
|
|
|
|
#############################################################################
|
#############################################################################
|
##
|
##
|
##
|
##
|
#############################################################################
|
#############################################################################
|
|
|
$home = cwd();
|
$home = cwd();
|
|
|
unless ($prefix)
|
unless ($prefix)
|
{
|
{
|
$prefix = yp::lib::get_workspace();
|
$prefix = yp::lib::get_workspace();
|
$prefix = "/${prefix}";
|
$prefix = "/${prefix}";
|
}
|
}
|
|
|
|
|
my $comp_xml_sep = yp::lib::find_comp_xml_sep($vendor,$library,$component,$version);
|
my $comp_xml_sep = yp::lib::find_comp_xml_sep($vendor,$library,$component,$version);
|
my $lib_comp_sep = yp::lib::find_lib_comp_sep($vendor,$library,$component);
|
my $lib_comp_sep = yp::lib::find_lib_comp_sep($vendor,$library,$component);
|
|
|
|
|
|
|
my $variant;
|
my $variant;
|
|
|
|
|
|
|
unless ($env ) {$env = "none";}
|
unless ($env ) {$env = "none";}
|
unless ($tool ){$tool = "none";}
|
unless ($tool ){$tool = "none";}
|
unless ($unit ){$unit = "none";}
|
unless ($unit ){$unit = "none";}
|
|
|
|
|
|
|
|
|
|
|
|
|
my $root = "root";
|
my $root = "root";
|
|
|
if($version) {$variant = "${component}_${version}";}
|
if($version) {$variant = "${component}_${version}";}
|
else {$variant = "${component}";}
|
else {$variant = "${component}";}
|
|
|
#print "./tools/verilog/elab_verilog -envidentifier $envidentifier -prefix $prefix -vendor $vendor -library $library -component $component -version $version -configuration $configuration -dest_dir $dest_dir -env $env -tool $tool -unit $unit -name $name \n";
|
#print "./tools/verilog/elab_verilog -envidentifier $envidentifier -prefix $prefix -vendor $vendor -library $library -component $component -version $version -configuration $configuration -dest_dir $dest_dir -env $env -tool $tool -unit $unit -name $name \n";
|
|
|
|
|
|
|
|
|
my $parser = XML::LibXML->new();
|
my $parser = XML::LibXML->new();
|
|
|
my $socgen_filename = yp::lib::find_componentConfiguration($vendor,$library,$component);
|
my $socgen_filename = yp::lib::find_componentConfiguration($vendor,$library,$component);
|
unless ($socgen_filename) { print "No socgen ip file $vendor,$library,$component \n";};
|
unless ($socgen_filename) { print "No socgen ip file $vendor,$library,$component \n";};
|
|
|
my $socgen_file = $parser->parse_file($socgen_filename);
|
my $socgen_file = $parser->parse_file($socgen_filename);
|
|
|
|
|
|
|
|
|
my $path;
|
my $path;
|
|
|
my $elab_db_filename;
|
my $elab_db_filename;
|
|
|
|
|
if($name)
|
if($name)
|
{
|
{
|
$elab_db_filename = yp::lib::get_elab_db_filename($vendor,$library,$component,$version,$name);
|
$elab_db_filename = yp::lib::get_elab_db_filename($vendor,$library,$component,$version,$name);
|
}
|
}
|
else
|
else
|
{
|
{
|
$elab_db_filename = yp::lib::get_elab_db_filename($vendor,$library,$component,$version,"default");
|
$elab_db_filename = yp::lib::get_elab_db_filename($vendor,$library,$component,$version,"default");
|
}
|
}
|
|
|
|
|
if(-e $elab_db_filename)
|
if(-e $elab_db_filename)
|
{
|
{
|
exit;
|
exit;
|
# "$data_db_file Exists\n";
|
# "$data_db_file Exists\n";
|
}
|
}
|
|
|
print "ELAB_VERILOG ${vendor}_${library}_${component}_${version} $env $tool $unit || $name || $data_db_file \n";
|
print "ELAB_VERILOG ${vendor}_${library}_${component}_${version} $env $tool $unit || $name || $data_db_file \n";
|
|
|
|
|
my $elab_db = new BerkeleyDB::Hash( -Filename => "$elab_db_filename", -Flags => DB_CREATE ) or die "Cannot open $elab_db_filename: $!";
|
my $elab_db = new BerkeleyDB::Hash( -Filename => "$elab_db_filename", -Flags => DB_CREATE ) or die "Cannot open $elab_db_filename: $!";
|
|
|
$elab_db->db_put( "component___root" ,"${vendor}:${library}:${component}:${version}" );
|
$elab_db->db_put( "component___root" ,"${vendor}:${library}:${component}:${version}" );
|
|
|
my $repo_data;
|
my $repo_data;
|
if(defined $name && length $name >0)
|
if(defined $name && length $name >0)
|
{
|
{
|
$elab_db->db_get("VLNV___${vendor}:${library}:${component}:${version}:${name}", $repo_data );
|
$elab_db->db_get("VLNV___${vendor}:${library}:${component}:${version}:${name}", $repo_data );
|
$elab_db->db_put("VLNV___${vendor}:${library}:${component}:${version}:${name}","${repo_data}${root}:::" );
|
$elab_db->db_put("VLNV___${vendor}:${library}:${component}:${version}:${name}","${repo_data}${root}:::" );
|
}
|
}
|
else
|
else
|
{
|
{
|
$elab_db->db_get("VLNV___${vendor}:${library}:${component}:${version}", $repo_data );
|
$elab_db->db_get("VLNV___${vendor}:${library}:${component}:${version}", $repo_data );
|
$elab_db->db_put("VLNV___${vendor}:${library}:${component}:${version}","${repo_data}${root}:::" );
|
$elab_db->db_put("VLNV___${vendor}:${library}:${component}:${version}","${repo_data}${root}:::" );
|
}
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
my @bro_filelist = yp::lib::parse_component_brothers($vendor,$library,$component,$version);
|
my @bro_filelist = yp::lib::parse_component_brothers($vendor,$library,$component,$version);
|
|
|
foreach $bro (@bro_filelist)
|
foreach $bro (@bro_filelist)
|
{
|
{
|
my $ven;
|
my $ven;
|
my $lib;
|
my $lib;
|
my $cmp;
|
my $cmp;
|
my $ver;
|
my $ver;
|
my $xxx;
|
my $xxx;
|
|
|
|
|
( ${xxx},${ven},${lib},${cmp},${ver}) = split( /::/ , $bro);
|
( ${xxx},${ven},${lib},${cmp},${ver}) = split( /::/ , $bro);
|
|
|
#print " $bro - ${ven} -${lib} -${cmp} -${ver} -${xxx} \n";
|
#print " $bro - ${ven} -${lib} -${cmp} -${ver} -${xxx} \n";
|
my $spirit_component_file = $parser->parse_file(yp::lib::find_ipxact_component($ven,$lib,$cmp,$ver));
|
my $spirit_component_file = $parser->parse_file(yp::lib::find_ipxact_component($ven,$lib,$cmp,$ver));
|
|
|
|
|
my $loc_comp_xml_sep = yp::lib::find_comp_xml_sep($ven,$lib,$cmp,$ver);
|
my $loc_comp_xml_sep = yp::lib::find_comp_xml_sep($ven,$lib,$cmp,$ver);
|
my $loc_lib_comp_sep = yp::lib::find_lib_comp_sep($ven,$lib,$cmp);
|
my $loc_lib_comp_sep = yp::lib::find_lib_comp_sep($ven,$lib,$cmp);
|
|
|
foreach my $i_name ($spirit_component_file->findnodes("//spirit:fileSets/spirit:fileSet/spirit:file/spirit:name"))
|
foreach my $i_name ($spirit_component_file->findnodes("//ipxact:fileSets/ipxact:fileSet/ipxact:file/ipxact:name"))
|
{
|
{
|
my($file_name) = $i_name ->findnodes('./text()')->to_literal ;
|
my($file_name) = $i_name ->findnodes('./text()')->to_literal ;
|
my($file_logicalname) = $i_name ->findnodes('../spirit:logicalName/text()')->to_literal ;
|
my($file_logicalname) = $i_name ->findnodes('../ipxact:logicalName/text()')->to_literal ;
|
my($file_type) = $i_name ->findnodes('../spirit:fileType/text()')->to_literal ;
|
my($file_type) = $i_name ->findnodes('../ipxact:fileType/text()')->to_literal ;
|
my($file_usertype) = $i_name ->findnodes('../spirit:userFileType/text()')->to_literal ;
|
my($file_usertype) = $i_name ->findnodes('../ipxact:userFileType/text()')->to_literal ;
|
my($fileSet_name) = $i_name ->findnodes('../../spirit:name/text()')->to_literal ;
|
my($fileSet_name) = $i_name ->findnodes('../../ipxact:name/text()')->to_literal ;
|
|
|
if(${file_usertype} eq "libraryDir" )
|
if(${file_usertype} eq "libraryDir" )
|
{
|
{
|
$elab_db->db_put( "FILE_${file_type}_${fileSet_name}_${file_usertype}__${file_name}","${vendor}__${library}${lib_comp_sep}${component}${comp_xml_sep}/${file_name}" );
|
$elab_db->db_put( "FILE_${file_type}_${fileSet_name}_${file_usertype}__${file_name}","${vendor}__${library}${lib_comp_sep}${component}${comp_xml_sep}/${file_name}" );
|
|
|
}
|
}
|
else
|
else
|
|
|
{
|
{
|
$elab_db->db_put( "FILE_${file_type}_${fileSet_name}_${file_usertype}__${file_name}","${ven}__${lib}${loc_lib_comp_sep}${cmp}${loc_comp_xml_sep}/${file_name}" );
|
$elab_db->db_put( "FILE_${file_type}_${fileSet_name}_${file_usertype}__${file_name}","${ven}__${lib}${loc_lib_comp_sep}${cmp}${loc_comp_xml_sep}/${file_name}" );
|
|
|
}
|
}
|
|
|
|
|
}
|
}
|
|
|
|
|
|
|
}
|
}
|
|
|
|
|
|
|
|
|
|
|
foreach my $socgen_cfg ($socgen_file->findnodes("//socgen:componentConfiguration/socgen:${env}/socgen:${tool}/socgen:${unit}/socgen:parameters/socgen:parameter"))
|
foreach my $socgen_cfg ($socgen_file->findnodes("//socgen:componentConfiguration/socgen:${env}/socgen:${tool}/socgen:${unit}/socgen:parameters/socgen:parameter"))
|
{
|
{
|
my($ise_param) = $socgen_cfg ->findnodes('./socgen:value/text()')->to_literal ;
|
my($ise_param) = $socgen_cfg ->findnodes('./socgen:value/text()')->to_literal ;
|
my($ise_param_name) = $socgen_cfg ->findnodes('./socgen:name/text()')->to_literal ;
|
my($ise_param_name) = $socgen_cfg ->findnodes('./socgen:name/text()')->to_literal ;
|
my($ise_new_name ) = $socgen_cfg ->findnodes('../../socgen:name/text()')->to_literal ;
|
my($ise_new_name ) = $socgen_cfg ->findnodes('../../socgen:name/text()')->to_literal ;
|
if($name eq "${ise_new_name}")
|
if($name eq "${ise_new_name}")
|
{
|
{
|
if($ise_param_name)
|
if($ise_param_name)
|
{
|
{
|
$elab_db->db_put( "parameter_${root}__${ise_param_name}","${ise_param}" );
|
$elab_db->db_put( "parameter_${root}__${ise_param_name}","${ise_param}" );
|
}
|
}
|
}
|
}
|
|
|
if($version eq "${ise_new_name}")
|
if($version eq "${ise_new_name}")
|
{
|
{
|
if($ise_param_name)
|
if($ise_param_name)
|
{
|
{
|
$elab_db->db_put( "parameter_${root}__${ise_param_name}","${ise_param}" );
|
$elab_db->db_put( "parameter_${root}__${ise_param_name}","${ise_param}" );
|
}
|
}
|
}
|
}
|
}
|
}
|
|
|
|
|
|
|
|
|
|
|
#/**********************************************************************/
|
#/**********************************************************************/
|
#/* */
|
#/* */
|
#/* if configuration set then read parameters from socgen:componentConfiguration file */
|
#/* if configuration set then read parameters from socgen:componentConfiguration file */
|
#/* */
|
#/* */
|
#/**********************************************************************/
|
#/**********************************************************************/
|
if(defined $configuration)
|
if(defined $configuration)
|
{
|
{
|
foreach my $socgen_cfg ($socgen_file->findnodes("//socgen:componentConfiguration/socgen:configurations/socgen:configuration/socgen:parameters/socgen:parameter/socgen:name"))
|
foreach my $socgen_cfg ($socgen_file->findnodes("//socgen:componentConfiguration/socgen:configurations/socgen:configuration/socgen:parameters/socgen:parameter/socgen:name"))
|
{
|
{
|
my($param_name) = $socgen_cfg->findnodes('./text()')->to_literal ;
|
my($param_name) = $socgen_cfg->findnodes('./text()')->to_literal ;
|
my($param_value) = $socgen_cfg->findnodes('../socgen:value/text()')->to_literal ;
|
my($param_value) = $socgen_cfg->findnodes('../socgen:value/text()')->to_literal ;
|
my($config_name) = $socgen_cfg->findnodes('../../../socgen:name/text()')->to_literal ;
|
my($config_name) = $socgen_cfg->findnodes('../../../socgen:name/text()')->to_literal ;
|
if($config_name eq $configuration )
|
if($config_name eq $configuration )
|
{
|
{
|
my $repo_data;
|
my $repo_data;
|
$elab_db->db_get("parameter_${root}__${param_name}", $repo_data );
|
$elab_db->db_get("parameter_${root}__${param_name}", $repo_data );
|
unless (defined $repo_data)
|
unless (defined $repo_data)
|
{
|
{
|
$elab_db->db_put( "parameter_${root}__${param_name}","${param_value}" );
|
$elab_db->db_put( "parameter_${root}__${param_name}","${param_value}" );
|
}
|
}
|
}
|
}
|
}
|
}
|
}
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
foreach my $socgen_cfg ($socgen_file->findnodes("//socgen:componentConfiguration/socgen:configurations/socgen:configuration/socgen:version[text() = '$version']/../socgen:parameters/socgen:parameter/socgen:name"))
|
foreach my $socgen_cfg ($socgen_file->findnodes("//socgen:componentConfiguration/socgen:configurations/socgen:configuration/socgen:version[text() = '$version']/../socgen:parameters/socgen:parameter/socgen:name"))
|
{
|
{
|
my($param_name) = $socgen_cfg->findnodes('./text()')->to_literal ;
|
my($param_name) = $socgen_cfg->findnodes('./text()')->to_literal ;
|
my($param_value) = $socgen_cfg->findnodes('../socgen:value/text()')->to_literal ;
|
my($param_value) = $socgen_cfg->findnodes('../socgen:value/text()')->to_literal ;
|
|
|
my $repo_data;
|
my $repo_data;
|
$elab_db->db_get("parameter_${root}__${param_name}", $repo_data );
|
$elab_db->db_get("parameter_${root}__${param_name}", $repo_data );
|
unless (defined $repo_data)
|
unless (defined $repo_data)
|
{
|
{
|
$elab_db->db_put( "parameter_${root}__${param_name}","${param_value}" );
|
$elab_db->db_put( "parameter_${root}__${param_name}","${param_value}" );
|
}
|
}
|
}
|
}
|
|
|
|
|
foreach my $socgen_cfg ($socgen_file->findnodes("//socgen:componentConfiguration/socgen:${env}/socgen:${tool}/socgen:${unit}/socgen:variant"))
|
foreach my $socgen_cfg ($socgen_file->findnodes("//socgen:componentConfiguration/socgen:${env}/socgen:${tool}/socgen:${unit}/socgen:variant"))
|
{
|
{
|
my($variant_name) = $socgen_cfg->findnodes('./text()')->to_literal ;
|
my($variant_name) = $socgen_cfg->findnodes('./text()')->to_literal ;
|
my $configuration = $socgen_cfg->findnodes('../socgen:configuration/text()')->to_literal ;
|
my $configuration = $socgen_cfg->findnodes('../socgen:configuration/text()')->to_literal ;
|
#/**********************************************************************/
|
#/**********************************************************************/
|
#/* */
|
#/* */
|
#/* if configuration set then read parameters from socgen:componentConfiguration file */
|
#/* if configuration set then read parameters from socgen:componentConfiguration file */
|
#/* */
|
#/* */
|
#/**********************************************************************/
|
#/**********************************************************************/
|
if($variant_name eq $variant)
|
if($variant_name eq $variant)
|
{
|
{
|
foreach my $socgen_cfg ($socgen_file->findnodes("//socgen:componentConfiguration/socgen:configurations/socgen:configuration/socgen:parameters/socgen:parameter/socgen:name"))
|
foreach my $socgen_cfg ($socgen_file->findnodes("//socgen:componentConfiguration/socgen:configurations/socgen:configuration/socgen:parameters/socgen:parameter/socgen:name"))
|
{
|
{
|
my($param_name) = $socgen_cfg->findnodes('./text()')->to_literal ;
|
my($param_name) = $socgen_cfg->findnodes('./text()')->to_literal ;
|
my($param_value) = $socgen_cfg->findnodes('../socgen:value/text()')->to_literal ;
|
my($param_value) = $socgen_cfg->findnodes('../socgen:value/text()')->to_literal ;
|
my($config_name) = $socgen_cfg->findnodes('../../../socgen:name/text()')->to_literal ;
|
my($config_name) = $socgen_cfg->findnodes('../../../socgen:name/text()')->to_literal ;
|
if($config_name eq $configuration )
|
if($config_name eq $configuration )
|
{
|
{
|
my $repo_data;
|
my $repo_data;
|
$elab_db->db_get("parameter_${root}__${param_name}", $repo_data );
|
$elab_db->db_get("parameter_${root}__${param_name}", $repo_data );
|
unless (defined $repo_data)
|
unless (defined $repo_data)
|
{
|
{
|
$elab_db->db_put( "parameter_${root}__${param_name}","${param_value}" );
|
$elab_db->db_put( "parameter_${root}__${param_name}","${param_value}" );
|
}
|
}
|
}
|
}
|
}
|
}
|
}
|
}
|
}
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
elaborate( "${root}","${vendor}","${library}","${component}","${version}" );
|
elaborate( "${root}","${vendor}","${library}","${component}","${version}" );
|
|
|
my $root = "root";
|
my $root = "root";
|
|
|
my $key;
|
my $key;
|
my $value;
|
my $value;
|
|
|
|
|
my @elab_list;
|
my @elab_list;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$elab_db->db_close();
|
$elab_db->db_close();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#/*********************************************************************************************/
|
#/*********************************************************************************************/
|
#/ */
|
#/ */
|
#/ Recursive entry point for all lower levels */
|
#/ Recursive entry point for all lower levels */
|
#/ */
|
#/ */
|
#/ */
|
#/ */
|
#/ */
|
#/ */
|
#/ */
|
#/ */
|
#/*********************************************************************************************/
|
#/*********************************************************************************************/
|
|
|
sub elaborate
|
sub elaborate
|
{
|
{
|
my @params = @_;
|
my @params = @_;
|
my $elab_version = pop(@params);
|
my $elab_version = pop(@params);
|
my $elab_component = pop(@params);
|
my $elab_component = pop(@params);
|
my $elab_library = pop(@params);
|
my $elab_library = pop(@params);
|
my $elab_vendor = pop(@params);
|
my $elab_vendor = pop(@params);
|
my $elab_root = pop(@params);
|
my $elab_root = pop(@params);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# print "ELABORATING $elab_root $elab_vendor $elab_library $elab_component $elab_version \n";
|
# print "ELABORATING $elab_root $elab_vendor $elab_library $elab_component $elab_version \n";
|
my $spirit_component_file = $parser->parse_file(yp::lib::find_ipxact_component($elab_vendor,$elab_library,$elab_component,$elab_version));
|
my $spirit_component_file = $parser->parse_file(yp::lib::find_ipxact_component($elab_vendor,$elab_library,$elab_component,$elab_version));
|
|
|
my $io_busses_filename = yp::lib::get_io_busses_db_filename($elab_vendor,$elab_library,$elab_component,$elab_version,"default");
|
my $io_busses_filename = yp::lib::get_io_busses_db_filename($elab_vendor,$elab_library,$elab_component,$elab_version,"default");
|
my $comp_io_busses_db = new BerkeleyDB::Hash( -Filename => "$io_busses_filename", -Flags => DB_CREATE ) or die "Cannot open $io_busses_filename : $!";
|
my $comp_io_busses_db = new BerkeleyDB::Hash( -Filename => "$io_busses_filename", -Flags => DB_CREATE ) or die "Cannot open $io_busses_filename : $!";
|
my $cursor = $comp_io_busses_db ->db_cursor() ;
|
my $cursor = $comp_io_busses_db ->db_cursor() ;
|
while ($cursor->c_get($key, $value, DB_NEXT) == 0)
|
while ($cursor->c_get($key, $value, DB_NEXT) == 0)
|
{
|
{
|
my $name;
|
my $name;
|
my $sense;
|
my $sense;
|
( ${key_type},${name},${sense}) = split( /\./ , $key);
|
( ${key_type},${name},${sense}) = split( /\./ , $key);
|
if($key_type eq "AbsDef")
|
if($key_type eq "AbsDef")
|
{
|
{
|
# print "BUS-- ${elab_root} ||| $name $sense === $value \n";
|
# print "BUS-- ${elab_root} ||| $name $sense === $value \n";
|
my $repo_data;
|
my $repo_data;
|
$elab_db->db_get("businterface_${elab_root}__${name}", $repo_data );
|
$elab_db->db_get("businterface_${elab_root}__${name}", $repo_data );
|
unless (defined $repo_data)
|
unless (defined $repo_data)
|
{
|
{
|
# print "BUS--::: \n";
|
# print "BUS--::: \n";
|
$elab_db->db_put( "busInterface_${elab_root}__${name}","busInterface:${sense}:${value}" );
|
$elab_db->db_put( "busInterface_${elab_root}__${name}","busInterface:${sense}:${value}" );
|
}
|
}
|
}
|
}
|
}
|
}
|
my $status = $cursor->c_close() ;
|
my $status = $cursor->c_close() ;
|
|
|
|
|
parse_component_file($spirit_component_file,$elab_root);
|
parse_component_file($spirit_component_file,$elab_root);
|
parse_design_files($spirit_component_file,$elab_root);
|
parse_design_files($spirit_component_file,$elab_root);
|
# print "Exit $elab_root \n";
|
# print "Exit $elab_root \n";
|
return;
|
return;
|
}
|
}
|
|
|
|
|
|
|
|
|
#/*********************************************************************************************/
|
#/*********************************************************************************************/
|
#/ */
|
#/ */
|
#/ */
|
#/ */
|
#/ */
|
#/ */
|
#/ */
|
#/ */
|
#/ */
|
#/ */
|
#/ */
|
#/ */
|
#/*********************************************************************************************/
|
#/*********************************************************************************************/
|
|
|
|
|
|
|
|
|
sub parse_component_file
|
sub parse_component_file
|
{
|
{
|
my @params = @_;
|
my @params = @_;
|
my $elab_root = pop(@params);
|
my $elab_root = pop(@params);
|
my $spirit_component_file = pop(@params);
|
my $spirit_component_file = pop(@params);
|
|
|
|
|
|
|
foreach my $new_comp ($spirit_component_file->findnodes("//spirit:component/spirit:vendor"))
|
foreach my $new_comp ($spirit_component_file->findnodes("//ipxact:component/ipxact: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('../ipxact:library/text()')->to_literal ;
|
my($new_name) = $new_comp->findnodes('../spirit:name/text()')->to_literal ;
|
my($new_name) = $new_comp->findnodes('../ipxact:name/text()')->to_literal ;
|
my($new_version) = $new_comp->findnodes('../spirit:version/text()')->to_literal ;
|
my($new_version) = $new_comp->findnodes('../ipxact:version/text()')->to_literal ;
|
# print "PARSE component file $elab_root $new_vendor $new_library $new_name $new_version \n";
|
# print "PARSE component file $elab_root $new_vendor $new_library $new_name $new_version \n";
|
|
|
|
|
|
|
my $parent_socgen_filename = yp::lib::find_componentConfiguration($new_vendor,$new_library,$new_name);
|
my $parent_socgen_filename = yp::lib::find_componentConfiguration($new_vendor,$new_library,$new_name);
|
|
|
if ($parent_socgen_filename)
|
if ($parent_socgen_filename)
|
|
|
{
|
{
|
|
|
my $parent_socgen_file = $parser->parse_file($parent_socgen_filename);
|
my $parent_socgen_file = $parser->parse_file($parent_socgen_filename);
|
foreach my $socgen_cfg ($parent_socgen_file->findnodes("//socgen:componentConfiguration/socgen:configurations/socgen:configuration/socgen:version[text() = '$new_version']/../socgen:parameters/socgen:parameter/socgen:name"))
|
foreach my $socgen_cfg ($parent_socgen_file->findnodes("//socgen:componentConfiguration/socgen:configurations/socgen:configuration/socgen:version[text() = '$new_version']/../socgen:parameters/socgen:parameter/socgen:name"))
|
{
|
{
|
my($param_name) = $socgen_cfg->findnodes('./text()')->to_literal ;
|
my($param_name) = $socgen_cfg->findnodes('./text()')->to_literal ;
|
my($param_default) = $socgen_cfg->findnodes('../socgen:value/text()')->to_literal ;
|
my($param_default) = $socgen_cfg->findnodes('../socgen:value/text()')->to_literal ;
|
# print "KKKKKKKK parameter_${elab_root}__${param_name} $param_default \n";
|
# print "KKKKKKKK parameter_${elab_root}__${param_name} $param_default \n";
|
my $repo_data;
|
my $repo_data;
|
$elab_db->db_get("parameter_${elab_root}__${param_name}", $repo_data );
|
$elab_db->db_get("parameter_${elab_root}__${param_name}", $repo_data );
|
unless (defined $repo_data)
|
unless (defined $repo_data)
|
{
|
{
|
$elab_db->db_put( "parameter_${elab_root}__${param_name}","${param_default}" );
|
$elab_db->db_put( "parameter_${elab_root}__${param_name}","${param_default}" );
|
}
|
}
|
}
|
}
|
};
|
};
|
|
|
#/**********************************************************************/
|
#/**********************************************************************/
|
#/* */
|
#/* */
|
#/* parse parameters and values */
|
#/* parse parameters and values */
|
#/* */
|
#/* */
|
#/**********************************************************************/
|
#/**********************************************************************/
|
|
|
foreach my $i_name ($spirit_component_file->findnodes('//spirit:model/spirit:modelParameters/spirit:modelParameter/spirit:name'))
|
foreach my $i_name ($spirit_component_file->findnodes('//ipxact:model/ipxact:modelParameters/ipxact:modelParameter/ipxact:name'))
|
{
|
{
|
my($parameter_name) = $i_name ->to_literal;
|
my($parameter_name) = $i_name ->to_literal;
|
my($parameter_default) = $i_name ->findnodes('../spirit:value/text()')->to_literal ;
|
my($parameter_default) = $i_name ->findnodes('../ipxact:value/text()')->to_literal ;
|
my $repo_data;
|
my $repo_data;
|
$elab_db->db_get("parameter_${elab_root}__${parameter_name}", $repo_data );
|
$elab_db->db_get("parameter_${elab_root}__${parameter_name}", $repo_data );
|
|
|
|
|
unless (defined $repo_data)
|
unless (defined $repo_data)
|
{
|
{
|
$elab_db->db_put( "parameter_${elab_root}__${parameter_name}","${parameter_default}" );
|
$elab_db->db_put( "parameter_${elab_root}__${parameter_name}","${parameter_default}" );
|
}
|
}
|
}
|
}
|
}
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
foreach my $new_comp ($spirit_component_file->findnodes("//spirit:component/spirit:model/spirit:views/spirit:view/spirit:vendorExtensions/spirit:componentRef"))
|
foreach my $new_comp ($spirit_component_file->findnodes("//ipxact:component/ipxact:model/ipxact:views/ipxact:view/ipxact:vendorExtensions/ipxact:componentRef"))
|
{
|
{
|
my($new_vendor) = $new_comp->findnodes('./@spirit:vendor')->to_literal ;
|
my($new_vendor) = $new_comp->findnodes('./@ipxact:vendor')->to_literal ;
|
my($new_library) = $new_comp->findnodes('./@spirit:library')->to_literal ;
|
my($new_library) = $new_comp->findnodes('./@ipxact:library')->to_literal ;
|
my($new_name) = $new_comp->findnodes('./@spirit:name')->to_literal ;
|
my($new_name) = $new_comp->findnodes('./@ipxact:name')->to_literal ;
|
my($new_version) = $new_comp->findnodes('./@spirit:version')->to_literal ;
|
my($new_version) = $new_comp->findnodes('./@ipxact:version')->to_literal ;
|
if(yp::lib::find_ipxact_component($new_vendor,$new_library,$new_name,$new_version))
|
if(yp::lib::find_ipxact_component($new_vendor,$new_library,$new_name,$new_version))
|
{
|
{
|
parse_component_file($parser->parse_file(yp::lib::find_ipxact_component($new_vendor,$new_library,$new_name,$new_version)),$elab_root );
|
parse_component_file($parser->parse_file(yp::lib::find_ipxact_component($new_vendor,$new_library,$new_name,$new_version)),$elab_root );
|
}
|
}
|
|
|
}
|
}
|
}
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
#/*********************************************************************************************/
|
#/*********************************************************************************************/
|
#/ */
|
#/ */
|
#/ */
|
#/ */
|
#/ */
|
#/ */
|
#/ */
|
#/ */
|
#/ */
|
#/ */
|
#/ */
|
#/ */
|
#/*********************************************************************************************/
|
#/*********************************************************************************************/
|
|
|
|
|
|
|
|
|
sub parse_design_files
|
sub parse_design_files
|
{
|
{
|
my @params = @_;
|
my @params = @_;
|
my $elab_root = pop(@params);
|
my $elab_root = pop(@params);
|
my $spirit_component_file = pop(@params);
|
my $spirit_component_file = pop(@params);
|
|
|
|
|
|
|
|
|
foreach my $new_comp ($spirit_component_file->findnodes("//spirit:component/spirit:model/spirit:views/spirit:view/spirit:vendorExtensions/spirit:componentRef"))
|
foreach my $new_comp ($spirit_component_file->findnodes("//ipxact:component/ipxact:model/ipxact:views/ipxact:view/ipxact:vendorExtensions/ipxact:componentRef"))
|
{
|
{
|
my($new_vendor) = $new_comp->findnodes('./@spirit:vendor')->to_literal ;
|
my($new_vendor) = $new_comp->findnodes('./@ipxact:vendor')->to_literal ;
|
my($new_library) = $new_comp->findnodes('./@spirit:library')->to_literal ;
|
my($new_library) = $new_comp->findnodes('./@ipxact:library')->to_literal ;
|
my($new_name) = $new_comp->findnodes('./@spirit:name')->to_literal ;
|
my($new_name) = $new_comp->findnodes('./@ipxact:name')->to_literal ;
|
my($new_version) = $new_comp->findnodes('./@spirit:version')->to_literal ;
|
my($new_version) = $new_comp->findnodes('./@ipxact:version')->to_literal ;
|
# print "PARSE design files $elab_root $new_vendor $new_library $new_name $new_version \n";
|
# print "PARSE design files $elab_root $new_vendor $new_library $new_name $new_version \n";
|
parse_design_files($parser->parse_file(yp::lib::find_ipxact_component($new_vendor,$new_library,$new_name,$new_version )),$elab_root );
|
parse_design_files($parser->parse_file(yp::lib::find_ipxact_component($new_vendor,$new_library,$new_name,$new_version )),$elab_root );
|
}
|
}
|
|
|
|
|
|
|
|
|
foreach my $new_comp ($spirit_component_file->findnodes("//spirit:component/spirit:model/spirit:views/spirit:view/spirit:hierarchyRef"))
|
foreach my $new_comp ($spirit_component_file->findnodes("//ipxact:component/ipxact:model/ipxact:views/ipxact:view/ipxact:hierarchyRef"))
|
{
|
{
|
my($new_vendor) = $new_comp->findnodes('./@spirit:vendor')->to_literal ;
|
my($new_vendor) = $new_comp->findnodes('./@ipxact:vendor')->to_literal ;
|
my($new_library) = $new_comp->findnodes('./@spirit:library')->to_literal ;
|
my($new_library) = $new_comp->findnodes('./@ipxact:library')->to_literal ;
|
my($new_name) = $new_comp->findnodes('./@spirit:name')->to_literal ;
|
my($new_name) = $new_comp->findnodes('./@ipxact:name')->to_literal ;
|
my($new_version) = $new_comp->findnodes('./@spirit:version')->to_literal ;
|
my($new_version) = $new_comp->findnodes('./@ipxact:version')->to_literal ;
|
if(yp::lib::find_ipxact_design($new_vendor,$new_library,$new_name,$new_version ))
|
if(yp::lib::find_ipxact_design($new_vendor,$new_library,$new_name,$new_version ))
|
{
|
{
|
# print "PARSE DESIGN file $elab_root $new_vendor $new_library $new_name $new_version \n";
|
# print "FFFFFFF $new_vendor $new_library $new_name $new_version hierarchyRef \n";
|
parse_design_file($parser->parse_file(yp::lib::find_ipxact_design($new_vendor,$new_library,$new_name,$new_version )),$elab_root );
|
parse_design_file($parser->parse_file(yp::lib::find_ipxact_design($new_vendor,$new_library,$new_name,$new_version )),$elab_root );
|
}
|
}
|
}
|
}
|
|
|
|
|
|
foreach my $new_comp ($spirit_component_file->findnodes("//ipxact:component/ipxact:model/ipxact:views/ipxact:view/ipxact:designInstantiationRef/text()"))
|
|
{
|
|
my($designInsref_value) = $new_comp ->to_literal ;
|
|
my($designInsref_name) = $new_comp ->findnodes('../../ipxact:name')->to_literal ;
|
|
|
|
foreach my $new_comp ($spirit_component_file->findnodes("//ipxact:component/ipxact:model/ipxact:instantiations/ipxact:designInstantiation"))
|
|
{
|
|
my($t_ref) = $new_comp->findnodes('./ipxact:name/text()')->to_literal ;
|
|
my($t_vendor) = $new_comp->findnodes('./ipxact:designRef/@vendor')->to_literal ;
|
|
my($t_library) = $new_comp->findnodes('./ipxact:designRef/@library')->to_literal ;
|
|
my($t_name) = $new_comp->findnodes('./ipxact:designRef/@name')->to_literal ;
|
|
my($t_version) = $new_comp->findnodes('./ipxact:designRef/@version')->to_literal ;
|
|
|
|
|
|
|
|
|
|
if($t_ref eq $designInsref_name )
|
|
{
|
|
if(yp::lib::find_ipxact_design($t_vendor,$t_library,$t_name,$t_version ))
|
|
{
|
|
# print "FFFFFFF $t_vendor $t_library $t_name $t_version designInstantiationRef \n";
|
|
parse_design_file($parser->parse_file(yp::lib::find_ipxact_design($t_vendor,$t_library,$t_name,$t_version )),$elab_root );
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#/*********************************************************************************************/
|
#/*********************************************************************************************/
|
#/ */
|
#/ */
|
#/ */
|
#/ */
|
#/ */
|
#/ */
|
#/ */
|
#/ */
|
#/ */
|
#/ */
|
#/ */
|
#/ */
|
#/*********************************************************************************************/
|
#/*********************************************************************************************/
|
|
|
|
|
|
|
|
|
sub parse_design_file
|
sub parse_design_file
|
{
|
{
|
my @params = @_;
|
my @params = @_;
|
my $elab_root = pop(@params);
|
my $elab_root = pop(@params);
|
my $spirit_design_file = pop(@params);
|
my $spirit_design_file = pop(@params);
|
|
|
foreach my $new_comp ($spirit_design_file->findnodes("//spirit:design/spirit:vendor"))
|
foreach my $new_comp ($spirit_design_file->findnodes("//ipxact:design/ipxact: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('../ipxact:library/text()')->to_literal ;
|
my($new_name) = $new_comp->findnodes('../spirit:name/text()')->to_literal ;
|
my($new_name) = $new_comp->findnodes('../ipxact:name/text()')->to_literal ;
|
my($new_version) = $new_comp->findnodes('../spirit:version/text()')->to_literal ;
|
my($new_version) = $new_comp->findnodes('../ipxact:version/text()')->to_literal ;
|
# print "WARNING $new_vendor $new_library $new_name $new_version DESIGN \n";
|
# print "WARNING $new_vendor $new_library $new_name $new_version DESIGN \n";
|
|
|
foreach my $x_name ($spirit_design_file->findnodes("//spirit:design/spirit:componentInstances/spirit:componentInstance/spirit:instanceName"))
|
foreach my $x_name ($spirit_design_file->findnodes("//ipxact:design/ipxact:componentInstances/ipxact:componentInstance/ipxact:instanceName"))
|
{
|
{
|
#/**********************************************************************/
|
#/**********************************************************************/
|
#/* */
|
#/* */
|
#/* Lookup VLNV for each instantiated component */
|
#/* Lookup VLNV for each instantiated component */
|
#/* */
|
#/* */
|
#/**********************************************************************/
|
#/**********************************************************************/
|
my($instance_name) = $x_name ->findnodes('./text()')->to_literal ;
|
my($instance_name) = $x_name ->findnodes('./text()')->to_literal ;
|
my($vendor_name) = $x_name ->findnodes('../spirit:componentRef/@spirit:vendor')->to_literal ;
|
my($vendor_name) = $x_name ->findnodes('../ipxact:componentRef/@vendor')->to_literal ;
|
my($library_name) = $x_name ->findnodes('../spirit:componentRef/@spirit:library')->to_literal ;
|
my($library_name) = $x_name ->findnodes('../ipxact:componentRef/@library')->to_literal ;
|
my($component_name) = $x_name ->findnodes('../spirit:componentRef/@spirit:name')->to_literal ;
|
my($component_name) = $x_name ->findnodes('../ipxact:componentRef/@name')->to_literal ;
|
my($version_name) = $x_name ->findnodes('../spirit:componentRef/@spirit:version')->to_literal ;
|
my($version_name) = $x_name ->findnodes('../ipxact:componentRef/@version')->to_literal ;
|
# print "INSTANCED $instance_name $vendor_name $library_name $component_name $version_name \n";
|
# print "INSTANCED $instance_name $vendor_name $library_name $component_name $version_name \n";
|
$elab_db->db_put( "component___${elab_root}.${instance_name}","${vendor_name}:${library_name}:${component_name}:${version_name}" );
|
$elab_db->db_put( "component___${elab_root}.${instance_name}","${vendor_name}:${library_name}:${component_name}:${version_name}" );
|
|
|
my $repo_data;
|
my $repo_data;
|
if(defined $name && length $name >0)
|
if(defined $name && length $name >0)
|
{
|
{
|
$elab_db->db_get("VLNV___${vendor_name}:${library_name}:${component_name}:${version_name}:${name}", $repo_data );
|
$elab_db->db_get("VLNV___${vendor_name}:${library_name}:${component_name}:${version_name}:${name}", $repo_data );
|
$elab_db->db_put("VLNV___${vendor_name}:${library_name}:${component_name}:${version_name}:${name}","${repo_data}${elab_root}.${instance_name}:::");
|
$elab_db->db_put("VLNV___${vendor_name}:${library_name}:${component_name}:${version_name}:${name}","${repo_data}${elab_root}.${instance_name}:::");
|
}
|
}
|
else
|
else
|
{
|
{
|
$elab_db->db_get("VLNV___${vendor_name}:${library_name}:${component_name}:${version_name}", $repo_data );
|
$elab_db->db_get("VLNV___${vendor_name}:${library_name}:${component_name}:${version_name}", $repo_data );
|
$elab_db->db_put("VLNV___${vendor_name}:${library_name}:${component_name}:${version_name}","${repo_data}${elab_root}.${instance_name}:::");
|
$elab_db->db_put("VLNV___${vendor_name}:${library_name}:${component_name}:${version_name}","${repo_data}${elab_root}.${instance_name}:::");
|
}
|
}
|
my $cmd ="./tools/verilog/elab_verilog -vendor ${vendor_name} -library ${library_name} -component ${component_name} -version ${version_name}\n";
|
my $cmd ="./tools/verilog/elab_verilog -vendor ${vendor_name} -library ${library_name} -component ${component_name} -version ${version_name}\n";
|
|
|
if(system($cmd)){}
|
if(system($cmd)){}
|
|
|
|
|
|
|
if ($instance_name)
|
if ($instance_name)
|
{
|
{
|
foreach my $i_parameter ($spirit_design_file->findnodes("//spirit:componentInstance[spirit:instanceName/text() = '$instance_name']/spirit:configurableElementValues/spirit:configurableElementValue/\@spirit:referenceId"))
|
foreach my $i_parameter ($spirit_design_file->findnodes("//ipxact:componentInstance[ipxact:instanceName/text() = '$instance_name']/ipxact:configurableElementValues/ipxact:configurableElementValue/\@referenceId"))
|
{
|
{
|
my($foo_name) = $i_parameter ->to_literal ;
|
my($foo_name) = $i_parameter ->to_literal ;
|
my($foo_value) = $i_parameter ->findnodes('../text()')->to_literal ;
|
my($foo_value) = $i_parameter ->findnodes('../text()')->to_literal ;
|
|
|
my $fee_value = $foo_value;
|
my $fee_value = $foo_value;
|
my $p_key;
|
my $p_key;
|
my $p_value;
|
my $p_value;
|
my $p_cursor = $elab_db ->db_cursor() ;
|
my $p_cursor = $elab_db ->db_cursor() ;
|
while ($p_cursor->c_get($p_key, $p_value, DB_NEXT) == 0)
|
while ($p_cursor->c_get($p_key, $p_value, DB_NEXT) == 0)
|
{
|
{
|
$_ = $p_key;
|
$_ = $p_key;
|
# print "---> $p_key $p_value \n";
|
# print "---> $p_key $p_value \n";
|
if(/parameter_${elab_root}__(\S+)/)
|
if(/parameter_${elab_root}__(\S+)/)
|
{
|
{
|
if($1 eq $p_value)
|
if($1 eq $p_value)
|
{
|
{
|
print "DDDDDDDDDDDDDDDDDDDDDDDDDD $p_key $p_value \n";
|
print "DDDDDDDDDDDDDDDDDDDDDDDDDD $p_key $p_value \n";
|
}
|
}
|
else
|
else
|
{
|
{
|
$fee_value = math::lib::parse($fee_value,$1,$p_value);
|
$fee_value = math::lib::parse($fee_value,$1,$p_value);
|
}
|
}
|
}
|
}
|
}
|
}
|
my $status = $p_cursor->c_close() ;
|
my $status = $p_cursor->c_close() ;
|
|
|
|
|
|
|
|
|
|
|
# replace this!!!
|
# replace this!!!
|
# scan for all names in db_get("parameter_${elab_root}__${name}", $repo_data
|
# scan for all names in db_get("parameter_${elab_root}__${name}", $repo_data
|
# and substitute $repo_data anywhere in $foo_value
|
# and substitute $repo_data anywhere in $foo_value
|
# then run $foo_value thru sys/math
|
# then run $foo_value thru sys/math
|
|
|
|
|
$_ = $foo_value;
|
$_ = $foo_value;
|
my $t_name;
|
my $t_name;
|
my $t_op;
|
my $t_op;
|
my $repo_data;
|
my $repo_data;
|
|
|
if(/(\S+)[+](\S+)/)
|
if(/(\S+)[+](\S+)/)
|
{
|
{
|
$t_name = $1;
|
$t_name = $1;
|
$t_op = $2;
|
$t_op = $2;
|
$elab_db->db_get("parameter_${elab_root}__${t_name}", $repo_data );
|
$elab_db->db_get("parameter_${elab_root}__${t_name}", $repo_data );
|
unless (defined $repo_data)
|
unless (defined $repo_data)
|
{
|
{
|
$repo_data = $foo_value ;
|
$repo_data = $foo_value ;
|
}
|
}
|
else
|
else
|
{
|
{
|
$repo_data = $repo_data + $t_op ;
|
$repo_data = $repo_data + $t_op ;
|
}
|
}
|
}
|
}
|
else
|
else
|
|
|
# end replace
|
# end replace
|
|
|
{
|
{
|
$elab_db->db_get("parameter_${elab_root}__${foo_value}", $repo_data );
|
$elab_db->db_get("parameter_${elab_root}__${foo_value}", $repo_data );
|
unless (defined $repo_data)
|
unless (defined $repo_data)
|
{
|
{
|
$repo_data = $foo_value ;
|
$repo_data = $foo_value ;
|
}
|
}
|
}
|
}
|
|
|
$elab_db->db_put( "parameter_${elab_root}.${instance_name}__${foo_name}","${repo_data}" );
|
$elab_db->db_put( "parameter_${elab_root}.${instance_name}__${foo_name}","${repo_data}" );
|
$elab_db->db_put( "Parameter_${elab_root}.${instance_name}__${foo_name}","${foo_value}" );
|
$elab_db->db_put( "Parameter_${elab_root}.${instance_name}__${foo_name}","${foo_value}" );
|
$elab_db->db_put( "Xarameter_${elab_root}.${instance_name}__${foo_name}","${fee_value}" );
|
$elab_db->db_put( "Xarameter_${elab_root}.${instance_name}__${foo_name}","${fee_value}" );
|
# print "PARAMETERE ${elab_root}.${instance_name} $foo_name p_ $repo_data P_ $foo_value X_ $fee_value \n";
|
# print "PARAMETERE ${elab_root}.${instance_name} $foo_name p_ $repo_data P_ $foo_value X_ $fee_value \n";
|
}
|
}
|
|
|
elaborate( "${elab_root}.${instance_name}","${vendor_name}","${library_name}","${component_name}","${version_name}" );
|
elaborate( "${elab_root}.${instance_name}","${vendor_name}","${library_name}","${component_name}","${version_name}" );
|
}
|
}
|
}
|
}
|
}
|
}
|
}
|
}
|
|
|
|
|
|
|
|
|
|
|