Skip to content

Commit 29d9cf4

Browse files
committed
added ability to inject Tcl commands in synth canonicalize step
tclfmt fixes Signed-off-by: Jeff Ng <[email protected]>
1 parent 9638e97 commit 29d9cf4

File tree

5 files changed

+21
-1
lines changed

5 files changed

+21
-1
lines changed

docs/user/FlowVariables.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ configuration file.
221221
| <a name="SLEW_MARGIN"></a>SLEW_MARGIN| Specifies a slew margin when fixing max slew violations. This option allows you to overfix.| |
222222
| <a name="SYNTH_ARGS"></a>SYNTH_ARGS| Optional synthesis variables for yosys.| |
223223
| <a name="SYNTH_BLACKBOXES"></a>SYNTH_BLACKBOXES| List of cells treated as a black box by Yosys. With Bazel, this can be used to run synthesis in parallel for the large modules of the design.| |
224+
| <a name="SYNTH_CANONICALIZE_TCL"></a>SYNTH_CANONICALIZE_TCL| Specifies a Tcl script with commands to run as part of the synth canonicalize step.| |
224225
| <a name="SYNTH_GUT"></a>SYNTH_GUT| Load design and remove all internal logic before doing synthesis. This is useful when creating a mock .lef abstract that has a smaller area than the amount of logic would allow. bazel-orfs uses this to mock SRAMs, for instance.| |
225226
| <a name="SYNTH_HDL_FRONTEND"></a>SYNTH_HDL_FRONTEND| Select an alternative language frontend to ingest the design. Available option is "slang". If the variable is empty, design is read with the Yosys read_verilog command.| |
226227
| <a name="SYNTH_HIERARCHICAL"></a>SYNTH_HIERARCHICAL| Enable to Synthesis hierarchically, otherwise considered flat synthesis.| 0|
@@ -256,6 +257,7 @@ configuration file.
256257
- [SDC_FILE](#SDC_FILE)
257258
- [SDC_GUT](#SDC_GUT)
258259
- [SYNTH_BLACKBOXES](#SYNTH_BLACKBOXES)
260+
- [SYNTH_CANONICALIZE_TCL](#SYNTH_CANONICALIZE_TCL)
259261
- [SYNTH_GUT](#SYNTH_GUT)
260262
- [SYNTH_HDL_FRONTEND](#SYNTH_HDL_FRONTEND)
261263
- [SYNTH_HIERARCHICAL](#SYNTH_HIERARCHICAL)
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Remove rvfi_probes_o interface since it's not in the baseline and contributes
2+
# 4k ports and connections (many of which are buffers tied to tie cells)
3+
4+
delete cva6/o:rvfi_probes_o*

flow/designs/rapidus2hp/cva6/config.mk

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ ifeq ($(SYNTH_HDL_FRONTEND),verific)
102102
else
103103
# Reduce the amount of resizing done between GPL and DPL
104104
export EARLY_SIZING_CAP_RATIO = 6
105-
export CORE_UTILIZATION = 50
105+
export CORE_UTILIZATION = 55
106106
endif
107107

108108
export CORE_MARGIN = 2
@@ -120,3 +120,6 @@ export SKIP_LAST_GASP ?= 1
120120
export SYNTH_MINIMUM_KEEP_SIZE ?= 40000
121121

122122
#export IO_CONSTRAINTS = $(DESIGN_HOME)/$(PLATFORM)/$(DESIGN_NAME)/io_constraints.tcl
123+
124+
# Remove rvfi_probes_o interface
125+
export SYNTH_CANONICALIZE_TCL = $(DESIGN_HOME)/$(PLATFORM)/$(DESIGN_NAME)/canonicalize.tcl

flow/scripts/synth_canonicalize.tcl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ dict for {key value} [env_var_or_empty VERILOG_TOP_PARAMS] {
77
}
88

99
hierarchy -check -top $::env(DESIGN_NAME)
10+
11+
if { [env_var_exists_and_non_empty SYNTH_CANONICALIZE_TCL] } {
12+
log_cmd source $::env(SYNTH_CANONICALIZE_TCL)
13+
}
14+
1015
# Get rid of unused modules
1116
opt_clean -purge
1217
# The hash of this file will not change if files not part of synthesis do not change

flow/scripts/variables.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,12 @@ SYNTH_NETLIST_FILES:
194194
subsequent modules are silently ignored and only the first module is used.
195195
stages:
196196
- synth
197+
SYNTH_CANONICALIZE_TCL:
198+
description: >
199+
Specifies a Tcl script with commands to run as part of the synth
200+
canonicalize step.
201+
stages:
202+
- synth
197203
LATCH_MAP_FILE:
198204
description: |
199205
List of latches treated as a black box by Yosys.

0 commit comments

Comments
 (0)