-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathxise_ghdl_unisim
executable file
·99 lines (97 loc) · 2.5 KB
/
xise_ghdl_unisim
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
#!/bin/bash
# $Id: xise_ghdl_unisim 1172 2019-06-29 07:27:24Z mueller $
# SPDX-License-Identifier: GPL-3.0-or-later
# Copyright 2007-2019 by Walter F.J. Mueller <[email protected]>
#
# Revision History:
# Date Rev Vers Comment
# 2016-07-02 782 1.3.1 add ghdlopts as 1st option; default is -O2
# 2015-02-03 642 1.3 remove ISE 10 legacy support; add unimacro support
# 2015-01-29 639 1.2 rename from xilinx_*; use XTWI_PATH rather XILINX
# 2009-11-08 248 1.1 adopt to ISE 11.1, use VITAL models from ./primitive
# 2007-10-26 92 1.0 Initial version
#
ghdlopts=${1:--O2 -g}
#
if [ -z "$XTWI_PATH" ]
then
echo "XTWI_PATH not defined"
exit 1
fi
if [ ! -d "$XTWI_PATH/ISE_DS/ISE" ]
then
echo "$XTWI_PATH/ISE_DS/ISE not existing"
exit 1
fi
#
ise_path=$XTWI_PATH/ISE_DS/ISE
#
cd $ise_path
echo "============================================================"
echo "* Build ghdl UNISIM lib for $ise_path"
echo "============================================================"
#
if [ ! -d ghdl ]
then
mkdir ghdl
fi
cd ghdl
#
if [ ! -d unisim ]
then
mkdir unisim
fi
cd unisim
#
cp $ise_path/vhdl/src/unisims/unisim_VCOMP.vhd .
cp $ise_path/vhdl/src/unisims/unisim_VPKG.vhd .
#
if [ ! -d primitive ]
then
mkdir primitive
fi
pushd primitive
#
cp -p $ise_path/vhdl/src/unisims/primitive/*.vhd .
cp -p $ise_path/vhdl/src/unisims/primitive/vhdl_analyze_order .
#
xilinx_vhdl_memcolltype_fix
popd
echo "# ghdl ... unisim_VCOMP.vhd"
ghdl -a --ieee=synopsys --work=unisim $ghdlopts unisim_VCOMP.vhd
echo "# ghdl ... unisim_VPKG.vhd"
ghdl -a --ieee=synopsys --work=unisim $ghdlopts unisim_VPKG.vhd
for file in `cat primitive/vhdl_analyze_order`
do
echo "# ghdl ... primitive/$file"
ghdl -a -fexplicit --ieee=synopsys --work=unisim $ghdlopts \
--no-vital-checks primitive/$file 2>&1 |\
tee primitive/$file.ghdl.log
done
#
echo "--- scan for compilation errors:"
find primitive -name "*.ghdl.log" | xargs grep error
#
echo "============================================================"
echo "* Build ghdl UNIMACRO lib for $XTWI_PATH/ISE_DS/ISE"
echo "============================================================"
#
cd $ise_path/ghdl
if [ ! -d unimacro ]
then
mkdir unimacro
fi
#
cd unimacro
cp $ise_path/vhdl/src/unimacro/*.vhd .
#
for file in *.vhd
do
echo "# ghdl ... $file"
ghdl -a -P../unisim -fexplicit --ieee=synopsys --work=unimacro $ghdlopts \
--no-vital-checks $file 2>&1 | tee $file.ghdl.log
done
#
echo "--- scan for compilation errors:"
find . -name "*.ghdl.log" | xargs grep error
#