Line 9... |
Line 9... |
#/* / TOOL \ */
|
#/* / TOOL \ */
|
#/* ============== */
|
#/* ============== */
|
#/* | | */
|
#/* | | */
|
#/* |____________| */
|
#/* |____________| */
|
#/* */
|
#/* */
|
#/* Traverse a socgen project and link it */
|
#/* Traverse a socgen library and link it */
|
#/* */
|
#/* */
|
#/* */
|
#/* */
|
#/* Author(s): */
|
#/* Author(s): */
|
#/* - John Eaton, jt_eaton@opencores.org */
|
#/* - John Eaton, jt_eaton@opencores.org */
|
#/* */
|
#/* */
|
Line 69... |
Line 69... |
|
|
Getopt::Long::config("require_order", "prefix=-");
|
Getopt::Long::config("require_order", "prefix=-");
|
GetOptions("h","help",
|
GetOptions("h","help",
|
"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
|
|
|
) || die "(use '$program_name -h' for help)";
|
) || die "(use '$program_name -h' for help)";
|
|
|
Line 81... |
Line 81... |
##############################################################################
|
##############################################################################
|
## Help option
|
## Help option
|
##############################################################################
|
##############################################################################
|
if ( $opt_h or $opt_help )
|
if ( $opt_h or $opt_help )
|
{
|
{
|
print "\n type soc_link_child -prefix /work -vendor vendor_name -project project_name -component component_name -version version_name projects_dir ";
|
print "\n type soc_link_child -prefix /work -vendor vendor_name -library library_name -component component_name -version version_name ";
|
print "\n";
|
print "\n";
|
exit 1;
|
exit 1;
|
}
|
}
|
|
|
|
|
Line 96... |
Line 96... |
my $home = cwd();
|
my $home = cwd();
|
|
|
|
|
my $parser = XML::LibXML->new();
|
my $parser = XML::LibXML->new();
|
|
|
my $projects_dir = $ARGV[0];
|
|
chomp($projects_dir);
|
|
my $variant;
|
my $variant;
|
|
|
if($version) {$variant = "${component}_${version}";}
|
if($version) {$variant = "${component}_${version}";}
|
else {$variant = "${component}";}
|
else {$variant = "${component}";}
|
|
|
|
|
|
|
#/*********************************************************************************************/
|
#/*********************************************************************************************/
|
#/ */
|
#/ */
|
#/ link overlay projects */
|
#/ link overlay librarys */
|
#/ */
|
#/ */
|
#/*********************************************************************************************/
|
#/*********************************************************************************************/
|
|
|
|
|
|
|
|
|
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));
|
|
|
|
|
foreach my $i_name ($socgen_file->findnodes("//socgen:syn/socgen:ise[socgen:variant/text() = '$variant']"))
|
foreach my $i_name ($socgen_file->findnodes("//socgen:syn/socgen:ise/socgen:chip[socgen:variant/text() = '$variant']"))
|
{
|
{
|
my($replace_vendor) = $i_name ->findnodes('socgen:target/socgen:vendor/text()')->to_literal ;
|
my($replace_vendor) = $i_name ->findnodes('socgen:target/socgen:vendor/text()')->to_literal ;
|
my($replace_library) = $i_name ->findnodes('socgen:target/socgen:library/text()')->to_literal ;
|
my($replace_library) = $i_name ->findnodes('socgen:target/socgen:library/text()')->to_literal ;
|
my @replace_components = yp::lib::find_components($replace_vendor,$replace_library);
|
my @replace_components = yp::lib::find_components($replace_vendor,$replace_library);
|
|
|
foreach my $replace_component (@replace_components)
|
foreach my $replace_component (@replace_components)
|
{
|
{
|
&link_child($vendor, $project,$replace_component, $replace_library ,$replace_vendor);
|
&link_child($vendor, $library,$replace_component, $replace_library ,$replace_vendor);
|
}
|
}
|
}
|
}
|
|
|
|
|
|
|
Line 149... |
Line 148... |
|
|
|
|
|
|
my @filelist = ( );
|
my @filelist = ( );
|
|
|
@filelist = yp::lib::parse_component_file("$vendor","$project","$component","$version");
|
@filelist = yp::lib::parse_component_file("$vendor","$library","$component","$version");
|
|
|
|
|
|
|
|
|
foreach $line (@filelist)
|
foreach $line (@filelist)
|
Line 163... |
Line 162... |
{
|
{
|
$new_vendor = $1;
|
$new_vendor = $1;
|
$new_proj = $2;
|
$new_proj = $2;
|
$new_comp = $3;
|
$new_comp = $3;
|
$new_version = $4;
|
$new_version = $4;
|
&link_child( $vendor,$project,$new_comp, $new_proj ,$new_vendor);
|
&link_child( $vendor,$library,$new_comp, $new_proj ,$new_vendor);
|
}
|
}
|
}
|
}
|
|
|
|
|
|
|
Line 191... |
Line 190... |
my $child_component = shift;
|
my $child_component = shift;
|
my $child_library = shift;
|
my $child_library = shift;
|
my $child_vendor = shift;
|
my $child_vendor = shift;
|
|
|
my $lib_comp_sep = yp::lib::find_lib_comp_sep($child_vendor,$child_library,$child_component);
|
my $lib_comp_sep = yp::lib::find_lib_comp_sep($child_vendor,$child_library,$child_component);
|
|
my $repo = yp::lib::find_component_repo($child_vendor,$child_library,$child_component);
|
|
|
|
|
|
|
my $path = ".${prefix}/${parent_vendor}__${parent_library}/children";
|
my $path = ".${prefix}/${parent_vendor}__${parent_library}/children";
|
mkdir $path,0755 unless( -e $path );
|
mkdir $path,0755 unless( -e $path );
|
Line 203... |
Line 203... |
my $path = ".${prefix}/${parent_vendor}__${parent_library}/children/${child_vendor}__${child_library}/bin";
|
my $path = ".${prefix}/${parent_vendor}__${parent_library}/children/${child_vendor}__${child_library}/bin";
|
|
|
unless( -e $path )
|
unless( -e $path )
|
{
|
{
|
mkdir $path,0755;
|
mkdir $path,0755;
|
$root = "${home}/${projects_dir}/${child_vendor}/${child_library}/bin";
|
$root = "${home}/${repo}/${child_vendor}/${child_library}/bin";
|
$dest = "${home}${prefix}/${parent_vendor}__${parent_library}/children/${child_vendor}__${child_library}/bin";
|
$dest = "${home}${prefix}/${parent_vendor}__${parent_library}/children/${child_vendor}__${child_library}/bin";
|
&sys::lib::link_dir( "$root", "$dest" );
|
&sys::lib::link_dir( "$root", "$dest" );
|
symlink( "${home}/tools/bin/Makefile.root", "${home}${prefix}/${parent_vendor}__${parent_library}/children/${child_vendor}__${child_library}/bin/Makefile.root");
|
symlink( "${home}/tools/bin/Makefile.root", "${home}${prefix}/${parent_vendor}__${parent_library}/children/${child_vendor}__${child_library}/bin/Makefile.root");
|
symlink( "${home}/tools/bin/Makefile", "${home}${prefix}/${parent_vendor}__${parent_library}/children/${child_vendor}__${child_library}/bin/Makefile");
|
symlink( "${home}/tools/bin/Makefile", "${home}${prefix}/${parent_vendor}__${parent_library}/children/${child_vendor}__${child_library}/bin/Makefile");
|
}
|
}
|
Line 222... |
Line 222... |
|
|
unless( -e $path )
|
unless( -e $path )
|
{
|
{
|
mkdir $path,0755;
|
mkdir $path,0755;
|
|
|
$root = "${home}/${projects_dir}/${child_vendor}/${child_library}${lib_comp_sep}${child_component}";
|
$root = "${home}/${repo}/${child_vendor}/${child_library}${lib_comp_sep}${child_component}";
|
$dest = ".${prefix}/${parent_vendor}__${parent_library}/children/${child_vendor}__${child_library}${lib_comp_sep}${child_component}";
|
$dest = ".${prefix}/${parent_vendor}__${parent_library}/children/${child_vendor}__${child_library}${lib_comp_sep}${child_component}";
|
&sys::lib::link_dir( "$root", "$dest" );
|
&sys::lib::link_dir( "$root", "$dest" );
|
|
|
|
|
my $socgen_file = $parser->parse_file(yp::lib::find_componentConfiguration($child_vendor,$child_library,$child_component));
|
my $socgen_file = $parser->parse_file(yp::lib::find_componentConfiguration($child_vendor,$child_library,$child_component));
|
Line 293... |
Line 293... |
{
|
{
|
my $path = ".${prefix}/${parent_vendor}__${parent_library}/children/${child_vendor}__${child_library}${lib_sw_dir}";
|
my $path = ".${prefix}/${parent_vendor}__${parent_library}/children/${child_vendor}__${child_library}${lib_sw_dir}";
|
unless( -e $path )
|
unless( -e $path )
|
{
|
{
|
mkdir $path,0755;
|
mkdir $path,0755;
|
$root = "${home}/${projects_dir}/${child_vendor}/${child_library}${lib_sw_dir}";
|
$root = "${home}/${repo}/${child_vendor}/${child_library}${lib_sw_dir}";
|
$dest = "${home}${prefix}/${parent_vendor}__${parent_library}/children/${child_vendor}__${child_library}${lib_sw_dir}";
|
$dest = "${home}${prefix}/${parent_vendor}__${parent_library}/children/${child_vendor}__${child_library}${lib_sw_dir}";
|
&sys::lib::link_dir( "$root", "$dest" );
|
&sys::lib::link_dir( "$root", "$dest" );
|
}
|
}
|
}
|
}
|
|
|