From 311a2739f66f8231174f5fc4d86064b6623fb6c7 Mon Sep 17 00:00:00 2001 From: "William D. Jones" Date: Mon, 20 Oct 2025 19:50:18 -0400 Subject: [PATCH 1/7] Add sys/wait.h header to bugpoint to bring in constants. --- passes/cmds/bugpoint.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/passes/cmds/bugpoint.cc b/passes/cmds/bugpoint.cc index 897dd8459..0ced09dd9 100644 --- a/passes/cmds/bugpoint.cc +++ b/passes/cmds/bugpoint.cc @@ -28,6 +28,8 @@ # define WEXITSTATUS(x) ((x) & 0xff) # define WTERMSIG(x) SIGTERM # define WSTOPSIG(x) 0 +#else +#include #endif USING_YOSYS_NAMESPACE From 64700dec65d6217d88b8f869dcf1a36cc365f94d Mon Sep 17 00:00:00 2001 From: YRabbit Date: Tue, 21 Oct 2025 12:36:06 +1000 Subject: [PATCH 2/7] Gowin. Disable unsupported BSRAM mode in GW5A All supported (and planned to be supported) GW5A series chips do not support the 2: Read-before-Write write mode. Here, we prohibit the generation of BSRAM with this mode. Signed-off-by: YRabbit --- techlibs/gowin/Makefile.inc | 1 + techlibs/gowin/brams_gw5a.txt | 69 +++++++++++++++++++++++++++++++++++ techlibs/gowin/synth_gowin.cc | 2 +- 3 files changed, 71 insertions(+), 1 deletion(-) create mode 100644 techlibs/gowin/brams_gw5a.txt diff --git a/techlibs/gowin/Makefile.inc b/techlibs/gowin/Makefile.inc index df1b79317..08893e73f 100644 --- a/techlibs/gowin/Makefile.inc +++ b/techlibs/gowin/Makefile.inc @@ -10,5 +10,6 @@ $(eval $(call add_share_file,share/gowin,techlibs/gowin/arith_map.v)) $(eval $(call add_share_file,share/gowin,techlibs/gowin/brams_map.v)) $(eval $(call add_share_file,share/gowin,techlibs/gowin/brams_map_gw5a.v)) $(eval $(call add_share_file,share/gowin,techlibs/gowin/brams.txt)) +$(eval $(call add_share_file,share/gowin,techlibs/gowin/brams_gw5a.txt)) $(eval $(call add_share_file,share/gowin,techlibs/gowin/lutrams_map.v)) $(eval $(call add_share_file,share/gowin,techlibs/gowin/lutrams.txt)) diff --git a/techlibs/gowin/brams_gw5a.txt b/techlibs/gowin/brams_gw5a.txt new file mode 100644 index 000000000..2747ea451 --- /dev/null +++ b/techlibs/gowin/brams_gw5a.txt @@ -0,0 +1,69 @@ +ram block $__GOWIN_SP_ { + abits 14; + widths 1 2 4 9 18 36 per_port; + cost 128; + init no_undef; + port srsw "A" { + clock posedge; + clken; + option "RESET_MODE" "SYNC" { + rdsrst zero ungated; + } + option "RESET_MODE" "ASYNC" { + rdarst zero; + } + rdinit zero; + portoption "WRITE_MODE" 0 { + rdwr no_change; + } + portoption "WRITE_MODE" 1 { + rdwr new; + } + } +} + +ram block $__GOWIN_DP_ { + abits 14; + widths 1 2 4 9 18 per_port; + cost 128; + init no_undef; + port srsw "A" "B" { + clock posedge; + clken; + option "RESET_MODE" "SYNC" { + rdsrst zero ungated; + } + option "RESET_MODE" "ASYNC" { + rdarst zero; + } + rdinit zero; + portoption "WRITE_MODE" 0 { + rdwr no_change; + } + portoption "WRITE_MODE" 1 { + rdwr new; + } + } +} + +ram block $__GOWIN_SDP_ { + abits 14; + widths 1 2 4 9 18 36 per_port; + cost 128; + init no_undef; + port sr "R" { + clock posedge; + clken; + option "RESET_MODE" "SYNC" { + rdsrst zero ungated; + } + option "RESET_MODE" "ASYNC" { + rdarst zero; + } + rdinit zero; + } + port sw "W" { + clock posedge; + clken; + } +} diff --git a/techlibs/gowin/synth_gowin.cc b/techlibs/gowin/synth_gowin.cc index 1a55f9f37..4e925daab 100644 --- a/techlibs/gowin/synth_gowin.cc +++ b/techlibs/gowin/synth_gowin.cc @@ -263,7 +263,7 @@ struct SynthGowinPass : public ScriptPass if (nolutram) args += " -no-auto-distributed"; } - run("memory_libmap -lib +/gowin/lutrams.txt -lib +/gowin/brams.txt" + args, "(-no-auto-block if -nobram, -no-auto-distributed if -nolutram)"); + run(stringf("memory_libmap -lib +/gowin/lutrams.txt -lib +/gowin/brams%s.txt", family == "gw5a" ? "_gw5a" : "") + args, "(-no-auto-block if -nobram, -no-auto-distributed if -nolutram)"); run(stringf("techmap -map +/gowin/lutrams_map.v -map +/gowin/brams_map%s.v", family == "gw5a" ? "_gw5a" : "")); } From f5c9e122de08b35526e722a4f1a53e1c181b9365 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 24 Oct 2025 00:21:47 +0000 Subject: [PATCH 3/7] Bump version --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index d17fe3a9a..f97935dea 100644 --- a/Makefile +++ b/Makefile @@ -160,7 +160,7 @@ ifeq ($(OS), Haiku) CXXFLAGS += -D_DEFAULT_SOURCE endif -YOSYS_VER := 0.58+80 +YOSYS_VER := 0.58+84 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) From 3956f103a9f9dec6261845c163fdf8d3eaaf8794 Mon Sep 17 00:00:00 2001 From: YRabbit Date: Sat, 25 Oct 2025 16:36:46 +1000 Subject: [PATCH 4/7] Gowin. Handle the WRITE_MODE. Process the WRITE_MODE in the GW5A series in a more concise manner. You can check it in the same way as in https://github.com/YosysHQ/yosys/pull/5440 Signed-off-by: YRabbit --- techlibs/gowin/Makefile.inc | 1 - techlibs/gowin/brams.txt | 12 ++++-- techlibs/gowin/brams_gw5a.txt | 69 ----------------------------------- techlibs/gowin/synth_gowin.cc | 2 +- 4 files changed, 9 insertions(+), 75 deletions(-) delete mode 100644 techlibs/gowin/brams_gw5a.txt diff --git a/techlibs/gowin/Makefile.inc b/techlibs/gowin/Makefile.inc index 08893e73f..df1b79317 100644 --- a/techlibs/gowin/Makefile.inc +++ b/techlibs/gowin/Makefile.inc @@ -10,6 +10,5 @@ $(eval $(call add_share_file,share/gowin,techlibs/gowin/arith_map.v)) $(eval $(call add_share_file,share/gowin,techlibs/gowin/brams_map.v)) $(eval $(call add_share_file,share/gowin,techlibs/gowin/brams_map_gw5a.v)) $(eval $(call add_share_file,share/gowin,techlibs/gowin/brams.txt)) -$(eval $(call add_share_file,share/gowin,techlibs/gowin/brams_gw5a.txt)) $(eval $(call add_share_file,share/gowin,techlibs/gowin/lutrams_map.v)) $(eval $(call add_share_file,share/gowin,techlibs/gowin/lutrams.txt)) diff --git a/techlibs/gowin/brams.txt b/techlibs/gowin/brams.txt index 435d3b5cf..ee76dd73a 100644 --- a/techlibs/gowin/brams.txt +++ b/techlibs/gowin/brams.txt @@ -19,8 +19,10 @@ ram block $__GOWIN_SP_ { portoption "WRITE_MODE" 1 { rdwr new; } - portoption "WRITE_MODE" 2 { - rdwr old; + ifndef gw5a { + portoption "WRITE_MODE" 2 { + rdwr old; + } } } } @@ -46,8 +48,10 @@ ram block $__GOWIN_DP_ { portoption "WRITE_MODE" 1 { rdwr new; } - portoption "WRITE_MODE" 2 { - rdwr old; + ifndef gw5a { + portoption "WRITE_MODE" 2 { + rdwr old; + } } } } diff --git a/techlibs/gowin/brams_gw5a.txt b/techlibs/gowin/brams_gw5a.txt deleted file mode 100644 index 2747ea451..000000000 --- a/techlibs/gowin/brams_gw5a.txt +++ /dev/null @@ -1,69 +0,0 @@ -ram block $__GOWIN_SP_ { - abits 14; - widths 1 2 4 9 18 36 per_port; - cost 128; - init no_undef; - port srsw "A" { - clock posedge; - clken; - option "RESET_MODE" "SYNC" { - rdsrst zero ungated; - } - option "RESET_MODE" "ASYNC" { - rdarst zero; - } - rdinit zero; - portoption "WRITE_MODE" 0 { - rdwr no_change; - } - portoption "WRITE_MODE" 1 { - rdwr new; - } - } -} - -ram block $__GOWIN_DP_ { - abits 14; - widths 1 2 4 9 18 per_port; - cost 128; - init no_undef; - port srsw "A" "B" { - clock posedge; - clken; - option "RESET_MODE" "SYNC" { - rdsrst zero ungated; - } - option "RESET_MODE" "ASYNC" { - rdarst zero; - } - rdinit zero; - portoption "WRITE_MODE" 0 { - rdwr no_change; - } - portoption "WRITE_MODE" 1 { - rdwr new; - } - } -} - -ram block $__GOWIN_SDP_ { - abits 14; - widths 1 2 4 9 18 36 per_port; - cost 128; - init no_undef; - port sr "R" { - clock posedge; - clken; - option "RESET_MODE" "SYNC" { - rdsrst zero ungated; - } - option "RESET_MODE" "ASYNC" { - rdarst zero; - } - rdinit zero; - } - port sw "W" { - clock posedge; - clken; - } -} diff --git a/techlibs/gowin/synth_gowin.cc b/techlibs/gowin/synth_gowin.cc index 4e925daab..b9902659c 100644 --- a/techlibs/gowin/synth_gowin.cc +++ b/techlibs/gowin/synth_gowin.cc @@ -263,7 +263,7 @@ struct SynthGowinPass : public ScriptPass if (nolutram) args += " -no-auto-distributed"; } - run(stringf("memory_libmap -lib +/gowin/lutrams.txt -lib +/gowin/brams%s.txt", family == "gw5a" ? "_gw5a" : "") + args, "(-no-auto-block if -nobram, -no-auto-distributed if -nolutram)"); + run(stringf("memory_libmap -lib +/gowin/lutrams.txt -lib +/gowin/brams.txt -D %s", family) + args, "(-no-auto-block if -nobram, -no-auto-distributed if -nolutram)"); run(stringf("techmap -map +/gowin/lutrams_map.v -map +/gowin/brams_map%s.v", family == "gw5a" ? "_gw5a" : "")); } From 8bc63ef6da5154f067b3d9521c5644c6eed3980f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 26 Oct 2025 00:25:16 +0000 Subject: [PATCH 5/7] Bump version --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index f97935dea..ff2f45d9e 100644 --- a/Makefile +++ b/Makefile @@ -160,7 +160,7 @@ ifeq ($(OS), Haiku) CXXFLAGS += -D_DEFAULT_SOURCE endif -YOSYS_VER := 0.58+84 +YOSYS_VER := 0.58+86 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) From 14c1802b0170df13fe7fd5b6a732721c1f94afa4 Mon Sep 17 00:00:00 2001 From: Patrick Urban Date: Mon, 27 Oct 2025 15:47:48 +0100 Subject: [PATCH 6/7] gatemate: fix SERDES CDR parameters --- techlibs/gatemate/cells_bb.v | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/techlibs/gatemate/cells_bb.v b/techlibs/gatemate/cells_bb.v index c0cd64c89..63629c836 100644 --- a/techlibs/gatemate/cells_bb.v +++ b/techlibs/gatemate/cells_bb.v @@ -79,8 +79,8 @@ module CC_SERDES #( parameter [2:0] RX_AFE_VCMSEL = 4, parameter [7:0] RX_CDR_CKP = 8'hF8, parameter [7:0] RX_CDR_CKI = 0, - parameter [8:0] RX_CDR_TRANS_TH = 128, - parameter [5:0] RX_CDR_LOCK_CFG = 8'h0B, + parameter [6:0] RX_CDR_TRANS_TH = 7'h08, + parameter [7:0] RX_CDR_LOCK_CFG = 8'hD5, parameter [14:0] RX_CDR_FREQ_ACC = 0, parameter [15:0] RX_CDR_PHASE_ACC = 0, parameter [1:0] RX_CDR_SET_ACC_CONFIG = 0, From 75eff54b316911f8a9aba6c8cb5c6637b76f2956 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 29 Oct 2025 00:24:43 +0000 Subject: [PATCH 7/7] Bump version --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index ff2f45d9e..108c92b2a 100644 --- a/Makefile +++ b/Makefile @@ -160,7 +160,7 @@ ifeq ($(OS), Haiku) CXXFLAGS += -D_DEFAULT_SOURCE endif -YOSYS_VER := 0.58+86 +YOSYS_VER := 0.58+89 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)