Skip to content

Commit d519070

Browse files
authored
Merge pull request #2284 from ucb-bar/custom_firtool
Allow overriding firtool in PATH with FIRTOOL_BIN flag
2 parents 24551ed + 753a5ec commit d519070

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

common.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,9 +195,9 @@ else
195195
endif
196196

197197
$(SFC_MFC_TARGETS) &: $(FIRRTL_FILE) $(FINAL_ANNO_FILE) $(MFC_LOWERING_OPTIONS)
198-
$(call require_cmd,firtool)
198+
$(call require_cmd,$(FIRTOOL_BIN))
199199
rm -rf $(GEN_COLLATERAL_DIR)
200-
(set -o pipefail && firtool \
200+
(set -o pipefail && $(FIRTOOL_BIN) \
201201
--format=fir \
202202
--export-module-hierarchy \
203203
--verify-each=true \

variables.mk

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ HELP_COMPILATION_VARIABLES = \
99
" SBT_OPTS = set additional sbt command line options (these take the form -Dsbt.<option>=<setting>) " \
1010
" See https://www.scala-sbt.org/1.x/docs/Command-Line-Reference.html\#Command+Line+Options" \
1111
" SBT = if overridden, used to invoke sbt (default is to invoke sbt by sbt-launch.jar)" \
12+
" FIRTOOL_BIN = path to CIRCT firtool (default: 'firtool' in PATH)" \
1213
1314
HELP_PROJECT_VARIABLES = \
1415
" SUB_PROJECT = use the specific subproject default variables [$(SUB_PROJECT)]" \
@@ -180,6 +181,9 @@ ANNO_FILE ?= $(build_dir)/$(long_name).anno.json
180181
CHISEL_LOG_FILE ?= $(build_dir)/$(long_name).chisel.log
181182
FIRTOOL_LOG_FILE ?= $(build_dir)/$(long_name).firtool.log
182183

184+
# Allow users to override the CIRCT FIRRTL compiler binary
185+
FIRTOOL_BIN ?= firtool
186+
183187
# chisel anno modification output
184188
MFC_EXTRA_ANNO_FILE ?= $(build_dir)/$(long_name).extrafirtool.anno.json
185189
FINAL_ANNO_FILE ?= $(build_dir)/$(long_name).appended.anno.json

0 commit comments

Comments
 (0)