-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathxtwi
executable file
·84 lines (76 loc) · 2.25 KB
/
xtwi
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
#!/bin/bash
# $Id: xtwi 1172 2019-06-29 07:27:24Z mueller $
# SPDX-License-Identifier: GPL-3.0-or-later
# Copyright 2013-2019 by Walter F.J. Mueller <[email protected]>
#
# Xilinx Tool Wrapper script for ISE:
# define XTWI_PATH
# usage xwti <ise command>
#
# Revision History:
# Date Rev Version Comment
# 2017-04-01 862 1.2.1 add usr_local/bin and bin_xilinx_wrapper to PATH
# 2016-08-28 804 1.2 BUGFIX: add ":." to PATH even under BARE_PATH
# 2016-02-21 735 1.1 use BARE_PATH ect to provide clean environment
# 2013-10-12 539 1.0 Initial version
#
# Note: For Xilinx ISE installations with an install path <ipath> holds
# <ipath>/ISE_DS dir with settings(32|64).sh
# <ipath>/ISE_DS/ISE XILINX env var will point here
#
# store arg list on vars (will be dropped later to source scripts)
arglist_val=$@
arglist_num=$#
#
# check whether ISE already setup ($XILINX defined)
if [ -z "$XILINX" ]
then
# check whether $XTWI_PATH defined
if [ -z "$XTWI_PATH" ]
then
echo "XTWI_PATH not defined"
exit 1
fi
# provide clean environment when BARE_PATH ect defined
# add prepend $HOME/usr_local/bin to path
# add append $RETROBASE/tools/bin and '.' to path
# '.' is needed to start tb's, which usually are in cwd
if [ -n "$BARE_PATH" ]
then
export PATH=$HOME/usr_local/bin:$BARE_PATH:$RETROBASE/tools/bin:.
unset LD_LIBRARY_PATH
if [ -n "$BARE_LD_LIBRARY_PATH" ]
then
export LD_LIBRARY_PATH=$BARE_LD_LIBRARY_PATH
fi
fi
# add bin_xilinx_wrapper to path (for firefox ect interceptors)
export PATH=$RETROBASE/tools/bin_xilinx_wrapper:$PATH
# check whether 32 or 64 bit system (uname -m gives 'i686' or 'x86_64')
if [ `uname -m` = "x86_64" ]
then
settings_filename=$XTWI_PATH/ISE_DS/settings64.sh
else
settings_filename=$XTWI_PATH/ISE_DS/settings32.sh
fi
if [ ! -e "$settings_filename" ]
then
echo "can't locate init script '$settings_filename'"
exit 1
fi
# drop arg list, suppress output
set --
. $settings_filename > /dev/null
# check that XILINX defined
if [ -z "$XILINX" ]
then
echo "Failed to setup XILINX"
exit 1
fi
else
echo "XILINX already defined"
fi
if [ $arglist_num != 0 ]
then
exec $arglist_val
fi