Skip to content

Commit 4ec37c3

Browse files
authored
Merge pull request #3076 from povik/synth-yosys-slang
Integrate yosys-slang
2 parents ac59028 + 592e6ad commit 4ec37c3

File tree

88 files changed

+11653
-9251
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+11653
-9251
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,6 @@
44
[submodule "tools/OpenROAD"]
55
path = tools/OpenROAD
66
url = ../OpenROAD.git
7+
[submodule "tools/yosys-slang"]
8+
path = tools/yosys-slang
9+
url = https://github.com/povik/yosys-slang.git

build_openroad.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ OPENROAD_APP_BRANCH="master"
2121
INSTALL_PATH="$(pwd)/tools/install"
2222

2323
YOSYS_USER_ARGS=""
24-
YOSYS_ARGS="CONFIG=clang"
24+
YOSYS_ARGS=""
2525

2626
OPENROAD_APP_USER_ARGS=""
2727
OPENROAD_APP_ARGS=""
@@ -246,6 +246,9 @@ __local_build()
246246
echo "[INFO FLW-0017] Compiling Yosys."
247247
${NICE} make install -C tools/yosys -j "${PROC}" ${YOSYS_ARGS}
248248

249+
echo "[INFO FLW-0030] Compiling yosys-slang."
250+
${NICE} make install -C tools/yosys-slang -j "${PROC}" YOSYS_PREFIX="${INSTALL_PATH}/yosys/bin/"
251+
249252
echo "[INFO FLW-0018] Compiling OpenROAD."
250253
eval ${NICE} ./tools/OpenROAD/etc/Build.sh -dir="$DIR/tools/OpenROAD/build" -threads=${PROC} -cmake=\'${OPENROAD_APP_ARGS}\'
251254
${NICE} cmake --build tools/OpenROAD/build --target install -j "${PROC}"
@@ -340,7 +343,7 @@ __common_setup
340343

341344
# Choose install method
342345
if [ -z "${LOCAL_BUILD+x}" ] && command -v docker &> /dev/null; then
343-
echo -n "[INFO FLW-0000] Using docker build method."
346+
echo "[INFO FLW-0000] Using docker build method."
344347
__docker_build
345348
else
346349
echo -n "[INFO FLW-0001] Using local build method."

docs/tutorials/FlowTutorial.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -187,15 +187,15 @@ minimum required timing constraint.
187187
create_clock -name core_clock -period 17.4 [get_ports {clk_i}]
188188
```
189189

190-
### Design Input Verilog
190+
### Design Input SystemVerilog
191191

192-
The Verilog input files are located in `./designs/src/ibex/`
192+
The SystemVerilog input files are located in `./designs/src/ibex_sv/`
193193

194-
The design is defined in `ibex_core.v` available
195-
[here](https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts/blob/master/flow/designs/src/ibex/ibex_core.v).
194+
The design is defined in `ibex_core.sv` available
195+
[here](https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts/blob/master/flow/designs/src/ibex_sv/ibex_core.sv).
196196

197197
Refer to the `ibex` design `README.md`
198-
[here](https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts/blob/master/flow/designs/src/ibex/README.md).
198+
[here](https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts/blob/master/flow/designs/src/ibex_sv/README.md).
199199

200200
## Running The Automated RTL-to-GDS Flow
201201

docs/user/BuildLocally.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ up the environment. The `make` command runs from RTL-GDSII generation for defaul
3232
``` shell
3333
source ./env.sh
3434
yosys -help
35+
yosys -m slang -p "slang_version"
3536
openroad -help
3637
cd flow
3738
make

