-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
65 lines (52 loc) · 2.87 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
FROM ubuntu:22.04
# Set to noninteractive mode
ARG DEBIAN_FRONTEND=noninteractive
ARG BENCHMARKS
RUN echo "Running benchmarks: ${BENCHMARKS}"
RUN apt-get update
RUN apt-get -yqq install git lsb-release sudo vim gnupg openjdk-17-jdk verilator curl make gcc g++ python3-pip
# Install sbt - https://www.scala-sbt.org/
RUN echo "deb https://repo.scala-sbt.org/scalasbt/debian all main" | tee /etc/apt/sources.list.d/sbt.list
RUN echo "deb https://repo.scala-sbt.org/scalasbt/debian /" | tee /etc/apt/sources.list.d/sbt_old.list
RUN curl -sL "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x2EE0EA64E40A89B84B2DF73499E82A75642AC823" | apt-key add
RUN apt-get update
RUN apt-get -yqq install sbt
# install vcdvcd (for eval)
WORKDIR /vcdvcd
RUN git clone --depth=1 --branch v2.3.3 https://github.com/cirosantilli/vcdvcd .
RUN python3 -m pip install --user /vcdvcd
# install gnu toolchain
WORKDIR /toolchain
RUN git clone --depth=1 --branch 2023.07.07 https://github.com/riscv/riscv-gnu-toolchain .
RUN apt-get -yqq install autoconf automake autotools-dev curl python3 libmpc-dev libmpfr-dev libgmp-dev gawk build-essential bison flex texinfo gperf libtool patchutils bc zlib1g-dev libexpat-dev ninja-build
RUN ./configure --prefix=/opt/riscv --with-arch=rv32im_zicsr --with-abi=ilp32 && \
make && \
make clean
ENV PATH="${PATH}:/opt/riscv/bin"
# Install baseline version of Proteus
WORKDIR /proteus-base
RUN git clone --recurse-submodules --depth=1 --branch v23.02 https://github.com/proteus-core/proteus.git .
# create simulator binary and run riscv-tests
RUN make -C tests CORE=riscv.CoreDynamicExtMem RISCV_PREFIX=riscv32-unknown-elf
RUN mv sim/build/sim sim/build/base
# comment out waveform dumping to save disk space
RUN sed -e '/tracer->dump(mainTime);/s/^/\/\//g' -i sim/main.cpp
# create simulator binary and run riscv-tests
RUN make -C tests CORE=riscv.CoreDynamicExtMem RISCV_PREFIX=riscv32-unknown-elf
RUN mv sim/build/sim sim/build/base_nodump
# Install Proteus extended with ProSpeCT
WORKDIR /prospect
RUN git clone --recurse-submodules --depth=1 --branch usenix_artifact https://github.com/proteus-core/prospect.git .
# create simulator binary and run riscv-tests
RUN make -C tests CORE=riscv.CoreDynamicExtMem RISCV_PREFIX=riscv32-unknown-elf
RUN mv sim/build/sim sim/build/prospect
# comment out waveform dumping to save disk space
RUN sed -e '/tracer->dump(mainTime);/s/^/\/\//g' -i sim/main.cpp
# create simulator binary and run riscv-tests
RUN make -C tests CORE=riscv.CoreDynamicExtMem RISCV_PREFIX=riscv32-unknown-elf
RUN mv sim/build/sim sim/build/prospect_nodump
WORKDIR /prospect/tests/spectre-tests
RUN ./eval.py /proteus-base/sim/build/base /prospect/sim/build/prospect
WORKDIR /prospect/tests/synthetic-benchmark
RUN if [ "${BENCHMARKS}" = "true" ] ; then ./eval.py /proteus-base/sim/build/base_nodump /prospect/sim/build/prospect_nodump ; else echo Skipping benchmarks... ; fi
CMD /bin/bash