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

Subversion Repositories socgen

[/] [socgen/] [trunk/] [tools/] [sys/] [workspace] - Blame information for rev 131

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

Line No. Rev Author Line
1 94 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 99 jt_eaton
#/*    Copyright (C) <2010-2011>                */
22 94 jt_eaton
#/*                                                                    */
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 117 jt_eaton
use Getopt::Long;
47
use English;
48
use File::Basename;
49 94 jt_eaton
use Cwd;
50
use XML::LibXML;
51 117 jt_eaton
use lib './tools';
52
use sys::lib;
53
use yp::lib;
54 94 jt_eaton
 
55 117 jt_eaton
$OUTPUT_AUTOFLUSH = 1; # set autoflush of stdout to TRUE.
56 94 jt_eaton
 
57
 
58 117 jt_eaton
 
59 119 jt_eaton
 
60 94 jt_eaton
#/*********************************************************************************************/
61
#/ We never generate files into a RCS database.                                               */
62
#/                                                                                            */
63
#/ A special work area is created that is the image of the database using symbolic links      */
64
#/                                                                                            */
65
#/*********************************************************************************************/
66
 
67 119 jt_eaton
my $home    = cwd();
68 100 jt_eaton
 
69
 
70
 
71
 
72 131 jt_eaton
my $prefix   =  yp::lib::get_workspace();
73
   $prefix   =  "/${prefix}";
74
 
75
my $path = "${home}${prefix}";
76
 
77
mkdir $path,0755          unless( -e $path );
78
 
79
 
80
my    $vendor     = $ARGV[0];
81
my    $library    = $ARGV[1];
82
 
83
chomp($vendor);
84
chomp($library);
85
 
86
 
87
$_ = $vendor;
88
 
89
if(/(\S+)\/(\S+)/)
90 119 jt_eaton
     {
91 131 jt_eaton
     $vendor         = $1;
92
     $library        = $2;
93 119 jt_eaton
     }
94 100 jt_eaton
 
95 94 jt_eaton
 
96
 
97 131 jt_eaton
my $repo  = yp::lib::find_library_repo($vendor,$library);
98
my $root  = ".${repo}/${vendor}/${library}/";
99
 
100
 
101 119 jt_eaton
unless ( -e $root )
102
     {
103 131 jt_eaton
     print "ERROR: Library   $vendor $library  does not exist \n";
104 119 jt_eaton
     exit(0);
105
     }
106 117 jt_eaton
 
107 118 jt_eaton
 
108
 
109 119 jt_eaton
 
110
 
111 100 jt_eaton
 
112
 
113 131 jt_eaton
 
114
 
115
$path    = "${home}${prefix}/${vendor}__${library}";
116 100 jt_eaton
mkdir $path,0755          unless( -e $path );
117
 
118 131 jt_eaton
my $vendor_status    =  yp::lib::get_vendor_status($vendor);
119
my $library_status   =  yp::lib::get_library_status($vendor,$library);
120 100 jt_eaton
 
121 94 jt_eaton
 
122 131 jt_eaton
print "Building Workspace ${prefix}/${vendor}__${library} from   .${repo}/${vendor}/${library}/  $vendor_status  $library_status      \n";
123 94 jt_eaton
 
124
 
125 119 jt_eaton
 
126 131 jt_eaton
 
127
$vendor_status   =  yp::lib::set_vendor_status($vendor,"active");
128
$vendor_status   =  yp::lib::get_vendor_status($vendor);
129
 
130
$library_status   =  yp::lib::set_library_status($vendor,$library,"active");
131
$library_status   =  yp::lib::get_library_status($vendor,$library);
132
 
133
 
134
print "Vendor $vendor_status  Library  $library_status        \n";
135
 
136
&link_sub( $root,$root, ".${prefix}/${vendor}__${library}" );
137
 
138
 
139 94 jt_eaton
#/*********************************************************************************************/
140
#/                                                                                            */
141 131 jt_eaton
#/ Each library is given access to the system tools by giving each of them a link to the      */
142 94 jt_eaton
#/ Master Makefiles in tools/bin                                                              */
143
#/                                                                                            */
144
#/                                                                                            */
145
#/*********************************************************************************************/
146
 
147
 
148
 
149 131 jt_eaton
if (system("chmod 755    ${home}/${repo}/${vendor}/${library}/bin/* \n"   )) {}
150 94 jt_eaton
 
151 100 jt_eaton
 
152 131 jt_eaton
symlink( "${home}/tools/bin/Makefile.root", "${home}${prefix}/${vendor}__${library}/bin/Makefile.root");
153
symlink( "${home}/tools/bin/Makefile",      "${home}${prefix}/${vendor}__${library}/bin/Makefile");
154 94 jt_eaton
 
155
 
156 96 jt_eaton
 
157 131 jt_eaton
my $path  = "${home}${prefix}/${vendor}__${library}/children";
158 119 jt_eaton
mkdir $path,0755          unless( -e $path );
159 96 jt_eaton
 
