From 5a965073d98c657e6a532b546526bc588dc93559 Mon Sep 17 00:00:00 2001 From: "Rodrigo A. Melo" Date: Sun, 27 Sep 2026 20:40:54 -0300 Subject: [PATCH 01/23] Add basic documentation --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README.md b/README.md index 501acaf..67ae49e 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,9 @@ # PyFPGA containers +A collection of Docker containers featuring a curated selection of Free/Libre and Open-Source Software (FLOSS) tools for FPGA development. +They streamline the setup process, ensuring consistency and easy access across diverse environments. +Below is a list of the available containers and their included tools. + * `langutils`: utilities for processing and analyzing HDL languages * [vhd2vl](https://github.com/ldoolitt/vhd2vl) * [Slang](https://github.com/MikePopoloski/slang) @@ -17,3 +21,12 @@ * [iVerilog](https://github.com/steveicarus/iverilog) * [Verilator](https://github.com/verilator/verilator) * [cocotb](https://github.com/cocotb/cocotb) + +In the CI pipeline, the Dockerfile is used to build a Docker image, which is then pushed to the GitHub Container Registry. +From there, it can be pulled and run as a container whenever needed. + +```bash +docker run --user $(id -u):$(id -g) --rm -v $PWD:$PWD -w $PWD ghcr.io/pyfpga/ +``` + +Replace `` with the appropriate image name and `` with the command you want to execute inside the container. From f11aa3ff1c3ba0935e25d44f66d66024cfca0e69 Mon Sep 17 00:00:00 2001 From: "Rodrigo A. Melo" Date: Sun, 27 Sep 2026 20:40:54 -0300 Subject: [PATCH 02/23] Add svlint into the langutils container Closes #8 --- README.md | 1 + recipes/langutils | 12 ++++++++++++ tests/langutils.sh | 2 ++ 3 files changed, 15 insertions(+) diff --git a/README.md b/README.md index 67ae49e..d5b153e 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,7 @@ Below is a list of the available containers and their included tools. * [vhd2vl](https://github.com/ldoolitt/vhd2vl) * [Slang](https://github.com/MikePopoloski/slang) * [sv2v](https://github.com/zachjs/sv2v) + * [svlint](https://github.com/dalance/svlint) * [Verible](https://github.com/chipsalliance/verible) * [Surelog](https://github.com/chipsalliance/Surelog) * `synthesis`: tools for logic synthesis diff --git a/recipes/langutils b/recipes/langutils index 1e13c63..cc7c648 100644 --- a/recipes/langutils +++ b/recipes/langutils @@ -22,6 +22,8 @@ RUN apt-get update -qq \ cmake \ default-jre \ python3-orderedmultidict \ + # svlint + unzip \ && curl -sSL https://get.haskellstack.org/ | sh \ && curl -sSL https://github.com/bazelbuild/bazel/releases/download/6.5.0/bazel-6.5.0-linux-x86_64 \ -o /usr/bin/bazel && chmod +x /usr/bin/bazel \ @@ -66,6 +68,16 @@ RUN git clone --depth 1 https://github.com/chipsalliance/verible.git \ && cd verible && bazel build -c opt :install-binaries \ && .github/bin/simple-install.sh /usr/local/bin +# +# svlint +# + +RUN LATEST_URL=$(curl -s https://api.github.com/repos/dalance/svlint/releases/latest | grep -o "https://[^\"]*x86_64-lnx.zip") \ + && curl -sL "$LATEST_URL" -o /tmp/svlint.zip \ + && unzip /tmp/svlint.zip -d /tmp/svlint \ + && mv /tmp/svlint/bin/svlint /usr/local/bin/ \ + && rm -rf /tmp/svlint /tmp/svlint.zip + # # Clean-up # diff --git a/tests/langutils.sh b/tests/langutils.sh index 45da66a..4de5f44 100644 --- a/tests/langutils.sh +++ b/tests/langutils.sh @@ -11,11 +11,13 @@ $DOCKER slang --version $DOCKER surelog --version $DOCKER sv2v --version $DOCKER verible-verilog-syntax --version +$DOCKER svlint --version $DOCKER vhd2vl --quiet hdl/counter.vhdl results/vhd2vl.v $DOCKER slang hdl/counter.sv --lint-only $DOCKER surelog -parse hdl/counter.sv $DOCKER sv2v hdl/counter.sv --write=results/sv2v.v $DOCKER verible-verilog-lint hdl/counter.sv +$DOCKER svlint hdl/counter.sv rm -fr slpp_all From 625ce40526fd26486430cabdfff691943e5767f8 Mon Sep 17 00:00:00 2001 From: "Rodrigo A. Melo" Date: Sun, 27 Sep 2026 20:40:54 -0300 Subject: [PATCH 03/23] langutils rewritten, to fix surelog compilation and reduce final weight --- recipes/langutils | 85 ++++++++++++++++++++++------------------------- 1 file changed, 40 insertions(+), 45 deletions(-) diff --git a/recipes/langutils b/recipes/langutils index cc7c648..8213ac4 100644 --- a/recipes/langutils +++ b/recipes/langutils @@ -1,35 +1,29 @@ -FROM ubuntu:latest AS build +FROM ubuntu:latest AS builder -WORKDIR /root +ENV DEBIAN_FRONTEND=noninteractive -# -# Dependencies -# - -RUN apt-get update -qq \ - && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ - # Common +RUN apt-get update -qq && apt-get install -y --no-install-recommends \ + bison \ build-essential \ ca-certificates \ + cargo \ + cmake \ curl \ + default-jre \ + flex \ git \ python3 \ - zlib1g-dev \ - # vhd2vl - flex \ - bison \ - # Surelog - cmake \ - default-jre \ python3-orderedmultidict \ - # svlint - unzip \ + # sv2v && curl -sSL https://get.haskellstack.org/ | sh \ - && curl -sSL https://github.com/bazelbuild/bazel/releases/download/6.5.0/bazel-6.5.0-linux-x86_64 \ - -o /usr/bin/bazel && chmod +x /usr/bin/bazel \ - && apt-get autoclean && apt-get clean && apt-get -y autoremove \ + # verible + && curl -fsSL https://github.com/bazelbuild/bazelisk/releases/latest/download/bazelisk-linux-amd64 \ + -o /usr/local/bin/bazel && chmod +x /usr/local/bin/bazel \ + # clean-up && rm -rf /var/lib/apt/lists/* +WORKDIR /tmp + # # vhd2vl # @@ -37,12 +31,19 @@ RUN apt-get update -qq \ RUN git clone --depth 1 https://github.com/ldoolitt/vhd2vl \ && cd vhd2vl && make -j$(nproc) && make install +# +# sv2v +# + +RUN git clone --depth 1 https://github.com/zachjs/sv2v.git \ + && cd sv2v && make -j$(nproc) && cp bin/sv2v /usr/local/bin + # # Slang # RUN git clone --depth 1 https://github.com/MikePopoloski/slang.git \ - && cd slang && cmake -B build && cmake --build build -j8 \ + && cd slang && cmake -B build && cmake --build build -j$(nproc) \ && cmake --install build --strip # @@ -51,14 +52,12 @@ RUN git clone --depth 1 https://github.com/MikePopoloski/slang.git \ RUN git clone --depth 1 https://github.com/alainmarcel/Surelog.git \ && cd Surelog && git submodule update --init --recursive \ - && make -j$(nproc) && make install - -# -# sv2v -# - -RUN git clone --depth 1 https://github.com/zachjs/sv2v.git \ - && cd sv2v && make -j$(nproc) && cp bin/sv2v /usr/local/bin + && cmake -B build \ + -DCMAKE_POLICY_VERSION_MINIMUM=3.5 \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=/usr/local \ + && cmake --build build -j$(nproc) \ + && cmake --install build --strip # # Verible @@ -72,25 +71,21 @@ RUN git clone --depth 1 https://github.com/chipsalliance/verible.git \ # svlint # -RUN LATEST_URL=$(curl -s https://api.github.com/repos/dalance/svlint/releases/latest | grep -o "https://[^\"]*x86_64-lnx.zip") \ - && curl -sL "$LATEST_URL" -o /tmp/svlint.zip \ - && unzip /tmp/svlint.zip -d /tmp/svlint \ - && mv /tmp/svlint/bin/svlint /usr/local/bin/ \ - && rm -rf /tmp/svlint /tmp/svlint.zip +RUN cargo install --root /usr/local --git https://github.com/dalance/svlint.git svlint # -# Clean-up +# clean-up # -RUN cd /usr/local/bin && rm stack +RUN rm -f /usr/local/bin/stack /usr/local/bin/bazel -############################################################################### +# ----------------------------------------------------------------------------- -FROM ubuntu:latest +FROM ubuntu:latest AS runtime -COPY --from=build /usr/local/bin /usr/local/bin -COPY --from=build /usr/local/lib /usr/local/lib -COPY --from=build /usr/local/include /usr/local/include -COPY --from=build /usr/local/share/pkgconfig /usr/local/share/pkgconfig -COPY --from=build /usr/local/share/surelog /usr/local/share/surelog -COPY --from=build /usr/local/share/uhdm /usr/local/share/uhdm +COPY --from=builder /usr/local/bin /usr/local/bin +COPY --from=builder /usr/local/lib /usr/local/lib +COPY --from=builder /usr/local/include /usr/local/include +COPY --from=builder /usr/local/share/pkgconfig /usr/local/share/pkgconfig +COPY --from=builder /usr/local/share/surelog /usr/local/share/surelog +COPY --from=builder /usr/local/share/uhdm /usr/local/share/uhdm From 7eb7c67e0cb4fdedbe8a6cc8ac55b48020a5d101 Mon Sep 17 00:00:00 2001 From: "Rodrigo A. Melo" Date: Sun, 27 Sep 2026 20:40:54 -0300 Subject: [PATCH 04/23] Add langutils tests --- tests/.svlint.toml | 244 +++++++++++++++++++++++++++++++++++++++++++++ tests/langutils.sh | 20 ++-- 2 files changed, 258 insertions(+), 6 deletions(-) create mode 100644 tests/.svlint.toml diff --git a/tests/.svlint.toml b/tests/.svlint.toml new file mode 100644 index 0000000..0430690 --- /dev/null +++ b/tests/.svlint.toml @@ -0,0 +1,244 @@ +[option] +exclude_paths = [] +textwidth = 80 +copyright_linenum = 1 +copyright_year = "1234" +copyright_holder = "HOLDER" +indent = 2 +prefix_inout = "b_" +prefix_input = "i_" +prefix_output = "o_" +prefix_label = "l_" +prefix_instance = "u_" +prefix_module = "mod_" +prefix_package = "pkg_" +prefix_interface = "ifc_" +re_required_assert = "^[a-z]+[a-z0-9_]*$" +re_required_assert_property = "^[a-z]+[a-z0-9_]*$" +re_required_checker = "^[a-z]+[a-z0-9_]*$" +re_required_class = "^[a-z]+[a-z0-9_]*$" +re_required_function = "^[a-z]+[a-z0-9_]*$" +re_required_generateblock = "^[a-z]+[a-z0-9_]*$" +re_required_genvar = "^[a-z]+[a-z0-9_]*$" +re_required_instance = "^[a-z]+[a-z0-9_]*$" +re_required_interface = "^[a-z]+[a-z0-9_]*$" +re_required_localparam = "^[A-Z]+[A-Z0-9_]*$" +re_required_modport = "^[a-z]+[a-z0-9_]*$" +re_required_module_ansi = "^[a-z]+[a-zA-Z0-9_]*$" +re_required_module_nonansi = "^[A-Z]+[A-Z0-9_]*$" +re_required_package = "^[a-z]+[a-z0-9_]*$" +re_required_parameter = "^[A-Z]+[A-Z0-9_]*$" +re_required_port_inout = "^[a-z]+[a-z0-9_]*$" +re_required_port_input = "^[a-z]+[a-z0-9_]*$" +re_required_port_output = "^[a-z]+[a-z0-9_]*$" +re_required_port_ref = "^[a-z]+[a-z0-9_]*$" +re_required_port_interface = "^[a-z]+[a-z0-9_]*$" +re_required_program = "^[a-z]+[a-z0-9_]*$" +re_required_property = "^[a-z]+[a-z0-9_]*$" +re_required_sequence = "^[a-z]+[a-z0-9_]*$" +re_required_task = "^[a-z]+[a-z0-9_]*$" +re_required_var_class = "^[a-z]+[a-z0-9_]*$" +re_required_var_classmethod = "^[a-z]+[a-z0-9_]*$" +re_forbidden_assert = "^[^X](UNCONFIGURED|.*)$" +re_forbidden_assert_property = "^[^X](UNCONFIGURED|.*)$" +re_forbidden_checker = "^[^X](UNCONFIGURED|.*)$" +re_forbidden_class = "^[^X](UNCONFIGURED|.*)$" +re_forbidden_function = "^[^X](UNCONFIGURED|.*)$" +re_forbidden_generateblock = "^[^X](UNCONFIGURED|.*)$" +re_forbidden_genvar = "^[^X](UNCONFIGURED|.*)$" +re_forbidden_instance = "^[^X](UNCONFIGURED|.*)$" +re_forbidden_interface = "^[^X](UNCONFIGURED|.*)$" +re_forbidden_localparam = "^[^X](UNCONFIGURED|.*)$" +re_forbidden_modport = "^[^X](UNCONFIGURED|.*)$" +re_forbidden_module_ansi = "^[^X](UNCONFIGURED|.*)$" +re_forbidden_module_nonansi = "^[^X](UNCONFIGURED|.*)$" +re_forbidden_package = "^[^X](UNCONFIGURED|.*)$" +re_forbidden_parameter = "^[^X](UNCONFIGURED|.*)$" +re_forbidden_port_inout = "^[^X](UNCONFIGURED|.*)$" +re_forbidden_port_input = "^[^X](UNCONFIGURED|.*)$" +re_forbidden_port_output = "^[^X](UNCONFIGURED|.*)$" +re_forbidden_port_ref = "^[^X](UNCONFIGURED|.*)$" +re_forbidden_port_interface = "^[^X](UNCONFIGURED|.*)$" +re_forbidden_program = "^[^X](UNCONFIGURED|.*)$" +re_forbidden_property = "^[^X](UNCONFIGURED|.*)$" +re_forbidden_sequence = "^[^X](UNCONFIGURED|.*)$" +re_forbidden_task = "^[^X](UNCONFIGURED|.*)$" +re_forbidden_var_class = "^[^X](UNCONFIGURED|.*)$" +re_forbidden_var_classmethod = "^[^X](UNCONFIGURED|.*)$" + +[option.unpacked_array] +localparam_declaration = false +param_declaration = false +specparam_declaration = false +inout_declaration = false +ansi_port_declaration = false +input_declaration = false +output_declaration = false +interface_port_declaration = false +ref_declaration = false +data_declaration = true +net_declaration = false + +[textrules] +header_copyright = false +style_directives = false +style_semicolon = false +style_textwidth = false + +[syntaxrules] +action_block_with_side_effect = false +blocking_assignment_in_always_at_edge = false +blocking_assignment_in_always_ff = false +blocking_assignment_in_always_latch = false +case_default = false +default_nettype_none = false +default_nettype_wire_at_end = false +enum_with_type = false +eventlist_comma_always_ff = false +eventlist_or = false +explicit_brackets_for_confusing_precedence = false +explicit_case_default = false +explicit_if_else = false +function_same_as_system_function = false +function_with_automatic = false +general_always_level_sensitive = false +general_always_no_edge = false +generate_case_with_label = false +generate_for_with_label = false +generate_if_with_label = false +genvar_declaration_in_loop = false +genvar_declaration_out_loop = false +implicit_case_default = false +inout_with_tri = false +input_with_var = false +interface_identifier_matches_filename = false +interface_port_with_modport = false +keyword_forbidden_always = false +keyword_forbidden_always_comb = false +keyword_forbidden_always_ff = false +keyword_forbidden_always_latch = false +keyword_forbidden_generate = false +keyword_forbidden_logic = false +keyword_forbidden_priority = false +keyword_forbidden_unique = false +keyword_forbidden_unique0 = false +keyword_forbidden_wire_reg = false +keyword_required_generate = false +localparam_explicit_type = false +localparam_type_twostate = false +loop_statement_in_always_comb = false +loop_statement_in_always_ff = false +loop_statement_in_always_latch = false +loop_variable_declaration = false +lowercamelcase_interface = false +lowercamelcase_module = false +lowercamelcase_package = false +module_ansi_forbidden = false +module_identifier_matches_filename = false +module_nonansi_forbidden = false +multiline_for_begin = false +multiline_if_begin = false +non_blocking_assignment_in_always_comb = false +non_blocking_assignment_in_always_no_edge = false +operator_case_equality = false +operator_incdec = false +operator_self_assignment = false +output_with_var = false +package_identifier_matches_filename = false +package_item_not_in_package = false +parameter_default_value = false +parameter_explicit_type = false +parameter_in_generate = false +parameter_in_package = false +parameter_type_twostate = false +prefix_inout = false +prefix_input = false +prefix_instance = false +prefix_interface = false +prefix_module = false +prefix_output = false +prefix_package = false +procedural_continuous_assignment = false +program_identifier_matches_filename = false +re_forbidden_assert = false +re_forbidden_assert_property = false +re_forbidden_checker = false +re_forbidden_class = false +re_forbidden_function = false +re_forbidden_generateblock = false +re_forbidden_genvar = false +re_forbidden_instance = false +re_forbidden_interface = false +re_forbidden_localparam = false +re_forbidden_modport = false +re_forbidden_module_ansi = false +re_forbidden_module_nonansi = false +re_forbidden_package = false +re_forbidden_parameter = false +re_forbidden_port_inout = false +re_forbidden_port_input = false +re_forbidden_port_interface = false +re_forbidden_port_output = false +re_forbidden_port_ref = false +re_forbidden_program = false +re_forbidden_property = false +re_forbidden_sequence = false +re_forbidden_task = false +re_forbidden_var_class = false +re_forbidden_var_classmethod = false +re_required_assert = false +re_required_assert_property = false +re_required_checker = false +re_required_class = false +re_required_function = false +re_required_generateblock = false +re_required_genvar = false +re_required_instance = false +re_required_interface = false +re_required_localparam = false +re_required_modport = false +re_required_module_ansi = false +re_required_module_nonansi = false +re_required_package = false +re_required_parameter = false +re_required_port_inout = false +re_required_port_input = false +re_required_port_interface = false +re_required_port_output = false +re_required_port_ref = false +re_required_program = false +re_required_property = false +re_required_sequence = false +re_required_task = false +re_required_var_class = false +re_required_var_classmethod = false +sequential_block_in_always_comb = false +sequential_block_in_always_ff = false +sequential_block_in_always_latch = false +style_commaleading = false +style_indent = false +style_keyword_0or1space = false +style_keyword_0space = false +style_keyword_1or2space = false +style_keyword_1space = false +style_keyword_1spaceornewline = false +style_keyword_construct = false +style_keyword_datatype = false +style_keyword_end = false +style_keyword_maybelabel = false +style_keyword_new = false +style_keyword_newline = false +style_operator_arithmetic = false +style_operator_arithmetic_leading_space = false +style_operator_boolean = false +style_operator_boolean_leading_space = false +style_operator_integer = false +style_operator_integer_leading_space = false +style_operator_unary = false +style_trailingwhitespace = false +tab_character = false +unpacked_array = false +uppercamelcase_interface = false +uppercamelcase_module = false +uppercamelcase_package = false + diff --git a/tests/langutils.sh b/tests/langutils.sh index 4de5f44..0bd1e98 100644 --- a/tests/langutils.sh +++ b/tests/langutils.sh @@ -7,17 +7,25 @@ DOCKER="docker run --rm -v $HOME:$HOME -w $PWD --user $(id -u):$(id -g) ghcr.io/ mkdir -p results $DOCKER vhd2vl --version -$DOCKER slang --version -$DOCKER surelog --version +$DOCKER vhd2vl --quiet hdl/counter.vhdl results/vhd2vl.v +test -f results/vhd2vl.v + $DOCKER sv2v --version -$DOCKER verible-verilog-syntax --version -$DOCKER svlint --version +$DOCKER sv2v hdl/counter.sv --write=results/sv2v.v +test -f results/sv2v.v -$DOCKER vhd2vl --quiet hdl/counter.vhdl results/vhd2vl.v +$DOCKER slang --version $DOCKER slang hdl/counter.sv --lint-only + +$DOCKER surelog --version $DOCKER surelog -parse hdl/counter.sv -$DOCKER sv2v hdl/counter.sv --write=results/sv2v.v + +$DOCKER verible-verilog-syntax --version $DOCKER verible-verilog-lint hdl/counter.sv + +$DOCKER svlint --version $DOCKER svlint hdl/counter.sv rm -fr slpp_all + +echo "Test passed" From 72d43b2d578036278cabd9caf8ab1f0e7e995200 Mon Sep 17 00:00:00 2001 From: "Rodrigo A. Melo" Date: Sun, 27 Sep 2026 20:40:54 -0300 Subject: [PATCH 05/23] Add purge script, to remove Docker containers related things --- purge.sh | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 purge.sh diff --git a/purge.sh b/purge.sh new file mode 100644 index 0000000..a611ee1 --- /dev/null +++ b/purge.sh @@ -0,0 +1,4 @@ +#!/bin/bash +set -e +docker rmi -f $(docker images -q) +docker system prune -a --volumes -f From 0e4eca749a88f6cf63618c40627a0b49415b42b4 Mon Sep 17 00:00:00 2001 From: "Rodrigo A. Melo" Date: Sun, 27 Sep 2026 20:40:54 -0300 Subject: [PATCH 06/23] Modify build script to use host network and avoid VPN errors --- build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 669fdb4..c384abb 100644 --- a/build.sh +++ b/build.sh @@ -1,4 +1,4 @@ #!/bin/bash set -e IMAGE=$1 -docker build -f recipes/$IMAGE -t ghcr.io/pyfpga/$IMAGE . +docker build -f recipes/$IMAGE --network=host -t ghcr.io/pyfpga/$IMAGE . From 128d0183d706ea350bbc0d09eb0c44e8d5b1b308 Mon Sep 17 00:00:00 2001 From: "Rodrigo A. Melo" Date: Sun, 27 Sep 2026 20:40:54 -0300 Subject: [PATCH 07/23] Add the 'Dockerfile.' prefix. update langutils --- .github/workflows/deploy.yml | 2 +- build.sh | 2 +- recipes/Dockerfile.langutils | 80 +++++++++++++++ recipes/{simulation => Dockerfile.simulation} | 0 recipes/Dockerfile.synthesis | 93 ++++++++++++++++++ recipes/langutils | 91 ----------------- recipes/synthesis | 98 ------------------- 7 files changed, 175 insertions(+), 191 deletions(-) create mode 100644 recipes/Dockerfile.langutils rename recipes/{simulation => Dockerfile.simulation} (100%) create mode 100644 recipes/Dockerfile.synthesis delete mode 100644 recipes/langutils delete mode 100644 recipes/synthesis diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index bebc407..b6be984 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -24,6 +24,6 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: Build Docker image for ${{ matrix.name }} - run: docker build -f recipes/${{ matrix.name }} -t ghcr.io/pyfpga/${{ matrix.name }} . + run: docker build -f recipes/Dockerfile.${{ matrix.name }} -t ghcr.io/pyfpga/${{ matrix.name }} . - name: Push Docker image for ${{ matrix.name }} run: docker push ghcr.io/pyfpga/${{ matrix.name }} diff --git a/build.sh b/build.sh index c384abb..66bec49 100644 --- a/build.sh +++ b/build.sh @@ -1,4 +1,4 @@ #!/bin/bash set -e IMAGE=$1 -docker build -f recipes/$IMAGE --network=host -t ghcr.io/pyfpga/$IMAGE . +docker build -f recipes/Dockerfile.$IMAGE --network=host -t ghcr.io/pyfpga/$IMAGE . diff --git a/recipes/Dockerfile.langutils b/recipes/Dockerfile.langutils new file mode 100644 index 0000000..5d18340 --- /dev/null +++ b/recipes/Dockerfile.langutils @@ -0,0 +1,80 @@ +FROM ubuntu:latest AS builder + +WORKDIR /tmp + +ENV DEBIAN_FRONTEND=noninteractive + +RUN apt-get update -qq +RUN apt-get install -y --no-install-recommends ca-certificates git +RUN apt-get install -y --no-install-recommends build-essential cmake curl \ + cargo default-jre flex bison python3 python3-orderedmultidict + +# +# vhd2vl +# + +RUN git clone --depth 1 https://github.com/ldoolitt/vhd2vl +RUN cd vhd2vl && make -j$(nproc) && make install + +# +# sv2v +# + +RUN curl -sSL https://get.haskellstack.org/ | sh + +RUN git clone --depth 1 https://github.com/zachjs/sv2v.git +RUN cd sv2v && make -j$(nproc) && cp bin/sv2v /usr/local/bin + +# +# Slang +# + +RUN git clone --depth 1 https://github.com/MikePopoloski/slang.git +RUN cd slang && cmake -B build && cmake --build build -j$(nproc) \ + && cmake --install build --strip + +# +# Surelog +# + +RUN git clone --depth 1 https://github.com/alainmarcel/Surelog.git +RUN cd Surelog && git submodule update --init --depth 1 --recursive \ + && cmake -B build \ + -DCMAKE_POLICY_VERSION_MINIMUM=3.5 \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=/usr/local \ + && cmake --build build -j$(nproc) \ + && cmake --install build --strip + +# +# Verible +# + +RUN curl -fsSL https://github.com/bazelbuild/bazelisk/releases/latest/download/bazelisk-linux-amd64 \ + -o /usr/local/bin/bazel && chmod +x /usr/local/bin/bazel + +RUN git clone --depth 1 https://github.com/chipsalliance/verible.git +RUN cd verible && bazel build -c opt :install-binaries \ + && .github/bin/simple-install.sh /usr/local/bin + +# +# svlint +# + +RUN cargo install --root /usr/local --git https://github.com/dalance/svlint.git svlint + +# +# clean-up +# + +RUN rm -f /usr/local/bin/stack /usr/local/bin/bazel + +#------------------------------------------------------------------------------ + +FROM ubuntu:latest AS runtime + +COPY --from=builder /usr/local/bin /usr/local/bin +COPY --from=builder /usr/local/lib /usr/local/lib +COPY --from=builder /usr/local/include /usr/local/include +COPY --from=builder /usr/local/share/surelog /usr/local/share/surelog +COPY --from=builder /usr/local/share/uhdm /usr/local/share/uhdm diff --git a/recipes/simulation b/recipes/Dockerfile.simulation similarity index 100% rename from recipes/simulation rename to recipes/Dockerfile.simulation diff --git a/recipes/Dockerfile.synthesis b/recipes/Dockerfile.synthesis new file mode 100644 index 0000000..a356e33 --- /dev/null +++ b/recipes/Dockerfile.synthesis @@ -0,0 +1,93 @@ +FROM ubuntu:latest AS builder + +ENV DEBIAN_FRONTEND=noninteractive + +RUN apt-get update -qq && apt-get install -y --no-install-recommends \ + # Common + build-essential \ + ca-certificates \ + git \ + zlib1g-dev \ + # GHDL + gnat \ + # Yosys + clang \ + bison \ + flex \ + libreadline-dev \ + tcl-dev \ + libffi-dev \ + pkg-config \ + python3 \ + # Synlig + cmake \ + default-jre \ + python3-orderedmultidict \ + && apt-get autoclean && apt-get clean && apt-get -y autoremove \ + && rm -rf /var/lib/apt/lists/* + +WORKDIR /tmp + +# +# GHDL +# + +RUN git clone --depth 1 https://github.com/ghdl/ghdl \ + && mkdir ghdl/build && cd ghdl/build \ + && ../configure --prefix=/usr/local \ + && make -j$(nproc) && make install + +# +# Yosys +# + +RUN git clone --depth 1 https://github.com/YosysHQ/yosys \ + && cd yosys && git submodule update --init --depth 1 \ + && cmake -B build . -DCMAKE_BUILD_TYPE=Release \ + && cmake --build build --config Release -j$(nproc) \ + && cmake --install build --strip + +# +# ghdl-yosys-plugin +# + +RUN git clone --depth 1 https://github.com/ghdl/ghdl-yosys-plugin \ + && cd ghdl-yosys-plugin && git submodule update --init --depth 1 \ + && make -j$(nproc) && make install + +# +# Synlig +# + +RUN git clone --depth 1 https://github.com/chipsalliance/synlig && cd synlig \ + && git submodule update --init --depth 1 --recursive third_party/surelog \ + && git submodule update --init --depth 1 --recursive third_party/yosys \ + && find third_party -name "CMakeLists.txt" -exec sed -i -E 's/cmake_minimum_required\s*\([^)]+\)/cmake_minimum_required(VERSION 3.5)/gI' {} + \ + && sed -i '1s/^/#include \n/' third_party/yosys/libs/json11/json11.cpp \ + && make install -j$(nproc) +# && CMAKE_POLICY_VERSION_MINIMUM=3.5 make install -j$(nproc) + +# +# clean-up +# + +RUN cd /usr/local/lib && rm -fr libghdlvpi.so libghw.so python3.* \ + && cd /usr/local/bin && rm ghwdump yosys-filterlib yosys-smtbmc yosys-witness + +# ----------------------------------------------------------------------------- + +# FROM ubuntu:latest AS runtime + +# RUN apt-get update -qq \ +# && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ +# gnat \ +# libreadline-dev \ +# tcl-dev \ +# && apt-get autoclean && apt-get clean && apt-get -y autoremove \ +# && rm -rf /var/lib/apt/lists/* + +# COPY --from=builder /usr/local/bin /usr/local/bin +# COPY --from=builder /usr/local/lib /usr/local/lib +# COPY --from=builder /usr/local/include/ghdl /usr/local/include/ghdl +# COPY --from=builder /usr/local/share/yosys /usr/local/share/yosys +# COPY --from=builder /usr/local/share/synlig /usr/local/share/synlig diff --git a/recipes/langutils b/recipes/langutils deleted file mode 100644 index 8213ac4..0000000 --- a/recipes/langutils +++ /dev/null @@ -1,91 +0,0 @@ -FROM ubuntu:latest AS builder - -ENV DEBIAN_FRONTEND=noninteractive - -RUN apt-get update -qq && apt-get install -y --no-install-recommends \ - bison \ - build-essential \ - ca-certificates \ - cargo \ - cmake \ - curl \ - default-jre \ - flex \ - git \ - python3 \ - python3-orderedmultidict \ - # sv2v - && curl -sSL https://get.haskellstack.org/ | sh \ - # verible - && curl -fsSL https://github.com/bazelbuild/bazelisk/releases/latest/download/bazelisk-linux-amd64 \ - -o /usr/local/bin/bazel && chmod +x /usr/local/bin/bazel \ - # clean-up - && rm -rf /var/lib/apt/lists/* - -WORKDIR /tmp - -# -# vhd2vl -# - -RUN git clone --depth 1 https://github.com/ldoolitt/vhd2vl \ - && cd vhd2vl && make -j$(nproc) && make install - -# -# sv2v -# - -RUN git clone --depth 1 https://github.com/zachjs/sv2v.git \ - && cd sv2v && make -j$(nproc) && cp bin/sv2v /usr/local/bin - -# -# Slang -# - -RUN git clone --depth 1 https://github.com/MikePopoloski/slang.git \ - && cd slang && cmake -B build && cmake --build build -j$(nproc) \ - && cmake --install build --strip - -# -# Surelog -# - -RUN git clone --depth 1 https://github.com/alainmarcel/Surelog.git \ - && cd Surelog && git submodule update --init --recursive \ - && cmake -B build \ - -DCMAKE_POLICY_VERSION_MINIMUM=3.5 \ - -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_INSTALL_PREFIX=/usr/local \ - && cmake --build build -j$(nproc) \ - && cmake --install build --strip - -# -# Verible -# - -RUN git clone --depth 1 https://github.com/chipsalliance/verible.git \ - && cd verible && bazel build -c opt :install-binaries \ - && .github/bin/simple-install.sh /usr/local/bin - -# -# svlint -# - -RUN cargo install --root /usr/local --git https://github.com/dalance/svlint.git svlint - -# -# clean-up -# - -RUN rm -f /usr/local/bin/stack /usr/local/bin/bazel - -# ----------------------------------------------------------------------------- - -FROM ubuntu:latest AS runtime - -COPY --from=builder /usr/local/bin /usr/local/bin -COPY --from=builder /usr/local/lib /usr/local/lib -COPY --from=builder /usr/local/include /usr/local/include -COPY --from=builder /usr/local/share/pkgconfig /usr/local/share/pkgconfig -COPY --from=builder /usr/local/share/surelog /usr/local/share/surelog -COPY --from=builder /usr/local/share/uhdm /usr/local/share/uhdm diff --git a/recipes/synthesis b/recipes/synthesis deleted file mode 100644 index acae36a..0000000 --- a/recipes/synthesis +++ /dev/null @@ -1,98 +0,0 @@ -FROM ubuntu:latest AS build - -WORKDIR /root - -# -# Dependencies -# - -RUN apt-get update -qq \ - && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ - # Common - build-essential \ - ca-certificates \ - git \ - zlib1g-dev \ - # GHDL - gnat \ - # Yosys - clang \ - bison \ - flex \ - libreadline-dev \ - tcl-dev \ - libffi-dev \ - pkg-config \ - python3 \ - # Synlig - cmake \ - default-jre \ - python3-orderedmultidict \ - && apt-get autoclean && apt-get clean && apt-get -y autoremove \ - && rm -rf /var/lib/apt/lists/* - -# -# GHDL -# - -RUN git clone --depth 1 https://github.com/ghdl/ghdl \ - && mkdir ghdl/build && cd ghdl/build \ - && ../configure --prefix=/usr/local \ - && make -j$(nproc) && make install - -# -# Yosys -# - -RUN git clone --depth 1 https://github.com/YosysHQ/yosys \ - && cd yosys && git submodule update --init \ - && make -j$(nproc) && make install - -# -# ghdl-yosys-plugin -# - -RUN git clone --depth 1 https://github.com/ghdl/ghdl-yosys-plugin \ - && cd ghdl-yosys-plugin && git submodule update --init \ - && make -j$(nproc) && make install - -# -# yosys-slang -# - -RUN git clone --recursive https://github.com/povik/yosys-slang \ - && cd yosys-slang && make -j$(nproc) && make install - -# -# Synlig -# - -RUN git clone --depth 1 https://github.com/chipsalliance/synlig && cd synlig \ - && git submodule update --init --depth 1 --recursive third_party/surelog \ - && git submodule update --init --depth 1 --recursive third_party/yosys \ - && make install -j$(nproc) - -# -# Clean-up -# - -RUN cd /usr/local/lib && rm -fr libghdlvpi.so libghw.so python3.* \ - && cd /usr/local/bin && rm ghwdump yosys-filterlib yosys-smtbmc yosys-witness - -############################################################################### - -FROM ubuntu:latest - -RUN apt-get update -qq \ - && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ - gnat \ - libreadline-dev \ - tcl-dev \ - && apt-get autoclean && apt-get clean && apt-get -y autoremove \ - && rm -rf /var/lib/apt/lists/* - -COPY --from=build /usr/local/bin /usr/local/bin -COPY --from=build /usr/local/lib /usr/local/lib -COPY --from=build /usr/local/include/ghdl /usr/local/include/ghdl -COPY --from=build /usr/local/share/yosys /usr/local/share/yosys -COPY --from=build /usr/local/share/synlig /usr/local/share/synlig From 4a7f9571a1e458421b5eddcd7ba9db52a7b37f91 Mon Sep 17 00:00:00 2001 From: "Rodrigo A. Melo" Date: Sun, 27 Sep 2026 20:40:54 -0300 Subject: [PATCH 08/23] Add individual dockerfiles for slang, surelog, sv2v, svlint, verible and vhd2vl --- recipes/Dockerfile.slang | 21 +++++++++++++++++++++ recipes/Dockerfile.surelog | 31 +++++++++++++++++++++++++++++++ recipes/Dockerfile.sv2v | 24 ++++++++++++++++++++++++ recipes/Dockerfile.svlint | 19 +++++++++++++++++++ recipes/Dockerfile.verible | 26 ++++++++++++++++++++++++++ recipes/Dockerfile.vhd2vl | 20 ++++++++++++++++++++ 6 files changed, 141 insertions(+) create mode 100644 recipes/Dockerfile.slang create mode 100644 recipes/Dockerfile.surelog create mode 100644 recipes/Dockerfile.sv2v create mode 100644 recipes/Dockerfile.svlint create mode 100644 recipes/Dockerfile.verible create mode 100644 recipes/Dockerfile.vhd2vl diff --git a/recipes/Dockerfile.slang b/recipes/Dockerfile.slang new file mode 100644 index 0000000..3ae943d --- /dev/null +++ b/recipes/Dockerfile.slang @@ -0,0 +1,21 @@ +# https://github.com/MikePopoloski/slang + +FROM ubuntu:latest AS builder + +WORKDIR /tmp + +ENV DEBIAN_FRONTEND=noninteractive + +RUN apt-get update -qq +RUN apt-get install -y --no-install-recommends ca-certificates git +RUN apt-get install -y --no-install-recommends build-essential cmake python3 + +RUN git clone --depth 1 https://github.com/MikePopoloski/slang.git +RUN cd slang && cmake -B build && cmake --build build -j$(nproc) \ + && cmake --install build --strip + +#------------------------------------------------------------------------------ + +FROM ubuntu:latest AS runtime + +COPY --from=builder /usr/local/bin /usr/local/bin diff --git a/recipes/Dockerfile.surelog b/recipes/Dockerfile.surelog new file mode 100644 index 0000000..b3748e2 --- /dev/null +++ b/recipes/Dockerfile.surelog @@ -0,0 +1,31 @@ +# https://github.com/chipsalliance/Surelog + +FROM ubuntu:latest AS builder + +WORKDIR /tmp + +ENV DEBIAN_FRONTEND=noninteractive + +RUN apt-get update -qq +RUN apt-get install -y --no-install-recommends ca-certificates git +RUN apt-get install -y --no-install-recommends build-essential cmake default-jre \ + python3 python3-orderedmultidict + +RUN git clone --depth 1 https://github.com/alainmarcel/Surelog.git +RUN cd Surelog && git submodule update --init --depth 1 --recursive \ + && cmake -B build \ + -DCMAKE_POLICY_VERSION_MINIMUM=3.5 \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=/usr/local \ + && cmake --build build -j$(nproc) \ + && cmake --install build --strip + +#------------------------------------------------------------------------------ + +FROM ubuntu:latest AS runtime + +COPY --from=builder /usr/local/bin /usr/local/bin +COPY --from=builder /usr/local/lib /usr/local/lib +COPY --from=builder /usr/local/include /usr/local/include +COPY --from=builder /usr/local/share/surelog /usr/local/share/surelog +COPY --from=builder /usr/local/share/uhdm /usr/local/share/uhdm diff --git a/recipes/Dockerfile.sv2v b/recipes/Dockerfile.sv2v new file mode 100644 index 0000000..427a998 --- /dev/null +++ b/recipes/Dockerfile.sv2v @@ -0,0 +1,24 @@ +# https://github.com/zachjs/sv2v + +FROM ubuntu:latest AS builder + +WORKDIR /tmp + +ENV DEBIAN_FRONTEND=noninteractive + +RUN apt-get update -qq +RUN apt-get install -y --no-install-recommends ca-certificates git +RUN apt-get install -y --no-install-recommends curl + +RUN curl -sSL https://get.haskellstack.org/ | sh + +RUN git clone --depth 1 https://github.com/zachjs/sv2v.git +RUN cd sv2v && make -j$(nproc) && cp bin/sv2v /usr/local/bin + +RUN rm -f /usr/local/bin/stack + +#------------------------------------------------------------------------------ + +FROM ubuntu:latest AS runtime + +COPY --from=builder /usr/local/bin /usr/local/bin diff --git a/recipes/Dockerfile.svlint b/recipes/Dockerfile.svlint new file mode 100644 index 0000000..94409cf --- /dev/null +++ b/recipes/Dockerfile.svlint @@ -0,0 +1,19 @@ +# https://github.com/dalance/svlint + +FROM ubuntu:latest AS builder + +WORKDIR /tmp + +ENV DEBIAN_FRONTEND=noninteractive + +RUN apt-get update -qq +RUN apt-get install -y --no-install-recommends ca-certificates git +RUN apt-get install -y --no-install-recommends cargo + +RUN cargo install --root /usr/local --git https://github.com/dalance/svlint.git svlint + +#------------------------------------------------------------------------------ + +FROM ubuntu:latest AS runtime + +COPY --from=builder /usr/local/bin /usr/local/bin diff --git a/recipes/Dockerfile.verible b/recipes/Dockerfile.verible new file mode 100644 index 0000000..001f9e4 --- /dev/null +++ b/recipes/Dockerfile.verible @@ -0,0 +1,26 @@ +# https://github.com/chipsalliance/verible + +FROM ubuntu:latest AS builder + +WORKDIR /tmp + +ENV DEBIAN_FRONTEND=noninteractive + +RUN apt-get update -qq +RUN apt-get install -y --no-install-recommends ca-certificates git +RUN apt-get install -y --no-install-recommends build-essential curl + +RUN curl -fsSL https://github.com/bazelbuild/bazelisk/releases/latest/download/bazelisk-linux-amd64 \ + -o /usr/local/bin/bazel && chmod +x /usr/local/bin/bazel + +RUN git clone --depth 1 https://github.com/chipsalliance/verible.git +RUN cd verible && bazel build -c opt :install-binaries \ + && .github/bin/simple-install.sh /usr/local/bin + +RUN rm -f /usr/local/bin/bazel + +#------------------------------------------------------------------------------ + +FROM ubuntu:latest AS runtime + +COPY --from=builder /usr/local/bin /usr/local/bin diff --git a/recipes/Dockerfile.vhd2vl b/recipes/Dockerfile.vhd2vl new file mode 100644 index 0000000..53eb9e1 --- /dev/null +++ b/recipes/Dockerfile.vhd2vl @@ -0,0 +1,20 @@ +# https://github.com/ldoolitt/vhd2vl + +FROM ubuntu:latest AS builder + +WORKDIR /tmp + +ENV DEBIAN_FRONTEND=noninteractive + +RUN apt-get update -qq +RUN apt-get install -y --no-install-recommends ca-certificates git +RUN apt-get install -y --no-install-recommends build-essential flex bison + +RUN git clone --depth 1 https://github.com/ldoolitt/vhd2vl +RUN cd vhd2vl && make -j$(nproc) && make install + +#------------------------------------------------------------------------------ + +FROM ubuntu:latest AS runtime + +COPY --from=builder /usr/local/bin /usr/local/bin From a79c8b34bac9680079396e26ea26f101f7a241c5 Mon Sep 17 00:00:00 2001 From: "Rodrigo A. Melo" Date: Sun, 27 Sep 2026 20:40:54 -0300 Subject: [PATCH 09/23] Update README - yosys-slang was renamed as sv-elab --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d5b153e..75b14d4 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ Below is a list of the available containers and their included tools. * [GHDL](https://github.com/ghdl/ghdl) * [Yosys](https://github.com/YosysHQ/yosys) * [ghdl-yosys-plugin](https://github.com/ghdl/ghdl-yosys-plugin) - * [yosys-slang](https://github.com/povik/yosys-slang) + * [sv-elab](https://github.com/povik/sv-elab) * [synlig](https://github.com/chipsalliance/synlig) * `simulation`: tools for simulation * [GHDL](https://github.com/ghdl/ghdl) From 7a89a081860fd8c4444088a9e1e3faa218f691fa Mon Sep 17 00:00:00 2001 From: "Rodrigo A. Melo" Date: Sun, 27 Sep 2026 21:24:19 -0300 Subject: [PATCH 10/23] Ignore slpp_all --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 1a06816..09863dd 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ results +slpp_all From 361df27f654321987a0f68bc54208f7e38a883a3 Mon Sep 17 00:00:00 2001 From: "Rodrigo A. Melo" Date: Sun, 27 Sep 2026 21:25:02 -0300 Subject: [PATCH 11/23] Update langutils test to be able of using PoC recipes --- tests/langutils.sh | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/tests/langutils.sh b/tests/langutils.sh index 0bd1e98..5096769 100644 --- a/tests/langutils.sh +++ b/tests/langutils.sh @@ -2,30 +2,40 @@ set -e -DOCKER="docker run --rm -v $HOME:$HOME -w $PWD --user $(id -u):$(id -g) ghcr.io/pyfpga/langutils" +POC=$1 + +# [[ -z "$POC" ]] && echo "POC is unset" +# [[ -n "$POC" ]] && echo "POC is set" + +[[ -z "$POC" ]] && DOCKER="docker run --rm -v $HOME:$HOME -w $PWD --user $(id -u):$(id -g) ghcr.io/pyfpga/langutils" mkdir -p results +[[ -n "$POC" ]] && DOCKER="docker run --rm -v $HOME:$HOME -w $PWD --user $(id -u):$(id -g) ghcr.io/pyfpga/vhd2vl" $DOCKER vhd2vl --version $DOCKER vhd2vl --quiet hdl/counter.vhdl results/vhd2vl.v test -f results/vhd2vl.v +[[ -n "$POC" ]] && DOCKER="docker run --rm -v $HOME:$HOME -w $PWD --user $(id -u):$(id -g) ghcr.io/pyfpga/sv2v" $DOCKER sv2v --version $DOCKER sv2v hdl/counter.sv --write=results/sv2v.v test -f results/sv2v.v +[[ -n "$POC" ]] && DOCKER="docker run --rm -v $HOME:$HOME -w $PWD --user $(id -u):$(id -g) ghcr.io/pyfpga/slang" $DOCKER slang --version $DOCKER slang hdl/counter.sv --lint-only +[[ -n "$POC" ]] && DOCKER="docker run --rm -v $HOME:$HOME -w $PWD --user $(id -u):$(id -g) ghcr.io/pyfpga/surelog" $DOCKER surelog --version $DOCKER surelog -parse hdl/counter.sv +rm -fr slpp_all +[[ -n "$POC" ]] && DOCKER="docker run --rm -v $HOME:$HOME -w $PWD --user $(id -u):$(id -g) ghcr.io/pyfpga/verible" $DOCKER verible-verilog-syntax --version $DOCKER verible-verilog-lint hdl/counter.sv +[[ -n "$POC" ]] && DOCKER="docker run --rm -v $HOME:$HOME -w $PWD --user $(id -u):$(id -g) ghcr.io/pyfpga/svlint" $DOCKER svlint --version $DOCKER svlint hdl/counter.sv -rm -fr slpp_all - echo "Test passed" From fe1d3c65533d8ee4d60a7ea51f674eb49fb5fa44 Mon Sep 17 00:00:00 2001 From: "Rodrigo A. Melo" Date: Sun, 27 Sep 2026 21:41:58 -0300 Subject: [PATCH 12/23] ci: add paths on push --- .github/workflows/deploy.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index b6be984..ccfdb00 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -2,6 +2,10 @@ name: Deploy Docker Images on: push: + paths: + - 'recipes/Dockerfile.langutils' + - 'recipes/Dockerfile.synthesis' + - 'recipes/Dockerfile.simulation' schedule: - cron: '0 21 * * 5' From 9670af3512fc3361a191a6743bf59e486fecdeb4 Mon Sep 17 00:00:00 2001 From: "Rodrigo A. Melo" Date: Mon, 28 Sep 2026 19:36:36 -0300 Subject: [PATCH 13/23] Add dockerfiles for ghdl, yosys and synlig, update synthesis --- recipes/Dockerfile.ghdl | 21 ++++++++++ recipes/Dockerfile.synlig | 27 +++++++++++++ recipes/Dockerfile.synthesis | 76 ++++++++++-------------------------- recipes/Dockerfile.yosys | 33 ++++++++++++++++ 4 files changed, 101 insertions(+), 56 deletions(-) create mode 100644 recipes/Dockerfile.ghdl create mode 100644 recipes/Dockerfile.synlig create mode 100644 recipes/Dockerfile.yosys diff --git a/recipes/Dockerfile.ghdl b/recipes/Dockerfile.ghdl new file mode 100644 index 0000000..e8ff2f1 --- /dev/null +++ b/recipes/Dockerfile.ghdl @@ -0,0 +1,21 @@ +# https://github.com/ghdl/ghdl + +FROM ubuntu:latest AS builder + +WORKDIR /tmp + +ENV DEBIAN_FRONTEND=noninteractive + +RUN apt-get update -qq +RUN apt-get install -y --no-install-recommends ca-certificates git +RUN apt-get install -y --no-install-recommends build-essential gnat zlib1g-dev + +RUN git clone --depth 1 https://github.com/ghdl/ghdl +RUN mkdir ghdl/build && cd ghdl/build && ../configure --prefix=/usr/local \ + && make -j$(nproc) && make install + +#------------------------------------------------------------------------------ + +FROM ubuntu:latest AS runtime + +COPY --from=builder /usr/local /usr/local diff --git a/recipes/Dockerfile.synlig b/recipes/Dockerfile.synlig new file mode 100644 index 0000000..9e1e1f9 --- /dev/null +++ b/recipes/Dockerfile.synlig @@ -0,0 +1,27 @@ +# https://github.com/chipsalliance/synlig + +FROM ubuntu:latest AS builder + +WORKDIR /tmp + +ENV DEBIAN_FRONTEND=noninteractive + +RUN apt-get update -qq +RUN apt-get install -y --no-install-recommends ca-certificates git +RUN apt-get install -y --no-install-recommends build-essential cmake default-jre \ + python3 python3-orderedmultidict tcl-dev libreadline-dev libffi-dev +RUN apt-get install -y --no-install-recommends bison flex pkg-config + +RUN git clone --depth 1 https://github.com/chipsalliance/synlig +RUN cd synlig \ + && git submodule update --init --depth 1 --recursive third_party/surelog \ + && git submodule update --init --depth 1 --recursive third_party/yosys \ + && find third_party -name "CMakeLists.txt" -exec sed -i -E 's/cmake_minimum_required\s*\([^)]+\)/cmake_minimum_required(VERSION 3.5)/gI' {} + \ + && sed -i '1s/^/#include \n/' third_party/yosys/libs/json11/json11.cpp \ + && make install -j$(nproc) + +#------------------------------------------------------------------------------ + +FROM ubuntu:latest AS runtime + +COPY --from=builder /usr/local /usr/local diff --git a/recipes/Dockerfile.synthesis b/recipes/Dockerfile.synthesis index a356e33..5fa0dcd 100644 --- a/recipes/Dockerfile.synthesis +++ b/recipes/Dockerfile.synthesis @@ -1,48 +1,31 @@ FROM ubuntu:latest AS builder +WORKDIR /tmp + ENV DEBIAN_FRONTEND=noninteractive -RUN apt-get update -qq && apt-get install -y --no-install-recommends \ - # Common - build-essential \ - ca-certificates \ - git \ - zlib1g-dev \ - # GHDL - gnat \ - # Yosys - clang \ - bison \ - flex \ - libreadline-dev \ - tcl-dev \ - libffi-dev \ - pkg-config \ - python3 \ - # Synlig - cmake \ - default-jre \ - python3-orderedmultidict \ - && apt-get autoclean && apt-get clean && apt-get -y autoremove \ - && rm -rf /var/lib/apt/lists/* - -WORKDIR /tmp +RUN apt-get update -qq +RUN apt-get install -y --no-install-recommends ca-certificates git +RUN apt-get install -y --no-install-recommends build-essential cmake default-jre +RUN apt-get install -y --no-install-recommends bison flex pkg-config +RUN apt-get install -y --no-install-recommends gnat zlib1g-dev +RUN apt-get install -y --no-install-recommends python3-orderedmultidict +RUN apt-get install -y --no-install-recommends tcl-dev libreadline-dev libffi-dev # # GHDL # -RUN git clone --depth 1 https://github.com/ghdl/ghdl \ - && mkdir ghdl/build && cd ghdl/build \ - && ../configure --prefix=/usr/local \ +RUN git clone --depth 1 https://github.com/ghdl/ghdl +RUN mkdir ghdl/build && cd ghdl/build && ../configure --prefix=/usr/local \ && make -j$(nproc) && make install # # Yosys # -RUN git clone --depth 1 https://github.com/YosysHQ/yosys \ - && cd yosys && git submodule update --init --depth 1 \ +RUN git clone --depth 1 https://github.com/YosysHQ/yosys +RUN cd yosys && git submodule update --init --depth 1 \ && cmake -B build . -DCMAKE_BUILD_TYPE=Release \ && cmake --build build --config Release -j$(nproc) \ && cmake --install build --strip @@ -51,43 +34,24 @@ RUN git clone --depth 1 https://github.com/YosysHQ/yosys \ # ghdl-yosys-plugin # -RUN git clone --depth 1 https://github.com/ghdl/ghdl-yosys-plugin \ - && cd ghdl-yosys-plugin && git submodule update --init --depth 1 \ +RUN git clone --depth 1 https://github.com/ghdl/ghdl-yosys-plugin +RUN cd ghdl-yosys-plugin && git submodule update --init --depth 1 \ && make -j$(nproc) && make install # # Synlig # -RUN git clone --depth 1 https://github.com/chipsalliance/synlig && cd synlig \ +RUN git clone --depth 1 https://github.com/chipsalliance/synlig +RUN cd synlig \ && git submodule update --init --depth 1 --recursive third_party/surelog \ && git submodule update --init --depth 1 --recursive third_party/yosys \ && find third_party -name "CMakeLists.txt" -exec sed -i -E 's/cmake_minimum_required\s*\([^)]+\)/cmake_minimum_required(VERSION 3.5)/gI' {} + \ && sed -i '1s/^/#include \n/' third_party/yosys/libs/json11/json11.cpp \ && make install -j$(nproc) -# && CMAKE_POLICY_VERSION_MINIMUM=3.5 make install -j$(nproc) - -# -# clean-up -# - -RUN cd /usr/local/lib && rm -fr libghdlvpi.so libghw.so python3.* \ - && cd /usr/local/bin && rm ghwdump yosys-filterlib yosys-smtbmc yosys-witness - -# ----------------------------------------------------------------------------- -# FROM ubuntu:latest AS runtime +#------------------------------------------------------------------------------ -# RUN apt-get update -qq \ -# && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ -# gnat \ -# libreadline-dev \ -# tcl-dev \ -# && apt-get autoclean && apt-get clean && apt-get -y autoremove \ -# && rm -rf /var/lib/apt/lists/* +FROM ubuntu:latest AS runtime -# COPY --from=builder /usr/local/bin /usr/local/bin -# COPY --from=builder /usr/local/lib /usr/local/lib -# COPY --from=builder /usr/local/include/ghdl /usr/local/include/ghdl -# COPY --from=builder /usr/local/share/yosys /usr/local/share/yosys -# COPY --from=builder /usr/local/share/synlig /usr/local/share/synlig +COPY --from=builder /usr/local /usr/local diff --git a/recipes/Dockerfile.yosys b/recipes/Dockerfile.yosys new file mode 100644 index 0000000..43b46c7 --- /dev/null +++ b/recipes/Dockerfile.yosys @@ -0,0 +1,33 @@ +# https://github.com/yosyshq/yosys + +FROM ubuntu:latest AS builder + +WORKDIR /tmp + +ENV DEBIAN_FRONTEND=noninteractive + +RUN apt-get update -qq +RUN apt-get install -y --no-install-recommends ca-certificates git +RUN apt-get install -y --no-install-recommends build-essential cmake python3 +RUN apt-get install -y --no-install-recommends bison flex +RUN apt-get install -y --no-install-recommends gnat zlib1g-dev + +RUN git clone --depth 1 https://github.com/ghdl/ghdl +RUN mkdir ghdl/build && cd ghdl/build && ../configure --prefix=/usr/local \ + && make -j$(nproc) && make install + +RUN git clone --depth 1 https://github.com/YosysHQ/yosys +RUN cd yosys && git submodule update --init --depth 1 \ + && cmake -B build . -DCMAKE_BUILD_TYPE=Release \ + && cmake --build build --config Release -j$(nproc) \ + && cmake --install build --strip + +RUN git clone --depth 1 https://github.com/ghdl/ghdl-yosys-plugin +RUN cd ghdl-yosys-plugin && git submodule update --init --depth 1 \ + && make -j$(nproc) && make install + +#------------------------------------------------------------------------------ + +FROM ubuntu:latest AS runtime + +COPY --from=builder /usr/local /usr/local/bin From b8da457951ce6645f00a355606ea24fa62109a99 Mon Sep 17 00:00:00 2001 From: "Rodrigo A. Melo" Date: Mon, 28 Sep 2026 19:39:06 -0300 Subject: [PATCH 14/23] Simplify final COPY on all the dockerfiles --- recipes/Dockerfile.langutils | 6 +----- recipes/Dockerfile.slang | 2 +- recipes/Dockerfile.surelog | 6 +----- recipes/Dockerfile.sv2v | 2 +- recipes/Dockerfile.svlint | 2 +- recipes/Dockerfile.verible | 2 +- recipes/Dockerfile.vhd2vl | 2 +- 7 files changed, 7 insertions(+), 15 deletions(-) diff --git a/recipes/Dockerfile.langutils b/recipes/Dockerfile.langutils index 5d18340..fb41b8f 100644 --- a/recipes/Dockerfile.langutils +++ b/recipes/Dockerfile.langutils @@ -73,8 +73,4 @@ RUN rm -f /usr/local/bin/stack /usr/local/bin/bazel FROM ubuntu:latest AS runtime -COPY --from=builder /usr/local/bin /usr/local/bin -COPY --from=builder /usr/local/lib /usr/local/lib -COPY --from=builder /usr/local/include /usr/local/include -COPY --from=builder /usr/local/share/surelog /usr/local/share/surelog -COPY --from=builder /usr/local/share/uhdm /usr/local/share/uhdm +COPY --from=builder /usr/local /usr/local diff --git a/recipes/Dockerfile.slang b/recipes/Dockerfile.slang index 3ae943d..c0d24ae 100644 --- a/recipes/Dockerfile.slang +++ b/recipes/Dockerfile.slang @@ -18,4 +18,4 @@ RUN cd slang && cmake -B build && cmake --build build -j$(nproc) \ FROM ubuntu:latest AS runtime -COPY --from=builder /usr/local/bin /usr/local/bin +COPY --from=builder /usr/local /usr/local diff --git a/recipes/Dockerfile.surelog b/recipes/Dockerfile.surelog index b3748e2..2566ed0 100644 --- a/recipes/Dockerfile.surelog +++ b/recipes/Dockerfile.surelog @@ -24,8 +24,4 @@ RUN cd Surelog && git submodule update --init --depth 1 --recursive \ FROM ubuntu:latest AS runtime -COPY --from=builder /usr/local/bin /usr/local/bin -COPY --from=builder /usr/local/lib /usr/local/lib -COPY --from=builder /usr/local/include /usr/local/include -COPY --from=builder /usr/local/share/surelog /usr/local/share/surelog -COPY --from=builder /usr/local/share/uhdm /usr/local/share/uhdm +COPY --from=builder /usr/local /usr/local diff --git a/recipes/Dockerfile.sv2v b/recipes/Dockerfile.sv2v index 427a998..86d3997 100644 --- a/recipes/Dockerfile.sv2v +++ b/recipes/Dockerfile.sv2v @@ -21,4 +21,4 @@ RUN rm -f /usr/local/bin/stack FROM ubuntu:latest AS runtime -COPY --from=builder /usr/local/bin /usr/local/bin +COPY --from=builder /usr/local /usr/local diff --git a/recipes/Dockerfile.svlint b/recipes/Dockerfile.svlint index 94409cf..559346d 100644 --- a/recipes/Dockerfile.svlint +++ b/recipes/Dockerfile.svlint @@ -16,4 +16,4 @@ RUN cargo install --root /usr/local --git https://github.com/dalance/svlint.git FROM ubuntu:latest AS runtime -COPY --from=builder /usr/local/bin /usr/local/bin +COPY --from=builder /usr/local /usr/local diff --git a/recipes/Dockerfile.verible b/recipes/Dockerfile.verible index 001f9e4..c7f7041 100644 --- a/recipes/Dockerfile.verible +++ b/recipes/Dockerfile.verible @@ -23,4 +23,4 @@ RUN rm -f /usr/local/bin/bazel FROM ubuntu:latest AS runtime -COPY --from=builder /usr/local/bin /usr/local/bin +COPY --from=builder /usr/local /usr/local diff --git a/recipes/Dockerfile.vhd2vl b/recipes/Dockerfile.vhd2vl index 53eb9e1..0ff061f 100644 --- a/recipes/Dockerfile.vhd2vl +++ b/recipes/Dockerfile.vhd2vl @@ -17,4 +17,4 @@ RUN cd vhd2vl && make -j$(nproc) && make install FROM ubuntu:latest AS runtime -COPY --from=builder /usr/local/bin /usr/local/bin +COPY --from=builder /usr/local /usr/local From 7420ed667717995189dd46a42228250890e4f81a Mon Sep 17 00:00:00 2001 From: "Rodrigo A. Melo" Date: Mon, 28 Sep 2026 22:41:25 -0300 Subject: [PATCH 15/23] Add dockerfiles for iverilog and verilator, update simulation --- recipes/Dockerfile.iverilog | 24 +++++++++++++ recipes/Dockerfile.simulation | 68 +++++++++++------------------------ recipes/Dockerfile.verilator | 24 +++++++++++++ 3 files changed, 69 insertions(+), 47 deletions(-) create mode 100644 recipes/Dockerfile.iverilog create mode 100644 recipes/Dockerfile.verilator diff --git a/recipes/Dockerfile.iverilog b/recipes/Dockerfile.iverilog new file mode 100644 index 0000000..cdec113 --- /dev/null +++ b/recipes/Dockerfile.iverilog @@ -0,0 +1,24 @@ +# https://github.com/steveicarus/iverilog + +FROM ubuntu:latest AS builder + +WORKDIR /tmp + +ENV DEBIAN_FRONTEND=noninteractive + +RUN apt-get update -qq +RUN apt-get install -y --no-install-recommends ca-certificates git +RUN apt-get install -y --no-install-recommends build-essential bison flex +RUN apt-get install -y --no-install-recommends autoconf gperf + +RUN git clone --depth 1 https://github.com/steveicarus/iverilog +RUN cd iverilog && autoconf && ./configure \ + && make -j$(nproc) && make install + +#------------------------------------------------------------------------------ + +FROM ubuntu:latest AS runtime + +COPY --from=builder /usr/local /usr/local + +RUN ldconfig diff --git a/recipes/Dockerfile.simulation b/recipes/Dockerfile.simulation index 15378d1..1e0a2b3 100644 --- a/recipes/Dockerfile.simulation +++ b/recipes/Dockerfile.simulation @@ -1,75 +1,49 @@ -FROM ubuntu:latest AS build +FROM ubuntu:latest AS builder -WORKDIR /root +WORKDIR /tmp -# -# Dependencies -# +ENV DEBIAN_FRONTEND=noninteractive -RUN apt-get update -qq \ - && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ - # Common - build-essential \ - ca-certificates \ - git \ - python3 \ - zlib1g-dev \ - # GHDL - gnat \ - # iVerilog & Verilator - autoconf \ - bison \ - flex \ - gperf \ - # Verilator - help2man \ - libfl2 \ - libfl-dev \ - zlib1g \ - ccache \ - mold \ - # cocotb - python3-pip \ - libpython3-dev \ - libgoogle-perftools-dev numactl \ - && apt-get autoclean && apt-get clean && apt-get -y autoremove \ - && rm -rf /var/lib/apt/lists/* +RUN apt-get update -qq +RUN apt-get install -y --no-install-recommends ca-certificates git +RUN apt-get install -y --no-install-recommends autoconf build-essential bison flex +RUN apt-get install -y --no-install-recommends autoconf gnat zlib1g-dev libfl-dev +RUN apt-get install -y --no-install-recommends python3 gperf help2man # -# GHDL +# ghdl # -RUN git clone --depth 1 https://github.com/ghdl/ghdl \ - && mkdir ghdl/build && cd ghdl/build \ - && ../configure --prefix=/usr/local \ +RUN git clone --depth 1 https://github.com/ghdl/ghdl +RUN mkdir ghdl/build && cd ghdl/build && ../configure --prefix=/usr/local \ && make -j$(nproc) && make install # # iVerilog # -RUN git clone --depth 1 https://github.com/steveicarus/iverilog \ - && cd iverilog && autoconf && ./configure \ +RUN git clone --depth 1 https://github.com/steveicarus/iverilog +RUN cd iverilog && autoconf && ./configure \ && make -j$(nproc) && make install # # Verilator # -RUN git clone --depth 1 https://github.com/verilator/verilator \ - && cd verilator && autoconf && ./configure \ +RUN git clone --depth 1 https://github.com/verilator/verilator +RUN cd verilator && autoconf && ./configure \ && make -j$(nproc) && make install # # cocotb # -RUN pip install cocotb --break-system-packages +# RUN pip install cocotb --break-system-packages -# -# Clean-up -# +#------------------------------------------------------------------------------ + +FROM ubuntu:latest AS runtime -############################################################################### +COPY --from=builder /usr/local /usr/local -# FROM ubuntu:latest +RUN ldconfig diff --git a/recipes/Dockerfile.verilator b/recipes/Dockerfile.verilator new file mode 100644 index 0000000..9c35508 --- /dev/null +++ b/recipes/Dockerfile.verilator @@ -0,0 +1,24 @@ +# https://github.com/verilator/verilator + +FROM ubuntu:latest AS builder + +WORKDIR /tmp + +ENV DEBIAN_FRONTEND=noninteractive + +RUN apt-get update -qq +RUN apt-get install -y --no-install-recommends ca-certificates git +RUN apt-get install -y --no-install-recommends autoconf build-essential bison flex +RUN apt-get install -y --no-install-recommends python3 libfl-dev help2man + +RUN git clone --depth 1 https://github.com/verilator/verilator +RUN cd verilator && autoconf && ./configure \ + && make -j$(nproc) && make install + +#------------------------------------------------------------------------------ + +FROM ubuntu:latest AS runtime + +COPY --from=builder /usr/local /usr/local + +RUN ldconfig From aa2d247a4ef780bc3c12a3b664ff0444f030ecf5 Mon Sep 17 00:00:00 2001 From: "Rodrigo A. Melo" Date: Mon, 28 Sep 2026 22:42:13 -0300 Subject: [PATCH 16/23] Install missing dependencies for synthesis --- recipes/Dockerfile.synthesis | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/recipes/Dockerfile.synthesis b/recipes/Dockerfile.synthesis index 5fa0dcd..71d20a0 100644 --- a/recipes/Dockerfile.synthesis +++ b/recipes/Dockerfile.synthesis @@ -54,4 +54,13 @@ RUN cd synlig \ FROM ubuntu:latest AS runtime +RUN apt-get update && apt-get install -y --no-install-recommends \ + libffi-dev \ + tcl-dev \ + libreadline-dev \ + && rm -rf /var/lib/apt/lists/* + COPY --from=builder /usr/local /usr/local +COPY --from=builder /usr/lib/x86_64-linux-gnu/libgnat-14.so* /usr/local/lib/ + +RUN ldconfig From d60269b2422fd669fb14bddf8bff3291f874e8ef Mon Sep 17 00:00:00 2001 From: "Rodrigo A. Melo" Date: Mon, 28 Sep 2026 22:43:08 -0300 Subject: [PATCH 17/23] Add a script to check the needed dynamic libraries --- tests/checklibs.sh | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 tests/checklibs.sh diff --git a/tests/checklibs.sh b/tests/checklibs.sh new file mode 100644 index 0000000..25a0275 --- /dev/null +++ b/tests/checklibs.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +set -e + +DOCKER="docker run --rm -v $HOME:$HOME -w $PWD --user $(id -u):$(id -g) ghcr.io/pyfpga/langutils" +echo "* vhd2vl" +$DOCKER ldd /usr/local/bin/vhd2vl +echo "* sv2v" +$DOCKER ldd /usr/local/bin/sv2v +echo "* slang" +$DOCKER ldd /usr/local/bin/slang +echo "* surelog" +$DOCKER ldd /usr/local/bin/surelog +echo "* verible" +$DOCKER ldd /usr/local/bin/verible-verilog-syntax +echo "* svlint" +$DOCKER ldd /usr/local/bin/svlint + +DOCKER="docker run --rm -v $HOME:$HOME -w $PWD --user $(id -u):$(id -g) ghcr.io/pyfpga/synthesis" +echo "* ghdl" +$DOCKER ldd /usr/local/bin/ghdl +echo "* yosys" +$DOCKER ldd /usr/local/bin/yosys +echo "* synlig" +$DOCKER ldd /usr/local/bin/synlig + +DOCKER="docker run --rm -v $HOME:$HOME -w $PWD --user $(id -u):$(id -g) ghcr.io/pyfpga/simulation" +echo "* ghdl" +$DOCKER ldd /usr/local/bin/ghdl +echo "* iverilog" +$DOCKER ldd /usr/local/bin/iverilog +echo "* verilator" +$DOCKER ldd /usr/local/bin/verilator_bin + +echo "Test passed" From ef354ecf18f481d6fdce636c57709c257efd8dc4 Mon Sep 17 00:00:00 2001 From: "Rodrigo A. Melo" Date: Mon, 28 Sep 2026 23:07:57 -0300 Subject: [PATCH 18/23] Reorder packages --- recipes/Dockerfile.ghdl | 9 +++++++-- recipes/Dockerfile.iverilog | 12 +++++++++--- recipes/Dockerfile.langutils | 18 +++++++++++++++--- recipes/Dockerfile.simulation | 18 ++++++++++++++---- recipes/Dockerfile.slang | 9 +++++++-- recipes/Dockerfile.surelog | 12 +++++++++--- recipes/Dockerfile.sv2v | 7 +++++-- recipes/Dockerfile.svlint | 7 +++++-- recipes/Dockerfile.synlig | 15 ++++++++++++--- recipes/Dockerfile.synthesis | 22 ++++++++++++++++------ recipes/Dockerfile.verible | 8 ++++++-- recipes/Dockerfile.verilator | 14 +++++++++++--- recipes/Dockerfile.vhd2vl | 9 +++++++-- recipes/Dockerfile.yosys | 15 +++++++++++---- 14 files changed, 134 insertions(+), 41 deletions(-) diff --git a/recipes/Dockerfile.ghdl b/recipes/Dockerfile.ghdl index e8ff2f1..b79f153 100644 --- a/recipes/Dockerfile.ghdl +++ b/recipes/Dockerfile.ghdl @@ -7,8 +7,13 @@ WORKDIR /tmp ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update -qq -RUN apt-get install -y --no-install-recommends ca-certificates git -RUN apt-get install -y --no-install-recommends build-essential gnat zlib1g-dev +RUN apt-get install -y --no-install-recommends \ + ca-certificates \ + git +RUN apt-get install -y --no-install-recommends \ + build-essential \ + gnat \ + zlib1g-dev RUN git clone --depth 1 https://github.com/ghdl/ghdl RUN mkdir ghdl/build && cd ghdl/build && ../configure --prefix=/usr/local \ diff --git a/recipes/Dockerfile.iverilog b/recipes/Dockerfile.iverilog index cdec113..6cdcfdc 100644 --- a/recipes/Dockerfile.iverilog +++ b/recipes/Dockerfile.iverilog @@ -7,9 +7,15 @@ WORKDIR /tmp ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update -qq -RUN apt-get install -y --no-install-recommends ca-certificates git -RUN apt-get install -y --no-install-recommends build-essential bison flex -RUN apt-get install -y --no-install-recommends autoconf gperf +RUN apt-get install -y --no-install-recommends \ + ca-certificates \ + git +RUN apt-get install -y --no-install-recommends \ + autoconf \ + bison \ + build-essential \ + flex \ + gperf RUN git clone --depth 1 https://github.com/steveicarus/iverilog RUN cd iverilog && autoconf && ./configure \ diff --git a/recipes/Dockerfile.langutils b/recipes/Dockerfile.langutils index fb41b8f..a94bb41 100644 --- a/recipes/Dockerfile.langutils +++ b/recipes/Dockerfile.langutils @@ -5,9 +5,19 @@ WORKDIR /tmp ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update -qq -RUN apt-get install -y --no-install-recommends ca-certificates git -RUN apt-get install -y --no-install-recommends build-essential cmake curl \ - cargo default-jre flex bison python3 python3-orderedmultidict +RUN apt-get install -y --no-install-recommends \ + ca-certificates \ + git +RUN apt-get install -y --no-install-recommends \ + bison \ + build-essential \ + cargo \ + cmake \ + curl \ + default-jre \ + flex \ + python3 \ + python3-orderedmultidict # # vhd2vl @@ -74,3 +84,5 @@ RUN rm -f /usr/local/bin/stack /usr/local/bin/bazel FROM ubuntu:latest AS runtime COPY --from=builder /usr/local /usr/local + +RUN ldconfig diff --git a/recipes/Dockerfile.simulation b/recipes/Dockerfile.simulation index 1e0a2b3..dd53ebe 100644 --- a/recipes/Dockerfile.simulation +++ b/recipes/Dockerfile.simulation @@ -5,10 +5,20 @@ WORKDIR /tmp ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update -qq -RUN apt-get install -y --no-install-recommends ca-certificates git -RUN apt-get install -y --no-install-recommends autoconf build-essential bison flex -RUN apt-get install -y --no-install-recommends autoconf gnat zlib1g-dev libfl-dev -RUN apt-get install -y --no-install-recommends python3 gperf help2man +RUN apt-get install -y --no-install-recommends \ + ca-certificates \ + git +RUN apt-get install -y --no-install-recommends \ + autoconf \ + bison \ + build-essential \ + flex \ + gnat \ + gperf \ + help2man \ + libfl-dev \ + python3 \ + zlib1g-dev # # ghdl diff --git a/recipes/Dockerfile.slang b/recipes/Dockerfile.slang index c0d24ae..a881798 100644 --- a/recipes/Dockerfile.slang +++ b/recipes/Dockerfile.slang @@ -7,8 +7,13 @@ WORKDIR /tmp ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update -qq -RUN apt-get install -y --no-install-recommends ca-certificates git -RUN apt-get install -y --no-install-recommends build-essential cmake python3 +RUN apt-get install -y --no-install-recommends \ + ca-certificates \ + git +RUN apt-get install -y --no-install-recommends \ + build-essential \ + cmake \ + python3 RUN git clone --depth 1 https://github.com/MikePopoloski/slang.git RUN cd slang && cmake -B build && cmake --build build -j$(nproc) \ diff --git a/recipes/Dockerfile.surelog b/recipes/Dockerfile.surelog index 2566ed0..dc5bddb 100644 --- a/recipes/Dockerfile.surelog +++ b/recipes/Dockerfile.surelog @@ -7,9 +7,15 @@ WORKDIR /tmp ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update -qq -RUN apt-get install -y --no-install-recommends ca-certificates git -RUN apt-get install -y --no-install-recommends build-essential cmake default-jre \ - python3 python3-orderedmultidict +RUN apt-get install -y --no-install-recommends \ + ca-certificates \ + git +RUN apt-get install -y --no-install-recommends \ + build-essential \ + cmake \ + default-jre \ + python3 \ + python3-orderedmultidict RUN git clone --depth 1 https://github.com/alainmarcel/Surelog.git RUN cd Surelog && git submodule update --init --depth 1 --recursive \ diff --git a/recipes/Dockerfile.sv2v b/recipes/Dockerfile.sv2v index 86d3997..ac8d85f 100644 --- a/recipes/Dockerfile.sv2v +++ b/recipes/Dockerfile.sv2v @@ -7,8 +7,11 @@ WORKDIR /tmp ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update -qq -RUN apt-get install -y --no-install-recommends ca-certificates git -RUN apt-get install -y --no-install-recommends curl +RUN apt-get install -y --no-install-recommends \ + ca-certificates \ + git +RUN apt-get install -y --no-install-recommends \ + curl RUN curl -sSL https://get.haskellstack.org/ | sh diff --git a/recipes/Dockerfile.svlint b/recipes/Dockerfile.svlint index 559346d..b7570c9 100644 --- a/recipes/Dockerfile.svlint +++ b/recipes/Dockerfile.svlint @@ -7,8 +7,11 @@ WORKDIR /tmp ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update -qq -RUN apt-get install -y --no-install-recommends ca-certificates git -RUN apt-get install -y --no-install-recommends cargo +RUN apt-get install -y --no-install-recommends \ + ca-certificates \ + git +RUN apt-get install -y --no-install-recommends \ + cargo RUN cargo install --root /usr/local --git https://github.com/dalance/svlint.git svlint diff --git a/recipes/Dockerfile.synlig b/recipes/Dockerfile.synlig index 9e1e1f9..3508ca1 100644 --- a/recipes/Dockerfile.synlig +++ b/recipes/Dockerfile.synlig @@ -7,9 +7,18 @@ WORKDIR /tmp ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update -qq -RUN apt-get install -y --no-install-recommends ca-certificates git -RUN apt-get install -y --no-install-recommends build-essential cmake default-jre \ - python3 python3-orderedmultidict tcl-dev libreadline-dev libffi-dev +RUN apt-get install -y --no-install-recommends \ + ca-certificates \ + git +RUN apt-get install -y --no-install-recommends \ + build-essential \ + cmake \ + default-jre \ + libffi-dev \ + libreadline-dev \ + python3 \ + python3-orderedmultidict \ + tcl-dev RUN apt-get install -y --no-install-recommends bison flex pkg-config RUN git clone --depth 1 https://github.com/chipsalliance/synlig diff --git a/recipes/Dockerfile.synthesis b/recipes/Dockerfile.synthesis index 71d20a0..d7d0e6b 100644 --- a/recipes/Dockerfile.synthesis +++ b/recipes/Dockerfile.synthesis @@ -5,12 +5,22 @@ WORKDIR /tmp ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update -qq -RUN apt-get install -y --no-install-recommends ca-certificates git -RUN apt-get install -y --no-install-recommends build-essential cmake default-jre -RUN apt-get install -y --no-install-recommends bison flex pkg-config -RUN apt-get install -y --no-install-recommends gnat zlib1g-dev -RUN apt-get install -y --no-install-recommends python3-orderedmultidict -RUN apt-get install -y --no-install-recommends tcl-dev libreadline-dev libffi-dev +RUN apt-get install -y --no-install-recommends \ + ca-certificates \ + git +RUN apt-get install -y --no-install-recommends \ + bison \ + build-essential \ + cmake \ + default-jre \ + flex \ + gnat \ + libffi-dev \ + libreadline-dev \ + pkg-config \ + python3-orderedmultidict \ + tcl-dev \ + zlib1g-dev # # GHDL diff --git a/recipes/Dockerfile.verible b/recipes/Dockerfile.verible index c7f7041..f953523 100644 --- a/recipes/Dockerfile.verible +++ b/recipes/Dockerfile.verible @@ -7,8 +7,12 @@ WORKDIR /tmp ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update -qq -RUN apt-get install -y --no-install-recommends ca-certificates git -RUN apt-get install -y --no-install-recommends build-essential curl +RUN apt-get install -y --no-install-recommends \ + ca-certificates \ + git +RUN apt-get install -y --no-install-recommends \ + build-essential \ + curl RUN curl -fsSL https://github.com/bazelbuild/bazelisk/releases/latest/download/bazelisk-linux-amd64 \ -o /usr/local/bin/bazel && chmod +x /usr/local/bin/bazel diff --git a/recipes/Dockerfile.verilator b/recipes/Dockerfile.verilator index 9c35508..a06f006 100644 --- a/recipes/Dockerfile.verilator +++ b/recipes/Dockerfile.verilator @@ -7,9 +7,17 @@ WORKDIR /tmp ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update -qq -RUN apt-get install -y --no-install-recommends ca-certificates git -RUN apt-get install -y --no-install-recommends autoconf build-essential bison flex -RUN apt-get install -y --no-install-recommends python3 libfl-dev help2man +RUN apt-get install -y --no-install-recommends \ + ca-certificates \ + git +RUN apt-get install -y --no-install-recommends \ + autoconf \ + bison \ + build-essential \ + flex \ + help2man \ + libfl-dev \ + python3 RUN git clone --depth 1 https://github.com/verilator/verilator RUN cd verilator && autoconf && ./configure \ diff --git a/recipes/Dockerfile.vhd2vl b/recipes/Dockerfile.vhd2vl index 0ff061f..f312df4 100644 --- a/recipes/Dockerfile.vhd2vl +++ b/recipes/Dockerfile.vhd2vl @@ -7,8 +7,13 @@ WORKDIR /tmp ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update -qq -RUN apt-get install -y --no-install-recommends ca-certificates git -RUN apt-get install -y --no-install-recommends build-essential flex bison +RUN apt-get install -y --no-install-recommends \ + ca-certificates \ + git +RUN apt-get install -y --no-install-recommends \ + bison \ + build-essential \ + flex RUN git clone --depth 1 https://github.com/ldoolitt/vhd2vl RUN cd vhd2vl && make -j$(nproc) && make install diff --git a/recipes/Dockerfile.yosys b/recipes/Dockerfile.yosys index 43b46c7..91289c4 100644 --- a/recipes/Dockerfile.yosys +++ b/recipes/Dockerfile.yosys @@ -7,10 +7,17 @@ WORKDIR /tmp ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update -qq -RUN apt-get install -y --no-install-recommends ca-certificates git -RUN apt-get install -y --no-install-recommends build-essential cmake python3 -RUN apt-get install -y --no-install-recommends bison flex -RUN apt-get install -y --no-install-recommends gnat zlib1g-dev +RUN apt-get install -y --no-install-recommends \ + ca-certificates \ + git +RUN apt-get install -y --no-install-recommends \ + bison \ + build-essential \ + cmake \ + flex \ + gnat \ + python3 \ + zlib1g-dev RUN git clone --depth 1 https://github.com/ghdl/ghdl RUN mkdir ghdl/build && cd ghdl/build && ../configure --prefix=/usr/local \ From 0fbc1b145ff6bb2358ea58bc1ed5a8b60d986f4e Mon Sep 17 00:00:00 2001 From: "Rodrigo A. Melo" Date: Tue, 29 Sep 2026 19:35:08 -0300 Subject: [PATCH 19/23] Install cocotb using a venv --- recipes/Dockerfile.simulation | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/recipes/Dockerfile.simulation b/recipes/Dockerfile.simulation index dd53ebe..a85b8c6 100644 --- a/recipes/Dockerfile.simulation +++ b/recipes/Dockerfile.simulation @@ -18,6 +18,9 @@ RUN apt-get install -y --no-install-recommends \ help2man \ libfl-dev \ python3 \ + python3-dev \ + python3-pip \ + python3-venv \ zlib1g-dev # @@ -50,10 +53,31 @@ RUN cd verilator && autoconf && ./configure \ # RUN pip install cocotb --break-system-packages +RUN python3 -m venv /opt/venv && /opt/venv/bin/pip install --no-cache-dir cocotb + +# +# Optimization +# + +RUN strip /usr/local/bin/* 2>/dev/null || true +RUN find /usr/local/lib -name "*.so*" -exec strip --strip-unneeded {} + 2>/dev/null || true + #------------------------------------------------------------------------------ FROM ubuntu:latest AS runtime +ENV PATH="/opt/venv/bin:$PATH" + +RUN apt-get update -qq && apt-get install -y --no-install-recommends \ + g++ \ + make \ + perl \ + python3 \ + libgnat-14 \ + zlib1g \ + && rm -rf /var/lib/apt/lists/* + COPY --from=builder /usr/local /usr/local +COPY --from=builder /opt/venv /opt/venv RUN ldconfig From e7fcefefbf267d395c7e33fefcd85426bd719d1e Mon Sep 17 00:00:00 2001 From: "Rodrigo A. Melo" Date: Tue, 29 Sep 2026 19:35:41 -0300 Subject: [PATCH 20/23] Modify how libgnat is installed --- recipes/Dockerfile.synthesis | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/Dockerfile.synthesis b/recipes/Dockerfile.synthesis index d7d0e6b..97f3cfa 100644 --- a/recipes/Dockerfile.synthesis +++ b/recipes/Dockerfile.synthesis @@ -64,13 +64,13 @@ RUN cd synlig \ FROM ubuntu:latest AS runtime -RUN apt-get update && apt-get install -y --no-install-recommends \ +RUN apt-get update -qq && apt-get install -y --no-install-recommends \ libffi-dev \ tcl-dev \ + libgnat-14 \ libreadline-dev \ && rm -rf /var/lib/apt/lists/* COPY --from=builder /usr/local /usr/local -COPY --from=builder /usr/lib/x86_64-linux-gnu/libgnat-14.so* /usr/local/lib/ RUN ldconfig From 3c47d8ccbddb4c99d64fe2ce0a2e857a1f60b142 Mon Sep 17 00:00:00 2001 From: "Rodrigo A. Melo" Date: Tue, 29 Sep 2026 19:37:43 -0300 Subject: [PATCH 21/23] Add ldconfig when missing --- recipes/Dockerfile.ghdl | 2 ++ recipes/Dockerfile.slang | 2 ++ recipes/Dockerfile.surelog | 2 ++ recipes/Dockerfile.sv2v | 2 ++ recipes/Dockerfile.svlint | 2 ++ recipes/Dockerfile.synlig | 2 ++ recipes/Dockerfile.verible | 2 ++ recipes/Dockerfile.vhd2vl | 2 ++ recipes/Dockerfile.yosys | 2 ++ 9 files changed, 18 insertions(+) diff --git a/recipes/Dockerfile.ghdl b/recipes/Dockerfile.ghdl index b79f153..418f50e 100644 --- a/recipes/Dockerfile.ghdl +++ b/recipes/Dockerfile.ghdl @@ -24,3 +24,5 @@ RUN mkdir ghdl/build && cd ghdl/build && ../configure --prefix=/usr/local \ FROM ubuntu:latest AS runtime COPY --from=builder /usr/local /usr/local + +RUN ldconfig diff --git a/recipes/Dockerfile.slang b/recipes/Dockerfile.slang index a881798..aa237e8 100644 --- a/recipes/Dockerfile.slang +++ b/recipes/Dockerfile.slang @@ -24,3 +24,5 @@ RUN cd slang && cmake -B build && cmake --build build -j$(nproc) \ FROM ubuntu:latest AS runtime COPY --from=builder /usr/local /usr/local + +RUN ldconfig diff --git a/recipes/Dockerfile.surelog b/recipes/Dockerfile.surelog index dc5bddb..123bc71 100644 --- a/recipes/Dockerfile.surelog +++ b/recipes/Dockerfile.surelog @@ -31,3 +31,5 @@ RUN cd Surelog && git submodule update --init --depth 1 --recursive \ FROM ubuntu:latest AS runtime COPY --from=builder /usr/local /usr/local + +RUN ldconfig diff --git a/recipes/Dockerfile.sv2v b/recipes/Dockerfile.sv2v index ac8d85f..3525752 100644 --- a/recipes/Dockerfile.sv2v +++ b/recipes/Dockerfile.sv2v @@ -25,3 +25,5 @@ RUN rm -f /usr/local/bin/stack FROM ubuntu:latest AS runtime COPY --from=builder /usr/local /usr/local + +RUN ldconfig diff --git a/recipes/Dockerfile.svlint b/recipes/Dockerfile.svlint index b7570c9..ce0a726 100644 --- a/recipes/Dockerfile.svlint +++ b/recipes/Dockerfile.svlint @@ -20,3 +20,5 @@ RUN cargo install --root /usr/local --git https://github.com/dalance/svlint.git FROM ubuntu:latest AS runtime COPY --from=builder /usr/local /usr/local + +RUN ldconfig diff --git a/recipes/Dockerfile.synlig b/recipes/Dockerfile.synlig index 3508ca1..af58541 100644 --- a/recipes/Dockerfile.synlig +++ b/recipes/Dockerfile.synlig @@ -34,3 +34,5 @@ RUN cd synlig \ FROM ubuntu:latest AS runtime COPY --from=builder /usr/local /usr/local + +RUN ldconfig diff --git a/recipes/Dockerfile.verible b/recipes/Dockerfile.verible index f953523..dcd5766 100644 --- a/recipes/Dockerfile.verible +++ b/recipes/Dockerfile.verible @@ -28,3 +28,5 @@ RUN rm -f /usr/local/bin/bazel FROM ubuntu:latest AS runtime COPY --from=builder /usr/local /usr/local + +RUN ldconfig diff --git a/recipes/Dockerfile.vhd2vl b/recipes/Dockerfile.vhd2vl index f312df4..f3a955b 100644 --- a/recipes/Dockerfile.vhd2vl +++ b/recipes/Dockerfile.vhd2vl @@ -23,3 +23,5 @@ RUN cd vhd2vl && make -j$(nproc) && make install FROM ubuntu:latest AS runtime COPY --from=builder /usr/local /usr/local + +RUN ldconfig diff --git a/recipes/Dockerfile.yosys b/recipes/Dockerfile.yosys index 91289c4..01eb070 100644 --- a/recipes/Dockerfile.yosys +++ b/recipes/Dockerfile.yosys @@ -38,3 +38,5 @@ RUN cd ghdl-yosys-plugin && git submodule update --init --depth 1 \ FROM ubuntu:latest AS runtime COPY --from=builder /usr/local /usr/local/bin + +RUN ldconfig From df0f226f8f61c0281e03be4cb08d6bc9cc4141e2 Mon Sep 17 00:00:00 2001 From: "Rodrigo A. Melo" Date: Tue, 29 Sep 2026 19:38:29 -0300 Subject: [PATCH 22/23] Remove to load the slang plugin, not needed anymore --- tests/synthesis.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/synthesis.sh b/tests/synthesis.sh index e8e881c..3607345 100644 --- a/tests/synthesis.sh +++ b/tests/synthesis.sh @@ -8,7 +8,7 @@ mkdir -p results $DOCKER ghdl --version $DOCKER yosys -m ghdl -V -$DOCKER yosys -m slang -V +$DOCKER yosys -V $DOCKER synlig -V $DOCKER ghdl synth --workdir=results hdl/counter.vhdl -e counter > results/ghdl.vhdl @@ -27,7 +27,6 @@ write_verilog -noattr results/yosys.v ' $DOCKER yosys -Q -p ' -plugin -i slang read_slang hdl/counter.sv -top counter write_verilog -noattr results/yosys-slang.v ' From a7307d508f051271f10c77df721c27121cdacf98 Mon Sep 17 00:00:00 2001 From: "Rodrigo A. Melo" Date: Tue, 29 Sep 2026 19:39:07 -0300 Subject: [PATCH 23/23] Add the sanity script to build and test all --- sanity.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 sanity.sh diff --git a/sanity.sh b/sanity.sh new file mode 100644 index 0000000..9dbdb17 --- /dev/null +++ b/sanity.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +set -e + +for dockerfile in "recipes"/Dockerfile.*; do + name="${dockerfile##*Dockerfile.}" + echo "Processing target: ${name}" + bash build.sh "${name}" +done + +cd tests +bash langutils.sh +bash simulation.sh +bash synthesis.sh +bash checklibs.sh