From f5c04c0a0e4771d05d8651c07073744570e6cbe5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Harboe?= Date: Wed, 21 Oct 2026 23:31:32 +0200 Subject: [PATCH 1/4] asap7/riscv32i: a clock repair cannot meet, IO budgets clear of reg2reg MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit At 950 ps every configuration of riscv32i measured closed at the clock, so WNS could not tell two of them apart. At 780 ps it does, and with the input and output budgets at 2 % of the period instead of 12.5 % WNS is a register-to-register path: an input-to-register path (instr through the decoder into the register file) set it at 12.5 %. No hold buffers are inserted, and the worst hold slack is +35 ps. riscv32i-mock-sram includes riscv32i's config.mk and was tuned at 950 ps; it gets a copy of today's constraint.sdc and is unchanged. Co-Authored-By: Claude Opus 5.5 Signed-off-by: Øyvind Harboe --- .../designs/asap7/riscv32i-mock-sram/config.mk | 3 +++ .../asap7/riscv32i-mock-sram/constraint.sdc | 18 ++++++++++++++++++ flow/designs/asap7/riscv32i/config.mk | 2 +- flow/designs/asap7/riscv32i/constraint.sdc | 4 ++-- 4 files changed, 24 insertions(+), 3 deletions(-) create mode 100644 flow/designs/asap7/riscv32i-mock-sram/constraint.sdc diff --git a/flow/designs/asap7/riscv32i-mock-sram/config.mk b/flow/designs/asap7/riscv32i-mock-sram/config.mk index 4d33d8182c..6e7ba02440 100644 --- a/flow/designs/asap7/riscv32i-mock-sram/config.mk +++ b/flow/designs/asap7/riscv32i-mock-sram/config.mk @@ -6,4 +6,7 @@ export BLOCKS=fakeram7_256x32 # with margin keeps them from failing together. export SETUP_SLACK_MARGIN ?= 30 +# riscv32i's constraints at the clock this design was tuned for +export SDC_FILE = $(DESIGN_HOME)/$(PLATFORM)/$(DESIGN_NICKNAME)/constraint.sdc + include designs/asap7/riscv32i/config.mk diff --git a/flow/designs/asap7/riscv32i-mock-sram/constraint.sdc b/flow/designs/asap7/riscv32i-mock-sram/constraint.sdc new file mode 100644 index 0000000000..d411b8d801 --- /dev/null +++ b/flow/designs/asap7/riscv32i-mock-sram/constraint.sdc @@ -0,0 +1,18 @@ +current_design riscv_top + +set clk_name clk +set clk_port_name clk +set clk_period 950 +set clk_io_pct 0.125 + +set clk_port [get_ports $clk_port_name] + +create_clock -name $clk_name -period $clk_period $clk_port +set clk_io_name vclk_$clk_name +create_clock -name $clk_io_name -period $clk_period +set_clock_latency 142.965 [get_clocks $clk_name] +set_clock_latency 142.965 [get_clocks $clk_io_name] + +set non_clock_inputs [all_inputs -no_clocks] +set_input_delay [expr $clk_period * $clk_io_pct] -clock $clk_io_name $non_clock_inputs +set_output_delay [expr $clk_period * $clk_io_pct] -clock $clk_io_name [all_outputs] diff --git a/flow/designs/asap7/riscv32i/config.mk b/flow/designs/asap7/riscv32i/config.mk index cfb6ed6adb..373bb22e43 100644 --- a/flow/designs/asap7/riscv32i/config.mk +++ b/flow/designs/asap7/riscv32i/config.mk @@ -7,7 +7,7 @@ export SYNTH_HIERARCHICAL ?= 1 export SYNTH_MINIMUM_KEEP_SIZE ?= 10000 export VERILOG_FILES = $(sort $(wildcard $(DESIGN_HOME)/src/riscv32i/*.v)) -export SDC_FILE = $(DESIGN_HOME)/$(PLATFORM)/riscv32i/constraint.sdc +export SDC_FILE ?= $(DESIGN_HOME)/$(PLATFORM)/riscv32i/constraint.sdc ifeq ($(BLOCKS),) export ADDITIONAL_LEFS = $(PLATFORM_DIR)/lef/fakeram7_256x32.lef diff --git a/flow/designs/asap7/riscv32i/constraint.sdc b/flow/designs/asap7/riscv32i/constraint.sdc index d411b8d801..bb055a15ac 100644 --- a/flow/designs/asap7/riscv32i/constraint.sdc +++ b/flow/designs/asap7/riscv32i/constraint.sdc @@ -2,8 +2,8 @@ current_design riscv_top set clk_name clk set clk_port_name clk -set clk_period 950 -set clk_io_pct 0.125 +set clk_period 780 +set clk_io_pct 0.02 set clk_port [get_ports $clk_port_name] From 0b9c0c0ab57e419046ca44f4020c0a6b5d171188 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Harboe?= Date: Wed, 21 Oct 2026 23:31:32 +0200 Subject: [PATCH 2/4] asap7/riscv32i: what SWAP_ARITH_OPERATORS buys, beside the setting MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit riscv32i already swaps adder architectures during repair. Measured at the new 780 ps clock, to global route: the reg2reg period is 835.6 ps with it and 943.4 ps without, 11 % shorter; with flat synthesis 791.8 and 895.7 ps. The comment records it beside the setting, so the next change to it starts from the number. Co-Authored-By: Claude Opus 5.5 Signed-off-by: Øyvind Harboe --- flow/designs/asap7/riscv32i/config.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/flow/designs/asap7/riscv32i/config.mk b/flow/designs/asap7/riscv32i/config.mk index 373bb22e43..edc6661c75 100644 --- a/flow/designs/asap7/riscv32i/config.mk +++ b/flow/designs/asap7/riscv32i/config.mk @@ -27,6 +27,8 @@ export TNS_END_PERCENT = 100 export CTS_CLUSTER_SIZE = 10 export CTS_CLUSTER_DIAMETER = 50 +# Adder architectures swapped during repair: at 780 ps the reg2reg +# period is 11 % shorter than with swapping off (835.6 against 943.4 ps). export SWAP_ARITH_OPERATORS = 1 export OPENROAD_HIERARCHICAL = 1 From 21600aacc4a28c18c69ab522a77dca8469a1e595 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Harboe?= Date: Wed, 21 Oct 2026 23:31:32 +0200 Subject: [PATCH 3/4] asap7/riscv32i: flat synthesis; the size rule kept dmem for its SRAMs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit SYNTH_MINIMUM_KEEP_SIZE=10000 kept one module, dmem: four SRAM macros (1,376 um^2 of liberty area) and 56 um^2 of address decode. The rule counts the macros' area, so it kept the wrapper, and the boundary sat on the worst path, between the ALU's address adder and the SRAMs' chip-enable decode, which synthesis then optimised apart. Flat, at 780 ps to global route: the reg2reg period is 791.8 ps against 835.6 (5.2 % shorter); of the reg2reg endpoints within 10 % of the period, 995 are faster and 3 slower. WNS is -11.8 ps, a reg2reg path. riscv32i-mock-sram hardens the SRAM as a block and keeps hierarchical synthesis and the size rule as before. Co-Authored-By: Claude Opus 5.5 Signed-off-by: Øyvind Harboe --- flow/designs/asap7/riscv32i/config.mk | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/flow/designs/asap7/riscv32i/config.mk b/flow/designs/asap7/riscv32i/config.mk index edc6661c75..54453839a4 100644 --- a/flow/designs/asap7/riscv32i/config.mk +++ b/flow/designs/asap7/riscv32i/config.mk @@ -2,16 +2,19 @@ export DESIGN_NICKNAME ?= riscv32i export DESIGN_NAME = riscv_top export PLATFORM = asap7 -export SYNTH_HIERARCHICAL ?= 1 - -export SYNTH_MINIMUM_KEEP_SIZE ?= 10000 - export VERILOG_FILES = $(sort $(wildcard $(DESIGN_HOME)/src/riscv32i/*.v)) export SDC_FILE ?= $(DESIGN_HOME)/$(PLATFORM)/riscv32i/constraint.sdc ifeq ($(BLOCKS),) export ADDITIONAL_LEFS = $(PLATFORM_DIR)/lef/fakeram7_256x32.lef export ADDITIONAL_LIBS = $(PLATFORM_DIR)/lib/NLDM/fakeram7_256x32.lib +else + # A hardened block (riscv32i-mock-sram) needs hierarchical synthesis. + # Otherwise flat: SYNTH_MINIMUM_KEEP_SIZE kept dmem for its four SRAMs' + # area, and its boundary cut the worst path, from the address adder to + # the SRAMs' enable decode. + export SYNTH_HIERARCHICAL ?= 1 + export SYNTH_MINIMUM_KEEP_SIZE ?= 10000 endif export CORE_UTILIZATION = 62 From b2402aa8aeb8ea0af0363657dfd4d2645ddf3a9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Harboe?= Date: Wed, 21 Oct 2026 23:38:19 +0200 Subject: [PATCH 4/4] asap7/riscv32i: SDC_FILE by DESIGN_NICKNAME, as IO_CONSTRAINTS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A design that includes riscv32i's config.mk now finds its own constraint.sdc as it finds its own io.tcl, so riscv32i-mock-sram no longer names it. Both designs resolve the same files as before. Co-Authored-By: Claude Opus 5.5 Signed-off-by: Øyvind Harboe --- flow/designs/asap7/riscv32i-mock-sram/config.mk | 3 --- flow/designs/asap7/riscv32i/config.mk | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/flow/designs/asap7/riscv32i-mock-sram/config.mk b/flow/designs/asap7/riscv32i-mock-sram/config.mk index 6e7ba02440..4d33d8182c 100644 --- a/flow/designs/asap7/riscv32i-mock-sram/config.mk +++ b/flow/designs/asap7/riscv32i-mock-sram/config.mk @@ -6,7 +6,4 @@ export BLOCKS=fakeram7_256x32 # with margin keeps them from failing together. export SETUP_SLACK_MARGIN ?= 30 -# riscv32i's constraints at the clock this design was tuned for -export SDC_FILE = $(DESIGN_HOME)/$(PLATFORM)/$(DESIGN_NICKNAME)/constraint.sdc - include designs/asap7/riscv32i/config.mk diff --git a/flow/designs/asap7/riscv32i/config.mk b/flow/designs/asap7/riscv32i/config.mk index 54453839a4..cad5f05b1f 100644 --- a/flow/designs/asap7/riscv32i/config.mk +++ b/flow/designs/asap7/riscv32i/config.mk @@ -3,7 +3,7 @@ export DESIGN_NAME = riscv_top export PLATFORM = asap7 export VERILOG_FILES = $(sort $(wildcard $(DESIGN_HOME)/src/riscv32i/*.v)) -export SDC_FILE ?= $(DESIGN_HOME)/$(PLATFORM)/riscv32i/constraint.sdc +export SDC_FILE ?= $(DESIGN_HOME)/$(PLATFORM)/$(DESIGN_NICKNAME)/constraint.sdc ifeq ($(BLOCKS),) export ADDITIONAL_LEFS = $(PLATFORM_DIR)/lef/fakeram7_256x32.lef