This file is indexed.

/usr/bin/a2lef is in alliance 5.1.1-1.1build1.

This file is owned by root:root, with mode 0o755.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
#!/bin/sh
#
# $Id: a2lef.sh,v 1.5 2003/05/19 16:16:41 jpc Exp $
#
# /------------------------------------------------------------------\
# |                                                                  |
# |        A l l i a n c e   C A D   S y s t e m                     |
# |  S i l i c o n   E n s e m b l e / A l l i a n c e               |
# |                                                                  |
# |  Author    :                      Jean-Paul CHAPUT               |
# |  E-mail    :           alliance-users@asim.lip6.fr               |
# | ================================================================ |
# |  Script    :         "./a2LEF.sh"                                |
# | **************************************************************** |
# |  U p d a t e s                                                   |
# |                                                                  |
# \------------------------------------------------------------------/
#


# --------------------------------------------------------------------
# Constants definitions.

                VL=0
          techFile=""
           lLibDir=""
           lefFile=""
       sx2lef_args=""
          cellName=""


# /------------------------------------------------------------------\
# |                                                                  |
# |                      Functions Definitions                       |
# |                                                                  |
# \------------------------------------------------------------------/
#
# --------------------------------------------------------------------
#  Function : "vecho()".

 vecho()
 {
   if [ $1 -le $VL ]; then
     if [ "$2" = "-n" ]; then
       printf "$3"
     else
       echo   "$2"
     fi
   fi
 }


# --------------------------------------------------------------------
# Function : "title()".

 title()
 {
   if [ $VL -ge 1 ]; then
     echo ""
     alcbanner "a2LEF" "V.RR" "Alliance Library to LEF converter" "2000"
     echo ""
   fi
 }


# --------------------------------------------------------------------
# Function : `print_usage()'.

 print_usage()
 {
   echo ""
   echo ""
   echo "Usage: a2LEF.sh [--verbose] [--very-verbose] [--help]              \\"
   echo "                [--allow-offgrid] [--fake-power] [--no-split-term] \\"
   echo "                <--techno <tech_file> >                            \\"
   echo "                <--library <lib_dir> [--library <lib_dir>]>        \\"
   echo "                <--lef <lef_file> >                                \\"
   echo "                <--cell <cell_name> >"
   echo "       a2LEF.sh [-vVhop] <-t <tech_file> >                         \\"
   echo "                         <-l <lib_dir> [-l <lib_dir>]>             \\"
   echo "                         <-L <lef_file> >                          \\"
   echo "                         <-c <cell_name> > "
   echo ""
   echo "Options:"
   echo "    o [--help|-h]                : print this help."
   echo "    o [--verbose|-v]             : be verbose."
   echo "    o [--very-verbose|-V]        : be very verbose :-)."
   echo "    o [--allow-offgrid|-o]       : allow terminals to be offgrid."
   echo "    o [--no-split-term|-T]       : do not split terminals segments."
   echo "    o [--fake-power|-p]          : do not attempt to generate"
   echo "        PORT geometries for power pins."
   echo "    o <--techno|-t <tech_file> > : location of the LEF techno header."
   echo "    o <--library|-l <lib_dir> >  : Alliance library directory."
   echo "    o <--lef|-L <lef_file> >     : output LEF file."
   echo "    o <--cell|-c <cell_name> >   : process a single (macro) cell."
   echo ""
   echo ""
 }


# --------------------------------------------------------------------
# Function : `setTechno()'.

 setTechno()
 {
   aTechFile="$1"
        aLEF="$2"

   rm -f $aLEF > /dev/null 2>&1
   cp $aTechFile $aLEF
 }


