Line 1... |
Line 1... |
#!/bin/bash
|
#!/bin/bash
|
# Author: Constantinos Xanthopoulos
|
# Author: Constantinos Xanthopoulos & Raul Fajardo
|
# This script install MinSOC tree
|
# This script install MinSOC tree
|
# under a specific directory.
|
# under a specific directory.
|
|
|
# ===== CONFIGURATIONS =====
|
# ===== CONFIGURATIONS =====
|
# ==========================
|
# ==========================
|
|
MINSOC_SVN_URL="http://opencores.org/ocsvn/minsoc/minsoc/branches/rc-0.1"
|
# Where should I put the dir. minsoc?
|
|
# ex. /home/conx/Thesis/
|
|
DIR_TO_INSTALL=`pwd`
|
|
|
|
# This variable should be set to trunk
|
|
# or to stable.
|
|
VERSION=""
|
|
|
|
# This variable should take one of
|
|
# the following values depending
|
|
# to your system: linux, cygwin, freebsd
|
|
ENV=""
|
|
|
|
# !!! DO NOT EDIT BELLOW THIS LINE !!!
|
|
# ===================================
|
|
|
|
# ===== SCRIPT ======
|
|
# ===================
|
|
|
|
|
|
# Debug ?
|
# Debug ?
|
export DEBUG=0;
|
export DEBUG=0;
|
. beautify.sh
|
. beautify.sh
|
|
|
Line 86... |
Line 67... |
testtool libusb
|
testtool libusb
|
fi
|
fi
|
|
|
|
|
# Wizard
|
# Wizard
|
|
DIR_TO_INSTALL=`pwd`
|
if [ -z "${ALTDIR}" ]
|
if [ -z "${ALTDIR}" ]
|
then
|
then
|
cnecho "Give full path (ex. /home/foo/) for installation directory or leave empty for "${DIR_TO_INSTALL}": ";
|
cnecho "Give full path (ex. /home/foo/) for installation directory or leave empty for "${DIR_TO_INSTALL}": ";
|
read ALTDIR;
|
read ALTDIR;
|
if [ ! -z "${ALTDIR}" ]
|
if [ ! -z "${ALTDIR}" ]
|
Line 114... |
Line 96... |
|
|
#Downloading everything we need
|
#Downloading everything we need
|
cecho "\nDownloading packages"
|
cecho "\nDownloading packages"
|
cd ${DIR_TO_INSTALL}
|
cd ${DIR_TO_INSTALL}
|
cecho "Download MinSoC"
|
cecho "Download MinSoC"
|
svn co -q http://opencores.org/ocsvn/minsoc/minsoc/trunk/ minsoc #user need to input password, execcmd omits command output and should be this way
|
svn co -q ${MINSOC_SVN_URL} minsoc #user need to input password, execcmd omits command output and should be this way
|
execcmd "cd ${DIR_TO_INSTALL}/download"
|
execcmd "cd ${DIR_TO_INSTALL}/download"
|
if [ "$ENV" == "Cygwin" ]
|
if [ "$ENV" == "Cygwin" ]
|
then
|
then
|
execcmd "Downloading GNU Toolchain" "wget ftp://ocuser:ocuser@openrisc.opencores.org/toolchain/or32-elf-cygwin-1.7.tar.bz2";
|
execcmd "Downloading GNU Toolchain" "wget ftp://ocuser:ocuser@openrisc.opencores.org/toolchain/or32-elf-cygwin-1.7.tar.bz2";
|
else
|
else
|
Line 241... |
Line 223... |
execcmd "./configure --prefix=${DIR_TO_INSTALL}/tools"
|
execcmd "./configure --prefix=${DIR_TO_INSTALL}/tools"
|
execcmd "Compiling Icarus Verilog" "make"
|
execcmd "Compiling Icarus Verilog" "make"
|
execcmd "make install"
|
execcmd "make install"
|
|
|
|
|
#Configuring MinSoC
|
#Configuring MinSoC, Advanced Debug System and patching OpenRISC
|
cecho "\nConfiguring MinSoC"
|
export ${DIR_TO_INSTALL}
|
execcmd "cd ${DIR_TO_INSTALL}/minsoc/backend/std"
|
bash configure.sh
|
execcmd "Configuring MinSoC as standard board (simulatable but not synthesizable)" "./configure"
|
|
execcmd "cd ${DIR_TO_INSTALL}"
|
|
|
|
|
|
#Configuring Advanced Debug System to work with MinSoC
|
|
cecho "\nConfiguring Advanced Debug System to work with MinSoC"
|
|
execcmd "cd ${DIR_TO_INSTALL}/minsoc/rtl/verilog/adv_debug_sys/Hardware/adv_dbg_if/rtl/verilog"
|
|
sed "s%\`define DBG_JSP_SUPPORTED%//\`define DBG_JSP_SUPPORTED%" adbg_defines.v > TMPFILE && mv TMPFILE adbg_defines.v
|
|
|
|
#Compiling and moving adv_jtag_bridge debug modules for simulation
|
|
execcmd "cd ${DIR_TO_INSTALL}/minsoc/rtl/verilog/adv_debug_sys/Software/adv_jtag_bridge/sim_lib/icarus"
|
|
execcmd "make"
|
|
execcmd "cp jp-io-vpi.vpi ${DIR_TO_INSTALL}/minsoc/bench/verilog/vpi"
|
|
|
|
|
|
#Precompiling firmwares
|
|
cecho "\nPrecompiling delivered firmwares";
|
|
execcmd "cd ${DIR_TO_INSTALL}/minsoc/sw/utils"
|
|
execcmd "Make utils" "make"
|
|
|
|
execcmd "cd ${DIR_TO_INSTALL}/minsoc/sw/support"
|
|
execcmd "Make support tools" "make"
|
|
|
|
execcmd "cd ${DIR_TO_INSTALL}/minsoc/sw/drivers"
|
|
execcmd "Make drivers" "make"
|
|
|
|
execcmd "cd ${DIR_TO_INSTALL}/minsoc/sw/uart"
|
|
execcmd "Make UART" "make"
|
|
|
|
|
|
#Setting-up new variables
|
#Setting-up new variables
|
cecho "\nSystem configurations"
|
cecho "\nSystem configurations"
|
execcmd "Adding MinSoC tools to PATH" "echo \"PATH=\\\$PATH:$DIR_TO_INSTALL/tools/bin\" >> /home/$(whoami)/.bashrc;";
|
execcmd "Adding MinSoC tools to PATH" "echo \"PATH=\\\$PATH:$DIR_TO_INSTALL/tools/bin\" >> /home/$(whoami)/.bashrc;";
|