Added Docker container

This commit is contained in:
mariusmonton 2019-02-03 12:05:06 +01:00
parent a8943a111f
commit 50147b4762
2 changed files with 66 additions and 1 deletions

48
Dockerfile Normal file
View File

@ -0,0 +1,48 @@
FROM ubuntu:bionic
MAINTAINER Màrius Montón
ENV SYSTEMC_VERSION 2.3.3
RUN apt-get update -q && apt-get install -qy gcc-riscv64-linux-gnu
RUN apt-get update -q && apt-get install -qy --no-install-recommends \
build-essential curl \
cmake \
git \
openssh-client \
wget \
g++-8 \
&& apt-get clean
RUN mkdir -p /usr/src/systemc \
&& wget --no-check-certificate https://accellera.org/images/downloads/standards/systemc/systemc-$SYSTEMC_VERSION.tar.gz \
&& tar fzxC systemc-$SYSTEMC_VERSION.tar.gz /usr/src/systemc \
&& cd /usr/src/systemc/systemc-$SYSTEMC_VERSION \
&& mkdir objs \
&& cd objs \
&& export CXX=g++-8 \
&& mkdir -p /usr/local/systemc-$SYSTEMC_VERSION \
&& ../configure --prefix=/usr/local/systemc-$SYSTEMC_VERSION CXXFLAGS="-DSC_CPLUSPLUS=201103L"\
&& make \
&& make install \
&& cd / \
&& rm -rf /usr/src/systemc
ENV CPLUS_INCLUDE_PATH=$CPLUS_INCLUDE_PATH:/usr/local/systemc-$SYSTEMC_VERSION/include
ENV LIBRARY_PATH=$LIBRARY_PATH:/usr/local/systemc-$SYSTEMC_VERSION/lib-linux64
ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/systemc-$SYSTEMC_VERSION/lib-linux64
ENV SYSTEMC=/usr/local/systemc-$SYSTEMC_VERSION
RUN mkdir -p /root/.ssh
RUN ssh-keyscan github.com > /root/.ssh/known_hosts
RUN mkdir -p /usr/src/riscv64 \
&& cd /usr/src/riscv64 \
&& git config --global http.sslVerify false \
&& git clone https://github.com/mariusmm/RISC-V-TLM.git \
&& cd RISC-V-TLM \
&& mkdir obj \
&& make

View File

@ -4,7 +4,7 @@
This is another RISC-V ISA simulator, this is coded in SystemC + TLM-2.
It supports RV32IMC Instruction set by now (with some bugs).
It supports RV32IMCA Instruction set by now.
[![travis](https://travis-ci.org/mariusmm/RISC-V-TLM.svg?branch=master)](https://travis-ci.org/mariusmm/RISC-V-TLM)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/0f7ccc8435f14ce2b241b3bfead772a2)](https://www.codacy.com/app/mariusmm/RISC-V-TLM?utm_source=github.com&utm_medium=referral&utm_content=mariusmm/RISC-V-TLM&utm_campaign=Badge_Grade)
@ -83,6 +83,23 @@ And then you can execute the simulator:
$ ./RISCV_TLM asm/BasicLoop.hex
```
## Docker container
There is a Docker container available with the latest release at https://hub.docker.com/r/mariusmm/riscv-tlm.
This container has RISCV-TLM already build at /usr/src/riscv64/RISCV-TLM directory.
### How to use Docker
```
$ docker pull mariusmm/riscv-tlm
$ docker run -v <localfiles>:/tmp -it riscv /bin/bash
# cd /usr/src/riscv64/RISCV_TLM/
# ./RISCV_TLM /tmp/<your_hex_file>
```
Performance is not affected by running the simulator inside the container
## Test
See [Test page](Test) for more information.