Skip to content

Commit 92eede0

Browse files
committed
flow: remove make dependency
Signed-off-by: Øyvind Harboe <[email protected]>
1 parent 6f9b40e commit 92eede0

File tree

4 files changed

+30
-18
lines changed

4 files changed

+30
-18
lines changed

flow/Makefile

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ ifeq (,$(strip $(NUM_CORES)))
208208
endif
209209
export NUM_CORES
210210

211-
YOSYS_FLAGS += -v 3
211+
export YOSYS_FLAGS += -v 3
212212

213213
#-------------------------------------------------------------------------------
214214
# setup all commands used within this flow
@@ -226,12 +226,12 @@ endif
226226
export OPENROAD_EXE ?= $(abspath $(FLOW_HOME)/../tools/install/OpenROAD/bin/openroad)
227227
export OPENSTA_EXE ?= $(abspath $(FLOW_HOME)/../tools/install/OpenROAD/bin/sta)
228228

229-
OPENROAD_ARGS = -no_init -threads $(NUM_CORES) $(OR_ARGS)
230-
OPENROAD_CMD = $(OPENROAD_EXE) -exit $(OPENROAD_ARGS)
231-
OPENROAD_NO_EXIT_CMD = $(OPENROAD_EXE) $(OPENROAD_ARGS)
232-
OPENROAD_GUI_CMD = $(OPENROAD_EXE) -gui $(OR_ARGS)
229+
export OPENROAD_ARGS = -no_init -threads $(NUM_CORES) $(OR_ARGS)
230+
export OPENROAD_CMD = $(OPENROAD_EXE) -exit $(OPENROAD_ARGS)
231+
export OPENROAD_NO_EXIT_CMD = $(OPENROAD_EXE) $(OPENROAD_ARGS)
232+
export OPENROAD_GUI_CMD = $(OPENROAD_EXE) -gui $(OR_ARGS)
233233

234-
YOSYS_EXE ?= $(abspath $(FLOW_HOME)/../tools/install/yosys/bin/yosys)
234+
export YOSYS_EXE ?= $(abspath $(FLOW_HOME)/../tools/install/yosys/bin/yosys)
235235

236236
# Use locally installed and built klayout if it exists, otherwise use klayout in path
237237
KLAYOUT_DIR = $(abspath $(FLOW_HOME)/../tools/install/klayout/)
@@ -435,14 +435,11 @@ yosys-dependencies: $(YOSYS_DEPENDENCIES)
435435

436436
.PHONY: do-yosys
437437
do-yosys: $(DONT_USE_SC_LIB)
438-
mkdir -p $(RESULTS_DIR) $(LOG_DIR) $(REPORTS_DIR) $(OBJECTS_DIR)
439-
(export VERILOG_FILES=$(RESULTS_DIR)/1_synth.rtlil; \
440-
$(TIME_CMD) $(YOSYS_EXE) $(YOSYS_FLAGS) -c $(SYNTH_SCRIPT)) 2>&1 | tee $(abspath $(LOG_DIR)/1_1_yosys.log)
438+
$(SCRIPTS_DIR)/synth.sh $(SYNTH_SCRIPT) $(LOG_DIR)/1_1_yosys.log
441439

442440
.PHONY: do-yosys-canonicalize
443441
do-yosys-canonicalize: yosys-dependencies $(DONT_USE_SC_LIB)
444-
mkdir -p $(RESULTS_DIR) $(LOG_DIR) $(REPORTS_DIR) $(OBJECTS_DIR)
445-
($(TIME_CMD) $(YOSYS_EXE) $(YOSYS_FLAGS) -c $(SCRIPTS_DIR)/synth_canonicalize.tcl) 2>&1 | tee $(abspath $(LOG_DIR)/1_1_yosys_canonicalize.log)
442+
$(SCRIPTS_DIR)/synth.sh $(SCRIPTS_DIR)/synth_canonicalize.tcl $(LOG_DIR)/1_1_yosys_canonicalize.log
446443

447444
$(RESULTS_DIR)/1_synth.rtlil: $(YOSYS_DEPENDENCIES)
448445
$(UNSET_AND_MAKE) do-yosys-canonicalize
@@ -555,13 +552,7 @@ endif
555552

556553
.PHONY: do-$(1)
557554
do-$(1): $(OBJECTS_DIR)/copyright.txt
558-
@mkdir -p $(RESULTS_DIR) $(LOG_DIR) $(REPORTS_DIR) $(OBJECTS_DIR)
559-
@echo Running $(3).tcl, stage $(1)
560-
@(set -eo pipefail; \
561-
trap 'mv $(LOG_DIR)/$(1).tmp.log $(LOG_DIR)/$(1).log' EXIT; \
562-
$(OPENROAD_EXE) $(OPENROAD_ARGS) -exit $(SCRIPTS_DIR)/noop.tcl 2>&1 >$(LOG_DIR)/$(1).tmp.log; \
563-
$(TIME_CMD) $(OPENROAD_CMD) -no_splash $(SCRIPTS_DIR)/$(3).tcl -metrics $(LOG_DIR)/$(1).json 2>&1 | \
564-
tee -a $(abspath $(LOG_DIR)/$(1).tmp.log))
555+
$(SCRIPTS_DIR)/flow.sh $(1) $(3)
565556
endef
566557

567558
# generate make rules to copy a file, if a dependency change and

flow/scripts/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22

33
Various scripts to support flow as well as utilities.
44

5+
## flow.sh/synth.sh - WORK IN PROGRESS
6+
7+
This script is a low level script used to invoke a flow step. ORFS make or bazel-orfs will set up all the project specific variables before invoking this script where the rest of the variables are set up before invoking OpenROAD.
8+
9+
scripts/flow.sh 2_1_floorplan floorplan
10+
11+
scripts/synth.sh
12+
513
## make run-yosys
614

715
Sets up all the ORFS environment variables and launches Yosys.

flow/scripts/flow.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
set -u -eo pipefail
3+
mkdir -p $RESULTS_DIR $LOG_DIR $REPORTS_DIR $OBJECTS_DIR
4+
echo Running $2.tcl, stage $1
5+
(trap 'mv $LOG_DIR/$1.tmp.log $LOG_DIR/$1.log' EXIT; \
6+
$OPENROAD_EXE $OPENROAD_ARGS -exit $SCRIPTS_DIR/noop.tcl 2>&1 >$LOG_DIR/$1.tmp.log; \
7+
env time -f 'Elapsed time: %E[h:]min:sec. CPU time: user %U sys %S (%P). Peak memory: %MKB.' $OPENROAD_CMD -no_splash $SCRIPTS_DIR/$2.tcl -metrics $LOG_DIR/$1.json 2>&1 | \
8+
tee -a $(realpath $LOG_DIR/$1.tmp.log))

flow/scripts/synth.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
set -u -eo pipefail
3+
mkdir -p $RESULTS_DIR $LOG_DIR $REPORTS_DIR $OBJECTS_DIR
4+
(env time -f 'Elapsed time: %E[h:]min:sec. CPU time: user %U sys %S (%P). Peak memory: %MKB.' \
5+
$YOSYS_EXE $YOSYS_FLAGS -c $1) 2>&1 | tee $(realpath $2)

0 commit comments

Comments
 (0)