OpenCores
URL https://opencores.org/ocsvn/socgen/socgen/trunk

Subversion Repositories socgen

[/] [socgen/] [trunk/] [tools/] [synthesys/] [build_fpga_master] - Blame information for rev 133

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 131 jt_eaton
eval 'exec `which perl` -S $0 ${1+"$@"}'
2
   if 0;
3
 
4
#/**********************************************************************/
5
#/*                                                                    */
6
#/*             -------                                                */
7
#/*            /   SOC  \                                              */
8
#/*           /    GEN   \                                             */
9
#/*          /    TOOL    \                                            */
10
#/*          ==============                                            */
11
#/*          |            |                                            */
12
#/*          |____________|                                            */
13
#/*                                                                    */
14
#/*                                                                    */
15
#/*                                                                    */
16
#/*  Author(s):                                                        */
17
#/*      - John Eaton, jt_eaton@opencores.org                          */
18
#/*                                                                    */
19
#/**********************************************************************/
20
#/*                                                                    */
21
#/*    Copyright (C) <2010-2013>                */
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 XML::LibXML;
55
use lib './tools';
56
use sys::lib;
57
use yp::lib;
58 133 jt_eaton
use Parallel::ForkManager;
59 131 jt_eaton
 
60
$OUTPUT_AUTOFLUSH = 1; # set autoflush of stdout to TRUE.
61
 
62
 
63
############################################################################
64
### Process the options
65
############################################################################
66
Getopt::Long::config("require_order", "prefix=-");
67
GetOptions("h","help",
68
) || die "(use '$program_name -h' for help)";
69
 
70
 
71
 
72
 
73
##############################################################################
74
## Help option
75
##############################################################################
76
if ( $opt_h or $opt_help  )
77
  { print "\n build_master";
78
    print "\n";
79
    exit 1;
80
  }
81
 
82
 
83
my $parser = XML::LibXML->new();
84
 
85
 
86
my      @kids          = (  );
87
my      @filelist      = (  );
88
 
89
 
90
 
91
#/**********************************************************************/
92
#/*  Process each library by finding any ip-xact file in any component */
93
#/*                                                                    */
94
#/*  Each ip-xact file is parsed and it's filename and the names of any*/
95
#/*  modules that it uses are saved.                                   */
96
#/*                                                                    */
97
#/*                                                                    */
98
#/**********************************************************************/
99
 
100
my $home = cwd();
101
 
102
my $prefix   = yp::lib::get_workspace();
103
   $prefix   = "/${prefix}";
104
 
105
my @vendors = yp::lib::find_vendors();
106
 
107
foreach my $vendor (@vendors)
108
 {
109
 my $vendor_status    =  yp::lib::get_vendor_status($vendor);
110
 if($vendor_status eq "active")
111
   {
112
   my @libraries = yp::lib::find_libraries($vendor);
113
   foreach my $library (@libraries)
114
     {
115
     my $library_status   =  yp::lib::get_library_status($vendor,$library);
116
     if($library_status eq "active")
117
         {
118
         run_vendor_library ( $vendor ,  $library)
119
         }
120
     }
121
   }
122
 }
123
 
124
 
125
 
126
 
127
sub run_vendor_library
128
   {
129
   my @params     = @_;
130
   my $library    = pop(@params);
131
   my $vendor     = pop(@params);
132 133 jt_eaton
   my $prefix          = yp::lib::get_workspace();
133
   my $number_of_cpus  = yp::lib::get_number_of_cpus();
134
 
135
   my @components   = yp::lib::find_components($vendor,$library);
136
 
137
   foreach my $component (@components)
138
      {
139
      my $socgen_filename     = yp::lib::find_componentConfiguration($vendor,$library,$component);
140
 
141
      if($socgen_filename)
142
        {
143
        my $socgen_file     = $parser->parse_file($socgen_filename);
144
        my $syn_library_path ;
145
        my $lib_comp_sep    = yp::lib::find_lib_comp_sep($vendor,$library,$component);
146
        my $syn_comp_path   = $socgen_file->findnodes("//socgen:componentConfiguration/socgen:syn/socgen:comp_path/text()")->to_literal;
147
 
148
        if ($syn_comp_path)
149
           {
150
           $syn_library_path ="${lib_comp_sep}${syn_comp_path}";
151
           }
152
        else
153
           {
154
           $syn_library_path = $socgen_file->findnodes("//socgen:componentConfiguration/socgen:syn/socgen:library_path/text()")->to_literal;
155
           }
156
 
157
      #   print "XXXX-   $vendor $library $component  $syn_library_path   \n";
158
 
159
        #/*********************************************************************************************/
160
        #/   files for synthesys                                                                      */
161
        #/                                                                                            */
162
        #/*********************************************************************************************/
163
        my $cmd;
164
        my @cmds =();
165
        my $manager = new Parallel::ForkManager( $number_of_cpus );
166
 
167
 
168
        foreach  my   $i_name ($socgen_file->findnodes("//socgen:componentConfiguration/socgen:syn/socgen:ise/socgen:chip/socgen:variant"))
169
           {
170
           my($chip_variant)     = $i_name ->findnodes('./text()')->to_literal ;
171
           my($chip_part)        = $i_name ->findnodes('../socgen:target/socgen:part/text()')->to_literal ;
172
           print "  FPGAs     $chip_variant       $chip_part    \n";
173
           $cmd ="./tools/synthesys/run_ise   $vendor $library $syn_library_path  $chip_variant    $chip_part       \n";
174
           push @cmds,$cmd;
175
           }
176
 
177
        foreach $cmd (@cmds)
178
           {
179
           $manager->start and next;
180
           system($cmd);
181
           $manager->finish;
182
           }
183
 
184
        #   $manager->wait_all_children;
185
        print "build_fpgas COMPLETE \n";
186
 
187
        }
188
      }
189 131 jt_eaton
   }
190 133 jt_eaton
 
191
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.