From 95a314caec847f32dec817542bfb4dba0bf27d6c Mon Sep 17 00:00:00 2001 From: RecRanger <168371178+RecRanger@users.noreply.github.com> Date: Mon, 6 Apr 2026 05:27:48 -0600 Subject: [PATCH 1/2] Add Dockerfile for building and running tests --- .gitignore | 11 ++++++++++- Dockerfile | 30 ++++++++++++++++++++++++++++++ README.md | 15 ++++++++++++++- 3 files changed, 54 insertions(+), 2 deletions(-) create mode 100644 Dockerfile 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..b27b8c3 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,30 @@ +# 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 or mcode backend. LLVM crashes during the execution phase. +# FROM ghdl/ghdl:7.0.0-dev-gcc-ubuntu-24.04 +FROM ghdl/ghdl:7.0.0-dev-mcode-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 +``` From 6de92425bb6ca1c6010f9e1bb6757ec690316dc2 Mon Sep 17 00:00:00 2001 From: RecRanger <168371178+RecRanger@users.noreply.github.com> Date: Mon, 6 Apr 2026 05:43:23 -0600 Subject: [PATCH 2/2] Change dockerfile ghdl backend to gcc --- Dockerfile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index b27b8c3..06a0b71 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,9 +6,10 @@ # # Inside the container, run `make` to build and run the tests. -# Important: Must use the gcc or mcode backend. LLVM crashes during the execution phase. -# FROM ghdl/ghdl:7.0.0-dev-gcc-ubuntu-24.04 -FROM ghdl/ghdl:7.0.0-dev-mcode-ubuntu-24.04 +# 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