# --------------------------------------------------------------------
# Function : `buildLib()'.

 buildLib()
 {
   aLibDir="$1"
      aLEF="$2"

   if [ ! -d $aLibDir ]; then
     echo "a2LEF:error: Library \"$aLibDir\" doesn't exist."
     exit 1
   fi


   MBK_CATA_LIB="$aLibDir"; export MBK_CATA_LIB


   lCellAp=`(cd $aLibDir; \ls *.vbe)`

   if [ "$lCellAp" = "" ]; then
     echo "a2LEF:error: Library \"$aLibDir\" is empty."
     exit 1
   fi


   libName="`echo $aLibDir | sed 's,.*/,,'`"
   vecho 1 ""
   vecho 1 "  o  Processing library \"$libName\"."


     success="$libName.success"
      failed="$libName.failed"
         log="$libName.log"
    failedNB=0
   successNB=0

   rm -f $success $failed $log > /dev/null 2>&1

   for cellAp in $lCellAp; do

     cell=`echo $cellAp | sed 's,\.vbe$,,'`
     vecho 2 -n "     - \"$cell\"... "

     case $cell in
       *_sp) pxlib2lef -V $cell              >> $log 2>&1; RV=$?;;
          *) sxlib2lef -V $sx2lef_args $cell >> $log 2>&1; RV=$?;;
     esac
     if [ $RV -ne 0 ]; then

       failedNB=`expr $failedNB + 1`
       echo "$cell" >> $failed

       vecho 2 "KO."

     else

       echo  ""         >> $aLEF
       cat    $cell.lef >> $aLEF
       rm  -f $cell.lef

       successNB=`expr $successNB + 1`
       echo "$cell"    >> $success

       vecho 2 "OK."

     fi

   done


   vecho 1 "  o  $successNB successful cells."


   if [ $failedNB -gt 0 ]; then

     echo ""
     echo "a2LEF:error:"
     echo "  $failedNB failed cells in library \"$libName\"."
     echo "  Please read \"$log\" for detailed explanations."
     exit 1

   fi
 }


# --------------------------------------------------------------------
# Function : `openLib()'.

 openLib()
 {
   aLEF="$1"

   echo ""                             >> $aLEF
   echo "VERSION             5.2 ;"    >> $aLEF
   echo "NAMESCASESENSITIVE  ON ;"     >> $aLEF
   echo "BUSBITCHARS         \"()\" ;" >> $aLEF
   echo "DIVIDERCHAR         \".\" ;"  >> $aLEF
   echo ""                             >> $aLEF
 }


# --------------------------------------------------------------------
# Function : `closeLib()'.

 closeLib()
 {
   aLEF="$1"

   echo ""            >> $aLEF
   echo "END LIBRARY" >> $aLEF
 }


