diff --git a/.gitignore b/.gitignore index 28f4763..46fd880 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,12 @@ *.cf *.vcd -*.ghw \ No newline at end of file +*.ghw + +*.o +tests/dataset.s + +tests/tb_blake2b +tests/tb_scratchpad +tests/tb_compile +tests/tb_exec +tests/tb_run diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..06a0b71 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,31 @@ +# Build the image (no source code baked into the image). +# docker build -t randomx-fpga . +# +# Run with your local repo mounted. Spawns a fish shell in the `tests/` directory. +# docker run -it -u $(id -u):$(id -g) -v $(pwd):/RandomX-FPGA randomx-fpga +# +# Inside the container, run `make` to build and run the tests. + +# Important: Must use the gcc backend. +# LLVM crashes during the execution phase. +# Mcode complains of invalid signal uses. +FROM ghdl/ghdl:7.0.0-dev-gcc-ubuntu-24.04 + +ENV DEBIAN_FRONTEND=noninteractive + +# Install required packages +RUN apt-get update && \ + apt-get install -y \ + ca-certificates \ + make \ + cmake \ + build-essential \ + git \ + fish && \ + rm -rf /var/lib/apt/lists/* + +# Set working directory (your mounted repo will appear here) +WORKDIR /RandomX-FPGA/tests + +# Start in fish shell +CMD ["fish"] diff --git a/README.md b/README.md index 5d4478d..85a108a 100644 --- a/README.md +++ b/README.md @@ -34,4 +34,17 @@ https://github.com/MainSilent/py-RandomX ### Credit: -Blake2: https://github.com/christian-krieg/blake2 \ No newline at end of file +Blake2: https://github.com/christian-krieg/blake2 + +## Run with Docker + +```bash +# Build the image (no source code baked into the image). +docker build -t randomx-fpga . + +# Run with your local repo mounted. Spawns a fish shell in the `tests/` directory. +docker run -it -u $(id -u):$(id -g) -v $(pwd):/RandomX-FPGA randomx-fpga + +# Inside the container, run `make` to build and run the tests. +make +```