From f2ebc3f7b14e1847798fecdf1c12cd3311cb214e Mon Sep 17 00:00:00 2001 From: Krystine Sherwin <93062060+KrystalDelusion@users.noreply.github.com> Date: Thu, 25 Apr 2024 09:39:23 +1200 Subject: [PATCH 01/56] github: Add template for documentation issues --- .github/ISSUE_TEMPLATE/docs_report.yml | 55 ++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/docs_report.yml diff --git a/.github/ISSUE_TEMPLATE/docs_report.yml b/.github/ISSUE_TEMPLATE/docs_report.yml new file mode 100644 index 00000000000..aa65c63b9c9 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/docs_report.yml @@ -0,0 +1,55 @@ +name: Documentation Report +description: Report a problem with the Yosys documentation +labels: ["pending-verification"] +body: + - type: markdown + attributes: + value: > + + If you have a general question, please ask it in the [Discussions](https://github.com/YosysHQ/yosys/discussions) area + or join our [IRC Channel](https://web.libera.chat/#yosys) or [Community Slack](https://join.slack.com/t/yosyshq/shared_invite/zt-1aopkns2q-EiQ97BeQDt_pwvE41sGSuA). + + + If you have found a bug in Yosys, or in building the documentation, + please fill out the Bug Report issue form, this form is for problems + with the live documentation on [Read the + Docs](https://yosyshq.readthedocs.io/projects/yosys/). Please only + report problems that appear on the latest version of the documentation. + + + Please contact [YosysHQ GmbH](https://www.yosyshq.com/) if you need + commercial support for Yosys. + + - type: input + id: docs_url + attributes: + label: Link to page + description: "Please provide a link to the page where the problem was found." + placeholder: "e.g. https://yosyshq.readthedocs.io/projects/yosys/" + validations: + required: true + + - type: input + id: build_number + attributes: + label: Build number + description: "If possible, please provide the latest build number from https://readthedocs.org/projects/yosys/builds/." + placeholder: "e.g. Build #24078236" + validations: + required: false + + - type: textarea + id: problem + attributes: + label: Issue + description: "Please describe what is incorrect, invalid, or missing." + validations: + required: true + + - type: textarea + id: expected + attributes: + label: Expected + description: "If applicable, please describe what should appear instead." + validations: + required: false From a2c1b268d9fa664fcd08723cdb673ce9ea87e786 Mon Sep 17 00:00:00 2001 From: Ethan Mahintorabi Date: Wed, 8 May 2024 01:00:06 +0000 Subject: [PATCH 02/56] frontend: Fixes verific import around range order Test Case ``` module packed_dimensions_range_ordering ( input wire [0:4-1] in, output wire [4-1:0] out ); assign out = in; endmodule : packed_dimensions_range_ordering module instanciates_packed_dimensions_range_ordering ( input wire [4-1:0] in, output wire [4-1:0] out ); packed_dimensions_range_ordering U0 ( .in (in), .out(out) ); endmodule : instanciates_packed_dimensions_range_ordering ``` ``` // with verific, does not pass formal module instanciates_packed_dimensions_range_ordering(in, out); input [3:0] in; wire [3:0] in; output [3:0] out; wire [3:0] out; assign out = { in[0], in[1], in[2], in[3] }; endmodule // with surelog, passes formal module instanciates_packed_dimensions_range_ordering(in, out); input [3:0] in; wire [3:0] in; output [3:0] out; wire [3:0] out; assign out = in; endmodule ``` Signed-off-by: Ethan Mahintorabi --- frontends/verific/verific.cc | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/frontends/verific/verific.cc b/frontends/verific/verific.cc index 81e79f7497f..6203013bf68 100644 --- a/frontends/verific/verific.cc +++ b/frontends/verific/verific.cc @@ -2156,8 +2156,16 @@ void VerificImporter::import_netlist(RTLIL::Design *design, Netlist *nl, std::ma int port_offset = 0; if (pr->GetPort()->Bus()) { port_name = pr->GetPort()->Bus()->Name(); - port_offset = pr->GetPort()->Bus()->IndexOf(pr->GetPort()) - - min(pr->GetPort()->Bus()->LeftIndex(), pr->GetPort()->Bus()->RightIndex()); + int msb = pr->GetPort()->Bus()->LeftIndex(); + int lsb = pr->GetPort()->Bus()->RightIndex(); + int index_of_port = pr->GetPort()->Bus()->IndexOf(pr->GetPort()); + port_offset = index_of_port - min(msb, lsb); + // In cases where the msb order is flipped we need to make sure + // that the indicies match LSB = 0 order to match the std::vector + // to SigSpec LSB = 0 precondition. + if (lsb > msb) { + port_offset = abs(port_offset - lsb); + } } IdString port_name_id = RTLIL::escape_id(port_name); auto &sigvec = cell_port_conns[port_name_id]; From c039da2ec167e2ef825357b09e6f7713c4a476df Mon Sep 17 00:00:00 2001 From: Ethan Mahintorabi Date: Wed, 8 May 2024 01:09:52 +0000 Subject: [PATCH 03/56] renames variables for more code clairty Signed-off-by: Ethan Mahintorabi --- frontends/verific/verific.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/frontends/verific/verific.cc b/frontends/verific/verific.cc index 6203013bf68..a18f9fc877b 100644 --- a/frontends/verific/verific.cc +++ b/frontends/verific/verific.cc @@ -2156,15 +2156,15 @@ void VerificImporter::import_netlist(RTLIL::Design *design, Netlist *nl, std::ma int port_offset = 0; if (pr->GetPort()->Bus()) { port_name = pr->GetPort()->Bus()->Name(); - int msb = pr->GetPort()->Bus()->LeftIndex(); - int lsb = pr->GetPort()->Bus()->RightIndex(); + int msb_index = pr->GetPort()->Bus()->LeftIndex(); + int lsb_index = pr->GetPort()->Bus()->RightIndex(); int index_of_port = pr->GetPort()->Bus()->IndexOf(pr->GetPort()); - port_offset = index_of_port - min(msb, lsb); + port_offset = index_of_port - min(msb_index, lsb_index); // In cases where the msb order is flipped we need to make sure // that the indicies match LSB = 0 order to match the std::vector // to SigSpec LSB = 0 precondition. - if (lsb > msb) { - port_offset = abs(port_offset - lsb); + if (lsb_index > msb_index) { + port_offset = abs(port_offset - lsb_index); } } IdString port_name_id = RTLIL::escape_id(port_name); From 82a4a87c97e8755e915bade43cf4f8010787ac42 Mon Sep 17 00:00:00 2001 From: Ethan Mahintorabi Date: Wed, 8 May 2024 20:28:37 +0000 Subject: [PATCH 04/56] Fixes error with vector indicies of the form [2:7] [-12:7] Make sure that we correctly adjust the value to align it to a zero indexed list with lsb = 0 Signed-off-by: Ethan Mahintorabi --- frontends/verific/verific.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontends/verific/verific.cc b/frontends/verific/verific.cc index a18f9fc877b..b4b0664d341 100644 --- a/frontends/verific/verific.cc +++ b/frontends/verific/verific.cc @@ -2164,7 +2164,7 @@ void VerificImporter::import_netlist(RTLIL::Design *design, Netlist *nl, std::ma // that the indicies match LSB = 0 order to match the std::vector // to SigSpec LSB = 0 precondition. if (lsb_index > msb_index) { - port_offset = abs(port_offset - lsb_index); + port_offset = abs(port_offset - (lsb_index - min(msb_index, lsb_index))); } } IdString port_name_id = RTLIL::escape_id(port_name); From fd84a3378eee639663005577c0b180b83cbbbd91 Mon Sep 17 00:00:00 2001 From: "Emil J. Tywoniak" Date: Thu, 9 May 2024 18:31:18 +0200 Subject: [PATCH 05/56] docs: Document $lut and $sop --- .../yosys_internals/formats/cell_library.rst | 44 ++++++++++++++++++- 1 file changed, 42 insertions(+), 2 deletions(-) diff --git a/docs/source/yosys_internals/formats/cell_library.rst b/docs/source/yosys_internals/formats/cell_library.rst index 2b8dc300154..69e82774c1f 100644 --- a/docs/source/yosys_internals/formats/cell_library.rst +++ b/docs/source/yosys_internals/formats/cell_library.rst @@ -661,6 +661,48 @@ The CONFIG parameter carries the following information: B is an array of concatenated 1-bit-wide unsigned integers to also be summed up. +Arbitrary logic functions +~~~~~~~~~~~~~~~~~~~~~~~~~ + +The ``$lut`` cell type implements a single-output LUT (lookup table). +It implements an arbitrary logic function with its ``\LUT`` parameter to map +input port ``\A`` to values of ``\Y`` output port values. +In psuedocode: ``Y = \LUT[A]``. +``\A`` has width set by parameter ``\WIDTH`` and ``\Y`` has a width of 1. +Every logic function with a single bit output has a unique ``$lut`` +representation. + +The ``$sop`` cell type implements a sum-of-products expression, also known +as disjunctive normal form (DNF). It implements an arbitrary logic function. +Its structure mimics a programmable logic array (PLA). +Output port ``\Y`` is the sum of products of the bits of the input port ``\A`` +as defined by parameter ``\TABLE``. ``\A`` is ``\WIDTH`` bits wide. +The number of products in the sum is set by parameter ``\DEPTH``, and each +product has two bits for each input bit - for the presence of the +unnegated and negated version of said input bit in the product. +Therefore the ``\TABLE`` parameter holds ``2 * \WIDTH * \DEPTH`` bits. + +For example: + +Let ``\WIDTH`` be 3. We would like to represent ``\Y =~\A[0] + \A[1]~\A[2]``. +There are 2 products to be summed, so ``\DEPTH`` shall be 2. + +.. code-block:: + ~A[2]-----┐ + A[2]----┐| + ~A[1]---┐|| + A[1]--┐||| + ~A[0]-┐|||| + A[0]┐||||| product formula + 010000 ~\A[0] + 001001 \A[1]~\A[2] + +So the value of ``\TABLE`` will become ``010000001001``. + +Any logic function with a single bit output can be represented with +``$sop`` but may have variously minimized or ordered summands represented +in the ``\TABLE`` values. + Specify rules ~~~~~~~~~~~~~ @@ -1192,6 +1234,4 @@ file via ABC using the abc pass. .. todo:: Add information about ``$slice`` and ``$concat`` cells. -.. todo:: Add information about ``$lut`` and ``$sop`` cells. - .. todo:: Add information about ``$alu``, ``$fa``, and ``$lcu`` cells. From 69eb39582b36101f005ca6c73eb908ca708f3417 Mon Sep 17 00:00:00 2001 From: Krystine Sherwin <93062060+KrystalDelusion@users.noreply.github.com> Date: Mon, 5 Feb 2024 21:48:25 +1300 Subject: [PATCH 06/56] ci: Introduce artifacts Separates `test-linux` into `build-linux` and `test-linux`, wherein `build-` builds out of tree, and uploading the build for the `test-` job. Tar compression is done to retain execution permissions when downloading build artifact. When calling `make test`, override `TARGETS` and `EXTRA_TARGETS` to prevent rebuild. --- .github/workflows/test-linux.yml | 66 ++++++++++++++++++++++++++------ .github/workflows/test-macos.yml | 9 ++++- 2 files changed, 61 insertions(+), 14 deletions(-) diff --git a/.github/workflows/test-linux.yml b/.github/workflows/test-linux.yml index 911b3b66e4d..c4098edbeff 100644 --- a/.github/workflows/test-linux.yml +++ b/.github/workflows/test-linux.yml @@ -1,6 +1,12 @@ name: Build and run tests (Linux) -on: [push, pull_request] +on: + pull_request: + branches: + - master + push: + branches: + - master jobs: pre_job: @@ -17,7 +23,7 @@ jobs: # only run on push *or* pull_request, not both concurrent_skipping: 'same_content_newer' - test-linux: + build-linux: needs: pre_job if: needs.pre_job.outputs.should_skip != 'true' runs-on: ${{ matrix.os.id }} @@ -123,25 +129,61 @@ jobs: make -j${{ env.procs }} make install - - name: Build yosys + - name: Build yosys out-of-tree + shell: bash + run: | + mkdir build + cd build + make -f ../Makefile config-${CC%%-*} + make -f ../Makefile -j${{ env.procs }} CXXSTD=${{ matrix.cpp_std }} CC=$CC CXX=$CC LD=$CC + + - name: Log yosys-config output + run: | + ./yosys-config || true + + - name: Compress build shell: bash run: | - make config-${CC%%-*} - make -j${{ env.procs }} CXXSTD=${{ matrix.cpp_std }} CC=$CC CXX=$CC LD=$CC + cd build + tar -cvf ../build.tar Makefile.conf share/ yosys yosys-* - name: Store build artifact if: (matrix.cpp_std == 'c++11') && (matrix.compiler == 'gcc-11') uses: actions/upload-artifact@v4 with: - name: compiled-yosys - path: yosys + name: build-artifact + path: build.tar + retention-days: 1 - - name: Run tests - if: (matrix.cpp_std == 'c++11') && (matrix.compiler == 'gcc-11') + test-linux: + name: Run tests + needs: build-linux + runs-on: ubuntu-latest + steps: + - name: Install Dependencies + shell: bash + run: | + sudo apt-get update + sudo apt-get install gperf build-essential bison flex libreadline-dev gawk tcl-dev libffi-dev git graphviz xdot pkg-config python3 libboost-system-dev libboost-python-dev libboost-filesystem-dev zlib1g-dev + + - name: Runtime environment shell: bash + env: + WORKSPACE: ${{ github.workspace }} run: | - make -j${{ env.procs }} test CXXSTD=${{ matrix.cpp_std }} CC=$CC CXX=$CC LD=$CC + echo "procs=$(nproc)" >> $GITHUB_ENV - - name: Log yosys-config output + - name: Download build artifact + uses: actions/download-artifact@v4 + with: + name: build-artifact + + - name: Uncompress build + shell: bash + run: + tar -xvf build.tar + + - name: Run tests + shell: bash run: | - ./yosys-config || true + make -j${{ env.procs }} test TARGETS= EXTRA_TARGETS= diff --git a/.github/workflows/test-macos.yml b/.github/workflows/test-macos.yml index cbba8adbd66..ed63c8f35b7 100644 --- a/.github/workflows/test-macos.yml +++ b/.github/workflows/test-macos.yml @@ -1,6 +1,12 @@ name: Build and run tests (macOS) -on: [push, pull_request] +on: + pull_request: + branches: + - master + push: + branches: + - master jobs: pre_job: @@ -27,7 +33,6 @@ jobs: - { id: macos-13, name: 'Ventura' } cpp_std: - 'c++11' - - 'c++17' fail-fast: false steps: - name: Install Dependencies From 7873fe791eb60436ba48104b6b6443754097459c Mon Sep 17 00:00:00 2001 From: Krystine Sherwin <93062060+KrystalDelusion@users.noreply.github.com> Date: Mon, 5 Feb 2024 21:50:41 +1300 Subject: [PATCH 07/56] Makefile: ignore missing docs e.g. when calling `make clean` out-of-tree --- Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 507d46f230d..f359ab76749 100644 --- a/Makefile +++ b/Makefile @@ -1022,7 +1022,9 @@ clean: rm -rf vloghtb/Makefile vloghtb/refdat vloghtb/rtl vloghtb/scripts vloghtb/spec vloghtb/check_yosys vloghtb/vloghammer_tb.tar.bz2 vloghtb/temp vloghtb/log_test_* rm -f tests/svinterfaces/*.log_stdout tests/svinterfaces/*.log_stderr tests/svinterfaces/dut_result.txt tests/svinterfaces/reference_result.txt tests/svinterfaces/a.out tests/svinterfaces/*_syn.v tests/svinterfaces/*.diff rm -f tests/tools/cmp_tbdata - $(MAKE) -C docs clean + -$(MAKE) -C docs clean + -$(MAKE) -C docs/images clean + rm -rf docs/source/cmd docs/util/__pycache__ clean-abc: $(MAKE) -C abc DEP= clean From 8e2dae21ad21e5cc87d7ecc8fc07871ce694aa92 Mon Sep 17 00:00:00 2001 From: Krystine Sherwin <93062060+KrystalDelusion@users.noreply.github.com> Date: Tue, 6 Feb 2024 10:30:37 +1300 Subject: [PATCH 08/56] ci: Checkout Yosys --- .github/workflows/test-linux.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/test-linux.yml b/.github/workflows/test-linux.yml index c4098edbeff..752d69a0694 100644 --- a/.github/workflows/test-linux.yml +++ b/.github/workflows/test-linux.yml @@ -173,6 +173,9 @@ jobs: run: | echo "procs=$(nproc)" >> $GITHUB_ENV + - name: Checkout Yosys + uses: actions/checkout@v4 + - name: Download build artifact uses: actions/download-artifact@v4 with: From 2bec6e3e0af83b0bdc5e4fa31f1bc7980a57e0db Mon Sep 17 00:00:00 2001 From: Krystine Sherwin <93062060+KrystalDelusion@users.noreply.github.com> Date: Tue, 6 Feb 2024 10:56:20 +1300 Subject: [PATCH 09/56] ci: Move iverilog from build to test --- .github/workflows/test-linux.yml | 58 ++++++++++++++++++-------------- 1 file changed, 33 insertions(+), 25 deletions(-) diff --git a/.github/workflows/test-linux.yml b/.github/workflows/test-linux.yml index 752d69a0694..e488c2f6c34 100644 --- a/.github/workflows/test-linux.yml +++ b/.github/workflows/test-linux.yml @@ -104,30 +104,6 @@ jobs: uses: actions/checkout@v4 with: submodules: true - - name: Get iverilog - shell: bash - run: | - git clone https://github.com/steveicarus/iverilog.git - cd iverilog - echo "IVERILOG_GIT=$(git rev-parse HEAD)" >> $GITHUB_ENV - - - name: Cache iverilog - id: cache-iverilog - uses: actions/cache@v4 - with: - path: .local/ - key: ${{ matrix.os.id }}-${{ env.IVERILOG_GIT }} - - - name: Build iverilog - if: steps.cache-iverilog.outputs.cache-hit != 'true' - shell: bash - run: | - mkdir -p $GITHUB_WORKSPACE/.local/ - cd iverilog - autoconf - CC=gcc CXX=g++ ./configure --prefix=$GITHUB_WORKSPACE/.local - make -j${{ env.procs }} - make install - name: Build yosys out-of-tree shell: bash @@ -158,7 +134,11 @@ jobs: test-linux: name: Run tests needs: build-linux - runs-on: ubuntu-latest + runs-on: ${{ matrix.os.id }} + strategy: + matrix: + os: + - { id: ubuntu-20.04, name: focal } steps: - name: Install Dependencies shell: bash @@ -171,11 +151,39 @@ jobs: env: WORKSPACE: ${{ github.workspace }} run: | + echo "GITHUB_WORKSPACE=`pwd`" >> $GITHUB_ENV + echo "$GITHUB_WORKSPACE/.local/bin" >> $GITHUB_PATH echo "procs=$(nproc)" >> $GITHUB_ENV - name: Checkout Yosys uses: actions/checkout@v4 + - name: Get iverilog + shell: bash + run: | + git clone https://github.com/steveicarus/iverilog.git + cd iverilog + git checkout 192b6aec96fde982e6ddcb28b346d5893aa8e874 + echo "IVERILOG_GIT=$(git rev-parse HEAD)" >> $GITHUB_ENV + + - name: Cache iverilog + id: cache-iverilog + uses: actions/cache@v4 + with: + path: .local/ + key: ${{ matrix.os.id }}-${{ env.IVERILOG_GIT }} + + - name: Build iverilog + if: steps.cache-iverilog.outputs.cache-hit != 'true' + shell: bash + run: | + mkdir -p $GITHUB_WORKSPACE/.local/ + cd iverilog + autoconf + CC=gcc CXX=g++ ./configure --prefix=$GITHUB_WORKSPACE/.local + make -j${{ env.procs }} + make install + - name: Download build artifact uses: actions/download-artifact@v4 with: From 1ef21efe3ff2cd6ead409803556c813c3f97d580 Mon Sep 17 00:00:00 2001 From: Krystine Sherwin <93062060+KrystalDelusion@users.noreply.github.com> Date: Tue, 6 Feb 2024 11:48:38 +1300 Subject: [PATCH 10/56] ci: working on test setup --- .github/workflows/test-linux.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test-linux.yml b/.github/workflows/test-linux.yml index e488c2f6c34..fd875d4ae87 100644 --- a/.github/workflows/test-linux.yml +++ b/.github/workflows/test-linux.yml @@ -121,7 +121,7 @@ jobs: shell: bash run: | cd build - tar -cvf ../build.tar Makefile.conf share/ yosys yosys-* + tar -cvf ../build.tar share/ yosys yosys-* - name: Store build artifact if: (matrix.cpp_std == 'c++11') && (matrix.compiler == 'gcc-11') @@ -134,11 +134,12 @@ jobs: test-linux: name: Run tests needs: build-linux - runs-on: ${{ matrix.os.id }} + runs-on: ${{ matrix.os }} + env: + CC: clang strategy: matrix: - os: - - { id: ubuntu-20.04, name: focal } + os: [ubuntu-20.04] steps: - name: Install Dependencies shell: bash @@ -171,7 +172,7 @@ jobs: uses: actions/cache@v4 with: path: .local/ - key: ${{ matrix.os.id }}-${{ env.IVERILOG_GIT }} + key: ${{ matrix.os }}-${{ env.IVERILOG_GIT }} - name: Build iverilog if: steps.cache-iverilog.outputs.cache-hit != 'true' @@ -197,4 +198,4 @@ jobs: - name: Run tests shell: bash run: | - make -j${{ env.procs }} test TARGETS= EXTRA_TARGETS= + make -j$procs test TARGETS= EXTRA_TARGETS= CONFIG=$CC From 93bee0fc3b89f692a866d4bdf22dc98f6e9f1aba Mon Sep 17 00:00:00 2001 From: Krystine Sherwin <93062060+KrystalDelusion@users.noreply.github.com> Date: Tue, 6 Feb 2024 12:18:52 +1300 Subject: [PATCH 11/56] ci: more context var use Also reduce `${{}}` expansion in `run` blocks. --- .github/workflows/test-linux.yml | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/.github/workflows/test-linux.yml b/.github/workflows/test-linux.yml index fd875d4ae87..17aa050558d 100644 --- a/.github/workflows/test-linux.yml +++ b/.github/workflows/test-linux.yml @@ -27,6 +27,9 @@ jobs: needs: pre_job if: needs.pre_job.outputs.should_skip != 'true' runs-on: ${{ matrix.os.id }} + env: + CC: ${{ matrix.compiler }} + CXXSTD: ${{ matrix.cpp_std }} strategy: matrix: os: @@ -63,11 +66,8 @@ jobs: sudo apt-add-repository ppa:ubuntu-toolchain-r/test sudo apt-get update sudo apt-get install $CC $CXX - echo "CC=$CC" >> $GITHUB_ENV echo "CXX=$CXX" >> $GITHUB_ENV echo "CXXFLAGS=-Wp,-D_GLIBCXX_ASSERTIONS" >> $GITHUB_ENV - env: - CC: ${{ matrix.compiler }} - name: Setup Clang if: startsWith(matrix.compiler, 'clang') @@ -80,18 +80,12 @@ jobs: sudo apt-get update CXX=${CC/#clang/clang++} sudo apt-get install $CC $CXX - echo "CC=$CC" >> $GITHUB_ENV echo "CXX=$CXX" >> $GITHUB_ENV - env: - CC: ${{ matrix.compiler }} - name: Runtime environment shell: bash - env: - WORKSPACE: ${{ github.workspace }} run: | - echo "GITHUB_WORKSPACE=`pwd`" >> $GITHUB_ENV - echo "$GITHUB_WORKSPACE/.local/bin" >> $GITHUB_PATH + echo "${{ github.workspace }}/.local/bin" >> $GITHUB_PATH echo "procs=$(nproc)" >> $GITHUB_ENV - name: Tool versions @@ -111,7 +105,7 @@ jobs: mkdir build cd build make -f ../Makefile config-${CC%%-*} - make -f ../Makefile -j${{ env.procs }} CXXSTD=${{ matrix.cpp_std }} CC=$CC CXX=$CC LD=$CC + make -f ../Makefile -j$procs CXXSTD=$CXXSTD CC=$CC CXX=$CC LD=$CC - name: Log yosys-config output run: | @@ -149,11 +143,8 @@ jobs: - name: Runtime environment shell: bash - env: - WORKSPACE: ${{ github.workspace }} run: | - echo "GITHUB_WORKSPACE=`pwd`" >> $GITHUB_ENV - echo "$GITHUB_WORKSPACE/.local/bin" >> $GITHUB_PATH + echo "${{ github.workspace }}/.local/bin" >> $GITHUB_PATH echo "procs=$(nproc)" >> $GITHUB_ENV - name: Checkout Yosys @@ -178,11 +169,11 @@ jobs: if: steps.cache-iverilog.outputs.cache-hit != 'true' shell: bash run: | - mkdir -p $GITHUB_WORKSPACE/.local/ + mkdir -p ${{ github.workspace }}/.local/ cd iverilog autoconf - CC=gcc CXX=g++ ./configure --prefix=$GITHUB_WORKSPACE/.local - make -j${{ env.procs }} + CC=gcc CXX=g++ ./configure --prefix=${{ github.workspace }}/.local + make -j$procs make install - name: Download build artifact From 5ceafea0eca31301f962f572c757f97674e968fb Mon Sep 17 00:00:00 2001 From: Krystine Sherwin <93062060+KrystalDelusion@users.noreply.github.com> Date: Tue, 6 Feb 2024 17:25:25 +1300 Subject: [PATCH 12/56] ci: Default clang build Switch build artifact to a default clang build. Testing with the build artifact locally, `make test` is failing with `/lib/x86_64-linux-gnu/libstdc++.so.6: version 'GLIBCXX_3.4.29' not found`. Using the gcc-11 build (might be?) installing GLIBCXX_3.4.29 but not linking it into the build. Rather than trying to get it to link, just use the pre-installed `clang` instead. --- .github/workflows/test-linux.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-linux.yml b/.github/workflows/test-linux.yml index 17aa050558d..489995615a3 100644 --- a/.github/workflows/test-linux.yml +++ b/.github/workflows/test-linux.yml @@ -29,12 +29,14 @@ jobs: runs-on: ${{ matrix.os.id }} env: CC: ${{ matrix.compiler }} + CXX: ${{ matrix.compiler }} CXXSTD: ${{ matrix.cpp_std }} strategy: matrix: os: - { id: ubuntu-20.04, name: focal } compiler: + - 'clang' - 'clang-12' - 'gcc-11' cpp_std: @@ -70,7 +72,7 @@ jobs: echo "CXXFLAGS=-Wp,-D_GLIBCXX_ASSERTIONS" >> $GITHUB_ENV - name: Setup Clang - if: startsWith(matrix.compiler, 'clang') + if: startsWith(matrix.compiler, 'clang') && (matrix.compiler != 'clang') shell: bash run: | wget https://apt.llvm.org/llvm-snapshot.gpg.key @@ -105,7 +107,7 @@ jobs: mkdir build cd build make -f ../Makefile config-${CC%%-*} - make -f ../Makefile -j$procs CXXSTD=$CXXSTD CC=$CC CXX=$CC LD=$CC + make -f ../Makefile -j$procs CXXSTD=$CXXSTD CC=$CC CXX=$CXX LD=$CC - name: Log yosys-config output run: | @@ -118,7 +120,7 @@ jobs: tar -cvf ../build.tar share/ yosys yosys-* - name: Store build artifact - if: (matrix.cpp_std == 'c++11') && (matrix.compiler == 'gcc-11') + if: (matrix.cpp_std == 'c++11') && (matrix.compiler == 'clang') uses: actions/upload-artifact@v4 with: name: build-artifact From e3f77ff11fc7b9cee3b9fad081c9312b89cdf4a5 Mon Sep 17 00:00:00 2001 From: Krystine Sherwin <93062060+KrystalDelusion@users.noreply.github.com> Date: Tue, 6 Feb 2024 17:56:15 +1300 Subject: [PATCH 13/56] ci: Add error reporting --- .github/workflows/test-linux.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/test-linux.yml b/.github/workflows/test-linux.yml index 489995615a3..c6088fd09f8 100644 --- a/.github/workflows/test-linux.yml +++ b/.github/workflows/test-linux.yml @@ -192,3 +192,9 @@ jobs: shell: bash run: | make -j$procs test TARGETS= EXTRA_TARGETS= CONFIG=$CC + + - name: Report errors + if: ${{ failure() }} + shell: bash + run: | + find tests/**/*.err -print -exec cat {} \; From aa470ccb4745452e45cb290ff5590f2f09424c5f Mon Sep 17 00:00:00 2001 From: Krystine Sherwin <93062060+KrystalDelusion@users.noreply.github.com> Date: Tue, 6 Feb 2024 18:31:53 +1300 Subject: [PATCH 14/56] ci: Unify test-*.yml Also rename `build-artifact` to use `matrix.os` for compatibility with testing across OS. --- .../{test-linux.yml => test-build.yml} | 53 +++++++--- .github/workflows/test-macos.yml | 97 ------------------- 2 files changed, 38 insertions(+), 112 deletions(-) rename .github/workflows/{test-linux.yml => test-build.yml} (80%) delete mode 100644 .github/workflows/test-macos.yml diff --git a/.github/workflows/test-linux.yml b/.github/workflows/test-build.yml similarity index 80% rename from .github/workflows/test-linux.yml rename to .github/workflows/test-build.yml index c6088fd09f8..ec132e7c192 100644 --- a/.github/workflows/test-linux.yml +++ b/.github/workflows/test-build.yml @@ -1,4 +1,4 @@ -name: Build and run tests (Linux) +name: Build and run tests on: pull_request: @@ -23,10 +23,10 @@ jobs: # only run on push *or* pull_request, not both concurrent_skipping: 'same_content_newer' - build-linux: + build-yosys: needs: pre_job if: needs.pre_job.outputs.should_skip != 'true' - runs-on: ${{ matrix.os.id }} + runs-on: ${{ matrix.os }} env: CC: ${{ matrix.compiler }} CXX: ${{ matrix.compiler }} @@ -34,9 +34,9 @@ jobs: strategy: matrix: os: - - { id: ubuntu-20.04, name: focal } + - ubuntu-20.04 + - macos-13 compiler: - - 'clang' - 'clang-12' - 'gcc-11' cpp_std: @@ -45,21 +45,34 @@ jobs: - 'c++17' - 'c++20' include: - # Limit the older compilers to C++11 mode - - os: { id: ubuntu-20.04, name: focal } + # Build for testing + - os: ubuntu-20.04 + compiler: 'clang' + cpp_std: 'c++11' + # Limited testing for older compilers + - os: ubuntu-20.04 compiler: 'clang-11' cpp_std: 'c++11' - - os: { id: ubuntu-20.04, name: focal } + - os: ubuntu-20.04 compiler: 'gcc-10' cpp_std: 'c++11' + # Add os_name + - os: ubuntu-20.04 + os_name: focal fail-fast: false steps: - - name: Install Dependencies + - name: Install Linux Dependencies + if: runner.os == 'Linux' shell: bash run: | sudo apt-get update sudo apt-get install gperf build-essential bison flex libreadline-dev gawk tcl-dev libffi-dev git graphviz xdot pkg-config python python3 libboost-system-dev libboost-python-dev libboost-filesystem-dev zlib1g-dev + - name: Install macOS Dependencies + if: runner.os == 'macOS' + run: | + brew install bison flex gawk libffi pkg-config bash + - name: Setup GCC if: startsWith(matrix.compiler, 'gcc') shell: bash @@ -78,18 +91,28 @@ jobs: wget https://apt.llvm.org/llvm-snapshot.gpg.key sudo apt-key add llvm-snapshot.gpg.key rm llvm-snapshot.gpg.key - sudo apt-add-repository "deb https://apt.llvm.org/${{ matrix.os.name }}/ llvm-toolchain-${{ matrix.os.name }} main" + sudo apt-add-repository "deb https://apt.llvm.org/${{ matrix.os_name }}/ llvm-toolchain-${{ matrix.os_name }} main" sudo apt-get update CXX=${CC/#clang/clang++} sudo apt-get install $CC $CXX echo "CXX=$CXX" >> $GITHUB_ENV - - name: Runtime environment + - name: Linux runtime environment + if: runner.os == 'Linux' shell: bash run: | echo "${{ github.workspace }}/.local/bin" >> $GITHUB_PATH echo "procs=$(nproc)" >> $GITHUB_ENV + - name: macOS runtime environment + if: runner.os == 'macOS' + shell: bash + run: | + echo "${{ github.workspace }}/.local/bin" >> $GITHUB_PATH + echo "$(brew --prefix bison)/bin" >> $GITHUB_PATH + echo "$(brew --prefix flex)/bin" >> $GITHUB_PATH + echo "procs=$(sysctl -n hw.ncpu)" >> $GITHUB_ENV + - name: Tool versions shell: bash run: | @@ -123,13 +146,13 @@ jobs: if: (matrix.cpp_std == 'c++11') && (matrix.compiler == 'clang') uses: actions/upload-artifact@v4 with: - name: build-artifact + name: build-${{ matrix.os }} path: build.tar retention-days: 1 - test-linux: + test-yosys: name: Run tests - needs: build-linux + needs: build-yosys runs-on: ${{ matrix.os }} env: CC: clang @@ -181,7 +204,7 @@ jobs: - name: Download build artifact uses: actions/download-artifact@v4 with: - name: build-artifact + name: build-${{ matrix.os }} - name: Uncompress build shell: bash diff --git a/.github/workflows/test-macos.yml b/.github/workflows/test-macos.yml deleted file mode 100644 index ed63c8f35b7..00000000000 --- a/.github/workflows/test-macos.yml +++ /dev/null @@ -1,97 +0,0 @@ -name: Build and run tests (macOS) - -on: - pull_request: - branches: - - master - push: - branches: - - master - -jobs: - pre_job: - runs-on: ubuntu-latest - outputs: - should_skip: ${{ steps.skip_check.outputs.should_skip }} - steps: - - id: skip_check - uses: fkirc/skip-duplicate-actions@v5 - with: - paths_ignore: '["**/README.md", "docs/**", "guidelines/**"]' - # cancel previous builds if a new commit is pushed - cancel_others: 'true' - # only run on push *or* pull_request, not both - concurrent_skipping: 'same_content_newer' - - test-macos: - needs: pre_job - if: needs.pre_job.outputs.should_skip != 'true' - runs-on: ${{ matrix.os.id }} - strategy: - matrix: - os: - - { id: macos-13, name: 'Ventura' } - cpp_std: - - 'c++11' - fail-fast: false - steps: - - name: Install Dependencies - run: | - HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 brew install bison flex gawk libffi pkg-config bash - - - name: Runtime environment - shell: bash - env: - WORKSPACE: ${{ github.workspace }} - run: | - echo "GITHUB_WORKSPACE=`pwd`" >> $GITHUB_ENV - echo "$GITHUB_WORKSPACE/.local/bin" >> $GITHUB_PATH - echo "$(brew --prefix bison)/bin" >> $GITHUB_PATH - echo "$(brew --prefix flex)/bin" >> $GITHUB_PATH - echo "procs=$(sysctl -n hw.ncpu)" >> $GITHUB_ENV - - - name: Tool versions - shell: bash - run: | - cc --version - - - name: Checkout Yosys - uses: actions/checkout@v4 - with: - submodules: true - - name: Get iverilog - shell: bash - run: | - git clone https://github.com/steveicarus/iverilog.git - cd iverilog - echo "IVERILOG_GIT=$(git rev-parse HEAD)" >> $GITHUB_ENV - - - name: Cache iverilog - id: cache-iverilog - uses: actions/cache@v4 - with: - path: .local/ - key: ${{ matrix.os.id }}-${{ env.IVERILOG_GIT }} - - - name: Build iverilog - if: steps.cache-iverilog.outputs.cache-hit != 'true' - shell: bash - run: | - mkdir -p $GITHUB_WORKSPACE/.local/ - cd iverilog - autoconf - CC=gcc CXX=g++ ./configure --prefix=$GITHUB_WORKSPACE/.local/ - make -j${{ env.procs }} - make install - - - name: Build yosys - shell: bash - run: | - make config-clang - make -j${{ env.procs }} CXXSTD=${{ matrix.cpp_std }} CC=cc CXX=cc LD=cc - - - name: Run tests - if: matrix.cpp_std == 'c++11' - shell: bash - run: | - make -j${{ env.procs }} test CXXSTD=${{ matrix.cpp_std }} CC=cc CXX=cc LD=cc From f408b4de05775c5735742114641d302f87bcb989 Mon Sep 17 00:00:00 2001 From: Krystine Sherwin <93062060+KrystalDelusion@users.noreply.github.com> Date: Tue, 6 Feb 2024 18:56:11 +1300 Subject: [PATCH 15/56] ci: fix compiler setup `os_name` in include section needs to be explicit (putting it at the end doesn't apply to the extra jobs). Move macOS test to extra job instead of doing all gcc/clang (which isn't setup for mac anyway). Also adds name to build-yosys task. --- .github/workflows/test-build.yml | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test-build.yml b/.github/workflows/test-build.yml index ec132e7c192..20417479522 100644 --- a/.github/workflows/test-build.yml +++ b/.github/workflows/test-build.yml @@ -24,9 +24,10 @@ jobs: concurrent_skipping: 'same_content_newer' build-yosys: + name: Build Yosys + runs-on: ${{ matrix.os }} needs: pre_job if: needs.pre_job.outputs.should_skip != 'true' - runs-on: ${{ matrix.os }} env: CC: ${{ matrix.compiler }} CXX: ${{ matrix.compiler }} @@ -35,7 +36,6 @@ jobs: matrix: os: - ubuntu-20.04 - - macos-13 compiler: - 'clang-12' - 'gcc-11' @@ -45,20 +45,27 @@ jobs: - 'c++17' - 'c++20' include: + # Add os_name + - os: ubuntu-20.04 + os_name: focal # Build for testing - os: ubuntu-20.04 + os_name: focal + compiler: 'clang' + cpp_std: 'c++11' + # macOS build + - os: macos-13 compiler: 'clang' cpp_std: 'c++11' # Limited testing for older compilers - os: ubuntu-20.04 + os_name: focal compiler: 'clang-11' cpp_std: 'c++11' - os: ubuntu-20.04 + os_name: focal compiler: 'gcc-10' cpp_std: 'c++11' - # Add os_name - - os: ubuntu-20.04 - os_name: focal fail-fast: false steps: - name: Install Linux Dependencies From 8bc206928f9c1b269de4b0416fb8a0ee14235f37 Mon Sep 17 00:00:00 2001 From: Krystine Sherwin <93062060+KrystalDelusion@users.noreply.github.com> Date: Fri, 9 Feb 2024 05:43:10 +1300 Subject: [PATCH 16/56] ci: split test build from matrix Allow test suite to run if, for example, the C++20 builds are failing but C++11 are fine. --- .github/workflows/test-build.yml | 75 ++++++++++++++++++++++++++++---- 1 file changed, 67 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test-build.yml b/.github/workflows/test-build.yml index 20417479522..853a2b12b46 100644 --- a/.github/workflows/test-build.yml +++ b/.github/workflows/test-build.yml @@ -23,8 +23,8 @@ jobs: # only run on push *or* pull_request, not both concurrent_skipping: 'same_content_newer' - build-yosys: - name: Build Yosys + test-builds: + name: Compiler testing runs-on: ${{ matrix.os }} needs: pre_job if: needs.pre_job.outputs.should_skip != 'true' @@ -48,11 +48,6 @@ jobs: # Add os_name - os: ubuntu-20.04 os_name: focal - # Build for testing - - os: ubuntu-20.04 - os_name: focal - compiler: 'clang' - cpp_std: 'c++11' # macOS build - os: macos-13 compiler: 'clang' @@ -131,7 +126,71 @@ jobs: with: submodules: true - - name: Build yosys out-of-tree + - name: Build + shell: bash + run: | + make config-${CC%%-*} + make -j$procs CXXSTD=$CXXSTD CC=$CC CXX=$CXX LD=$CC + + build-yosys: + name: Reusable Yosys build + runs-on: ${{ matrix.os }} + env: + CC: ${{ matrix.compiler }} + CXX: ${{ matrix.compiler }} + CXXSTD: ${{ matrix.cpp_std }} + strategy: + matrix: + os: + - ubuntu-20.04 + compiler: + - 'clang' + cpp_std: + - 'c++11' + include: + # Add os_name + - os: ubuntu-20.04 + os_name: focal + fail-fast: false + steps: + - name: Install Linux Dependencies + if: runner.os == 'Linux' + shell: bash + run: | + sudo apt-get update + sudo apt-get install gperf build-essential bison flex libreadline-dev gawk tcl-dev libffi-dev git graphviz xdot pkg-config python python3 libboost-system-dev libboost-python-dev libboost-filesystem-dev zlib1g-dev + + - name: Install macOS Dependencies + if: runner.os == 'macOS' + run: | + brew install bison flex gawk libffi pkg-config bash + + - name: Linux runtime environment + if: runner.os == 'Linux' + shell: bash + run: | + echo "${{ github.workspace }}/.local/bin" >> $GITHUB_PATH + echo "procs=$(nproc)" >> $GITHUB_ENV + + - name: macOS runtime environment + if: runner.os == 'macOS' + shell: bash + run: | + echo "${{ github.workspace }}/.local/bin" >> $GITHUB_PATH + echo "$(brew --prefix bison)/bin" >> $GITHUB_PATH + echo "$(brew --prefix flex)/bin" >> $GITHUB_PATH + echo "procs=$(sysctl -n hw.ncpu)" >> $GITHUB_ENV + + - name: Tool versions + shell: bash + run: | + $CC --version + $CXX --version + + - name: Checkout Yosys + uses: actions/checkout@v4 + + - name: Build shell: bash run: | mkdir build From 934822115417c7323c72f9b4b0d992dcd691c354 Mon Sep 17 00:00:00 2001 From: Krystine Sherwin <93062060+KrystalDelusion@users.noreply.github.com> Date: Sat, 10 Feb 2024 12:34:07 +1300 Subject: [PATCH 17/56] ci: simplify tests a bit Remove compiler and cpp_std from `build-yosys` matrix. Using `config-$CC` will instead fall back to default values. Drop `Tool versions` step and introduce `yosys-config` output instead. Rename `test-builds` to `test-compile`. --- .github/workflows/test-build.yml | 34 ++++++++++---------------------- 1 file changed, 10 insertions(+), 24 deletions(-) diff --git a/.github/workflows/test-build.yml b/.github/workflows/test-build.yml index 853a2b12b46..b27a37a8719 100644 --- a/.github/workflows/test-build.yml +++ b/.github/workflows/test-build.yml @@ -23,7 +23,7 @@ jobs: # only run on push *or* pull_request, not both concurrent_skipping: 'same_content_newer' - test-builds: + test-compile: name: Compiler testing runs-on: ${{ matrix.os }} needs: pre_job @@ -133,24 +133,13 @@ jobs: make -j$procs CXXSTD=$CXXSTD CC=$CC CXX=$CXX LD=$CC build-yosys: - name: Reusable Yosys build + name: Reusable build runs-on: ${{ matrix.os }} env: - CC: ${{ matrix.compiler }} - CXX: ${{ matrix.compiler }} - CXXSTD: ${{ matrix.cpp_std }} + CC: clang strategy: matrix: - os: - - ubuntu-20.04 - compiler: - - 'clang' - cpp_std: - - 'c++11' - include: - # Add os_name - - os: ubuntu-20.04 - os_name: focal + os: [ubuntu-20.04] fail-fast: false steps: - name: Install Linux Dependencies @@ -181,12 +170,6 @@ jobs: echo "$(brew --prefix flex)/bin" >> $GITHUB_PATH echo "procs=$(sysctl -n hw.ncpu)" >> $GITHUB_ENV - - name: Tool versions - shell: bash - run: | - $CC --version - $CXX --version - - name: Checkout Yosys uses: actions/checkout@v4 @@ -195,8 +178,12 @@ jobs: run: | mkdir build cd build - make -f ../Makefile config-${CC%%-*} - make -f ../Makefile -j$procs CXXSTD=$CXXSTD CC=$CC CXX=$CXX LD=$CC + make -f ../Makefile config-$CC + make -f ../Makefile -j$procs + + - name: Log yosys-config output + run: | + ./yosys-config || true - name: Log yosys-config output run: | @@ -209,7 +196,6 @@ jobs: tar -cvf ../build.tar share/ yosys yosys-* - name: Store build artifact - if: (matrix.cpp_std == 'c++11') && (matrix.compiler == 'clang') uses: actions/upload-artifact@v4 with: name: build-${{ matrix.os }} From c9c6b96ba92a50ae32515e1ffb76f1f18a7c78fe Mon Sep 17 00:00:00 2001 From: Krystine Sherwin <93062060+KrystalDelusion@users.noreply.github.com> Date: Thu, 15 Feb 2024 09:49:02 +1300 Subject: [PATCH 18/56] ci: add missing macOS build `test-macos.yml` included c++17 which was missing in `test-build.yml`. --- .github/workflows/test-build.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-build.yml b/.github/workflows/test-build.yml index b27a37a8719..7f581af277e 100644 --- a/.github/workflows/test-build.yml +++ b/.github/workflows/test-build.yml @@ -48,10 +48,13 @@ jobs: # Add os_name - os: ubuntu-20.04 os_name: focal - # macOS build + # macOS builds - os: macos-13 compiler: 'clang' cpp_std: 'c++11' + - os: macos-13 + compiler: 'clang' + cpp_std: 'c++17' # Limited testing for older compilers - os: ubuntu-20.04 os_name: focal From 154464e7ce79f46f5647b0e06e7cb226c756fec5 Mon Sep 17 00:00:00 2001 From: Krystine Sherwin <93062060+KrystalDelusion@users.noreply.github.com> Date: Thu, 15 Feb 2024 10:00:22 +1300 Subject: [PATCH 19/56] ci: add macos test build --- .github/workflows/test-build.yml | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test-build.yml b/.github/workflows/test-build.yml index 7f581af277e..f223bde24d1 100644 --- a/.github/workflows/test-build.yml +++ b/.github/workflows/test-build.yml @@ -142,7 +142,7 @@ jobs: CC: clang strategy: matrix: - os: [ubuntu-20.04] + os: [ubuntu-20.04, macos-13] fail-fast: false steps: - name: Install Linux Dependencies @@ -213,20 +213,36 @@ jobs: CC: clang strategy: matrix: - os: [ubuntu-20.04] + os: [ubuntu-20.04, macos-13] steps: - - name: Install Dependencies + - name: Install Linux Dependencies + if: runner.os == 'Linux' shell: bash run: | sudo apt-get update - sudo apt-get install gperf build-essential bison flex libreadline-dev gawk tcl-dev libffi-dev git graphviz xdot pkg-config python3 libboost-system-dev libboost-python-dev libboost-filesystem-dev zlib1g-dev + sudo apt-get install gperf build-essential bison flex libreadline-dev gawk tcl-dev libffi-dev git graphviz xdot pkg-config python python3 libboost-system-dev libboost-python-dev libboost-filesystem-dev zlib1g-dev + + - name: Install macOS Dependencies + if: runner.os == 'macOS' + run: | + brew install bison flex gawk libffi pkg-config bash - - name: Runtime environment + - name: Linux runtime environment + if: runner.os == 'Linux' shell: bash run: | echo "${{ github.workspace }}/.local/bin" >> $GITHUB_PATH echo "procs=$(nproc)" >> $GITHUB_ENV + - name: macOS runtime environment + if: runner.os == 'macOS' + shell: bash + run: | + echo "${{ github.workspace }}/.local/bin" >> $GITHUB_PATH + echo "$(brew --prefix bison)/bin" >> $GITHUB_PATH + echo "$(brew --prefix flex)/bin" >> $GITHUB_PATH + echo "procs=$(sysctl -n hw.ncpu)" >> $GITHUB_ENV + - name: Checkout Yosys uses: actions/checkout@v4 From 326d802220acaf8102d967b49247d95153396d55 Mon Sep 17 00:00:00 2001 From: Krystine Sherwin <93062060+KrystalDelusion@users.noreply.github.com> Date: Thu, 15 Feb 2024 10:00:58 +1300 Subject: [PATCH 20/56] ci: split test-compile from test-build --- .github/workflows/test-build.yml | 114 +----------------------- .github/workflows/test-compile.yml | 137 +++++++++++++++++++++++++++++ 2 files changed, 139 insertions(+), 112 deletions(-) create mode 100644 .github/workflows/test-compile.yml diff --git a/.github/workflows/test-build.yml b/.github/workflows/test-build.yml index f223bde24d1..8ad44f0b550 100644 --- a/.github/workflows/test-build.yml +++ b/.github/workflows/test-build.yml @@ -23,121 +23,11 @@ jobs: # only run on push *or* pull_request, not both concurrent_skipping: 'same_content_newer' - test-compile: - name: Compiler testing - runs-on: ${{ matrix.os }} - needs: pre_job - if: needs.pre_job.outputs.should_skip != 'true' - env: - CC: ${{ matrix.compiler }} - CXX: ${{ matrix.compiler }} - CXXSTD: ${{ matrix.cpp_std }} - strategy: - matrix: - os: - - ubuntu-20.04 - compiler: - - 'clang-12' - - 'gcc-11' - cpp_std: - - 'c++11' - - 'c++14' - - 'c++17' - - 'c++20' - include: - # Add os_name - - os: ubuntu-20.04 - os_name: focal - # macOS builds - - os: macos-13 - compiler: 'clang' - cpp_std: 'c++11' - - os: macos-13 - compiler: 'clang' - cpp_std: 'c++17' - # Limited testing for older compilers - - os: ubuntu-20.04 - os_name: focal - compiler: 'clang-11' - cpp_std: 'c++11' - - os: ubuntu-20.04 - os_name: focal - compiler: 'gcc-10' - cpp_std: 'c++11' - fail-fast: false - steps: - - name: Install Linux Dependencies - if: runner.os == 'Linux' - shell: bash - run: | - sudo apt-get update - sudo apt-get install gperf build-essential bison flex libreadline-dev gawk tcl-dev libffi-dev git graphviz xdot pkg-config python python3 libboost-system-dev libboost-python-dev libboost-filesystem-dev zlib1g-dev - - - name: Install macOS Dependencies - if: runner.os == 'macOS' - run: | - brew install bison flex gawk libffi pkg-config bash - - - name: Setup GCC - if: startsWith(matrix.compiler, 'gcc') - shell: bash - run: | - CXX=${CC/#gcc/g++} - sudo apt-add-repository ppa:ubuntu-toolchain-r/test - sudo apt-get update - sudo apt-get install $CC $CXX - echo "CXX=$CXX" >> $GITHUB_ENV - echo "CXXFLAGS=-Wp,-D_GLIBCXX_ASSERTIONS" >> $GITHUB_ENV - - - name: Setup Clang - if: startsWith(matrix.compiler, 'clang') && (matrix.compiler != 'clang') - shell: bash - run: | - wget https://apt.llvm.org/llvm-snapshot.gpg.key - sudo apt-key add llvm-snapshot.gpg.key - rm llvm-snapshot.gpg.key - sudo apt-add-repository "deb https://apt.llvm.org/${{ matrix.os_name }}/ llvm-toolchain-${{ matrix.os_name }} main" - sudo apt-get update - CXX=${CC/#clang/clang++} - sudo apt-get install $CC $CXX - echo "CXX=$CXX" >> $GITHUB_ENV - - - name: Linux runtime environment - if: runner.os == 'Linux' - shell: bash - run: | - echo "${{ github.workspace }}/.local/bin" >> $GITHUB_PATH - echo "procs=$(nproc)" >> $GITHUB_ENV - - - name: macOS runtime environment - if: runner.os == 'macOS' - shell: bash - run: | - echo "${{ github.workspace }}/.local/bin" >> $GITHUB_PATH - echo "$(brew --prefix bison)/bin" >> $GITHUB_PATH - echo "$(brew --prefix flex)/bin" >> $GITHUB_PATH - echo "procs=$(sysctl -n hw.ncpu)" >> $GITHUB_ENV - - - name: Tool versions - shell: bash - run: | - $CC --version - $CXX --version - - - name: Checkout Yosys - uses: actions/checkout@v4 - with: - submodules: true - - - name: Build - shell: bash - run: | - make config-${CC%%-*} - make -j$procs CXXSTD=$CXXSTD CC=$CC CXX=$CXX LD=$CC - build-yosys: name: Reusable build runs-on: ${{ matrix.os }} + needs: pre_job + if: needs.pre_job.outputs.should_skip != 'true' env: CC: clang strategy: diff --git a/.github/workflows/test-compile.yml b/.github/workflows/test-compile.yml new file mode 100644 index 00000000000..5d1c0aca94b --- /dev/null +++ b/.github/workflows/test-compile.yml @@ -0,0 +1,137 @@ +name: Compiler testing + +on: + pull_request: + branches: + - master + push: + branches: + - master + +jobs: + pre_job: + runs-on: ubuntu-latest + outputs: + should_skip: ${{ steps.skip_check.outputs.should_skip }} + steps: + - id: skip_check + uses: fkirc/skip-duplicate-actions@v5 + with: + paths_ignore: '["**/README.md", "docs/**", "guidelines/**"]' + # cancel previous builds if a new commit is pushed + cancel_others: 'true' + # only run on push *or* pull_request, not both + concurrent_skipping: 'same_content_newer' + + test-compile: + runs-on: ${{ matrix.os }} + needs: pre_job + if: needs.pre_job.outputs.should_skip != 'true' + env: + CC: ${{ matrix.compiler }} + CXX: ${{ matrix.compiler }} + CXXSTD: ${{ matrix.cpp_std }} + strategy: + matrix: + os: + - ubuntu-20.04 + compiler: + - 'clang-12' + - 'gcc-11' + cpp_std: + - 'c++11' + - 'c++14' + - 'c++17' + - 'c++20' + include: + # Add os_name + - os: ubuntu-20.04 + os_name: focal + # macOS builds + - os: macos-13 + compiler: 'clang' + cpp_std: 'c++11' + - os: macos-13 + compiler: 'clang' + cpp_std: 'c++17' + # Limited testing for older compilers + - os: ubuntu-20.04 + os_name: focal + compiler: 'clang-11' + cpp_std: 'c++11' + - os: ubuntu-20.04 + os_name: focal + compiler: 'gcc-10' + cpp_std: 'c++11' + fail-fast: false + steps: + - name: Install Linux Dependencies + if: runner.os == 'Linux' + shell: bash + run: | + sudo apt-get update + sudo apt-get install gperf build-essential bison flex libreadline-dev gawk tcl-dev libffi-dev git graphviz xdot pkg-config python python3 libboost-system-dev libboost-python-dev libboost-filesystem-dev zlib1g-dev + + - name: Install macOS Dependencies + if: runner.os == 'macOS' + run: | + brew install bison flex gawk libffi pkg-config bash + + - name: Setup GCC + if: startsWith(matrix.compiler, 'gcc') + shell: bash + run: | + CXX=${CC/#gcc/g++} + sudo apt-add-repository ppa:ubuntu-toolchain-r/test + sudo apt-get update + sudo apt-get install $CC $CXX + echo "CXX=$CXX" >> $GITHUB_ENV + echo "CXXFLAGS=-Wp,-D_GLIBCXX_ASSERTIONS" >> $GITHUB_ENV + + - name: Setup Clang + if: startsWith(matrix.compiler, 'clang') && (matrix.compiler != 'clang') + shell: bash + run: | + wget https://apt.llvm.org/llvm-snapshot.gpg.key + sudo apt-key add llvm-snapshot.gpg.key + rm llvm-snapshot.gpg.key + sudo apt-add-repository "deb https://apt.llvm.org/${{ matrix.os_name }}/ llvm-toolchain-${{ matrix.os_name }} main" + sudo apt-get update + CXX=${CC/#clang/clang++} + sudo apt-get install $CC $CXX + echo "CXX=$CXX" >> $GITHUB_ENV + + - name: Linux runtime environment + if: runner.os == 'Linux' + shell: bash + run: | + echo "${{ github.workspace }}/.local/bin" >> $GITHUB_PATH + echo "procs=$(nproc)" >> $GITHUB_ENV + + - name: macOS runtime environment + if: runner.os == 'macOS' + shell: bash + run: | + echo "${{ github.workspace }}/.local/bin" >> $GITHUB_PATH + echo "$(brew --prefix bison)/bin" >> $GITHUB_PATH + echo "$(brew --prefix flex)/bin" >> $GITHUB_PATH + echo "procs=$(sysctl -n hw.ncpu)" >> $GITHUB_ENV + + - name: Tool versions + shell: bash + run: | + $CC --version + $CXX --version + + - name: Checkout Yosys + uses: actions/checkout@v4 + + - name: Build + shell: bash + run: | + make config-${CC%%-*} + make -j$procs CXXSTD=$CXXSTD CC=$CC CXX=$CXX LD=$CC + + - name: Log yosys-config output + run: | + ./yosys-config || true From 616848b773297ed8c37d94c0a5cf68c84b416284 Mon Sep 17 00:00:00 2001 From: Krystine Sherwin <93062060+KrystalDelusion@users.noreply.github.com> Date: Mon, 4 Mar 2024 11:37:25 +1300 Subject: [PATCH 21/56] ci: Use aminya/setup-cpp --- .github/workflows/test-compile.yml | 30 +++++------------------------- 1 file changed, 5 insertions(+), 25 deletions(-) diff --git a/.github/workflows/test-compile.yml b/.github/workflows/test-compile.yml index 5d1c0aca94b..b03af924346 100644 --- a/.github/workflows/test-compile.yml +++ b/.github/workflows/test-compile.yml @@ -28,9 +28,8 @@ jobs: needs: pre_job if: needs.pre_job.outputs.should_skip != 'true' env: - CC: ${{ matrix.compiler }} - CXX: ${{ matrix.compiler }} CXXSTD: ${{ matrix.cpp_std }} + CXXFLAGS: ${{ startsWith(matrix.compiler, 'gcc') && '-Wp,-D_GLIBCXX_ASSERTIONS' || ''}} strategy: matrix: os: @@ -77,29 +76,10 @@ jobs: run: | brew install bison flex gawk libffi pkg-config bash - - name: Setup GCC - if: startsWith(matrix.compiler, 'gcc') - shell: bash - run: | - CXX=${CC/#gcc/g++} - sudo apt-add-repository ppa:ubuntu-toolchain-r/test - sudo apt-get update - sudo apt-get install $CC $CXX - echo "CXX=$CXX" >> $GITHUB_ENV - echo "CXXFLAGS=-Wp,-D_GLIBCXX_ASSERTIONS" >> $GITHUB_ENV - - - name: Setup Clang - if: startsWith(matrix.compiler, 'clang') && (matrix.compiler != 'clang') - shell: bash - run: | - wget https://apt.llvm.org/llvm-snapshot.gpg.key - sudo apt-key add llvm-snapshot.gpg.key - rm llvm-snapshot.gpg.key - sudo apt-add-repository "deb https://apt.llvm.org/${{ matrix.os_name }}/ llvm-toolchain-${{ matrix.os_name }} main" - sudo apt-get update - CXX=${CC/#clang/clang++} - sudo apt-get install $CC $CXX - echo "CXX=$CXX" >> $GITHUB_ENV + - name: Setup Cpp + uses: aminya/setup-cpp@v1 + with: + compiler: ${{ matrix.compiler }} - name: Linux runtime environment if: runner.os == 'Linux' From 62440246ec2d9fdc16d9a9ae535087c3498fc273 Mon Sep 17 00:00:00 2001 From: Krystine Sherwin <93062060+KrystalDelusion@users.noreply.github.com> Date: Mon, 4 Mar 2024 12:00:51 +1300 Subject: [PATCH 22/56] ci: Add CC_SHORT env var New Setup Cpp step uses fully qualified paths for $CC and $CXX so ${CC%%-*} no longer works. Remove os_name since it's not needed anymore. --- .github/workflows/test-compile.yml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test-compile.yml b/.github/workflows/test-compile.yml index b03af924346..9c25874bbcd 100644 --- a/.github/workflows/test-compile.yml +++ b/.github/workflows/test-compile.yml @@ -30,6 +30,7 @@ jobs: env: CXXSTD: ${{ matrix.cpp_std }} CXXFLAGS: ${{ startsWith(matrix.compiler, 'gcc') && '-Wp,-D_GLIBCXX_ASSERTIONS' || ''}} + CC_SHORT: ${{ startsWith(matrix.compiler, 'gcc') && 'gcc' || 'clang' }} strategy: matrix: os: @@ -43,9 +44,6 @@ jobs: - 'c++17' - 'c++20' include: - # Add os_name - - os: ubuntu-20.04 - os_name: focal # macOS builds - os: macos-13 compiler: 'clang' @@ -55,11 +53,9 @@ jobs: cpp_std: 'c++17' # Limited testing for older compilers - os: ubuntu-20.04 - os_name: focal compiler: 'clang-11' cpp_std: 'c++11' - os: ubuntu-20.04 - os_name: focal compiler: 'gcc-10' cpp_std: 'c++11' fail-fast: false @@ -109,8 +105,8 @@ jobs: - name: Build shell: bash run: | - make config-${CC%%-*} - make -j$procs CXXSTD=$CXXSTD CC=$CC CXX=$CXX LD=$CC + make config-$CC_SHORT + make -j$procs CXXSTD=$CXXSTD - name: Log yosys-config output run: | From d07323e7ddca262727c39750a8c5ec29fcbd59d1 Mon Sep 17 00:00:00 2001 From: Krystine Sherwin <93062060+KrystalDelusion@users.noreply.github.com> Date: Mon, 4 Mar 2024 13:10:50 +1300 Subject: [PATCH 23/56] ci: Add action for reusable build env setup --- .github/actions/setup-build-env/action.yml | 32 ++++++++++++ .github/workflows/test-build.yml | 58 ++-------------------- .github/workflows/test-compile.yml | 29 +---------- 3 files changed, 38 insertions(+), 81 deletions(-) create mode 100644 .github/actions/setup-build-env/action.yml diff --git a/.github/actions/setup-build-env/action.yml b/.github/actions/setup-build-env/action.yml new file mode 100644 index 00000000000..e1b550e5ca8 --- /dev/null +++ b/.github/actions/setup-build-env/action.yml @@ -0,0 +1,32 @@ +name: Build environment setup +description: Configure build env for Yosys builds +runs: + using: composite + steps: + - name: Install Linux Dependencies + if: runner.os == 'Linux' + shell: bash + run: | + sudo apt-get update + sudo apt-get install gperf build-essential bison flex libreadline-dev gawk tcl-dev libffi-dev git graphviz xdot pkg-config python python3 libboost-system-dev libboost-python-dev libboost-filesystem-dev zlib1g-dev + + - name: Install macOS Dependencies + if: runner.os == 'macOS' + run: | + brew install bison flex gawk libffi pkg-config bash + + - name: Linux runtime environment + if: runner.os == 'Linux' + shell: bash + run: | + echo "${{ github.workspace }}/.local/bin" >> $GITHUB_PATH + echo "procs=$(nproc)" >> $GITHUB_ENV + + - name: macOS runtime environment + if: runner.os == 'macOS' + shell: bash + run: | + echo "${{ github.workspace }}/.local/bin" >> $GITHUB_PATH + echo "$(brew --prefix bison)/bin" >> $GITHUB_PATH + echo "$(brew --prefix flex)/bin" >> $GITHUB_PATH + echo "procs=$(sysctl -n hw.ncpu)" >> $GITHUB_ENV \ No newline at end of file diff --git a/.github/workflows/test-build.yml b/.github/workflows/test-build.yml index 8ad44f0b550..37322883106 100644 --- a/.github/workflows/test-build.yml +++ b/.github/workflows/test-build.yml @@ -35,33 +35,8 @@ jobs: os: [ubuntu-20.04, macos-13] fail-fast: false steps: - - name: Install Linux Dependencies - if: runner.os == 'Linux' - shell: bash - run: | - sudo apt-get update - sudo apt-get install gperf build-essential bison flex libreadline-dev gawk tcl-dev libffi-dev git graphviz xdot pkg-config python python3 libboost-system-dev libboost-python-dev libboost-filesystem-dev zlib1g-dev - - - name: Install macOS Dependencies - if: runner.os == 'macOS' - run: | - brew install bison flex gawk libffi pkg-config bash - - - name: Linux runtime environment - if: runner.os == 'Linux' - shell: bash - run: | - echo "${{ github.workspace }}/.local/bin" >> $GITHUB_PATH - echo "procs=$(nproc)" >> $GITHUB_ENV - - - name: macOS runtime environment - if: runner.os == 'macOS' - shell: bash - run: | - echo "${{ github.workspace }}/.local/bin" >> $GITHUB_PATH - echo "$(brew --prefix bison)/bin" >> $GITHUB_PATH - echo "$(brew --prefix flex)/bin" >> $GITHUB_PATH - echo "procs=$(sysctl -n hw.ncpu)" >> $GITHUB_ENV + - name: Setup environment + uses: ./.github/actions/setup-build-env - name: Checkout Yosys uses: actions/checkout@v4 @@ -105,33 +80,8 @@ jobs: matrix: os: [ubuntu-20.04, macos-13] steps: - - name: Install Linux Dependencies - if: runner.os == 'Linux' - shell: bash - run: | - sudo apt-get update - sudo apt-get install gperf build-essential bison flex libreadline-dev gawk tcl-dev libffi-dev git graphviz xdot pkg-config python python3 libboost-system-dev libboost-python-dev libboost-filesystem-dev zlib1g-dev - - - name: Install macOS Dependencies - if: runner.os == 'macOS' - run: | - brew install bison flex gawk libffi pkg-config bash - - - name: Linux runtime environment - if: runner.os == 'Linux' - shell: bash - run: | - echo "${{ github.workspace }}/.local/bin" >> $GITHUB_PATH - echo "procs=$(nproc)" >> $GITHUB_ENV - - - name: macOS runtime environment - if: runner.os == 'macOS' - shell: bash - run: | - echo "${{ github.workspace }}/.local/bin" >> $GITHUB_PATH - echo "$(brew --prefix bison)/bin" >> $GITHUB_PATH - echo "$(brew --prefix flex)/bin" >> $GITHUB_PATH - echo "procs=$(sysctl -n hw.ncpu)" >> $GITHUB_ENV + - name: Setup environment + uses: ./.github/actions/setup-build-env - name: Checkout Yosys uses: actions/checkout@v4 diff --git a/.github/workflows/test-compile.yml b/.github/workflows/test-compile.yml index 9c25874bbcd..6a0b69c8bb3 100644 --- a/.github/workflows/test-compile.yml +++ b/.github/workflows/test-compile.yml @@ -60,39 +60,14 @@ jobs: cpp_std: 'c++11' fail-fast: false steps: - - name: Install Linux Dependencies - if: runner.os == 'Linux' - shell: bash - run: | - sudo apt-get update - sudo apt-get install gperf build-essential bison flex libreadline-dev gawk tcl-dev libffi-dev git graphviz xdot pkg-config python python3 libboost-system-dev libboost-python-dev libboost-filesystem-dev zlib1g-dev - - - name: Install macOS Dependencies - if: runner.os == 'macOS' - run: | - brew install bison flex gawk libffi pkg-config bash + - name: Setup environment + uses: ./.github/actions/setup-build-env - name: Setup Cpp uses: aminya/setup-cpp@v1 with: compiler: ${{ matrix.compiler }} - - name: Linux runtime environment - if: runner.os == 'Linux' - shell: bash - run: | - echo "${{ github.workspace }}/.local/bin" >> $GITHUB_PATH - echo "procs=$(nproc)" >> $GITHUB_ENV - - - name: macOS runtime environment - if: runner.os == 'macOS' - shell: bash - run: | - echo "${{ github.workspace }}/.local/bin" >> $GITHUB_PATH - echo "$(brew --prefix bison)/bin" >> $GITHUB_PATH - echo "$(brew --prefix flex)/bin" >> $GITHUB_PATH - echo "procs=$(sysctl -n hw.ncpu)" >> $GITHUB_ENV - - name: Tool versions shell: bash run: | From 3c65ddbea07a12e6f0d4cbcee4b18e9c6297913c Mon Sep 17 00:00:00 2001 From: Krystine Sherwin <93062060+KrystalDelusion@users.noreply.github.com> Date: Mon, 4 Mar 2024 13:12:45 +1300 Subject: [PATCH 24/56] ci: Checkout goes first --- .github/workflows/test-build.yml | 12 ++++++------ .github/workflows/test-compile.yml | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/test-build.yml b/.github/workflows/test-build.yml index 37322883106..cdc19b0e35a 100644 --- a/.github/workflows/test-build.yml +++ b/.github/workflows/test-build.yml @@ -35,12 +35,12 @@ jobs: os: [ubuntu-20.04, macos-13] fail-fast: false steps: - - name: Setup environment - uses: ./.github/actions/setup-build-env - - name: Checkout Yosys uses: actions/checkout@v4 + - name: Setup environment + uses: ./.github/actions/setup-build-env + - name: Build shell: bash run: | @@ -80,12 +80,12 @@ jobs: matrix: os: [ubuntu-20.04, macos-13] steps: - - name: Setup environment - uses: ./.github/actions/setup-build-env - - name: Checkout Yosys uses: actions/checkout@v4 + - name: Setup environment + uses: ./.github/actions/setup-build-env + - name: Get iverilog shell: bash run: | diff --git a/.github/workflows/test-compile.yml b/.github/workflows/test-compile.yml index 6a0b69c8bb3..c541b68ff30 100644 --- a/.github/workflows/test-compile.yml +++ b/.github/workflows/test-compile.yml @@ -60,6 +60,9 @@ jobs: cpp_std: 'c++11' fail-fast: false steps: + - name: Checkout Yosys + uses: actions/checkout@v4 + - name: Setup environment uses: ./.github/actions/setup-build-env @@ -74,9 +77,6 @@ jobs: $CC --version $CXX --version - - name: Checkout Yosys - uses: actions/checkout@v4 - - name: Build shell: bash run: | From 6451a6a0dc480a67bf681610577a76b4e6d58559 Mon Sep 17 00:00:00 2001 From: Krystine Sherwin <93062060+KrystalDelusion@users.noreply.github.com> Date: Mon, 4 Mar 2024 13:13:43 +1300 Subject: [PATCH 25/56] ci: Fix action.yml --- .github/actions/setup-build-env/action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/actions/setup-build-env/action.yml b/.github/actions/setup-build-env/action.yml index e1b550e5ca8..f61d6565e51 100644 --- a/.github/actions/setup-build-env/action.yml +++ b/.github/actions/setup-build-env/action.yml @@ -12,6 +12,7 @@ runs: - name: Install macOS Dependencies if: runner.os == 'macOS' + shell: bash run: | brew install bison flex gawk libffi pkg-config bash From 112a5cfc6752c04f5fcec35c750df30b812c56d8 Mon Sep 17 00:00:00 2001 From: Krystine Sherwin <93062060+KrystalDelusion@users.noreply.github.com> Date: Thu, 21 Mar 2024 10:01:01 +1300 Subject: [PATCH 26/56] ci: Add testing for newer compilers --- .github/workflows/test-compile.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/.github/workflows/test-compile.yml b/.github/workflows/test-compile.yml index c541b68ff30..5b0c716f0be 100644 --- a/.github/workflows/test-compile.yml +++ b/.github/workflows/test-compile.yml @@ -58,6 +58,28 @@ jobs: - os: ubuntu-20.04 compiler: 'gcc-10' cpp_std: 'c++11' + # Limited testing for newer compilers + - os: ubuntu-20.04 + compiler: 'clang-13' + cpp_std: 'c++11' + - os: ubuntu-20.04 + compiler: 'clang-14' + cpp_std: 'c++11' + - os: ubuntu-20.04 + compiler: 'clang-15' + cpp_std: 'c++11' + - os: ubuntu-20.04 + compiler: 'clang-16' + cpp_std: 'c++11' + - os: ubuntu-20.04 + compiler: 'clang-17' + cpp_std: 'c++11' + - os: ubuntu-20.04 + compiler: 'gcc-12' + cpp_std: 'c++11' + - os: ubuntu-20.04 + compiler: 'gcc-13' + cpp_std: 'c++11' fail-fast: false steps: - name: Checkout Yosys From 6f602e79d4abe113eff11d61d9072e18a4bf6733 Mon Sep 17 00:00:00 2001 From: Krystine Sherwin <93062060+KrystalDelusion@users.noreply.github.com> Date: Thu, 21 Mar 2024 11:02:18 +1300 Subject: [PATCH 27/56] docs: Debugging macro test fail Call yosys-config post build extraction for sanity check. Report absolute path for yosys exe if it can't be found. --- .github/workflows/test-build.yml | 43 +++++++++++++++++++++++++++++++- docs/tests/macro_commands.py | 7 +++--- 2 files changed, 46 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-build.yml b/.github/workflows/test-build.yml index cdc19b0e35a..605ce570da4 100644 --- a/.github/workflows/test-build.yml +++ b/.github/workflows/test-build.yml @@ -72,8 +72,9 @@ jobs: test-yosys: name: Run tests - needs: build-yosys runs-on: ${{ matrix.os }} + needs: [build-yosys, pre_job] + if: needs.pre_job.outputs.should_skip != 'true' env: CC: clang strategy: @@ -122,6 +123,10 @@ jobs: run: tar -xvf build.tar + - name: Log yosys-config output + run: | + ./yosys-config || true + - name: Run tests shell: bash run: | @@ -132,3 +137,39 @@ jobs: shell: bash run: | find tests/**/*.err -print -exec cat {} \; + + test-docs: + name: Run docs tests + runs-on: ${{ matrix.os }} + needs: [build-yosys, pre_job] + if: needs.pre_job.outputs.should_skip != 'true' + env: + CC: clang + strategy: + matrix: + os: [ubuntu-20.04, macos-13] + steps: + - name: Checkout Yosys + uses: actions/checkout@v4 + + - name: Setup environment + uses: ./.github/actions/setup-build-env + + - name: Download build artifact + uses: actions/download-artifact@v4 + with: + name: build-${{ matrix.os }} + + - name: Uncompress build + shell: bash + run: + tar -xvf build.tar + + - name: Log yosys-config output + run: | + ./yosys-config || true + + - name: Run tests + shell: bash + run: | + make -C docs test -j${{ env.procs }} diff --git a/docs/tests/macro_commands.py b/docs/tests/macro_commands.py index faf2baa530b..d879e4365b2 100755 --- a/docs/tests/macro_commands.py +++ b/docs/tests/macro_commands.py @@ -12,12 +12,13 @@ # expects __file__ = yosys/docs/tests/macro_commands.py TESTS_DIR = Path(__file__).parent ROOT_DIR = TESTS_DIR.parent.parent +logging.log(logging.INFO, f"Using {ROOT_DIR.absolute()} as root directory") THIS_FILE = (TESTS_DIR / "macro_commands.py").relative_to(ROOT_DIR) MACRO_SOURCE = TESTS_DIR.parent / "source" / "code_examples" / "macro_commands" -assert MACRO_SOURCE.exists(), f"can't find macro_commands in {MACRO_SOURCE}" +assert MACRO_SOURCE.exists(), f"can't find macro_commands in {MACRO_SOURCE.absolute()}" -YOSYS = TESTS_DIR.parent.parent / "yosys" -assert YOSYS.exists(), f"can't find yosys executable in {YOSYS}" +YOSYS = ROOT_DIR / "yosys" +assert YOSYS.exists(), f"can't find yosys executable in {YOSYS.absolute()}" raise_error = False # get all macro commands being used From 0720020226426838c8f670b8288b71284244ed16 Mon Sep 17 00:00:00 2001 From: Krystine Sherwin <93062060+KrystalDelusion@users.noreply.github.com> Date: Thu, 21 Mar 2024 11:04:24 +1300 Subject: [PATCH 28/56] ci: Drop gcc-12 Setup script unable to install gcc-12 under ubuntu-20.04. --- .github/workflows/test-compile.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/test-compile.yml b/.github/workflows/test-compile.yml index 5b0c716f0be..ae48c618081 100644 --- a/.github/workflows/test-compile.yml +++ b/.github/workflows/test-compile.yml @@ -74,9 +74,6 @@ jobs: - os: ubuntu-20.04 compiler: 'clang-17' cpp_std: 'c++11' - - os: ubuntu-20.04 - compiler: 'gcc-12' - cpp_std: 'c++11' - os: ubuntu-20.04 compiler: 'gcc-13' cpp_std: 'c++11' From a4c3dcc5a0cc6a32dd4ac756a66394b41cc060f0 Mon Sep 17 00:00:00 2001 From: Krystine Sherwin <93062060+KrystalDelusion@users.noreply.github.com> Date: Fri, 22 Mar 2024 09:13:39 +1300 Subject: [PATCH 29/56] docs: Fix macro_commands Get absolute path for `TESTS_DIR` to work from `docs` directory or from `docs/tests` in addition to `yosys` directory. --- docs/tests/macro_commands.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/tests/macro_commands.py b/docs/tests/macro_commands.py index d879e4365b2..7ceb092d867 100755 --- a/docs/tests/macro_commands.py +++ b/docs/tests/macro_commands.py @@ -10,15 +10,15 @@ logging.basicConfig(level=logging.INFO) # expects __file__ = yosys/docs/tests/macro_commands.py -TESTS_DIR = Path(__file__).parent +TESTS_DIR = Path(__file__).parent.absolute() ROOT_DIR = TESTS_DIR.parent.parent -logging.log(logging.INFO, f"Using {ROOT_DIR.absolute()} as root directory") +logging.log(logging.INFO, f"Using {ROOT_DIR} as root directory") THIS_FILE = (TESTS_DIR / "macro_commands.py").relative_to(ROOT_DIR) MACRO_SOURCE = TESTS_DIR.parent / "source" / "code_examples" / "macro_commands" -assert MACRO_SOURCE.exists(), f"can't find macro_commands in {MACRO_SOURCE.absolute()}" +assert MACRO_SOURCE.exists(), f"can't find macro_commands in {MACRO_SOURCE}" YOSYS = ROOT_DIR / "yosys" -assert YOSYS.exists(), f"can't find yosys executable in {YOSYS.absolute()}" +assert YOSYS.exists(), f"can't find yosys executable in {YOSYS}" raise_error = False # get all macro commands being used From 7fbf286b3f240fe82ca89a22f07497b5f92c6eaa Mon Sep 17 00:00:00 2001 From: Krystine Sherwin <93062060+KrystalDelusion@users.noreply.github.com> Date: Fri, 22 Mar 2024 09:16:43 +1300 Subject: [PATCH 30/56] ci: Update for main branch rename --- .github/workflows/test-build.yml | 4 ++-- .github/workflows/test-compile.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-build.yml b/.github/workflows/test-build.yml index 605ce570da4..5a957e5bb70 100644 --- a/.github/workflows/test-build.yml +++ b/.github/workflows/test-build.yml @@ -3,10 +3,10 @@ name: Build and run tests on: pull_request: branches: - - master + - main push: branches: - - master + - main jobs: pre_job: diff --git a/.github/workflows/test-compile.yml b/.github/workflows/test-compile.yml index ae48c618081..88eaed90c35 100644 --- a/.github/workflows/test-compile.yml +++ b/.github/workflows/test-compile.yml @@ -3,10 +3,10 @@ name: Compiler testing on: pull_request: branches: - - master + - main push: branches: - - master + - main jobs: pre_job: From c89c5c34a0782d5cdcac37ed60c6b40be08921cc Mon Sep 17 00:00:00 2001 From: Krystine Sherwin <93062060+KrystalDelusion@users.noreply.github.com> Date: Fri, 22 Mar 2024 10:06:30 +1300 Subject: [PATCH 31/56] ci: Disable fail fast for test runs --- .github/workflows/test-build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test-build.yml b/.github/workflows/test-build.yml index 5a957e5bb70..2f078ae6974 100644 --- a/.github/workflows/test-build.yml +++ b/.github/workflows/test-build.yml @@ -80,6 +80,7 @@ jobs: strategy: matrix: os: [ubuntu-20.04, macos-13] + fail-fast: false steps: - name: Checkout Yosys uses: actions/checkout@v4 @@ -148,6 +149,7 @@ jobs: strategy: matrix: os: [ubuntu-20.04, macos-13] + fail-fast: false steps: - name: Checkout Yosys uses: actions/checkout@v4 From 7d8928af4b9488dca402ba90f7d2878c13151bc7 Mon Sep 17 00:00:00 2001 From: Krystine Sherwin <93062060+KrystalDelusion@users.noreply.github.com> Date: Fri, 22 Mar 2024 10:24:07 +1300 Subject: [PATCH 32/56] ci: Remove macOS from test-docs macOS fails due to missing gvpack, but trying to install graphviz triggers a Python update which breaks the macOS runner. --- .github/workflows/test-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-build.yml b/.github/workflows/test-build.yml index 2f078ae6974..beb98e60e35 100644 --- a/.github/workflows/test-build.yml +++ b/.github/workflows/test-build.yml @@ -148,7 +148,7 @@ jobs: CC: clang strategy: matrix: - os: [ubuntu-20.04, macos-13] + os: [ubuntu-20.04] fail-fast: false steps: - name: Checkout Yosys From 144d3c9601341730705920da7e5c73cc20a99d36 Mon Sep 17 00:00:00 2001 From: Krystine Sherwin <93062060+KrystalDelusion@users.noreply.github.com> Date: Thu, 25 Apr 2024 09:58:07 +1200 Subject: [PATCH 33/56] Add empty line to action.yml --- .github/actions/setup-build-env/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/setup-build-env/action.yml b/.github/actions/setup-build-env/action.yml index f61d6565e51..56565ce89fd 100644 --- a/.github/actions/setup-build-env/action.yml +++ b/.github/actions/setup-build-env/action.yml @@ -30,4 +30,4 @@ runs: echo "${{ github.workspace }}/.local/bin" >> $GITHUB_PATH echo "$(brew --prefix bison)/bin" >> $GITHUB_PATH echo "$(brew --prefix flex)/bin" >> $GITHUB_PATH - echo "procs=$(sysctl -n hw.ncpu)" >> $GITHUB_ENV \ No newline at end of file + echo "procs=$(sysctl -n hw.ncpu)" >> $GITHUB_ENV From fc48c3a8719c413dd48aa122695166d506673173 Mon Sep 17 00:00:00 2001 From: Krystine Sherwin <93062060+KrystalDelusion@users.noreply.github.com> Date: Thu, 25 Apr 2024 10:41:28 +1200 Subject: [PATCH 34/56] ci: Update OS/compiler targets --- .github/workflows/test-compile.yml | 32 ++++++++++++++++++------------ 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/.github/workflows/test-compile.yml b/.github/workflows/test-compile.yml index 88eaed90c35..935167b629c 100644 --- a/.github/workflows/test-compile.yml +++ b/.github/workflows/test-compile.yml @@ -34,7 +34,7 @@ jobs: strategy: matrix: os: - - ubuntu-20.04 + - ubuntu-22.04 compiler: - 'clang-12' - 'gcc-11' @@ -45,36 +45,42 @@ jobs: - 'c++20' include: # macOS builds + - os: macos-latest + compiler: 'clang' + cpp_std: 'c++11' - os: macos-13 compiler: 'clang' cpp_std: 'c++11' - os: macos-13 compiler: 'clang' cpp_std: 'c++17' - # Limited testing for older compilers - - os: ubuntu-20.04 + # ubuntu-22.04 compilers + - os: ubuntu-22.04 compiler: 'clang-11' cpp_std: 'c++11' - - os: ubuntu-20.04 - compiler: 'gcc-10' - cpp_std: 'c++11' - # Limited testing for newer compilers - - os: ubuntu-20.04 + - os: ubuntu-22.04 compiler: 'clang-13' cpp_std: 'c++11' - - os: ubuntu-20.04 + # ubuntu-latest compilers + - os: ubuntu-latest compiler: 'clang-14' cpp_std: 'c++11' - - os: ubuntu-20.04 + - os: ubuntu-latest compiler: 'clang-15' cpp_std: 'c++11' - - os: ubuntu-20.04 + - os: ubuntu-latest compiler: 'clang-16' cpp_std: 'c++11' - - os: ubuntu-20.04 + - os: ubuntu-latest compiler: 'clang-17' cpp_std: 'c++11' - - os: ubuntu-20.04 + - os: ubuntu-latest + compiler: 'gcc-10' + cpp_std: 'c++11' + - os: ubuntu-latest + compiler: 'gcc-12' + cpp_std: 'c++11' + - os: ubuntu-latest compiler: 'gcc-13' cpp_std: 'c++11' fail-fast: false From 8fc7dcb5165ccc051fb3f838843fd3f50d076450 Mon Sep 17 00:00:00 2001 From: Krystine Sherwin <93062060+KrystalDelusion@users.noreply.github.com> Date: Thu, 25 Apr 2024 10:42:50 +1200 Subject: [PATCH 35/56] ci: Drop python2 --- .github/actions/setup-build-env/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/setup-build-env/action.yml b/.github/actions/setup-build-env/action.yml index 56565ce89fd..d938d6b27ae 100644 --- a/.github/actions/setup-build-env/action.yml +++ b/.github/actions/setup-build-env/action.yml @@ -8,7 +8,7 @@ runs: shell: bash run: | sudo apt-get update - sudo apt-get install gperf build-essential bison flex libreadline-dev gawk tcl-dev libffi-dev git graphviz xdot pkg-config python python3 libboost-system-dev libboost-python-dev libboost-filesystem-dev zlib1g-dev + sudo apt-get install gperf build-essential bison flex libreadline-dev gawk tcl-dev libffi-dev git graphviz xdot pkg-config python3 libboost-system-dev libboost-python-dev libboost-filesystem-dev zlib1g-dev - name: Install macOS Dependencies if: runner.os == 'macOS' From eae7356c701d8419859e378bada12b6550d65262 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Thu, 25 Apr 2024 08:37:44 +0200 Subject: [PATCH 36/56] Cleanups and update of VS action --- .github/workflows/test-build.yml | 14 ++++---------- .github/workflows/test-compile.yml | 8 +------- .gitignore | 1 - 3 files changed, 5 insertions(+), 18 deletions(-) diff --git a/.github/workflows/test-build.yml b/.github/workflows/test-build.yml index beb98e60e35..703cb6bd70a 100644 --- a/.github/workflows/test-build.yml +++ b/.github/workflows/test-build.yml @@ -1,12 +1,6 @@ name: Build and run tests -on: - pull_request: - branches: - - main - push: - branches: - - main +on: [push, pull_request] jobs: pre_job: @@ -32,7 +26,7 @@ jobs: CC: clang strategy: matrix: - os: [ubuntu-20.04, macos-13] + os: [ubuntu-latest, macos-13] fail-fast: false steps: - name: Checkout Yosys @@ -79,7 +73,7 @@ jobs: CC: clang strategy: matrix: - os: [ubuntu-20.04, macos-13] + os: [ubuntu-latest, macos-13] fail-fast: false steps: - name: Checkout Yosys @@ -148,7 +142,7 @@ jobs: CC: clang strategy: matrix: - os: [ubuntu-20.04] + os: [ubuntu-latest] fail-fast: false steps: - name: Checkout Yosys diff --git a/.github/workflows/test-compile.yml b/.github/workflows/test-compile.yml index 935167b629c..6dd348102b5 100644 --- a/.github/workflows/test-compile.yml +++ b/.github/workflows/test-compile.yml @@ -1,12 +1,6 @@ name: Compiler testing -on: - pull_request: - branches: - - main - push: - branches: - - main +on: [push, pull_request] jobs: pre_job: diff --git a/.gitignore b/.gitignore index b4797d63884..6f3e521d62e 100644 --- a/.gitignore +++ b/.gitignore @@ -45,4 +45,3 @@ __pycache__ /tests/unit/bintest/ /tests/unit/objtest/ /tests/ystests -/build From 24b3690c255d8e23a0d422daf3c5dad20e645952 Mon Sep 17 00:00:00 2001 From: Krystine Sherwin <93062060+KrystalDelusion@users.noreply.github.com> Date: Tue, 30 Apr 2024 11:01:30 +1200 Subject: [PATCH 37/56] test-build: Use macos-latest (macOS 14, M1) --- .github/workflows/test-build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-build.yml b/.github/workflows/test-build.yml index 703cb6bd70a..c73aa995347 100644 --- a/.github/workflows/test-build.yml +++ b/.github/workflows/test-build.yml @@ -26,7 +26,7 @@ jobs: CC: clang strategy: matrix: - os: [ubuntu-latest, macos-13] + os: [ubuntu-latest, macos-latest] fail-fast: false steps: - name: Checkout Yosys @@ -73,7 +73,7 @@ jobs: CC: clang strategy: matrix: - os: [ubuntu-latest, macos-13] + os: [ubuntu-latest, macos-latest] fail-fast: false steps: - name: Checkout Yosys From 6908330005f8e1b08a5367fe25a82b2670c482d0 Mon Sep 17 00:00:00 2001 From: Krystine Sherwin <93062060+KrystalDelusion@users.noreply.github.com> Date: Tue, 30 Apr 2024 11:11:46 +1200 Subject: [PATCH 38/56] ci: Reduce number of jobs Limit compilers to oldest and newest. Oldest compilers test with minimum supported standard. Newest compilers test with minimum *and* maximum supported standard. --- .github/workflows/test-compile.yml | 66 ++++++++---------------------- Makefile | 6 +++ 2 files changed, 24 insertions(+), 48 deletions(-) diff --git a/.github/workflows/test-compile.yml b/.github/workflows/test-compile.yml index 6dd348102b5..6a9097ad33a 100644 --- a/.github/workflows/test-compile.yml +++ b/.github/workflows/test-compile.yml @@ -22,61 +22,26 @@ jobs: needs: pre_job if: needs.pre_job.outputs.should_skip != 'true' env: - CXXSTD: ${{ matrix.cpp_std }} CXXFLAGS: ${{ startsWith(matrix.compiler, 'gcc') && '-Wp,-D_GLIBCXX_ASSERTIONS' || ''}} CC_SHORT: ${{ startsWith(matrix.compiler, 'gcc') && 'gcc' || 'clang' }} strategy: matrix: os: - - ubuntu-22.04 + - ubuntu-latest compiler: - - 'clang-12' - - 'gcc-11' - cpp_std: - - 'c++11' - - 'c++14' - - 'c++17' - - 'c++20' + # oldest supported + - 'clang-14' + - 'gcc-10' + # newest + - 'clang' + - 'gcc' include: - # macOS builds - - os: macos-latest - compiler: 'clang' - cpp_std: 'c++11' - - os: macos-13 - compiler: 'clang' - cpp_std: 'c++11' + # macOS - os: macos-13 compiler: 'clang' - cpp_std: 'c++17' - # ubuntu-22.04 compilers + # oldest clang not available on ubuntu-latest - os: ubuntu-22.04 compiler: 'clang-11' - cpp_std: 'c++11' - - os: ubuntu-22.04 - compiler: 'clang-13' - cpp_std: 'c++11' - # ubuntu-latest compilers - - os: ubuntu-latest - compiler: 'clang-14' - cpp_std: 'c++11' - - os: ubuntu-latest - compiler: 'clang-15' - cpp_std: 'c++11' - - os: ubuntu-latest - compiler: 'clang-16' - cpp_std: 'c++11' - - os: ubuntu-latest - compiler: 'clang-17' - cpp_std: 'c++11' - - os: ubuntu-latest - compiler: 'gcc-10' - cpp_std: 'c++11' - - os: ubuntu-latest - compiler: 'gcc-12' - cpp_std: 'c++11' - - os: ubuntu-latest - compiler: 'gcc-13' - cpp_std: 'c++11' fail-fast: false steps: - name: Checkout Yosys @@ -96,12 +61,17 @@ jobs: $CC --version $CXX --version - - name: Build + # minimum standard + - name: Build C++11 shell: bash run: | make config-$CC_SHORT - make -j$procs CXXSTD=$CXXSTD + make -j$procs CXXSTD=c++11 compile-only - - name: Log yosys-config output + # maximum standard, only on newest compilers + - name: Build C++20 + if: ${{ matrix.compiler == 'clang' || matrix.compiler == 'gcc'}} + shell: bash run: | - ./yosys-config || true + make config-$CC_SHORT + make -j$procs CXXSTD=c++20 compile-only diff --git a/Makefile b/Makefile index f359ab76749..85391d47013 100644 --- a/Makefile +++ b/Makefile @@ -727,6 +727,12 @@ top-all: $(TARGETS) $(EXTRA_TARGETS) @echo " Build successful." @echo "" +.PHONY: compile-only +compile-only: $(OBJS) + @echo "" + @echo " Compile successful." + @echo "" + ifeq ($(CONFIG),emcc) yosys.js: $(filter-out yosysjs-$(YOSYS_VER).zip,$(EXTRA_TARGETS)) endif From 4d8ce13aa4d4e347b552b9e365238e83c6a14b3c Mon Sep 17 00:00:00 2001 From: Krystine Sherwin <93062060+KrystalDelusion@users.noreply.github.com> Date: Tue, 30 Apr 2024 11:18:42 +1200 Subject: [PATCH 39/56] compile-only: Include genfiles and extra_targets --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 85391d47013..8f427579d92 100644 --- a/Makefile +++ b/Makefile @@ -728,7 +728,7 @@ top-all: $(TARGETS) $(EXTRA_TARGETS) @echo "" .PHONY: compile-only -compile-only: $(OBJS) +compile-only: $(OBJS) $(GENFILES) $(EXTRA_TARGETS) @echo "" @echo " Compile successful." @echo "" From ff730f486a80d73f6502cb6b39ec7c25571a90e1 Mon Sep 17 00:00:00 2001 From: Krystine Sherwin <93062060+KrystalDelusion@users.noreply.github.com> Date: Tue, 30 Apr 2024 11:38:05 +1200 Subject: [PATCH 40/56] ci: Add autoconf to macos dependencies --- .github/actions/setup-build-env/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/setup-build-env/action.yml b/.github/actions/setup-build-env/action.yml index d938d6b27ae..345b6db8ada 100644 --- a/.github/actions/setup-build-env/action.yml +++ b/.github/actions/setup-build-env/action.yml @@ -14,7 +14,7 @@ runs: if: runner.os == 'macOS' shell: bash run: | - brew install bison flex gawk libffi pkg-config bash + HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 brew install bison flex gawk libffi pkg-config bash autoconf - name: Linux runtime environment if: runner.os == 'Linux' From 7905921bd0cdeafb714886aa13021e96b42ffff4 Mon Sep 17 00:00:00 2001 From: Krystine Sherwin <93062060+KrystalDelusion@users.noreply.github.com> Date: Fri, 10 May 2024 10:00:33 +1200 Subject: [PATCH 41/56] Remove test-docs.yml in favour of test-build --- .github/workflows/test-docs.yml | 58 --------------------------------- 1 file changed, 58 deletions(-) delete mode 100644 .github/workflows/test-docs.yml diff --git a/.github/workflows/test-docs.yml b/.github/workflows/test-docs.yml deleted file mode 100644 index 7b3906c52ca..00000000000 --- a/.github/workflows/test-docs.yml +++ /dev/null @@ -1,58 +0,0 @@ -name: Build and test doc code samples - -on: - pull_request: - branches: - - main - -jobs: - pre_job: - runs-on: ubuntu-latest - outputs: - should_skip: ${{ steps.skip_check.outputs.should_skip }} - steps: - - id: skip_check - uses: fkirc/skip-duplicate-actions@v5 - with: - # cancel previous builds if a new commit is pushed - cancel_others: 'true' - # only run on push *or* pull_request, not both - concurrent_skipping: 'same_content_newer' - - test-docs: - needs: pre_job - if: needs.pre_job.outputs.should_skip != 'true' - runs-on: ubuntu-latest - steps: - - name: Install Dependencies - shell: bash - run: | - sudo apt-get update - sudo apt-get install gperf build-essential bison flex libreadline-dev gawk tcl-dev libffi-dev git graphviz xdot pkg-config python3 libboost-system-dev libboost-python-dev libboost-filesystem-dev zlib1g-dev - - - name: Setup GCC - uses: Dup4/actions-setup-gcc@v1 - - - name: Runtime environment - shell: bash - env: - WORKSPACE: ${{ github.workspace }} - run: | - echo "GITHUB_WORKSPACE=`pwd`" >> $GITHUB_ENV - echo "$GITHUB_WORKSPACE/.local/bin" >> $GITHUB_PATH - echo "procs=$(nproc)" >> $GITHUB_ENV - - - name: Checkout Yosys - uses: actions/checkout@v4 - with: - submodules: true - - name: Build yosys - shell: bash - run: | - make config-gcc - make -j${{ env.procs }} - - - name: Run tests - shell: bash - run: | - make -C docs test -j${{ env.procs }} From c24a9063b6c5cb6591906ceed497b89b1f4ee36f Mon Sep 17 00:00:00 2001 From: Krystine Sherwin <93062060+KrystalDelusion@users.noreply.github.com> Date: Fri, 10 May 2024 10:15:03 +1200 Subject: [PATCH 42/56] Fix submodules --- .github/workflows/test-build.yml | 2 ++ .github/workflows/test-compile.yml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/.github/workflows/test-build.yml b/.github/workflows/test-build.yml index c73aa995347..e13b96816ab 100644 --- a/.github/workflows/test-build.yml +++ b/.github/workflows/test-build.yml @@ -31,6 +31,8 @@ jobs: steps: - name: Checkout Yosys uses: actions/checkout@v4 + with: + submodules: true - name: Setup environment uses: ./.github/actions/setup-build-env diff --git a/.github/workflows/test-compile.yml b/.github/workflows/test-compile.yml index 6a9097ad33a..375ea7fc54a 100644 --- a/.github/workflows/test-compile.yml +++ b/.github/workflows/test-compile.yml @@ -46,6 +46,8 @@ jobs: steps: - name: Checkout Yosys uses: actions/checkout@v4 + with: + submodules: true - name: Setup environment uses: ./.github/actions/setup-build-env From 16579176936a475428c74a3e540eb70e43e485dd Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 10 May 2024 00:16:44 +0000 Subject: [PATCH 43/56] Bump version --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 507d46f230d..106396d726d 100644 --- a/Makefile +++ b/Makefile @@ -142,7 +142,7 @@ LIBS += -lrt endif endif -YOSYS_VER := 0.41+8 +YOSYS_VER := 0.41+24 # Note: We arrange for .gitcommit to contain the (short) commit hash in # tarballs generated with git-archive(1) using .gitattributes. The git repo From d73771b0d96f414a48609a27a2a0162031df477b Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Fri, 10 May 2024 15:01:39 +0200 Subject: [PATCH 44/56] Make abc Makefile check for dependancies --- Makefile | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 106396d726d..f5bc4072981 100644 --- a/Makefile +++ b/Makefile @@ -788,7 +788,6 @@ check-git-abc: echo "Initialize the submodule: Run 'git submodule update --init' to set up 'abc' as a submodule."; \ exit 1; \ elif git -C "$(YOSYS_SRC)" submodule status abc 2>/dev/null | grep -q '^ '; then \ - echo "'abc' is a git submodule. Continuing."; \ exit 0; \ elif [ -f "$(YOSYS_SRC)/abc/.gitcommit" ] && ! grep -q '\$$Format:%h\$$' "$(YOSYS_SRC)/abc/.gitcommit"; then \ echo "'abc' comes from a tarball. Continuing."; \ @@ -806,9 +805,7 @@ check-git-abc: exit 1; \ fi -ABC_SOURCES := $(wildcard $(YOSYS_SRC)/abc/*) - -abc/abc$(EXE) abc/libabc.a: $(ABC_SOURCES) check-git-abc +abc/abc$(EXE) abc/libabc.a: check-git-abc $(P) $(Q) mkdir -p abc && $(MAKE) -C $(PROGRAM_PREFIX)abc -f "$(realpath $(YOSYS_SRC)/abc/Makefile)" ABCSRC="$(realpath $(YOSYS_SRC)/abc/)" $(S) $(ABCMKARGS) $(if $(filter %.a,$@),PROG="abc",PROG="abc$(EXE)") MSG_PREFIX="$(eval P_OFFSET = 5)$(call P_SHOW)$(eval P_OFFSET = 10) ABC: " $(if $(filter %.a,$@),libabc.a) From a31620fda3283cb91d9157b61d699ac4044ba40c Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Fri, 10 May 2024 15:02:06 +0200 Subject: [PATCH 45/56] make yosys-abc build before yosys --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index f5bc4072981..7e06deb13d7 100644 --- a/Makefile +++ b/Makefile @@ -495,7 +495,7 @@ LIBS += -lpthread endif else ifeq ($(ABCEXTERNAL),) -TARGETS += $(PROGRAM_PREFIX)yosys-abc$(EXE) +TARGETS := $(PROGRAM_PREFIX)yosys-abc$(EXE) $(TARGETS) endif endif endif From cef8bedf63edce900731d7ce296d34d3597efd93 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Fri, 10 May 2024 15:03:17 +0200 Subject: [PATCH 46/56] Remove emcc target from Makefile --- Makefile | 54 +----------------------------------------------------- 1 file changed, 1 insertion(+), 53 deletions(-) diff --git a/Makefile b/Makefile index 7e06deb13d7..e2354853f17 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,6 @@ CONFIG := none # CONFIG := clang # CONFIG := gcc # CONFIG := afl-gcc -# CONFIG := emcc # CONFIG := wasi # CONFIG := mxe # CONFIG := msys2-32 @@ -254,45 +253,6 @@ CXX = g++ CXXFLAGS += -std=gnu++11 -Os ABCMKARGS += ARCHFLAGS="-DABC_USE_STDINT_H" -else ifeq ($(CONFIG),emcc) -CXX = emcc -CXXFLAGS := -std=$(CXXSTD) $(filter-out -fPIC -ggdb,$(CXXFLAGS)) -ABCMKARGS += ARCHFLAGS="-DABC_USE_STDINT_H -DABC_MEMALIGN=8" -EMCC_CXXFLAGS := -Os -Wno-warn-absolute-paths -EMCC_LINKFLAGS := --embed-file share -EMCC_LINKFLAGS += -s NO_EXIT_RUNTIME=1 -EMCC_LINKFLAGS += -s EXPORTED_FUNCTIONS="['_main','_run','_prompt','_errmsg','_memset']" -EMCC_LINKFLAGS += -s TOTAL_MEMORY=134217728 -EMCC_LINKFLAGS += -s EXPORTED_RUNTIME_METHODS='["ccall", "cwrap"]' -# https://github.com/kripken/emscripten/blob/master/src/settings.js -CXXFLAGS += $(EMCC_CXXFLAGS) -LINKFLAGS += $(EMCC_LINKFLAGS) -LIBS = -EXE = .js - -DISABLE_SPAWN := 1 - -TARGETS := $(filter-out $(PROGRAM_PREFIX)yosys-config,$(TARGETS)) -EXTRA_TARGETS += yosysjs-$(YOSYS_VER).zip - -ifeq ($(ENABLE_ABC),1) -LINK_ABC := 1 -DISABLE_ABC_THREADS := 1 -endif - -viz.js: - wget -O viz.js.part https://github.com/mdaines/viz.js/releases/download/0.0.3/viz.js - mv viz.js.part viz.js - -yosysjs-$(YOSYS_VER).zip: yosys.js viz.js misc/yosysjs/* - rm -rf yosysjs-$(YOSYS_VER) yosysjs-$(YOSYS_VER).zip - mkdir -p yosysjs-$(YOSYS_VER) - cp viz.js misc/yosysjs/* yosys.js yosys.wasm yosysjs-$(YOSYS_VER)/ - zip -r yosysjs-$(YOSYS_VER).zip yosysjs-$(YOSYS_VER) - -yosys.html: misc/yosys.html - $(P) cp misc/yosys.html yosys.html - else ifeq ($(CONFIG),wasi) ifeq ($(WASI_SDK),) CXX = clang++ @@ -357,7 +317,7 @@ CXXFLAGS += -std=$(CXXSTD) -Os ABCMKARGS += ARCHFLAGS="-DABC_USE_STDINT_H $(ABC_ARCHFLAGS)" else -$(error Invalid CONFIG setting '$(CONFIG)'. Valid values: clang, gcc, emcc, mxe, msys2-32, msys2-64, none) +$(error Invalid CONFIG setting '$(CONFIG)'. Valid values: clang, gcc, mxe, msys2-32, msys2-64, none) endif ifeq ($(ENABLE_LIBYOSYS),1) @@ -727,10 +687,6 @@ top-all: $(TARGETS) $(EXTRA_TARGETS) @echo " Build successful." @echo "" -ifeq ($(CONFIG),emcc) -yosys.js: $(filter-out yosysjs-$(YOSYS_VER).zip,$(EXTRA_TARGETS)) -endif - $(PROGRAM_PREFIX)yosys$(EXE): $(OBJS) $(P) $(CXX) -o $(PROGRAM_PREFIX)yosys$(EXE) $(EXE_LINKFLAGS) $(LINKFLAGS) $(OBJS) $(LIBS) $(LIBS_VERIFIC) @@ -1082,14 +1038,6 @@ config-gcc-static: clean config-afl-gcc: clean echo 'CONFIG := afl-gcc' > Makefile.conf -config-emcc: clean - echo 'CONFIG := emcc' > Makefile.conf - echo 'ENABLE_TCL := 0' >> Makefile.conf - echo 'ENABLE_ABC := 0' >> Makefile.conf - echo 'ENABLE_PLUGINS := 0' >> Makefile.conf - echo 'ENABLE_READLINE := 0' >> Makefile.conf - echo 'ENABLE_ZLIB := 0' >> Makefile.conf - config-wasi: clean echo 'CONFIG := wasi' > Makefile.conf echo 'ENABLE_TCL := 0' >> Makefile.conf From 6dde8107c3214a917eb7f1c1683576fde4922840 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Fri, 10 May 2024 15:46:32 +0200 Subject: [PATCH 47/56] Remove checkout for specific iverilog git version --- .github/workflows/test-build.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/test-build.yml b/.github/workflows/test-build.yml index e13b96816ab..5966ec3afdf 100644 --- a/.github/workflows/test-build.yml +++ b/.github/workflows/test-build.yml @@ -89,7 +89,6 @@ jobs: run: | git clone https://github.com/steveicarus/iverilog.git cd iverilog - git checkout 192b6aec96fde982e6ddcb28b346d5893aa8e874 echo "IVERILOG_GIT=$(git rev-parse HEAD)" >> $GITHUB_ENV - name: Cache iverilog From 9be7089f4f90365ff3105824f3867b84d6bca077 Mon Sep 17 00:00:00 2001 From: Krystine Sherwin <93062060+KrystalDelusion@users.noreply.github.com> Date: Sat, 11 May 2024 10:40:28 +1200 Subject: [PATCH 48/56] Docs-css: Add invert-helper class for images Use svg color filter matrix from @jix to invert brightness for images when using dark theme. Co-authored-by: Jannis Harder --- docs/source/_static/yosyshq.css | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/docs/source/_static/yosyshq.css b/docs/source/_static/yosyshq.css index 57ae8f87a5f..447c8536743 100644 --- a/docs/source/_static/yosyshq.css +++ b/docs/source/_static/yosyshq.css @@ -24,3 +24,17 @@ a.external { th { text-align: left; } + +body[data-theme="dark"] { + .invert-helper { + filter: url("data:image/svg+xml,#f"); + } +} + +@media (prefers-color-scheme: dark) { + body:not([data-theme="light"]) { + .invert-helper { + filter: url("data:image/svg+xml,#f"); + } + } +} \ No newline at end of file From 3a36612ec7bbf4e445e5dc80a902002f1bd0bfa4 Mon Sep 17 00:00:00 2001 From: Krystine Sherwin <93062060+KrystalDelusion@users.noreply.github.com> Date: Sat, 11 May 2024 10:40:54 +1200 Subject: [PATCH 49/56] Docs: Apply invert-helper where needed --- docs/source/appendix/primer.rst | 8 ++-- docs/source/getting_started/example_synth.rst | 32 +++++++-------- .../getting_started/scripting_intro.rst | 6 +-- docs/source/introduction.rst | 2 +- .../interactive_investigation.rst | 24 +++++------ .../using_yosys/more_scripting/selections.rst | 26 ++++++------ .../using_yosys/synthesis/cell_libs.rst | 8 ++-- docs/source/using_yosys/synthesis/extract.rst | 40 +++++++++---------- docs/source/using_yosys/synthesis/memory.rst | 4 +- docs/source/using_yosys/synthesis/opt.rst | 8 ++-- docs/source/using_yosys/synthesis/proc.rst | 6 +-- .../extending_yosys/extensions.rst | 4 +- .../yosys_internals/flow/control_and_data.rst | 2 +- docs/source/yosys_internals/flow/overview.rst | 2 +- .../yosys_internals/flow/verilog_frontend.rst | 2 +- .../yosys_internals/formats/rtlil_rep.rst | 2 +- docs/source/yosys_internals/techmap.rst | 10 ++--- 17 files changed, 93 insertions(+), 93 deletions(-) diff --git a/docs/source/appendix/primer.rst b/docs/source/appendix/primer.rst index 101723e32cb..50656af780e 100644 --- a/docs/source/appendix/primer.rst +++ b/docs/source/appendix/primer.rst @@ -24,7 +24,7 @@ circuit to a functionally equivalent low-level representation of a circuit. abstraction and how they relate to different kinds of synthesis. .. figure:: /_images/primer/basics_abstractions.* - :class: width-helper + :class: width-helper invert-helper :name: fig:Basics_abstractions Different levels of abstraction and synthesis. @@ -499,7 +499,7 @@ using a series of tools and the results are again verified using simulation. This process is illustrated in :numref:`Fig. %s `. .. figure:: /_images/primer/basics_flow.* - :class: width-helper + :class: width-helper invert-helper :name: fig:Basics_flow Typical design flow. Green boxes represent manually created models. @@ -598,7 +598,7 @@ Let's consider the following BNF (in Bison syntax): expr: TOK_IDENTIFIER | TOK_NUMBER | expr TOK_PLUS expr; .. figure:: /_images/primer/basics_parsetree.* - :class: width-helper + :class: width-helper invert-helper :name: fig:Basics_parsetree Example parse tree for the Verilog expression @@ -627,7 +627,7 @@ suitable for further processing. In compilers this is often an assembler-like three-address-code intermediate representation. :cite:p:`Dragonbook` .. figure:: /_images/primer/basics_ast.* - :class: width-helper + :class: width-helper invert-helper :name: fig:Basics_ast Example abstract syntax tree for the Verilog expression diff --git a/docs/source/getting_started/example_synth.rst b/docs/source/getting_started/example_synth.rst index 916bef9fabd..ae0a9a36620 100644 --- a/docs/source/getting_started/example_synth.rst +++ b/docs/source/getting_started/example_synth.rst @@ -122,7 +122,7 @@ Since we're just getting started, let's instead begin with :yoscrypt:`hierarchy Our ``addr_gen`` circuit now looks like this: .. figure:: /_images/code_examples/fifo/addr_gen_hier.* - :class: width-helper + :class: width-helper invert-helper :name: addr_gen_hier ``addr_gen`` module after :cmd:ref:`hierarchy` @@ -145,7 +145,7 @@ we run it. For now, we will call :yoscrypt:`proc -noopt` to prevent some automatic optimizations which would normally happen. .. figure:: /_images/code_examples/fifo/addr_gen_proc.* - :class: width-helper + :class: width-helper invert-helper :name: addr_gen_proc ``addr_gen`` module after :yoscrypt:`proc -noopt` @@ -166,7 +166,7 @@ the same time by separating them with a colon and space: :yoscrypt:`opt_expr; clean`. .. figure:: /_images/code_examples/fifo/addr_gen_clean.* - :class: width-helper + :class: width-helper invert-helper :name: addr_gen_clean ``addr_gen`` module after :yoscrypt:`opt_expr; clean` @@ -252,7 +252,7 @@ command only works with a single module, so you may need to call it with :doc:`/getting_started/scripting_intro` has more on how to use :cmd:ref:`show`. .. figure:: /_images/code_examples/fifo/rdata_proc.* - :class: width-helper + :class: width-helper invert-helper :name: rdata_proc ``rdata`` output after :cmd:ref:`proc` @@ -298,7 +298,7 @@ optimizations between modules which would otherwise be missed. Let's run :caption: output of :yoscrypt:`flatten;;` .. figure:: /_images/code_examples/fifo/rdata_flat.* - :class: width-helper + :class: width-helper invert-helper :name: rdata_flat ``rdata`` output after :yoscrypt:`flatten;;` @@ -385,7 +385,7 @@ options is able to fold one of the ``$mux`` cells into the ``$adff`` to form an :caption: output of :cmd:ref:`opt_dff` .. figure:: /_images/code_examples/fifo/rdata_adffe.* - :class: width-helper + :class: width-helper invert-helper :name: rdata_adffe ``rdata`` output after :cmd:ref:`opt_dff` @@ -424,7 +424,7 @@ the schematic and see the output of that cell has now changed. .. todo:: pending bugfix in :cmd:ref:`wreduce` and/or :cmd:ref:`opt_clean` .. figure:: /_images/code_examples/fifo/rdata_wreduce.* - :class: width-helper + :class: width-helper invert-helper :name: rdata_wreduce ``rdata`` output after :cmd:ref:`wreduce` @@ -446,7 +446,7 @@ Our next command to run is :caption: output of :cmd:ref:`memory_dff` .. figure:: /_images/code_examples/fifo/rdata_memrdv2.* - :class: width-helper + :class: width-helper invert-helper :name: rdata_memrdv2 ``rdata`` output after :cmd:ref:`memory_dff` @@ -535,7 +535,7 @@ example design: :caption: output of :cmd:ref:`alumacc` .. figure:: /_images/code_examples/fifo/rdata_alumacc.* - :class: width-helper + :class: width-helper invert-helper :name: rdata_alumacc ``rdata`` output after :cmd:ref:`alumacc` @@ -553,7 +553,7 @@ operating on the same memory only in the abstract. :cmd:ref:`memory_collect` combines all of the reads and writes for a memory block into a single cell. .. figure:: /_images/code_examples/fifo/rdata_coarse.* - :class: width-helper + :class: width-helper invert-helper :name: rdata_coarse ``rdata`` output after :cmd:ref:`memory_collect` @@ -604,7 +604,7 @@ Mapping to hard memory blocks uses a combination of :cmd:ref:`memory_libmap` and :caption: ``map_ram`` section .. figure:: /_images/code_examples/fifo/rdata_map_ram.* - :class: width-helper + :class: width-helper invert-helper :name: rdata_map_ram ``rdata`` output after :ref:`map_ram` @@ -646,7 +646,7 @@ into flip flops (the ``logic fallback``) with :cmd:ref:`memory_map`. :caption: ``map_ffram`` section .. figure:: /_images/code_examples/fifo/rdata_map_ffram.* - :class: width-helper + :class: width-helper invert-helper :name: rdata_map_ffram ``rdata`` output after :ref:`map_ffram` @@ -682,7 +682,7 @@ replaced with single-bit ``$_MUX_`` and ``$_DFFE_PP0P_`` cells, while the :caption: ``map_gates`` section .. figure:: /_images/code_examples/fifo/rdata_map_gates.* - :class: width-helper + :class: width-helper invert-helper :name: rdata_map_gates ``rdata`` output after :ref:`map_gates` @@ -711,7 +711,7 @@ instead with an ``$_AND_`` cell. :caption: ``map_ffs`` section .. figure:: /_images/code_examples/fifo/rdata_map_ffs.* - :class: width-helper + :class: width-helper invert-helper :name: rdata_map_ffs ``rdata`` output after :ref:`map_ffs` @@ -737,7 +737,7 @@ what the difference between these two commands are, refer to :caption: ``map_luts`` section .. figure:: /_images/code_examples/fifo/rdata_map_luts.* - :class: width-helper + :class: width-helper invert-helper :name: rdata_map_luts ``rdata`` output after :ref:`map_luts` @@ -754,7 +754,7 @@ Finally we use :cmd:ref:`techmap` to map the generic ``$lut`` cells to iCE40 :caption: ``map_cells`` section .. figure:: /_images/code_examples/fifo/rdata_map_cells.* - :class: width-helper + :class: width-helper invert-helper :name: rdata_map_cells ``rdata`` output after :ref:`map_cells` diff --git a/docs/source/getting_started/scripting_intro.rst b/docs/source/getting_started/scripting_intro.rst index 63eca990125..bda76b74e9a 100644 --- a/docs/source/getting_started/scripting_intro.rst +++ b/docs/source/getting_started/scripting_intro.rst @@ -108,7 +108,7 @@ what the different symbols represent, see :ref:`interactive_show` and the :doc:`/using_yosys/more_scripting/interactive_investigation` page. .. figure:: /_images/code_examples/fifo/addr_gen_show.* - :class: width-helper + :class: width-helper invert-helper :name: addr_gen_show Calling :yoscrypt:`show addr_gen` after :cmd:ref:`hierarchy` @@ -158,7 +158,7 @@ selection` and called it ``new_cells``? We saw in the ``$eq``. We can call :cmd:ref:`show` on that selection just as easily: .. figure:: /_images/code_examples/fifo/new_cells_show.* - :class: width-helper + :class: width-helper invert-helper :name: new_cells_show Calling :yoscrypt:`show -notitle @new_cells` @@ -173,7 +173,7 @@ the two ``PROC`` blocks. To achieve this highlight, we make use of the :yoscrypt:`-color` option: .. figure:: /_images/code_examples/fifo/addr_gen_hier.* - :class: width-helper + :class: width-helper invert-helper Calling :yoscrypt:`show -color maroon3 @new_cells -color cornflowerblue p:* -notitle` diff --git a/docs/source/introduction.rst b/docs/source/introduction.rst index 936784d7411..1d9cd008044 100644 --- a/docs/source/introduction.rst +++ b/docs/source/introduction.rst @@ -151,7 +151,7 @@ extensible and therefore is a good basis for implementing custom synthesis tools for specialised tasks. .. figure:: /_images/primer/levels_of_abstraction.* - :class: width-helper + :class: width-helper invert-helper :name: fig:Levels_of_abstraction Where Yosys exists in the layers of abstraction diff --git a/docs/source/using_yosys/more_scripting/interactive_investigation.rst b/docs/source/using_yosys/more_scripting/interactive_investigation.rst index f56543bebbb..db34f041bb9 100644 --- a/docs/source/using_yosys/more_scripting/interactive_investigation.rst +++ b/docs/source/using_yosys/more_scripting/interactive_investigation.rst @@ -56,7 +56,7 @@ is shown. ``xdot example_first.dot`` etc. .. figure:: /_images/code_examples/show/example_first.* - :class: width-helper + :class: width-helper invert-helper Output of the first :cmd:ref:`show` command in :numref:`example_ys` @@ -88,7 +88,7 @@ The :cmd:ref:`proc` command transforms the process from the first diagram into a multiplexer and a d-type flip-flop, which brings us to the second diagram: .. figure:: /_images/code_examples/show/example_second.* - :class: width-helper + :class: width-helper invert-helper Output of the second :cmd:ref:`show` command in :numref:`example_ys` @@ -110,7 +110,7 @@ In this script we directly call :cmd:ref:`opt` as the next step, which finally leads us to the third diagram: .. figure:: /_images/code_examples/show/example_third.* - :class: width-helper + :class: width-helper invert-helper :name: example_out Output of the third :cmd:ref:`show` command in :ref:`example_ys` @@ -137,7 +137,7 @@ that operate on wide integers, it also introduces some additional complexity when the individual bits of of a signal vector are accessed. .. figure:: /_images/code_examples/show/splice.* - :class: width-helper + :class: width-helper invert-helper :name: splice_dia Output of ``yosys -p 'prep -top splice_demo; show' splice.v`` @@ -165,7 +165,7 @@ Gate level netlists mapped to a cell library: .. figure:: /_images/code_examples/show/cmos_00.* - :class: width-helper + :class: width-helper invert-helper :name: first_pitfall A half-adder built from simple CMOS gates, demonstrating common pitfalls when @@ -185,7 +185,7 @@ column. Secondly the two-bit vector ``y`` requires breakout-boxes for its individual bits, resulting in an unnecessary complex diagram. .. figure:: /_images/code_examples/show/cmos_01.* - :class: width-helper + :class: width-helper invert-helper :name: second_pitfall Effects of :cmd:ref:`splitnets` command and of providing a cell library on @@ -358,10 +358,10 @@ reorganizing a module in Yosys and checking the resulting circuit. :end-before: cd .. .. figure:: /_images/code_examples/scrambler/scrambler_p01.* - :class: width-helper + :class: width-helper invert-helper .. figure:: /_images/code_examples/scrambler/scrambler_p02.* - :class: width-helper + :class: width-helper invert-helper Analyzing the resulting circuit with :doc:`/cmd/eval`: @@ -442,7 +442,7 @@ if the circuit under investigation is encapsulated in a separate module. Recall the ``memdemo`` design from :ref:`advanced_logic_cones`: .. figure:: /_images/code_examples/selections/memdemo_00.* - :class: width-helper + :class: width-helper invert-helper ``memdemo`` @@ -463,18 +463,18 @@ name of the new cell in the current module. The resulting circuits are shown below. .. figure:: /_images/code_examples/selections/submod_02.* - :class: width-helper + :class: width-helper invert-helper ``outstage`` .. figure:: /_images/code_examples/selections/submod_03.* - :class: width-helper + :class: width-helper invert-helper :name: selstage ``selstage`` .. figure:: /_images/code_examples/selections/submod_01.* - :class: width-helper + :class: width-helper invert-helper ``scramble`` diff --git a/docs/source/using_yosys/more_scripting/selections.rst b/docs/source/using_yosys/more_scripting/selections.rst index 6aa3465cc99..b0028347499 100644 --- a/docs/source/using_yosys/more_scripting/selections.rst +++ b/docs/source/using_yosys/more_scripting/selections.rst @@ -160,7 +160,7 @@ Selecting ``a:sumstuff`` in this module will yield the following circuit diagram: .. figure:: /_images/code_examples/selections/sumprod_00.* - :class: width-helper + :class: width-helper invert-helper :name: sumprod_00 Output of ``show a:sumstuff`` on :numref:`sumprod` @@ -177,7 +177,7 @@ selected wire it selects all cells connected to the wire and vice versa. So :yoscrypt:`show a:sumstuff %x` yields the diagram shown in :numref:`sumprod_01`: .. figure:: /_images/code_examples/selections/sumprod_01.* - :class: width-helper + :class: width-helper invert-helper :name: sumprod_01 Output of ``show a:sumstuff %x`` on :numref:`sumprod` @@ -200,22 +200,22 @@ input ports. The following sequence of diagrams demonstrates this step-wise expansion: .. figure:: /_images/code_examples/selections/sumprod_02.* - :class: width-helper + :class: width-helper invert-helper Output of :yoscrypt:`show prod` on :numref:`sumprod` .. figure:: /_images/code_examples/selections/sumprod_03.* - :class: width-helper + :class: width-helper invert-helper Output of :yoscrypt:`show prod %ci` on :numref:`sumprod` .. figure:: /_images/code_examples/selections/sumprod_04.* - :class: width-helper + :class: width-helper invert-helper Output of :yoscrypt:`show prod %ci %ci` on :numref:`sumprod` .. figure:: /_images/code_examples/selections/sumprod_05.* - :class: width-helper + :class: width-helper invert-helper Output of :yoscrypt:`show prod %ci %ci %ci` on :numref:`sumprod` @@ -280,7 +280,7 @@ provided :file:`memdemo.v` is in the same directory. We can now change to the diagram in :numref:`memdemo_00`. .. figure:: /_images/code_examples/selections/memdemo_00.* - :class: width-helper + :class: width-helper invert-helper :name: memdemo_00 Complete circuit diagram for the design shown in :numref:`memdemo_src` @@ -291,7 +291,7 @@ output signal, ``y``, and its immediate predecessors. Remember `Selecting logic cones`_ from above, we can use :yoscrypt:`show y %ci2`: .. figure:: /_images/code_examples/selections/memdemo_01.* - :class: width-helper + :class: width-helper invert-helper :name: memdemo_01 Output of :yoscrypt:`show y %ci2` @@ -303,7 +303,7 @@ wire into the input ``D`` of the flip-flop cell (indicated by the ``$`` at the start of the name). Let's go a bit further now and try :yoscrypt:`show y %ci5`: .. figure:: /_images/code_examples/selections/memdemo_02.* - :class: width-helper + :class: width-helper invert-helper :name: memdemo_02 Output of :yoscrypt:`show y %ci5` @@ -317,7 +317,7 @@ brackets. In this case, we want to exclude the ``S`` port of the ``$mux`` cell type with :yoscrypt:`show y %ci5:-$mux[S]`: .. figure:: /_images/code_examples/selections/memdemo_03.* - :class: width-helper + :class: width-helper invert-helper :name: memdemo_03 Output of :yoscrypt:`show y %ci5:-$mux[S]` @@ -328,7 +328,7 @@ flip-flop and the 2nd action selects the entire input cone without going over multiplexer select inputs and flip-flop cells: .. figure:: /_images/code_examples/selections/memdemo_05.* - :class: width-helper + :class: width-helper invert-helper :name: memdemo_05 Output of ``show y %ci2:+$dff[Q,D] %ci*:-$mux[S]:-$dff`` @@ -340,7 +340,7 @@ ignoring any ports named ``CLK`` or ``S``: .. TODO:: pending discussion on whether rule ordering is a bug or a feature .. figure:: /_images/code_examples/selections/memdemo_04.* - :class: width-helper + :class: width-helper invert-helper :name: memdemo_04 Output of :yoscrypt:`show y %ci*:-[CLK,S]:+$dff,$mux` @@ -417,6 +417,6 @@ Example code from |code_examples/selections|_: :name: select_ys .. figure:: /_images/code_examples/selections/select.* - :class: width-helper + :class: width-helper invert-helper Circuit diagram produced by :numref:`select_ys` diff --git a/docs/source/using_yosys/synthesis/cell_libs.rst b/docs/source/using_yosys/synthesis/cell_libs.rst index 476269abfc9..92b6dab3f58 100644 --- a/docs/source/using_yosys/synthesis/cell_libs.rst +++ b/docs/source/using_yosys/synthesis/cell_libs.rst @@ -51,7 +51,7 @@ Loading the design Our circuit now looks like this: .. figure:: /_images/code_examples/intro/counter_00.* - :class: width-helper + :class: width-helper invert-helper :name: counter-hierarchy ``counter`` after :cmd:ref:`hierarchy` @@ -66,7 +66,7 @@ Coarse-grain representation :caption: :file:`counter.ys` - the high-level stuff .. figure:: /_images/code_examples/intro/counter_01.* - :class: width-helper + :class: width-helper invert-helper Coarse-grain representation of the ``counter`` module @@ -80,7 +80,7 @@ Logic gate mapping :caption: :file:`counter.ys` - mapping to internal cell library .. figure:: /_images/code_examples/intro/counter_02.* - :class: width-helper + :class: width-helper invert-helper ``counter`` after :cmd:ref:`techmap` @@ -111,7 +111,7 @@ Recall that the Yosys built-in logic gate types are ``$_NOT_``, ``$_AND_``, The final version of our ``counter`` module looks like this: .. figure:: /_images/code_examples/intro/counter_03.* - :class: width-helper + :class: width-helper invert-helper ``counter`` after hardware cell mapping diff --git a/docs/source/using_yosys/synthesis/extract.rst b/docs/source/using_yosys/synthesis/extract.rst index bbe1870dfb3..c9b76840e3b 100644 --- a/docs/source/using_yosys/synthesis/extract.rst +++ b/docs/source/using_yosys/synthesis/extract.rst @@ -23,7 +23,7 @@ Example code can be found in |code_examples/macc|_. :lines: 1-2 .. figure:: /_images/code_examples/macc/macc_simple_test_00a.* - :class: width-helper + :class: width-helper invert-helper before :cmd:ref:`extract` @@ -32,7 +32,7 @@ Example code can be found in |code_examples/macc|_. :lines: 6 .. figure:: /_images/code_examples/macc/macc_simple_test_00b.* - :class: width-helper + :class: width-helper invert-helper after :cmd:ref:`extract` @@ -49,20 +49,20 @@ Example code can be found in |code_examples/macc|_. :caption: :file:`macc_simple_test_01.v` .. figure:: /_images/code_examples/macc/macc_simple_test_01a.* - :class: width-helper + :class: width-helper invert-helper .. figure:: /_images/code_examples/macc/macc_simple_test_01b.* - :class: width-helper + :class: width-helper invert-helper .. literalinclude:: /code_examples/macc/macc_simple_test_02.v :language: verilog :caption: :file:`macc_simple_test_02.v` .. figure:: /_images/code_examples/macc/macc_simple_test_02a.* - :class: width-helper + :class: width-helper invert-helper .. figure:: /_images/code_examples/macc/macc_simple_test_02b.* - :class: width-helper + :class: width-helper invert-helper The wrap-extract-unwrap method ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -149,10 +149,10 @@ Unwrapping adders: :file:`macc_xilinx_unwrap_map.v` :caption: ``test1`` of :file:`macc_xilinx_test.v` .. figure:: /_images/code_examples/macc/macc_xilinx_test1a.* - :class: width-helper + :class: width-helper invert-helper .. figure:: /_images/code_examples/macc/macc_xilinx_test1b.* - :class: width-helper + :class: width-helper invert-helper .. literalinclude:: /code_examples/macc/macc_xilinx_test.v :language: verilog @@ -160,15 +160,15 @@ Unwrapping adders: :file:`macc_xilinx_unwrap_map.v` :caption: ``test2`` of :file:`macc_xilinx_test.v` .. figure:: /_images/code_examples/macc/macc_xilinx_test2a.* - :class: width-helper + :class: width-helper invert-helper .. figure:: /_images/code_examples/macc/macc_xilinx_test2b.* - :class: width-helper + :class: width-helper invert-helper Wrapping in ``test1``: .. figure:: /_images/code_examples/macc/macc_xilinx_test1b.* - :class: width-helper + :class: width-helper invert-helper .. literalinclude:: /code_examples/macc/macc_xilinx_test.ys :language: yoscrypt @@ -176,12 +176,12 @@ Wrapping in ``test1``: :end-before: end part c .. figure:: /_images/code_examples/macc/macc_xilinx_test1c.* - :class: width-helper + :class: width-helper invert-helper Wrapping in ``test2``: .. figure:: /_images/code_examples/macc/macc_xilinx_test2b.* - :class: width-helper + :class: width-helper invert-helper .. literalinclude:: /code_examples/macc/macc_xilinx_test.ys :language: yoscrypt @@ -189,12 +189,12 @@ Wrapping in ``test2``: :end-before: end part c .. figure:: /_images/code_examples/macc/macc_xilinx_test2c.* - :class: width-helper + :class: width-helper invert-helper Extract in ``test1``: .. figure:: /_images/code_examples/macc/macc_xilinx_test1c.* - :class: width-helper + :class: width-helper invert-helper .. literalinclude:: /code_examples/macc/macc_xilinx_test.ys :language: yoscrypt @@ -202,12 +202,12 @@ Extract in ``test1``: :end-before: end part d .. figure:: /_images/code_examples/macc/macc_xilinx_test1d.* - :class: width-helper + :class: width-helper invert-helper Extract in ``test2``: .. figure:: /_images/code_examples/macc/macc_xilinx_test2c.* - :class: width-helper + :class: width-helper invert-helper .. literalinclude:: /code_examples/macc/macc_xilinx_test.ys :language: yoscrypt @@ -215,12 +215,12 @@ Extract in ``test2``: :end-before: end part d .. figure:: /_images/code_examples/macc/macc_xilinx_test2d.* - :class: width-helper + :class: width-helper invert-helper Unwrap in ``test2``: .. figure:: /_images/code_examples/macc/macc_xilinx_test2d.* - :class: width-helper + :class: width-helper invert-helper .. literalinclude:: /code_examples/macc/macc_xilinx_test.ys :language: yoscrypt @@ -228,4 +228,4 @@ Unwrap in ``test2``: :end-before: end part e .. figure:: /_images/code_examples/macc/macc_xilinx_test2e.* - :class: width-helper \ No newline at end of file + :class: width-helper invert-helper \ No newline at end of file diff --git a/docs/source/using_yosys/synthesis/memory.rst b/docs/source/using_yosys/synthesis/memory.rst index 3dbafeaab7e..0f5e1bd3010 100644 --- a/docs/source/using_yosys/synthesis/memory.rst +++ b/docs/source/using_yosys/synthesis/memory.rst @@ -39,7 +39,7 @@ Example .. _code_examples/synth_flow: https://github.com/YosysHQ/yosys/tree/main/docs/source/code_examples/synth_flow .. figure:: /_images/code_examples/synth_flow/memory_01.* - :class: width-helper + :class: width-helper invert-helper .. literalinclude:: /code_examples/synth_flow/memory_01.ys :language: yoscrypt @@ -50,7 +50,7 @@ Example :caption: :file:`memory_01.v` .. figure:: /_images/code_examples/synth_flow/memory_02.* - :class: width-helper + :class: width-helper invert-helper .. literalinclude:: /code_examples/synth_flow/memory_02.v :language: verilog diff --git a/docs/source/using_yosys/synthesis/opt.rst b/docs/source/using_yosys/synthesis/opt.rst index 7861f66d4cd..2a06aadd118 100644 --- a/docs/source/using_yosys/synthesis/opt.rst +++ b/docs/source/using_yosys/synthesis/opt.rst @@ -88,7 +88,7 @@ trees can interfere with other optimizations. :caption: example verilog for demonstrating :cmd:ref:`opt_expr` .. figure:: /_images/code_examples/opt/opt_expr.* - :class: width-helper + :class: width-helper invert-helper Before and after :cmd:ref:`opt_expr` @@ -111,7 +111,7 @@ possible optimizations. :caption: example verilog for demonstrating :cmd:ref:`opt_merge` .. figure:: /_images/code_examples/opt/opt_merge.* - :class: width-helper + :class: width-helper invert-helper Before and after :cmd:ref:`opt_merge` @@ -133,7 +133,7 @@ detects this contradiction and replaces the inner multiplexer with a constant 1, yielding the logic for ``y = a ? b : d``. .. figure:: /_images/code_examples/opt/opt_muxtree.* - :class: width-helper + :class: width-helper invert-helper Before and after :cmd:ref:`opt_muxtree` @@ -172,7 +172,7 @@ multiplexing its output to multiplexing the non-shared input signals. :caption: example verilog for demonstrating :cmd:ref:`opt_share` .. figure:: /_images/code_examples/opt/opt_share.* - :class: width-helper + :class: width-helper invert-helper Before and after :cmd:ref:`opt_share` diff --git a/docs/source/using_yosys/synthesis/proc.rst b/docs/source/using_yosys/synthesis/proc.rst index b4983438021..d90aa087dc7 100644 --- a/docs/source/using_yosys/synthesis/proc.rst +++ b/docs/source/using_yosys/synthesis/proc.rst @@ -42,10 +42,10 @@ Example :caption: :file:`proc_01.ys` .. figure:: /_images/code_examples/synth_flow/proc_01.* - :class: width-helper + :class: width-helper invert-helper .. figure:: /_images/code_examples/synth_flow/proc_02.* - :class: width-helper + :class: width-helper invert-helper .. literalinclude:: /code_examples/synth_flow/proc_02.v :language: verilog @@ -56,7 +56,7 @@ Example :caption: :file:`proc_02.ys` .. figure:: /_images/code_examples/synth_flow/proc_03.* - :class: width-helper + :class: width-helper invert-helper .. literalinclude:: /code_examples/synth_flow/proc_03.ys :language: yoscrypt diff --git a/docs/source/yosys_internals/extending_yosys/extensions.rst b/docs/source/yosys_internals/extending_yosys/extensions.rst index 68e1740be4a..f10c634b015 100644 --- a/docs/source/yosys_internals/extending_yosys/extensions.rst +++ b/docs/source/yosys_internals/extending_yosys/extensions.rst @@ -38,7 +38,7 @@ This document will focus on the much simpler version of RTLIL left after the commands :cmd:ref:`proc` and :cmd:ref:`memory` (or :yoscrypt:`memory -nomap`): .. figure:: /_images/internals/simplified_rtlil.* - :class: width-helper + :class: width-helper invert-helper :name: fig:Simplified_RTLIL Simplified RTLIL entity-relationship diagram without memories and processes @@ -140,7 +140,7 @@ We'll do the same as before and format it as a a ``Yosys::Pass``. And if we look at the schematic for this new module we see the following: .. figure:: /_images/code_examples/extensions/test1.* - :class: width-helper + :class: width-helper invert-helper Output of ``yosys -m ./my_cmd.so -p 'test1; show'`` diff --git a/docs/source/yosys_internals/flow/control_and_data.rst b/docs/source/yosys_internals/flow/control_and_data.rst index 5dcbe073025..70a84747f9e 100644 --- a/docs/source/yosys_internals/flow/control_and_data.rst +++ b/docs/source/yosys_internals/flow/control_and_data.rst @@ -10,7 +10,7 @@ and generating the data for the next subsystem (see :numref:`Fig. %s `). .. figure:: /_images/internals/approach_flow.* - :class: width-helper + :class: width-helper invert-helper :name: fig:approach_flow General data- and control-flow of a synthesis tool diff --git a/docs/source/yosys_internals/flow/overview.rst b/docs/source/yosys_internals/flow/overview.rst index f7589df031f..b357e5b50ea 100644 --- a/docs/source/yosys_internals/flow/overview.rst +++ b/docs/source/yosys_internals/flow/overview.rst @@ -42,7 +42,7 @@ possible it is key that (1) all passes operate on the same data structure design in different stages of the synthesis. .. figure:: /_images/internals/overview_flow.* - :class: width-helper + :class: width-helper invert-helper :name: fig:Overview_flow Yosys simplified data flow (ellipses: data structures, rectangles: diff --git a/docs/source/yosys_internals/flow/verilog_frontend.rst b/docs/source/yosys_internals/flow/verilog_frontend.rst index 127fa7be388..f2eaeae97b3 100644 --- a/docs/source/yosys_internals/flow/verilog_frontend.rst +++ b/docs/source/yosys_internals/flow/verilog_frontend.rst @@ -10,7 +10,7 @@ is then passed to the AST frontend that converts it to RTLIL data, as illustrated in :numref:`Fig. %s `. .. figure:: /_images/internals/verilog_flow.* - :class: width-helper + :class: width-helper invert-helper :name: fig:Verilog_flow Simplified Verilog to RTLIL data flow diff --git a/docs/source/yosys_internals/formats/rtlil_rep.rst b/docs/source/yosys_internals/formats/rtlil_rep.rst index 5de3430f228..2737cd4bd46 100644 --- a/docs/source/yosys_internals/formats/rtlil_rep.rst +++ b/docs/source/yosys_internals/formats/rtlil_rep.rst @@ -24,7 +24,7 @@ create an additional ``RTLIL::Design`` object and call the Verilog frontend with this other object to parse the cell library. .. figure:: /_images/internals/overview_rtlil.* - :class: width-helper + :class: width-helper invert-helper :name: fig:Overview_RTLIL Simplified RTLIL Entity-Relationship Diagram diff --git a/docs/source/yosys_internals/techmap.rst b/docs/source/yosys_internals/techmap.rst index ab161ed92d3..00fce26bd4f 100644 --- a/docs/source/yosys_internals/techmap.rst +++ b/docs/source/yosys_internals/techmap.rst @@ -34,7 +34,7 @@ Mapping OR3X1 :caption: :file:`red_or3x1_map.v` .. figure:: /_images/code_examples/techmap/red_or3x1.* - :class: width-helper + :class: width-helper invert-helper .. literalinclude:: /code_examples/techmap/red_or3x1_test.ys :language: yoscrypt @@ -61,7 +61,7 @@ Conditional techmap Example: .. figure:: /_images/code_examples/techmap/sym_mul.* - :class: width-helper + :class: width-helper invert-helper .. literalinclude:: /code_examples/techmap/sym_mul_map.v :language: verilog @@ -100,7 +100,7 @@ Scripting in map modules Example: .. figure:: /_images/code_examples/techmap/mymul.* - :class: width-helper + :class: width-helper invert-helper .. literalinclude:: /code_examples/techmap/mymul_map.v :language: verilog @@ -130,7 +130,7 @@ Handling constant inputs Example: .. figure:: /_images/code_examples/techmap/mulshift.* - :class: width-helper + :class: width-helper invert-helper .. literalinclude:: /code_examples/techmap/mulshift_map.v :language: verilog @@ -162,7 +162,7 @@ Handling shorted inputs Example: .. figure:: /_images/code_examples/techmap/addshift.* - :class: width-helper + :class: width-helper invert-helper .. literalinclude:: /code_examples/techmap/addshift_map.v :language: verilog From a8bad3060ca362c07e37734aac55d58fa5e64c9d Mon Sep 17 00:00:00 2001 From: Krystine Sherwin <93062060+KrystalDelusion@users.noreply.github.com> Date: Sat, 11 May 2024 10:51:08 +1200 Subject: [PATCH 50/56] test-build.yml: test-docs should not ignore docs changes --- .github/workflows/test-build.yml | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-build.yml b/.github/workflows/test-build.yml index 5966ec3afdf..1cc068c1e5d 100644 --- a/.github/workflows/test-build.yml +++ b/.github/workflows/test-build.yml @@ -16,12 +16,23 @@ jobs: cancel_others: 'true' # only run on push *or* pull_request, not both concurrent_skipping: 'same_content_newer' + pre_docs_job: + runs-on: ubuntu-latest + outputs: + should_skip: ${{ steps.skip_check.outputs.should_skip }} + steps: + - id: skip_check + uses: fkirc/skip-duplicate-actions@v5 + with: + paths_ignore: '["**/README.md"]' + # cancel previous builds if a new commit is pushed + cancel_others: 'true' + # only run on push *or* pull_request, not both + concurrent_skipping: 'same_content_newer' build-yosys: name: Reusable build runs-on: ${{ matrix.os }} - needs: pre_job - if: needs.pre_job.outputs.should_skip != 'true' env: CC: clang strategy: @@ -137,8 +148,8 @@ jobs: test-docs: name: Run docs tests runs-on: ${{ matrix.os }} - needs: [build-yosys, pre_job] - if: needs.pre_job.outputs.should_skip != 'true' + needs: [build-yosys, pre_docs_job] + if: needs.pre_docs_job.outputs.should_skip != 'true' env: CC: clang strategy: From 95bd7c9b0803f072f2e1b4780b8b7fdbce5042ea Mon Sep 17 00:00:00 2001 From: Krystine Sherwin <93062060+KrystalDelusion@users.noreply.github.com> Date: Sat, 11 May 2024 11:00:58 +1200 Subject: [PATCH 51/56] test-build.yml Use pre_docs_job for build-yosys pre_job will never skip something that is not skipped by pre_docs_job, so we can gate the build step by pre_docs_job to skip it when the two later jobs are both being skipped. --- .github/workflows/test-build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test-build.yml b/.github/workflows/test-build.yml index 1cc068c1e5d..20a00639533 100644 --- a/.github/workflows/test-build.yml +++ b/.github/workflows/test-build.yml @@ -33,6 +33,8 @@ jobs: build-yosys: name: Reusable build runs-on: ${{ matrix.os }} + needs: pre_docs_job + if: needs.pre_docs_job.outputs.should_skip != 'true' env: CC: clang strategy: From 26b148f455fab2c820402c5f011fb2dab7587091 Mon Sep 17 00:00:00 2001 From: Krystine Sherwin <93062060+KrystalDelusion@users.noreply.github.com> Date: Sat, 11 May 2024 11:28:16 +1200 Subject: [PATCH 52/56] test-build.yml: Remove duplicated yosys-config --- .github/workflows/test-build.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/test-build.yml b/.github/workflows/test-build.yml index 20a00639533..bf95688a15c 100644 --- a/.github/workflows/test-build.yml +++ b/.github/workflows/test-build.yml @@ -62,10 +62,6 @@ jobs: run: | ./yosys-config || true - - name: Log yosys-config output - run: | - ./yosys-config || true - - name: Compress build shell: bash run: | From 07ac4c2faecb9e72b53988f4a3b87642dfaa0465 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 11 May 2024 00:16:25 +0000 Subject: [PATCH 53/56] Bump version --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 120214ced04..b6e0e91e4dd 100644 --- a/Makefile +++ b/Makefile @@ -141,7 +141,7 @@ LIBS += -lrt endif endif -YOSYS_VER := 0.41+24 +YOSYS_VER := 0.41+69 # Note: We arrange for .gitcommit to contain the (short) commit hash in # tarballs generated with git-archive(1) using .gitattributes. The git repo From fa19abad98c7d57dc958141ff2997eca41fd5746 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Mon, 13 May 2024 16:44:42 +0200 Subject: [PATCH 54/56] Fix rst syntax error --- docs/source/yosys_internals/formats/cell_library.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/source/yosys_internals/formats/cell_library.rst b/docs/source/yosys_internals/formats/cell_library.rst index 69e82774c1f..70c36e6e747 100644 --- a/docs/source/yosys_internals/formats/cell_library.rst +++ b/docs/source/yosys_internals/formats/cell_library.rst @@ -688,6 +688,7 @@ Let ``\WIDTH`` be 3. We would like to represent ``\Y =~\A[0] + \A[1]~\A[2]``. There are 2 products to be summed, so ``\DEPTH`` shall be 2. .. code-block:: + ~A[2]-----┐ A[2]----┐| ~A[1]---┐|| From 229300bb4a244fccb110d467045d830af83aec86 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Mon, 13 May 2024 17:37:24 +0200 Subject: [PATCH 55/56] replace unicode chars in rst to make pdf work --- .../yosys_internals/formats/cell_library.rst | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/docs/source/yosys_internals/formats/cell_library.rst b/docs/source/yosys_internals/formats/cell_library.rst index 70c36e6e747..7a19255a3d0 100644 --- a/docs/source/yosys_internals/formats/cell_library.rst +++ b/docs/source/yosys_internals/formats/cell_library.rst @@ -689,14 +689,15 @@ There are 2 products to be summed, so ``\DEPTH`` shall be 2. .. code-block:: - ~A[2]-----┐ - A[2]----┐| - ~A[1]---┐|| - A[1]--┐||| - ~A[0]-┐|||| - A[0]┐||||| product formula - 010000 ~\A[0] - 001001 \A[1]~\A[2] + ~A[2]-----+ + A[2]----+| + ~A[1]---+|| + A[1]--+||| + ~A[0]-+|||| + A[0]+||||| + |||||| product formula + 010000 ~\A[0] + 001001 \A[1]~\A[2] So the value of ``\TABLE`` will become ``010000001001``. From 7045cf509e1d95cbc973746674cf2d7c73c02e50 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 14 May 2024 00:16:31 +0000 Subject: [PATCH 56/56] Bump version --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index b6e0e91e4dd..9e3fd1a20ff 100644 --- a/Makefile +++ b/Makefile @@ -141,7 +141,7 @@ LIBS += -lrt endif endif -YOSYS_VER := 0.41+69 +YOSYS_VER := 0.41+83 # Note: We arrange for .gitcommit to contain the (short) commit hash in # tarballs generated with git-archive(1) using .gitattributes. The git repo