# /------------------------------------------------------------------\
# |                                                                  |
# |                  Main Part of the Shell Script                   |
# |                                                                  |
# \------------------------------------------------------------------/
#
# --------------------------------------------------------------------
# Process the command line.

 while [ $# -gt 0 ]; do

   case $1 in

     --help)          print_usage; exit 0;;
     --verbose)       VL=1;;
     --very-verbose)  VL=2;;
     --allow-offgrid) sx2lef_args="$sx2lef_args -o";;
     --fake-power)    sx2lef_args="$sx2lef_args -p";;
     --no-split-term) sx2lef_args="$sx2lef_args -t";;

     --techno)
             if [ $# -ge 2 ]; then
               techFile="$2"
               shift
             else
               echo "a2LEF.sh:error: Missing <tech_file> argument."
               print_usage; exit 1
             fi;;

     --library)
             if [ $# -ge 2 ]; then
               lLibDir="$lLibDir $2"
               shift
             else
               echo "a2LEF.sh:error: Missing <libDir> argument."
               print_usage; exit 1
             fi
             if [ ! -z "$cellName" ]; then
               echo -n "a2LEF.sh:error: --library and --cell options are"
               echo    " mutually exclusive."
               print_usage; exit 1
             fi;;

     --lef)
             if [ $# -ge 2 ]; then
               lefFile="$2"
               shift
             else
               echo "a2LEF.sh:error: Missing <lef_file> argument."
               print_usage; exit 1
             fi;;

     --cell)
             if [ $# -ge 2 ]; then
               cellName="$2"
               shift
             else
               echo "a2LEF.sh:error: Missing <cell_name> argument."
               print_usage; exit 1
             fi
             if [ ! -z "$lLibDir" ]; then
               echo -n "a2LEF.sh:error: --library and --cell options are"
               echo    " mutually exclusive."
               print_usage; exit 1
             fi;;

     --*) echo "a2LEF.sh:error: Invalid argument \`$1'."
          print_usage; exit 1;;

     -*) lSwitch="$1"; NB=2; CH=`echo $lSwitch | cut -c$NB`

         while [ "$CH" != "" ]; do

           case $CH in

             h) print_usage; exit 0;;
             v) VL=1;;
             V) VL=2;;
             o) sx2lef_args="$sx2lef_args -o";;
             p) sx2lef_args="$sx2lef_args -p";;
             T) sx2lef_args="$sx2lef_args -t";;

             t) if [ $# -ge 2 ]; then
                  techFile="$2"
                  shift
                else
                  echo "a2LEF.sh:error: Missing <tech_file> argument."
                  print_usage; exit 1
                fi;;

             l) if [ $# -ge 2 ]; then
                  lLibDir="$lLibDir $2"
                  shift
                else
                  echo "a2LEF.sh:error: Missing <libDir> argument."
                  print_usage; exit 1
                fi
                if [ ! -z "$cellName" ]; then
                  echo -n "a2LEF.sh:error: --library and --cell options are"
                  echo    " mutually exclusive."
                  print_usage; exit 1
                fi;;

             L)
                if [ $# -ge 2 ]; then
                  lefFile="$2"
                  shift
                else
                  echo "a2LEF.sh:error: Missing <lef_file> argument."
                  print_usage; exit 1
                fi;;

             c)
                if [ $# -ge 2 ]; then
                  cellName="$2"
                  shift
                else
                  echo "a2LEF.sh:error: Missing <cell_name> argument."
                  print_usage; exit 1
                fi
                if [ ! -z "$lLibDir" ]; then
                  echo -n "a2LEF.sh:error: --library and --cell options are"
                  echo    " mutually exclusive."
                  print_usage; exit 1
                fi;;

             *) echo "a2LEF:error: Invalid option \`$CH'."
                print_usage; exit 1;;

           esac

           NB=`expr $NB + 1`
           CH=`echo $lSwitch | cut -c$NB`

         done;;

     *) echo "a2LEF:error: Invalid option \`$1'."
        print_usage; exit 1;;

   esac

   shift

 done


 title
  

 MBK_IN_PH=ap  ; export MBK_IN_PH
 MBK_IN_LO=vst ; export MBK_IN_LO
 MBK_OUT_PH=ap ; export MBK_OUT_PH
 MBK_OUT_LO=vst; export MBK_OUT_LO
  

 if [ "$techFile" != "" ]; then
   if [ ! -f $techFile ]; then
     echo "a2LEF:error: Technological file \"$techFile\" doesn't exist."
     exit 1
   fi
   setTechno $techFile $lefFile
 fi


 if [ -z "$cellName" ]; then
   if [ "$lLibDir" = "" ]; then
     echo "a2LEF:error: Missing mandatory argument <--library <lib_dir> >."
     print_usage; exit 1
   fi
  
   if [ "$lefFile" = "" ]; then
     echo "a2LEF:error: Missing mandatory argument <--lef <lef_file> >."
     print_usage; exit 1
   fi

  # ------------------------------------------------------------------
  # Library Generation.
  
   rm -f $lefFile > /dev/null 2>&1

   openLib $lefFile
  
   for libDir in $lLibDir; do
     buildLib $libDir $lefFile
   done
  
   closeLib $lefFile
 else
   if [ ! -f ${cellName}.ap ]; then
     echo "a2LEF:error: Can't find layout file \"${cellName}.ap\"."
     print_usage; exit 1
   fi

   if [ ! -f ${cellName}.vbe -a ! -f ${cellName}.vst ]; then
     echo "a2LEF:error: Can't find netlist/behavioral file :"
     echo "             \"${cellName}.vst or \"${cellName}.vbe\"."
     print_usage; exit 1
   fi

   log="$cellName.log"
   rm -f $log

   vecho 2 -n "     - \"$cellName\"... "
   sxlib2lef -V $sx2lef_args $cellName >> $log 2>&1; RV=$?

   if [ $RV -ne 0 ]; then
     vecho 2 "KO."
   else
     vecho 2 "OK."
   fi

   closeLib ${cellName}.lef
 fi



# --------------------------------------------------------------------
# That's all Folks.

 vecho 2 ""
 vecho 2 ""
 exit 0