From 50147b4762a798ed11e4d98a73666a7b982baa4e Mon Sep 17 00:00:00 2001 From: mariusmonton Date: Sun, 3 Feb 2019 12:05:06 +0100 Subject: [PATCH] Added Docker container --- Dockerfile | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 19 ++++++++++++++++++- 2 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..b9991bc --- /dev/null +++ b/Dockerfile @@ -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 + + diff --git a/README.md b/README.md index 3a69ba7..27efbb9 100644 --- a/README.md +++ b/README.md @@ -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 :/tmp -it riscv /bin/bash + +# cd /usr/src/riscv64/RISCV_TLM/ +# ./RISCV_TLM /tmp/ +``` + +Performance is not affected by running the simulator inside the container + ## Test See [Test page](Test) for more information.