Skip to content

Commit 725fad6

Browse files
committed
synth: use rtlil for canonicalization instead of json
Signed-off-by: Øyvind Harboe <[email protected]>
1 parent c8548c4 commit 725fad6

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

flow/Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ export SYNTH_MEMORY_MAX_BITS ?= 4096
483483

484484
$(SYNTH_STOP_MODULE_SCRIPT):
485485
mkdir -p $(RESULTS_DIR) $(LOG_DIR) $(REPORTS_DIR)
486-
(export VERILOG_FILES=$(RESULTS_DIR)/1_synth.json; \
486+
(export VERILOG_FILES=$(RESULTS_DIR)/1_synth.rtlil; \
487487
$(TIME_CMD) $(YOSYS_CMD) $(YOSYS_FLAGS) -c $(HIER_REPORT_SCRIPT)) 2>&1 | tee $(LOG_DIR)/1_1_yosys_hier_report.log
488488

489489
ifeq ($(SYNTH_HIERARCHICAL), 1)
@@ -502,18 +502,18 @@ yosys-dependencies: $(DONT_USE_LIBS) $(WRAPPED_LIBS) $(DONT_USE_SC_LIB) $(DFF_LI
502502
.PHONY: do-yosys
503503
do-yosys:
504504
mkdir -p $(RESULTS_DIR) $(LOG_DIR) $(REPORTS_DIR) $(OBJECTS_DIR)
505-
(export VERILOG_FILES=$(RESULTS_DIR)/1_synth.json; \
505+
(export VERILOG_FILES=$(RESULTS_DIR)/1_synth.rtlil; \
506506
$(TIME_CMD) $(YOSYS_CMD) $(YOSYS_FLAGS) -c $(SYNTH_SCRIPT)) 2>&1 | tee -a $(LOG_DIR)/1_1_yosys.log
507507

508508
.PHONY: do-yosys-canonicalize
509509
do-yosys-canonicalize: yosys-dependencies
510510
mkdir -p $(RESULTS_DIR) $(LOG_DIR) $(REPORTS_DIR) $(OBJECTS_DIR)
511511
($(TIME_CMD) $(YOSYS_CMD) $(YOSYS_FLAGS) -c $(SCRIPTS_DIR)/synth_canonicalize.tcl) 2>&1 | tee $(LOG_DIR)/1_1_yosys.log
512512

513-
$(RESULTS_DIR)/1_synth.json: $(RESULTS_DIR)/1_1_yosys.v $(SDC_FILE_CLOCK_PERIOD)
513+
$(RESULTS_DIR)/1_synth.rtlil: $(RESULTS_DIR)/1_1_yosys.v $(SDC_FILE_CLOCK_PERIOD)
514514
$(UNSET_AND_MAKE) do-yosys-canonicalize
515515

516-
$(RESULTS_DIR)/1_1_yosys.v: $(RESULTS_DIR)/1_synth.json $(SDC_FILE_CLOCK_PERIOD)
516+
$(RESULTS_DIR)/1_1_yosys.v: $(RESULTS_DIR)/1_synth.rtlil $(SDC_FILE_CLOCK_PERIOD)
517517
$(UNSET_AND_MAKE) do-yosys
518518

519519
$(RESULTS_DIR)/1_synth.sdc: $(SDC_FILE)
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
source $::env(SCRIPTS_DIR)/synth_preamble.tcl
22
hierarchy -check -top $::env(DESIGN_NAME)
3-
procs
43
# Get rid of unused modules
5-
clean
4+
opt_clean -purge
65
# The hash of this file will not change if files not part of synthesis do not change
7-
json -o $::env(RESULTS_DIR)/1_synth.json
6+
write_rtlil $::env(RESULTS_DIR)/1_synth.rtlil

flow/scripts/synth_preamble.tcl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ if {[info exist ::env(VERILOG_INCLUDE_DIRS)]} {
2222

2323
# Read verilog files
2424
foreach file $::env(VERILOG_FILES) {
25-
if {[file extension $file] == ".json"} {
25+
if {[file extension $file] == ".rtlil"} {
26+
read_rtlil $file
27+
} elseif {[file extension $file] == ".json"} {
2628
read_json $file
2729
} else {
2830
read_verilog -defer -sv {*}$vIdirsArgs $file

0 commit comments

Comments
 (0)