| 1 |
134 |
jt_eaton |
eval 'exec `which perl` -S $0 ${1+"$@"}'
|
| 2 |
|
|
if 0;
|
| 3 |
|
|
#/**********************************************************************/
|
| 4 |
|
|
#/* */
|
| 5 |
|
|
#/* ------- */
|
| 6 |
|
|
#/* / SOC \ */
|
| 7 |
|
|
#/* / GEN \ */
|
| 8 |
|
|
#/* / TOOL \ */
|
| 9 |
|
|
#/* ============== */
|
| 10 |
|
|
#/* | | */
|
| 11 |
|
|
#/* |____________| */
|
| 12 |
|
|
#/* */
|
| 13 |
|
|
#/* */
|
| 14 |
|
|
#/* */
|
| 15 |
|
|
#/* */
|
| 16 |
|
|
#/* Author(s): */
|
| 17 |
|
|
#/* - John Eaton, jt_eaton@opencores.org */
|
| 18 |
|
|
#/* */
|
| 19 |
|
|
#/**********************************************************************/
|
| 20 |
|
|
#/* */
|
| 21 |
|
|
#/* Copyright (C) <2010-2011> */
|
| 22 |
|
|
#/* */
|
| 23 |
|
|
#/* This source file may be used and distributed without */
|
| 24 |
|
|
#/* restriction provided that this copyright statement is not */
|
| 25 |
|
|
#/* removed from the file and that any derivative work contains */
|
| 26 |
|
|
#/* the original copyright notice and the associated disclaimer. */
|
| 27 |
|
|
#/* */
|
| 28 |
|
|
#/* This source file is free software; you can redistribute it */
|
| 29 |
|
|
#/* and/or modify it under the terms of the GNU Lesser General */
|
| 30 |
|
|
#/* Public License as published by the Free Software Foundation; */
|
| 31 |
|
|
#/* either version 2.1 of the License, or (at your option) any */
|
| 32 |
|
|
#/* later version. */
|
| 33 |
|
|
#/* */
|
| 34 |
|
|
#/* This source is distributed in the hope that it will be */
|
| 35 |
|
|
#/* useful, but WITHOUT ANY WARRANTY; without even the implied */
|
| 36 |
|
|
#/* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR */
|
| 37 |
|
|
#/* PURPOSE. See the GNU Lesser General Public License for more */
|
| 38 |
|
|
#/* details. */
|
| 39 |
|
|
#/* */
|
| 40 |
|
|
#/* You should have received a copy of the GNU Lesser General */
|
| 41 |
|
|
#/* Public License along with this source; if not, download it */
|
| 42 |
|
|
#/* from http://www.opencores.org/lgpl.shtml */
|
| 43 |
|
|
#/* */
|
| 44 |
|
|
#/**********************************************************************/
|
| 45 |
|
|
|
| 46 |
|
|
|
| 47 |
|
|
############################################################################
|
| 48 |
|
|
# General PERL config
|
| 49 |
|
|
############################################################################
|
| 50 |
|
|
use Getopt::Long;
|
| 51 |
|
|
use English;
|
| 52 |
|
|
use File::Basename;
|
| 53 |
|
|
use Cwd;
|
| 54 |
|
|
use Scalar::Util qw(looks_like_number);
|
| 55 |
|
|
use XML::LibXML;
|
| 56 |
|
|
use lib './tools';
|
| 57 |
|
|
use sys::lib;
|
| 58 |
|
|
use yp::lib;
|
| 59 |
|
|
use BerkeleyDB;
|
| 60 |
|
|
|
| 61 |
|
|
|
| 62 |
|
|
$OUTPUT_AUTOFLUSH = 1; # set autoflush of stdout to TRUE.
|
| 63 |
|
|
|
| 64 |
|
|
|
| 65 |
|
|
############################################################################
|
| 66 |
|
|
### Process the options
|
| 67 |
|
|
############################################################################
|
| 68 |
|
|
Getopt::Long::config("require_order", "prefix=-");
|
| 69 |
|
|
GetOptions("h","help"
|
| 70 |
|
|
) || die "(use '$program_name -h' for help)";
|
| 71 |
|
|
|
| 72 |
|
|
|
| 73 |
|
|
|
| 74 |
|
|
##############################################################################
|
| 75 |
|
|
## Help option
|
| 76 |
|
|
##############################################################################
|
| 77 |
|
|
if ( $opt_h or $opt_help )
|
| 78 |
|
|
{ print "\n gen_instance_roots \n";
|
| 79 |
|
|
exit 1;
|
| 80 |
|
|
}
|
| 81 |
|
|
|
| 82 |
|
|
|
| 83 |
|
|
|
| 84 |
|
|
#############################################################################
|
| 85 |
|
|
##
|
| 86 |
|
|
##
|
| 87 |
|
|
#############################################################################
|
| 88 |
|
|
|
| 89 |
|
|
$home = cwd();
|
| 90 |
|
|
@gen_root_cmds = ();
|
| 91 |
|
|
|
| 92 |
|
|
$design_db_file = yp::lib::get_design_db_file;
|
| 93 |
|
|
my $design_db = new BerkeleyDB::Hash( -Filename => "$design_db_file", -Flags => DB_CREATE ) or die "Cannot open $design_db_file: $!";
|
| 94 |
|
|
|
| 95 |
|
|
my $key;
|
| 96 |
|
|
my $value;
|
| 97 |
|
|
|
| 98 |
|
|
my $cursor = $design_db ->db_cursor() ;
|
| 99 |
|
|
while ($cursor->c_get($key, $value, DB_NEXT) == 0)
|
| 100 |
|
|
{
|
| 101 |
|
|
|
| 102 |
|
|
$_ = $key;
|
| 103 |
|
|
if(/instance_/)
|
| 104 |
|
|
{
|
| 105 |
|
|
|
| 106 |
|
|
push @gen_root_cmds, $value;
|
| 107 |
|
|
}
|
| 108 |
|
|
}
|
| 109 |
|
|
my $status = $cursor->c_close() ;
|
| 110 |
|
|
|
| 111 |
|
|
$design_db->db_close();
|
| 112 |
|
|
|
| 113 |
|
|
@gen_root_cmds = sys::lib::trim_sort(@gen_root_cmds);
|
| 114 |
|
|
|
| 115 |
|
|
foreach my $cmd (@gen_root_cmds)
|
| 116 |
|
|
{
|
| 117 |
|
|
( ${ven},${lib},${cmp},${ver},${config}) = split( /\:/ , $cmd);
|
| 118 |
|
|
|
| 119 |
|
|
$cmd ="./tools/verilog/gen_root -vendor ${ven} -library ${lib} -component ${cmp} -version ${ver} -name ${config} -configuration ${config} \n";
|
| 120 |
|
|
print "$cmd";
|
| 121 |
|
|
if(system($cmd)){}
|
| 122 |
|
|
}
|
| 123 |
|
|
|
| 124 |
|
|
|
| 125 |
|
|
1
|