Skip to content

Commit 51d1a73

Browse files
committed
Merge pull request #10 from xfxf/scripts
Installation/setup script improvements
2 parents 3caa127 + cf22346 commit 51d1a73

File tree

7 files changed

+82
-17
lines changed

7 files changed

+82
-17
lines changed

.gitignore

+7
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,10 @@ firmware/firmware.bin
55
firmware/firmware.elf
66
firmware/version.h
77
test/dump.png
8+
build
9+
misoc
10+
makestuff
11+
migen
12+
misoc
13+
*.pyc
14+
*.pnm

Makefile

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
MSCDIR ?= ../misoc
1+
MSCDIR ?= build/misoc
22
PROG ?= impact
33
SERIAL ?= /dev/ttyVIZ0
44

@@ -17,8 +17,8 @@ endif
1717
help:
1818
@echo "Targets avaliable:"
1919
@echo " make gateware"
20-
@echo " make load_gateware"
21-
@echo " make load_firmware (OR) make load_firmware_alt"
20+
@echo " make load-gateware"
21+
@echo " make load-lm32-firmware"
2222
@echo " make clean"
2323
@echo ""
2424
@echo "Environment:"

firmware/lm32/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# XXX remove this
2-
MSCDIR=../../../misoc
2+
MSCDIR=../../build/misoc
33
include $(MSCDIR)/software/common.mak
44

55
OBJECTS=isr.o processor.o dvisampler.o edid.o pll.o ci.o config.o encoder.o main.o

scripts/README.md

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
These scripts are designed to bootstrap an environment on Ubuntu 14.04 LTS.
2+
3+
To get started (will install packages, etc):
4+
5+
```curl -fsS https://raw.githubusercontent.com/xfxf/HDMI2USB-misoc-firmware/scripts/scripts/bootstrap.sh | bash```
6+
7+
8+
Files:
9+
10+
* bootstrap.sh: script to run on a fresh Ubuntu 14.04 LTS install
11+
* get-env.sh: called from bootstrap (gets and installs software)
12+
* setup-env.sh: script to run after installation to setup environemnt
13+

scripts/bootstrap.sh

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/bash
2+
3+
set -x
4+
set -e
5+
6+
#GIT_REPO=https://github.com/timvideos/HDMI2USB-misoc-firmware.git
7+
GIT_REPO=https://github.com/xfxf/HDMI2USB-misoc-firmware
8+
GIT_BRANCH=scripts
9+
10+
sudo apt-get install -y git realpath
11+
cd ~
12+
13+
if [ -e HDMI2USB-misoc-firmware ]; then
14+
cd HDMI2USB-misoc-firmware
15+
#git pull
16+
else
17+
git clone $GIT_REPO
18+
cd HDMI2USB-misoc-firmware
19+
fi
20+
21+
git checkout $GIT_BRANCH
22+
./scripts/get-env.sh
23+

scripts/get-env.sh

+33-11
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,21 @@ BINUTILS_URL=http://ftp.gnu.org/gnu/binutils/binutils-2.25.tar.gz
77
GCC_URL=http://mirrors-usa.go-parts.com/gcc/releases/gcc-4.9.3/gcc-4.9.3.tar.bz2
88
TARGET=lm32-elf
99

10-
OUTPUT_DIR=$SETUP_DIR/gnu/output
10+
BUILD_DIR=$SETUP_DIR/../build
11+
GNU_DIR=$BUILD_DIR/gnu
12+
OUTPUT_DIR=$GNU_DIR/output
1113
mkdir -p $OUTPUT_DIR
1214

1315
export PATH=$OUTPUT_DIR/bin:$PATH
1416

1517
set -x
1618
set -e
1719

20+
sudo apt-get install -y build-essential
21+
1822
# Get and build gcc+binutils for the target
1923
(
20-
sudo apt-get install -y build-essential
21-
22-
cd gnu
24+
cd $GNU_DIR
2325
# Download binutils + gcc
2426
(
2527
mkdir -p download
@@ -52,21 +54,40 @@ set -e
5254
)
5355
)
5456

57+
# Get iverilog
58+
(
59+
sudo apt-get install -y iverilog
60+
)
61+
62+
5563
# Get migen
5664
(
57-
git clone https://github.com/m-labs/migen.git
58-
cd migen
65+
cd $BUILD_DIR
66+
if [ -e migen ]; then
67+
cd migen
68+
git pull
69+
else
70+
git clone https://github.com/m-labs/migen.git
71+
cd migen
72+
fi
5973
cd vpi
6074
make all
6175
sudo make install
6276
)
6377

6478
# Get misoc
65-
git clone https://github.com/m-labs/misoc.git
79+
(
80+
cd $BUILD_DIR
81+
git clone https://github.com/m-labs/misoc.git
82+
cd misoc
83+
git submodule init
84+
git submodule update
85+
)
6686

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

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

78-
# Get the HDMI2USB-misoc-firmware
79-
git clone https://github.com/timvideos/HDMI2USB-misoc-firmware.git
99+
sudo apt-get install -y gtkwave
100+
101+
echo "Completed. To load environment:"
102+
echo "source HDMI2USB-misoc-firmware/scripts/setup-env.sh"
80103

81-
sudo apt-get install -y iverilog gtkwave

scripts/setup-env.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ CALLED=$_
55

66
SETUP_SRC=$(realpath ${BASH_SOURCE[@]})
77
SETUP_DIR=$(dirname $SETUP_SRC)
8-
TOP_DIR=$(realpath $SETUP_DIR/../..)
8+
TOP_DIR=$(realpath $SETUP_DIR/../build)
99

1010
echo $TOP_DIR
1111

@@ -22,6 +22,6 @@ fi
2222

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

2727
alias python=python3

0 commit comments

Comments
 (0)