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

Subversion Repositories socgen

[/] [socgen/] [trunk/] [tools/] [fizzim/] [gen_fizzim] - Blame information for rev 128

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

Line No. Rev Author Line
1 119 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-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
############################################################################
49
# General PERL config
50
############################################################################
51
use Getopt::Long;
52
use English;
53
use File::Basename;
54
use Cwd;
55
use XML::LibXML;
56
use lib './tools';
57
use sys::lib;
58
use yp::lib;
59
 
60
 
61
$OUTPUT_AUTOFLUSH = 1; # set autoflush of stdout to TRUE.
62
 
63
 
64
############################################################################
65
### Process the options
66
############################################################################
67
 
68
Getopt::Long::config("require_order", "prefix=-");
69
GetOptions("h","help",
70 128 jt_eaton
           "envidentifier=s" => \$envidentifier,
71 119 jt_eaton
           "prefix=s" => \$prefix,
72
           "vendor=s" => \$vendor,
73
           "project=s" => \$project,
74
           "version=s" => \$version,
75
           "component=s" => \$component,
76
           "encoding=s" => \$encoding,
77
           "terse"
78
) || die "(use '$program_name -h' for help)";
79
 
80
 
81
##############################################################################
82
## Help option
83
##############################################################################
84
if ( $opt_h  or $opt_help  )
85
   {
86
   print "\n gen_fizzim  -work_site /work/ -project project -component component  -version version -encoding [onehot] -terse source_file destination_file";
87
   print "\n";
88
   exit 1;
89
   }
90
 
91
 
92
##############################################################################
93
##
94
##############################################################################
95
 
96
 
97
 
98
$home = cwd();
99
 
100
my $cmd;
101
 
102
 
103
my $source             = $ARGV[0];
104
my $destination        = $ARGV[1];
105
 
106
 
107
 
108 127 jt_eaton
my $lib_comp_sep    = yp::lib::find_lib_comp_sep($vendor,$project,$component);
109 119 jt_eaton
 
110
 
111
 
112
 
113
unless ($encoding) {$encoding = "twohot";}
114
my $variant;
115
 if($version)       {$variant   = "${component}_${version}";}
116
 else               {$variant   = "${component}";}
117
 
118
#############################################################################
119
##
120
## wrapper for fizzim script
121
##
122
#############################################################################
123
 
124
  $cmd = "${home}${prefix}/${vendor}__${project}/bin/fizzim";
125
  if   ($encoding  )  {$cmd =  "$cmd -encoding $encoding";}
126
  if   ($opt_terse )  {$cmd =  "$cmd -terse";}
127
  $cmd =  "$cmd <${home}${prefix}/${vendor}__${project}${lib_comp_sep}/${component}/${source}";
128
  $cmd =  "$cmd >${home}${prefix}/${vendor}__${project}${lib_comp_sep}/${component}/${destination}";
129
  $cmd =  "${cmd}\n";
130
  if (system($cmd)) {
131
  print "build_fizzim ${vendor}__${project}${lib_comp_sep}/${component}/${destination}   finished\n";
132
 }
133
1
134
 
135
 
136
 
137
 
138
 
139
 
140
 
141
 
142
 
143
 
144
 
145
 
146
 
147
 
148
 
149
 
150
 
151
 
152
 

powered by: WebSVN 2.1.0

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