-
Notifications
You must be signed in to change notification settings - Fork 148
/
set_env.sh
executable file
·61 lines (51 loc) · 1.87 KB
/
set_env.sh
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
#!/bin/bash
# source this file
echo "Setting up lowRISC/RISC-V and SoC Debug SoC environment..."
echo "Make sure you source this script at the top of lowrisc-chip."
echo
# Variables for lowRISC/RISC-V
if [ -z $TOP ] || [ ! -d $TOP ]; then
echo "\$TOP is not defined or does not point to a directory. Set \$TOP to the top of lowrisc-chip which is the current directory."
export TOP=$PWD
fi
if [ -z $RISCV ]; then
echo "\$RISCV is not defined. Set \$TOP/riscv to the RISC-V toolchain installation target (\$RISCV)."
export RISCV=$TOP/riscv
fi
export PATH=$PATH:$RISCV/bin
# Variables for Open SoC Debug
if [ -z $OSD_ROOT ]; then
echo "\$OSD_ROOT is not defined."
echo "Set \$TOP/tools to the Open SoC Debug installation target (\$OSD_ROOT)."
export OSD_ROOT=$TOP/tools
fi
echo "Add opensocdebug to \$PYTHONPATH"
export PYTHONPATH=$OSD_ROOT/lib/python2.7/site-packages:$PYTHONPATH
if [ -z $LD_LIBRARY_PATH ]; then
export LD_LIBRARY_PATH=$OSD_ROOT/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$RISCV/lib
else
export LD_LIBRARY_PATH=$OSD_ROOT/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$RISCV/lib
fi
export PATH=$OSD_ROOT/bin:$PATH
if [ -z $PKG_CONFIG_PATH ]; then
export PKG_CONFIG_PATH=$OSD_ROOT/lib/pkgconfig
else
export PKG_CONFIG_PATH=$OSD_ROOT/lib/pkgconfig:$PKG_CONFIG_PATH
fi
# choose the FPGA board (Nexys4-DDR in default)
if [ -z $FPGA_BOARD ]; then
echo "\$FPGA_BOARD is not defined. Set the target FPGA board to nexys4_ddr."
export FPGA_BOARD=nexys4_ddr
fi
echo "============================"
echo " export TOP=$TOP"
echo " export RISCV=$RISCV"
echo " export OSD_ROOT=$OSD_ROOT"
echo " export PYTHONPATH=$PYTHONPATH"
echo " export PATH=$PATH"
echo " export LD_LIBRARY_PATH=$LD_LIBRARY_PATH"
echo " export PKG_CONFIG_PATH=$PKG_CONFIG_PATH"
echo " export FPGA_BOARD=$FPGA_BOARD"
echo "============================"