From 547382504b0d2b842b2d326079f621c164c7c194 Mon Sep 17 00:00:00 2001 From: KrystalDelusion <93062060+KrystalDelusion@users.noreply.github.com> Date: Thu, 8 May 2025 10:37:04 +1200 Subject: [PATCH 1/6] Update verilog_frontend.cc `read_verilog_file_list` should not try to read arguments as selection args. Without this, trying to pass a file without a `-f|-F` flag is misleading, in the best case giving a warning about the selection not matching any module, or in worst case just doing nothing (if the filename is a valid selection). --- frontends/verilog/verilog_frontend.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontends/verilog/verilog_frontend.cc b/frontends/verilog/verilog_frontend.cc index 14a0f16c0..1f272ca4f 100644 --- a/frontends/verilog/verilog_frontend.cc +++ b/frontends/verilog/verilog_frontend.cc @@ -753,7 +753,7 @@ struct VerilogFileList : public Pass { break; } - extra_args(args, argidx, design); + extra_args(args, argidx, design, false); } } VerilogFilelist; From 784de0f6e3cdac8e68f0f0685b4f4e9de4ba433d Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Wed, 4 Jun 2025 08:01:21 +0200 Subject: [PATCH 2/6] Make attrmap able to alter memory attributes as well --- passes/techmap/attrmap.cc | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/passes/techmap/attrmap.cc b/passes/techmap/attrmap.cc index 96e65ff2e..58f5a47e5 100644 --- a/passes/techmap/attrmap.cc +++ b/passes/techmap/attrmap.cc @@ -270,26 +270,19 @@ struct AttrmapPass : public Pass { { for (auto module : design->selected_modules()) { - for (auto wire : module->selected_wires()) + for (auto wire : module->selected_members()) attrmap_apply(stringf("%s.%s", log_id(module), log_id(wire)), actions, wire->attributes); - for (auto cell : module->selected_cells()) - attrmap_apply(stringf("%s.%s", log_id(module), log_id(cell)), actions, cell->attributes); - - for (auto proc : module->processes) + for (auto proc : module->selected_processes()) { - if (!design->selected(module, proc.second)) - continue; - attrmap_apply(stringf("%s.%s", log_id(module), log_id(proc.first)), actions, proc.second->attributes); - - std::vector all_cases = {&proc.second->root_case}; + std::vector all_cases = {&proc->root_case}; while (!all_cases.empty()) { RTLIL::CaseRule *cs = all_cases.back(); all_cases.pop_back(); - attrmap_apply(stringf("%s.%s (case)", log_id(module), log_id(proc.first)), actions, cs->attributes); + attrmap_apply(stringf("%s.%s (case)", log_id(module), log_id(proc)), actions, cs->attributes); for (auto &sw : cs->switches) { - attrmap_apply(stringf("%s.%s (switch)", log_id(module), log_id(proc.first)), actions, sw->attributes); + attrmap_apply(stringf("%s.%s (switch)", log_id(module), log_id(proc)), actions, sw->attributes); all_cases.insert(all_cases.end(), sw->cases.begin(), sw->cases.end()); } } From beaca05b405c9547375358df9a86a6193e80902d Mon Sep 17 00:00:00 2001 From: Krystine Sherwin <93062060+KrystalDelusion@users.noreply.github.com> Date: Sat, 21 Jun 2025 09:49:56 +1200 Subject: [PATCH 3/6] Include boxes in attrmap Rename `selected_members` iterator to memb. Add comment on `selected_processes` loop for clarity. --- passes/techmap/attrmap.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/passes/techmap/attrmap.cc b/passes/techmap/attrmap.cc index 58f5a47e5..7f5bfc94f 100644 --- a/passes/techmap/attrmap.cc +++ b/passes/techmap/attrmap.cc @@ -263,16 +263,17 @@ struct AttrmapPass : public Pass { if (modattr_mode) { - for (auto module : design->selected_whole_modules()) + for (auto module : design->all_selected_whole_modules()) attrmap_apply(stringf("%s", log_id(module)), actions, module->attributes); } else { - for (auto module : design->selected_modules()) + for (auto module : design->all_selected_modules()) { - for (auto wire : module->selected_members()) - attrmap_apply(stringf("%s.%s", log_id(module), log_id(wire)), actions, wire->attributes); + for (auto memb : module->selected_members()) + attrmap_apply(stringf("%s.%s", log_id(module), log_id(memb)), actions, memb->attributes); + // attrmap already applied to process itself during above loop, but not its children for (auto proc : module->selected_processes()) { std::vector all_cases = {&proc->root_case}; From e6961d8c9ff181771c57a11cae116470176c6629 Mon Sep 17 00:00:00 2001 From: Krystine Sherwin <93062060+KrystalDelusion@users.noreply.github.com> Date: Sat, 28 Jun 2025 11:33:18 +1200 Subject: [PATCH 4/6] CI: Test with ASAN as well New matrix variable for sanitizer, running `undefined` and `address` separately (because they are mutually exclusive). Probably don't need to run both sanitizers on both os targets, but it's probably fine. --- .github/workflows/test-build.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-build.yml b/.github/workflows/test-build.yml index b88662f0f..22d3a94f8 100644 --- a/.github/workflows/test-build.yml +++ b/.github/workflows/test-build.yml @@ -40,6 +40,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, macos-latest] + sanitizer: [undefined, address] fail-fast: false steps: - name: Checkout Yosys @@ -57,7 +58,7 @@ jobs: mkdir build cd build make -f ../Makefile config-$CC - echo 'SANITIZER = undefined' >> Makefile.conf + echo 'SANITIZER = ${{ matrix.sanitizer }}' >> Makefile.conf make -f ../Makefile -j$procs ENABLE_LTO=1 - name: Log yosys-config output @@ -73,7 +74,7 @@ jobs: - name: Store build artifact uses: actions/upload-artifact@v4 with: - name: build-${{ matrix.os }} + name: build-${{ matrix.os }}-${{ matrix.sanitizer }} path: build.tar retention-days: 1 @@ -84,10 +85,12 @@ jobs: if: needs.pre_job.outputs.should_skip != 'true' env: CC: clang + ASAN_OPTIONS: halt_on_error=1 UBSAN_OPTIONS: halt_on_error=1 strategy: matrix: os: [ubuntu-latest, macos-latest] + sanitizer: [undefined, address] fail-fast: false steps: - name: Checkout Yosys @@ -136,7 +139,7 @@ jobs: - name: Download build artifact uses: actions/download-artifact@v4 with: - name: build-${{ matrix.os }} + name: build-${{ matrix.os }}-${{ matrix.sanitizer }} - name: Uncompress build shell: bash @@ -168,6 +171,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] + sanitizer: [undefined, address] fail-fast: false steps: - name: Checkout Yosys @@ -181,7 +185,7 @@ jobs: - name: Download build artifact uses: actions/download-artifact@v4 with: - name: build-${{ matrix.os }} + name: build-${{ matrix.os }}-${{ matrix.sanitizer }} - name: Uncompress build shell: bash From 017524d7a2a1a170b1f22ae3df996b3b4ce875d6 Mon Sep 17 00:00:00 2001 From: Krystine Sherwin <93062060+KrystalDelusion@users.noreply.github.com> Date: Sat, 28 Jun 2025 11:33:18 +1200 Subject: [PATCH 5/6] tests/verific: Don't ASAN verific --- tests/verific/run-test.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/verific/run-test.sh b/tests/verific/run-test.sh index dee032827..2e340916d 100755 --- a/tests/verific/run-test.sh +++ b/tests/verific/run-test.sh @@ -2,3 +2,4 @@ set -eu source ../gen-tests-makefile.sh generate_mk --yosys-scripts --bash +sed -i '1i\export ASAN_OPTIONS=halt_on_error=0' run-test.mk From 67583fee48be2428781f86e323c21886054559cb Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 30 Jun 2025 00:27:10 +0000 Subject: [PATCH 6/6] Bump version --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 77771b6b0..3c2bc11b6 100644 --- a/Makefile +++ b/Makefile @@ -160,7 +160,7 @@ ifeq ($(OS), Haiku) CXXFLAGS += -D_DEFAULT_SOURCE endif -YOSYS_VER := 0.54+23 +YOSYS_VER := 0.54+29 YOSYS_MAJOR := $(shell echo $(YOSYS_VER) | cut -d'.' -f1) YOSYS_MINOR := $(shell echo $(YOSYS_VER) | cut -d'.' -f2 | cut -d'+' -f1) YOSYS_COMMIT := $(shell echo $(YOSYS_VER) | cut -d'+' -f2)