docs/user/BuildWithDocker.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ Then, inside docker:
7979
``` shell
8080
source ./env.sh
8181
yosys -help
82+
yosys -m slang -p "slang_version"
8283
openroad -help
8384
cd flow
8485
make

docs/user/BuildWithPrebuilt.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ export YOSYS_EXE=$(command -v yosys)
6363
export LD_LIBRARY_PATH="<klayout_location>/bin:$PATH"
6464
6565
yosys -help
66+
yosys -m slang -p "slang_version"
6667
openroad -help
6768
cd flow
6869
make

docs/user/FlowVariables.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ configuration file.
183183
| <a name="SYNTH_ARGS"></a>SYNTH_ARGS| Optional synthesis variables for yosys.| -flatten| |
184184
| <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.| | |
185185
| <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.| | |
186+
| <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.| | |
186187
| <a name="SYNTH_HIERARCHICAL"></a>SYNTH_HIERARCHICAL| Enable to Synthesis hierarchically, otherwise considered flat synthesis.| 0| |
187188
| <a name="SYNTH_KEEP_MODULES"></a>SYNTH_KEEP_MODULES| Mark modules to keep from getting removed in flattening.| | |
188189
| <a name="SYNTH_MEMORY_MAX_BITS"></a>SYNTH_MEMORY_MAX_BITS| Maximum number of bits for memory synthesis.| 4096| |
@@ -196,7 +197,8 @@ configuration file.
196197
| <a name="TIELO_CELL_AND_PORT"></a>TIELO_CELL_AND_PORT| Tie low cells used in Yosys synthesis to replace a logical 0 in the Netlist.| | |
197198
| <a name="TNS_END_PERCENT"></a>TNS_END_PERCENT| Default TNS_END_PERCENT value for post CTS timing repair. Try fixing all violating endpoints by default (reduce to 5% for runtime). Specifies how many percent of violating paths to fix [0-100]. Worst path will always be fixed.| 100| |
198199
| <a name="USE_FILL"></a>USE_FILL| Whether to perform metal density filling.| 0| |
199-
| <a name="VERILOG_FILES"></a>VERILOG_FILES| The path to the design Verilog files or JSON files providing a description of modules (check `yosys -h write_json` for more details).| | |
200+
| <a name="VERILOG_DEFINES"></a>VERILOG_DEFINES| Preprocessor defines passed to the language frontend. Example: `-D HPDCACHE_ASSERT_OFF`| | |
201+
| <a name="VERILOG_FILES"></a>VERILOG_FILES| The path to the design Verilog/SystemVerilog files providing a description of modules.| | |
200202
| <a name="VERILOG_INCLUDE_DIRS"></a>VERILOG_INCLUDE_DIRS| Specifies the include directories for the Verilog input files.| | |
201203
| <a name="VERILOG_TOP_PARAMS"></a>VERILOG_TOP_PARAMS| Apply toplevel params (if exist).| | |
202204
| <a name="YOSYS_FLAGS"></a>YOSYS_FLAGS| Flags to pass to yosys.| -v 3| |
@@ -214,6 +216,7 @@ configuration file.
214216
- [SDC_GUT](#SDC_GUT)
215217
- [SYNTH_BLACKBOXES](#SYNTH_BLACKBOXES)
216218
- [SYNTH_GUT](#SYNTH_GUT)
219+
- [SYNTH_HDL_FRONTEND](#SYNTH_HDL_FRONTEND)
217220
- [SYNTH_HIERARCHICAL](#SYNTH_HIERARCHICAL)
218221
- [SYNTH_KEEP_MODULES](#SYNTH_KEEP_MODULES)
219222
- [SYNTH_MEMORY_MAX_BITS](#SYNTH_MEMORY_MAX_BITS)
@@ -222,6 +225,7 @@ configuration file.
222225
- [SYNTH_WRAPPED_OPERATORS](#SYNTH_WRAPPED_OPERATORS)
223226
- [TIEHI_CELL_AND_PORT](#TIEHI_CELL_AND_PORT)
224227
- [TIELO_CELL_AND_PORT](#TIELO_CELL_AND_PORT)
228+
- [VERILOG_DEFINES](#VERILOG_DEFINES)
225229
- [VERILOG_FILES](#VERILOG_FILES)
226230
- [VERILOG_INCLUDE_DIRS](#VERILOG_INCLUDE_DIRS)
227231
- [VERILOG_TOP_PARAMS](#VERILOG_TOP_PARAMS)

flow/designs/asap7/cva6/config.mk

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
#
2-
# TODO before enablement: pipe VERILOG_DEFINES through to yosys
3-
#
4-
51
export PLATFORM = asap7
62

73
export DESIGN_NAME = cva6
@@ -197,4 +193,4 @@ export PLACE_DENSITY = 0.50
197193
export SKIP_LAST_GASP ?= 1
198194

199195

200-
export SYNTH_USE_SLANG = 1
196+
export SYNTH_HDL_FRONTEND = slang

flow/designs/asap7/ibex/config.mk

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,13 @@ export PLATFORM = asap7
33
export DESIGN_NICKNAME = ibex
44
export DESIGN_NAME = ibex_core
55

6-
export VERILOG_FILES = $(sort $(wildcard $(DESIGN_HOME)/src/$(DESIGN_NICKNAME)/*.v))
6+
export VERILOG_FILES = $(sort $(wildcard $(DESIGN_HOME)/src/ibex_sv/*.sv)) \
7+
$(DESIGN_HOME)/src/ibex_sv/syn/rtl/prim_clock_gating.v
8+
9+
export VERILOG_INCLUDE_DIRS = \
10+
$(DESIGN_HOME)/src/ibex_sv/vendor/lowrisc_ip/prim/rtl/
11+
12+
export SYNTH_HDL_FRONTEND = slang
713

814
# if FLOW_VARIANT == pos_slack, use an SDC file that has a larger clock
915
# resulting in positive slack

flow/designs/gf12/ibex/config.mk

Lines changed: 5 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -2,46 +2,13 @@ export DESIGN_NICKNAME = ibex
22
export DESIGN_NAME = ibex_core
33
export PLATFORM = gf12
44

5+
export VERILOG_FILES = $(sort $(wildcard $(DESIGN_HOME)/src/ibex_sv/*.sv)) \
6+
$(DESIGN_HOME)/src/ibex_sv/syn/rtl/prim_clock_gating.v
57

6-
export VERILOG_FILES = $(DESIGN_HOME)/src/$(DESIGN_NICKNAME)/ibex_alu.v \
7-
$(DESIGN_HOME)/src/$(DESIGN_NICKNAME)/ibex_branch_predict.v \
8-
$(DESIGN_HOME)/src/$(DESIGN_NICKNAME)/ibex_compressed_decoder.v \
9-
$(DESIGN_HOME)/src/$(DESIGN_NICKNAME)/ibex_controller.v \
10-
$(DESIGN_HOME)/src/$(DESIGN_NICKNAME)/ibex_core.v \
11-
$(DESIGN_HOME)/src/$(DESIGN_NICKNAME)/ibex_counter.v \
12-
$(DESIGN_HOME)/src/$(DESIGN_NICKNAME)/ibex_cs_registers.v \
13-
$(DESIGN_HOME)/src/$(DESIGN_NICKNAME)/ibex_csr.v \
14-
$(DESIGN_HOME)/src/$(DESIGN_NICKNAME)/ibex_decoder.v \
15-
$(DESIGN_HOME)/src/$(DESIGN_NICKNAME)/ibex_dummy_instr.v \
16-
$(DESIGN_HOME)/src/$(DESIGN_NICKNAME)/ibex_ex_block.v \
17-
$(DESIGN_HOME)/src/$(DESIGN_NICKNAME)/ibex_fetch_fifo.v \
18-
$(DESIGN_HOME)/src/$(DESIGN_NICKNAME)/ibex_icache.v \
19-
$(DESIGN_HOME)/src/$(DESIGN_NICKNAME)/ibex_id_stage.v \
20-
$(DESIGN_HOME)/src/$(DESIGN_NICKNAME)/ibex_if_stage.v \
21-
$(DESIGN_HOME)/src/$(DESIGN_NICKNAME)/ibex_load_store_unit.v \
22-
$(DESIGN_HOME)/src/$(DESIGN_NICKNAME)/ibex_multdiv_fast.v \
23-
$(DESIGN_HOME)/src/$(DESIGN_NICKNAME)/ibex_multdiv_slow.v \
24-
$(DESIGN_HOME)/src/$(DESIGN_NICKNAME)/ibex_pmp.v \
25-
$(DESIGN_HOME)/src/$(DESIGN_NICKNAME)/ibex_prefetch_buffer.v \
26-
$(DESIGN_HOME)/src/$(DESIGN_NICKNAME)/ibex_register_file_ff.v \
27-
$(DESIGN_HOME)/src/$(DESIGN_NICKNAME)/ibex_register_file_fpga.v \
28-
$(DESIGN_HOME)/src/$(DESIGN_NICKNAME)/ibex_register_file_latch.v \
29-
$(DESIGN_HOME)/src/$(DESIGN_NICKNAME)/ibex_wb_stage.v \
30-
$(DESIGN_HOME)/src/$(DESIGN_NICKNAME)/prim_badbit_ram_1p.v \
31-
$(DESIGN_HOME)/src/$(DESIGN_NICKNAME)/prim_clock_gating.v \
32-
$(DESIGN_HOME)/src/$(DESIGN_NICKNAME)/prim_generic_clock_gating.v \
33-
$(DESIGN_HOME)/src/$(DESIGN_NICKNAME)/prim_generic_ram_1p.v \
34-
$(DESIGN_HOME)/src/$(DESIGN_NICKNAME)/prim_lfsr.v \
35-
$(DESIGN_HOME)/src/$(DESIGN_NICKNAME)/prim_ram_1p.v \
36-
$(DESIGN_HOME)/src/$(DESIGN_NICKNAME)/prim_secded_28_22_dec.v \
37-
$(DESIGN_HOME)/src/$(DESIGN_NICKNAME)/prim_secded_28_22_enc.v \
38-
$(DESIGN_HOME)/src/$(DESIGN_NICKNAME)/prim_secded_39_32_dec.v \
39-
$(DESIGN_HOME)/src/$(DESIGN_NICKNAME)/prim_secded_39_32_enc.v \
40-
$(DESIGN_HOME)/src/$(DESIGN_NICKNAME)/prim_secded_72_64_dec.v \
41-
$(DESIGN_HOME)/src/$(DESIGN_NICKNAME)/prim_secded_72_64_enc.v \
42-
$(DESIGN_HOME)/src/$(DESIGN_NICKNAME)/prim_xilinx_clock_gating.v
43-
8+
export VERILOG_INCLUDE_DIRS = \
9+
$(DESIGN_HOME)/src/ibex_sv/vendor/lowrisc_ip/prim/rtl/
4410

11+
export SYNTH_HDL_FRONTEND = slang
4512

4613
export SDC_FILE = $(DESIGN_HOME)/$(PLATFORM)/$(DESIGN_NICKNAME)/constraint.sdc
4714

0 commit comments

Comments
 (0)