-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
75 lines (63 loc) · 2.55 KB
/
Dockerfile
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
FROM ubuntu:latest
LABEL maintainer="Josh Lloyd <[email protected]>"
# Docker ENV
ENV TERM linux
ENV DEBIAN_FRONTEND noninteractive
# Prerequisites
RUN apt-get update -y && \
apt-get install -y build-essential clang bison libreadline-dev \
flex gawk tcl-dev libffi-dev git mercurial graphviz \
xdot pkg-config python python3 python3-pip libftdi-dev \
qt5-default python3-dev libboost-all-dev cmake gperf \
libeigen3-dev libelf-dev autoconf automake autotools-dev \
curl libmpc-dev libmpfr-dev libgmp-dev texinfo libtool \
patchutils bc zlib1g-dev libexpat1-dev
# RISC-V Toolchain
RUN mkdir /opt/riscv32i && \
git clone https://github.com/riscv/riscv-gnu-toolchain riscv-gnu-toolchain-rv32i && \
cd riscv-gnu-toolchain-rv32i && \
git checkout 411d134 && \
git submodule update --init --recursive && \
mkdir build; cd build && \
../configure --with-arch=rv32i --prefix=/opt/riscv32i && \
make -j$(nproc)
# IceStorm Tools
RUN git clone https://github.com/cliffordwolf/icestorm.git icestorm && \
cd icestorm && \
make -j$(nproc) && \
make install
# NextPNR
RUN git clone https://github.com/YosysHQ/nextpnr nextpnr && \
cd nextpnr && \
cmake -DARCH=ice40 -DCMAKE_INSTALL_PREFIX=/usr/local . && \
make -j$(nproc) && \
make install
# Yosys
RUN git clone https://github.com/cliffordwolf/yosys.git yosys && \
cd yosys && \
make -j$(nproc) && \
make install
# Arachne-PNR (predecessor to NextPNR)
RUN git clone https://github.com/cseed/arachne-pnr.git arachne-pnr && \
cd arachne-pnr && \
make -j$(nproc) && \
make install
# iVerilog
RUN git clone https://github.com/steveicarus/iverilog.git iverilog && \
cd iverilog && \
sh autoconf.sh && \
./configure && make && make install
# Create workspace before registering with fusesoc
RUN mkdir "/workspace"
VOLUME ["/workspace"]
# Python tool installation (fusesoc, tinyprog, apio)
RUN python3 -m pip install apio tinyprog fusesoc && \
fusesoc init -y && \
fusesoc --config ~/.config/fusesoc/fusesoc.conf library add workspace /workspace && \
fusesoc --config ~/.config/fusesoc/fusesoc.conf library add --global tinyfpga_bx_usbserial https://github.com/davidthings/tinyfpga_bx_usbserial.git && \
fusesoc library update
ENV PATH="/opt/riscv32i/bin:${PATH}"
# Switch to workspace
WORKDIR "/workspace"
# Default interpreter
CMD ["/bin/bash"]