Line 1... |
Line 1... |
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 \ */
|
|
#/* ============== */
|
|
#/* | | */
|
|
#/* |____________| */
|
|
#/* */
|
|
#/* Traverse a socgen library and link it */
|
|
#/* */
|
#/* */
|
|
#/* Version 1.0.0 */
|
#/* */
|
#/* */
|
#/* Author(s): */
|
#/* Author(s): */
|
#/* - John Eaton, jt_eaton@opencores.org */
|
#/* - John Eaton, z3qmtr45@gmail.com */
|
|
#/* */
|
|
#/****************************************************************************/
|
|
#/* */
|
|
#/* */
|
|
#/* Copyright 2016 John T Eaton */
|
|
#/* */
|
|
#/* 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 */
|
#/* */
|
#/* */
|
#/**********************************************************************/
|
#/* http://www.apache.org/licenses/LICENSE-2.0 */
|
#/* */
|
#/* */
|
#/* Copyright (C) <2010-2012> */
|
#/* 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. */
|
#/* */
|
#/* */
|
#/* This source file may be used and distributed without */
|
|
#/* 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 */
|
|
#/* */
|
#/* */
|
#/**********************************************************************/
|
#/****************************************************************************/
|
|
|
|
|
############################################################################
|
############################################################################
|
# General PERL config
|
# General PERL config
|
############################################################################
|
############################################################################
|
Line 116... |
Line 102... |
|
|
|
|
my $socgen_file = $parser->parse_file(yp::lib::find_componentConfiguration($vendor,$library,$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:chip[socgen:variant/text() = '$variant']"))
|
foreach my $i_name ($socgen_file->findnodes("//socgen:syn/socgen:fpgas/socgen:fpga[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);
|
|
|
Line 191... |
Line 177... |
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 $repo = yp::lib::find_component_repo($child_vendor,$child_library,$child_component);
|
|
my $child_dir = yp::lib::get_child_dir;
|
|
|
|
my $path = "./${child_dir}";
|
|
|
my $path = ".${prefix}/children";
|
|
mkdir $path,0755 unless( -e $path );
|
mkdir $path,0755 unless( -e $path );
|
my $path = ".${prefix}/children/${child_vendor}__${child_library}";
|
my $path = "./${child_dir}/${child_vendor}__${child_library}";
|
mkdir $path,0755 unless( -e $path );
|
mkdir $path,0755 unless( -e $path );
|
my $path = ".${prefix}/children/${child_vendor}__${child_library}/bin";
|
|
|
|
unless( -e $path )
|
my $path = "./${child_dir}/${child_vendor}__${child_library}${lib_comp_sep}";
|
{
|
|
mkdir $path,0755;
|
|
$root = "${home}/${repo}/${child_vendor}/${child_library}/bin";
|
|
$dest = "${home}${prefix}/children/${child_vendor}__${child_library}/bin";
|
|
&sys::lib::link_dir( "$root", "$dest" );
|
|
symlink( "${home}/tools/bin/Makefile.root", "${home}${prefix}/children/${child_vendor}__${child_library}/bin/Makefile.root");
|
|
symlink( "${home}/tools/bin/Makefile", "${home}${prefix}/children/${child_vendor}__${child_library}/bin/Makefile");
|
|
}
|
|
|
|
|
|
|
|
my $path = ".${prefix}/children/${child_vendor}__${child_library}${lib_comp_sep}";
|
|
mkdir $path,0755 unless( -e $path );
|
mkdir $path,0755 unless( -e $path );
|
|
|
my $path = ".${prefix}/children/${child_vendor}__${child_library}${lib_comp_sep}${child_component}";
|
my $path = "./${child_dir}/${child_vendor}__${child_library}${lib_comp_sep}${child_component}";
|
|
|
|
|
unless( -e $path )
|
unless( -e $path )
|
{
|
{
|
mkdir $path,0755;
|
mkdir $path,0755;
|
|
|
$root = "${home}/${repo}/${child_vendor}/${child_library}${lib_comp_sep}${child_component}";
|
$root = "${home}/${repo}/${child_vendor}/${child_library}${lib_comp_sep}${child_component}";
|
$dest = ".${prefix}/children/${child_vendor}__${child_library}${lib_comp_sep}${child_component}";
|
$dest = "./${child_dir}/${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));
|
my $sim_library_path ;
|
my $sim_library_path ;
|
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 $sim_comp_path = $socgen_file->findnodes("//socgen:componentConfiguration/socgen:sim/socgen:comp_path/text()")->to_literal;
|
my $sim_comp_path = $socgen_file->findnodes("//socgen:componentConfiguration/socgen:sim/socgen:comp_path/text()")->to_literal;
|
|
|
Line 241... |
Line 212... |
else
|
else
|
{
|
{
|
$sim_library_path = $socgen_file->findnodes("//socgen:componentConfiguration/socgen:sim/socgen:library_path/text()")->to_literal;
|
$sim_library_path = $socgen_file->findnodes("//socgen:componentConfiguration/socgen:sim/socgen:library_path/text()")->to_literal;
|
}
|
}
|
|
|
my $sim_full_path = ".${prefix}/children/${child_vendor}__${child_library}${sim_library_path}";
|
my $sim_full_path = "./${child_dir}/${child_vendor}__${child_library}${sim_library_path}";
|
|
|
|
|
if( $sim_library_path)
|
if( $sim_library_path)
|
{
|
{
|
if(-e $sim_full_path)
|
if(-e $sim_full_path)
|
{
|
{
|
my $cmd = "rm -r .${prefix}/children/${child_vendor}__${child_library}${sim_library_path} \n";
|
my $cmd = "rm -r ./${child_dir}/${child_vendor}__${child_library}${sim_library_path} \n";
|
if (system($cmd)) {}
|
if (system($cmd)) {}
|
}
|
}
|
}
|
}
|
|
|
|
|
Line 268... |
Line 239... |
{
|
{
|
$syn_library_path = $socgen_file->findnodes("//socgen:componentConfiguration/socgen:syn/socgen:library_path/text()")->to_literal;
|
$syn_library_path = $socgen_file->findnodes("//socgen:componentConfiguration/socgen:syn/socgen:library_path/text()")->to_literal;
|
}
|
}
|
|
|
|
|
my $syn_full_path = ".${prefix}/children/${child_vendor}__${child_library}${syn_library_path}";
|
my $syn_full_path = "./${child_dir}/${child_vendor}__${child_library}${syn_library_path}";
|
|
|
if( $syn_library_path)
|
if( $syn_library_path)
|
{
|
{
|
if(-e $syn_full_path)
|
if(-e $syn_full_path)
|
{
|
{
|
|
|
my $cmd = "rm -r .${prefix}/children/${child_vendor}__${child_library}${syn_library_path} \n";
|
my $cmd = "rm -r ./${child_dir}/${child_vendor}__${child_library}${syn_library_path} \n";
|
if (system($cmd)) {}
|
if (system($cmd)) {}
|
}
|
}
|
}
|
}
|
|
|
|
|
Line 287... |
Line 258... |
}
|
}
|
|
|
|
|
my $lib_sw_dir = yp::lib::find_lib_sw_dir($child_vendor,$child_library);
|
my $lib_sw_dir = yp::lib::find_lib_sw_dir($child_vendor,$child_library);
|
|
|
if($lib_sw_dir)
|
if(defined $lib_sw_dir & length $lib_sw_dir > 0 )
|
{
|
{
|
my $path = ".${prefix}/children/${child_vendor}__${child_library}${lib_sw_dir}";
|
my $path = "./code";
|
|
mkdir $path,0755 unless( -e $path );
|
|
$path = "./code/${child_vendor}__${child_library}";
|
unless( -e $path )
|
unless( -e $path )
|
{
|
{
|
mkdir $path,0755;
|
mkdir $path,0755;
|
$root = "${home}/${repo}/${child_vendor}/${child_library}${lib_sw_dir}";
|
$root = "${home}/${repo}/${child_vendor}/${child_library}/${lib_sw_dir}";
|
$dest = "${home}${prefix}/children/${child_vendor}__${child_library}${lib_sw_dir}";
|
$dest = "${home}/code/${child_vendor}__${child_library}";
|
&sys::lib::link_dir( "$root", "$dest" );
|
&sys::lib::link_dir( "$root", "$dest" );
|
}
|
}
|
}
|
}
|
|
|
|
|