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
#!/bin/sh
#
#
# Copyright (c) 2013-2024 by Altair Engineering, Inc.
# Author: Pascal Bolzhauser
#
# Script to read a set of Liberty files and merge the binlib created for
# each input Liberty file into one merged binlib.
#

##
# This is the list of input Liberty files.
#
LIBERTY_FILES="file1.lib file2.lib ... fileN.lib"

##
# Temporary space.
#
TMP_DIR=/tmp

##
# File to store the list of Liberty file and the corresponding binlib.
#
LIB_FILE_LIST=$TMP_DIR/fileList.txt

##
# Name of the merged binlib created by this script.
#
BINLIB=mergedLib.zdb

##
# Specify name (and path if not in the search path) to the needed binaries.
#
LIBERTY2ZDB=liberty2zdb
GATEVISION=gatevisionpro
ZDBSH=zdbsh

##
# Options for liberty2zdb
#
LIBERTY2ZDB_OPTIONS="-nologo -info error"

##
# The use of the 'zdb shell' is optional. This can also be done by GateVision.
#
USE_ZDBSH=0

# ---- end of configuration section ----

##
# Loop over all input Liberty files, add them to the file with the list of
# input files and compile them using liberty2zdb.
#
rm -f $LIB_FILE_LIST
for f in $LIBERTY_FILES
do
    binlib=$TMP_DIR/$(basename "$f" .lib).zdb
    echo "\"$binlib\"" >> $LIB_FILE_LIST
    eval "$LIBERTY2ZDB $LIBERTY2ZDB_OPTIONS -o $binlib $f"
done


##
# Use either GateVision or the zdb shell to merge all binlibs into one.
#
if [ "$USE_ZDBSH" -eq 0 ]
then
    $GATEVISION -userware3 mergeBinlib.tcl $LIB_FILE_LIST $BINLIB
else
    $ZDBSH mergeBinlib.tcl $LIB_FILE_LIST $BINLIB
fi


##
# Clean-up tmp files.
#
for f in $LIBERTY_FILES
do
    rm -f "$TMP_DIR/$(basename "$f" .lib).zdb"
done
rm -f "$LIB_FILE_LIST"


##
# Now start GateVision with the merged binlib and the design data.
#
#$GATEVISION -binlib $BINLIB <OPTIONS> <DESIGN_FILES>