Skip to content

Installation/setup script improvements #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Aug 12, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,10 @@ firmware/firmware.bin
firmware/firmware.elf
firmware/version.h
test/dump.png
build
misoc
makestuff
migen
misoc
*.pyc
*.pnm
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
MSCDIR ?= ../misoc
MSCDIR ?= build/misoc
PROG ?= impact
SERIAL ?= /dev/ttyVIZ0

Expand All @@ -17,8 +17,8 @@ endif
help:
@echo "Targets avaliable:"
@echo " make gateware"
@echo " make load_gateware"
@echo " make load_firmware (OR) make load_firmware_alt"
@echo " make load-gateware"
@echo " make load-lm32-firmware"
@echo " make clean"
@echo ""
@echo "Environment:"
Expand Down
2 changes: 1 addition & 1 deletion firmware/lm32/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# XXX remove this
MSCDIR=../../../misoc
MSCDIR=../../build/misoc
include $(MSCDIR)/software/common.mak

OBJECTS=isr.o processor.o dvisampler.o edid.o pll.o ci.o config.o encoder.o main.o
Expand Down
13 changes: 13 additions & 0 deletions scripts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
These scripts are designed to bootstrap an environment on Ubuntu 14.04 LTS.

To get started (will install packages, etc):

```curl -fsS https://raw.githubusercontent.com/xfxf/HDMI2USB-misoc-firmware/scripts/scripts/bootstrap.sh | bash```


Files:

* bootstrap.sh: script to run on a fresh Ubuntu 14.04 LTS install
* get-env.sh: called from bootstrap (gets and installs software)
* setup-env.sh: script to run after installation to setup environemnt

23 changes: 23 additions & 0 deletions scripts/bootstrap.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash

set -x
set -e

#GIT_REPO=https://github.com/timvideos/HDMI2USB-misoc-firmware.git
GIT_REPO=https://github.com/xfxf/HDMI2USB-misoc-firmware
GIT_BRANCH=scripts

sudo apt-get install -y git realpath
cd ~

if [ -e HDMI2USB-misoc-firmware ]; then
cd HDMI2USB-misoc-firmware
#git pull
else
git clone $GIT_REPO
cd HDMI2USB-misoc-firmware
fi

git checkout $GIT_BRANCH
./scripts/get-env.sh

44 changes: 33 additions & 11 deletions scripts/get-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,21 @@ BINUTILS_URL=http://ftp.gnu.org/gnu/binutils/binutils-2.25.tar.gz
GCC_URL=http://mirrors-usa.go-parts.com/gcc/releases/gcc-4.9.3/gcc-4.9.3.tar.bz2
TARGET=lm32-elf

OUTPUT_DIR=$SETUP_DIR/gnu/output
BUILD_DIR=$SETUP_DIR/../build
GNU_DIR=$BUILD_DIR/gnu
OUTPUT_DIR=$GNU_DIR/output
mkdir -p $OUTPUT_DIR

export PATH=$OUTPUT_DIR/bin:$PATH

set -x
set -e

sudo apt-get install -y build-essential

# Get and build gcc+binutils for the target
(
sudo apt-get install -y build-essential

cd gnu
cd $GNU_DIR
# Download binutils + gcc
(
mkdir -p download
Expand Down Expand Up @@ -52,21 +54,40 @@ set -e
)
)

# Get iverilog
(
sudo apt-get install -y iverilog
)


# Get migen
(
git clone https://github.com/m-labs/migen.git
cd migen
cd $BUILD_DIR
if [ -e migen ]; then
cd migen
git pull
else
git clone https://github.com/m-labs/migen.git
cd migen
fi
cd vpi
make all
sudo make install
)

# Get misoc
git clone https://github.com/m-labs/misoc.git
(
cd $BUILD_DIR
git clone https://github.com/m-labs/misoc.git
cd misoc
git submodule init
git submodule update
)

# Get libfpgalink
(
sudo apt-get install build-essential libreadline-dev libusb-1.0-0-dev python-yaml
cd $BUILD_DIR
sudo apt-get install -y libreadline-dev libusb-1.0-0-dev python-yaml
wget -qO- http://tiny.cc/msbil | tar zxf -

cd makestuff/libs
Expand All @@ -75,7 +96,8 @@ git clone https://github.com/m-labs/misoc.git
make deps
)

# Get the HDMI2USB-misoc-firmware
git clone https://github.com/timvideos/HDMI2USB-misoc-firmware.git
sudo apt-get install -y gtkwave

echo "Completed. To load environment:"
echo "source HDMI2USB-misoc-firmware/scripts/setup-env.sh"

sudo apt-get install -y iverilog gtkwave
4 changes: 2 additions & 2 deletions scripts/setup-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ CALLED=$_

SETUP_SRC=$(realpath ${BASH_SOURCE[@]})
SETUP_DIR=$(dirname $SETUP_SRC)
TOP_DIR=$(realpath $SETUP_DIR/../..)
TOP_DIR=$(realpath $SETUP_DIR/../build)

echo $TOP_DIR

Expand All @@ -22,6 +22,6 @@ fi

export LD_LIBRARY_PATH=$TOP_DIR/makestuff/libs/libfpgalink/lin.x64/rel:$LD_LIBRARY_PATH
export PYTHONPATH=$TOP_DIR/migen:$TOP_DIR/misoc:$TOP_DIR/makestuff/libs/libfpgalink/examples/python/:$PYTHONPATH
export PATH=$TOP_DIR/gnu/output/bin:$PATH
export PATH=$TOP_DIR/gnu/output/bin:/opt/Xilinx/14.7/ISE_DS/ISE/bin/lin64/:$PATH

alias python=python3