160 131 jt_eaton
my @components =       yp::lib::find_components($vendor,$library);
161 119 jt_eaton
foreach my $component (@components)
162
   {
163
   my $parser = XML::LibXML->new();
164 131 jt_eaton
   print " $vendor,$library,$component  \n";
165 94 jt_eaton
 
166 131 jt_eaton
 
167
   my $socgen_filename     = yp::lib::find_componentConfiguration($vendor,$library,$component);
168
   if($socgen_filename)
169
   {
170
 
171
   my $socgen_file     = $parser->parse_file(yp::lib::find_componentConfiguration($vendor,$library,$component));
172
 
173
 
174
 
175
 
176
   my @versions =       yp::lib::find_component_versions($vendor,$library,$component);
177
 
178 119 jt_eaton
   foreach $comp_version (@versions)
179
     {
180 131 jt_eaton
     $cmd ="./tools/sys/soc_link_child -prefix $prefix -vendor $vendor -library $library  -component $component -version $comp_version  \n";
181 119 jt_eaton
     if (system($cmd)) {}
182
     }
183 99 jt_eaton
 
184 131 jt_eaton
   print "Linking simulations for  $vendor  $library  $component      \n";
185 94 jt_eaton
 
186 130 jt_eaton
   foreach  my   $i_name ($socgen_file->findnodes("//socgen:sim/socgen:testbenches/socgen:testbench/socgen:version"))
187 119 jt_eaton
      {
188 94 jt_eaton
 
189 119 jt_eaton
      my($tb_version)  = $i_name ->findnodes('./text()')->to_literal ;
190 94 jt_eaton
 
191 131 jt_eaton
      $cmd ="./tools/sys/soc_link_child -prefix $prefix -vendor ${vendor}  -library $library  -component $component       -version $tb_version    \n";
192 119 jt_eaton
      if (system($cmd)) {}
193
      }
194 117 jt_eaton
 
195 119 jt_eaton
   #/*********************************************************************************************/
196
   #/   link chip files for synthesys                                                            */
197
   #/                                                                                            */
198
   #/                                                                                            */
199
   #/                                                                                            */
200
   #/                                                                                            */
201
   #/                                                                                            */
202
   #/*********************************************************************************************/
203
 
204 131 jt_eaton
   print "Linking synthesys targets for  $vendor  $library  $component      \n";
205
   my $lib_comp_sep    = yp::lib::find_lib_comp_sep($vendor,$library,$component);
206 117 jt_eaton
 
207 119 jt_eaton
 
208 131 jt_eaton
   foreach  my   $i_name ($socgen_file->findnodes("//socgen:syn/socgen:ise/socgen:chip/socgen:variant"))
209 119 jt_eaton
      {
210
      my($chip_name)  = $i_name ->findnodes('./text()')->to_literal ;
211
      my($chip_target)  = $i_name ->findnodes('../socgen:target/socgen:library/text()')->to_literal ;
212
      my($chip_part)  = $i_name ->findnodes('../socgen:target/socgen:part/text()')->to_literal ;
213 131 jt_eaton
      $outfile ="${home}${prefix}/${vendor}__${library}${lib_comp_sep}${component}/syn/ise/${chip_name}/Makefile";
214 119 jt_eaton
      open  MAKSYNFILE,">$outfile" or die "unable to open $outfile";
215 128 jt_eaton
      print MAKSYNFILE  "include ${home}/tools/bin/Makefile.root\n";
216 119 jt_eaton
      print MAKSYNFILE  "Part=${chip_part}\n";
217
      print MAKSYNFILE  "board=${chip_target}\n";
218
      print MAKSYNFILE  "Design=${chip_name}\n";
219 131 jt_eaton
      my $path  = "${home}${prefix}/${vendor}__${library}${lib_comp_sep}${component}/syn/ise/${chip_name}/target";
220 119 jt_eaton
      mkdir $path,0755          unless( -e $path );
221 131 jt_eaton
      &sys::lib::link_dir( "${home}/tools/synthesys/targets/ip/${chip_target}", "${home}${prefix}/${vendor}__${library}${lib_comp_sep}${component}/syn/ise/${chip_name}/target"  );
222 119 jt_eaton
      }
223
   }
224 131 jt_eaton
 
225
   }
226 119 jt_eaton
 
227 94 jt_eaton
 
228
 
229 118 jt_eaton
 
230
 
231 94 jt_eaton
#/*********************************************************************************************/
232 117 jt_eaton
#/   recursively map directory information                                                    */
233 94 jt_eaton
#/                                                                                            */
234
#/                                                                                            */
235
#/                                                                                            */
236
#/                                                                                            */
237
#/                                                                                            */
238
#/*********************************************************************************************/
239
 
240
 
241
sub link_sub {
242
    my $root = shift;
243
    my $path = shift;
244
    my $dest = shift;
245
    return unless( -e $path );
246
 
247
    my $dest_path = $path;
248
      $dest_path =~ s/$root/$dest/;
249
 
250 119 jt_eaton
    if( -d $path )
251
      {
252
      mkdir $dest_path,0755;
253 94 jt_eaton
 
254 119 jt_eaton
      my @contents = (  );
255
      opendir( DIR, $path );
256
      while( my $item = readdir( DIR ))
257
           {
258
           next if( $item eq '.' or $item eq '..'   or $item eq '.svn'    );
259
           push( @contents, $item );
260
           }
261
      closedir( DIR );
262 94 jt_eaton
 
263 119 jt_eaton
      # recurse on items in the directory
264
      foreach my $item ( @contents )          { &link_sub($root, "$path/$item", $dest );}
265 94 jt_eaton
 
266
 
267 119 jt_eaton
      }
268
    else
269
      {
270
       symlink( "${home}/${path}", $dest_path);
271
      }
272 94 jt_eaton
}
273
 
274
 

powered by: WebSVN 2.1.0

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