Skip to content

Commit

Permalink
Add the mill wrapper (millw)
Browse files Browse the repository at this point in the history
To make the project easier to build add the mill wrapper (millw)
submodule and make the mill executable selectable via the MILL
Makefile variable. Furthermore, set ./millw as the default for the
MILL Makefile variable, so that the wrapper is used as default.
  • Loading branch information
Flowdalic committed Apr 4, 2024
1 parent 1d97d64 commit 09720f7
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 8 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,6 @@
[submodule "coupledL2"]
path = coupledL2
url = https://github.com/OpenXiangShan/coupledL2
[submodule "tools/millw"]
path = tools/millw
url = https://github.com/lefou/millw.git
11 changes: 6 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ IMAGE ?= temp
CONFIG ?= DefaultConfig
NUM_CORES ?= 1
MFC ?= 0
MILL ?= ./millw

# common chisel args
ifeq ($(MFC),1)
Expand Down Expand Up @@ -110,11 +111,11 @@ endif
.DEFAULT_GOAL = verilog

help:
mill -i xiangshan[$(CHISEL_VERSION)].runMain $(FPGATOP) --help
$(MILL) -i xiangshan[$(CHISEL_VERSION)].runMain $(FPGATOP) --help

$(TOP_V): $(SCALA_FILE)
mkdir -p $(@D)
$(TIME_CMD) mill -i xiangshan[$(CHISEL_VERSION)].runMain $(FPGATOP) \
$(TIME_CMD) $(MILL) -i xiangshan[$(CHISEL_VERSION)].runMain $(FPGATOP) \
-td $(@D) --config $(CONFIG) $(FPGA_MEM_ARGS) \
--num-cores $(NUM_CORES) $(RELEASE_ARGS)
ifeq ($(MFC),1)
Expand All @@ -136,7 +137,7 @@ $(SIM_TOP_V): $(SCALA_FILE) $(TEST_FILE)
mkdir -p $(@D)
@echo "\n[mill] Generating Verilog files..." > $(TIMELOG)
@date -R | tee -a $(TIMELOG)
$(TIME_CMD) mill -i xiangshan[$(CHISEL_VERSION)].test.runMain $(SIMTOP) \
$(TIME_CMD) $(MILL) -i xiangshan[$(CHISEL_VERSION)].test.runMain $(SIMTOP) \
-td $(@D) --config $(CONFIG) $(SIM_MEM_ARGS) \
--num-cores $(NUM_CORES) $(SIM_ARGS)
ifeq ($(MFC),1)
Expand Down Expand Up @@ -175,10 +176,10 @@ bump:
git submodule foreach "git fetch origin&&git checkout master&&git reset --hard origin/master"

bsp:
mill -i mill.bsp.BSP/install
$(MILL) -i mill.bsp.BSP/install

idea:
mill -i mill.scalalib.GenIdea/idea
$(MILL) -i mill.scalalib.GenIdea/idea

# verilator simulation
emu: sim-verilog
Expand Down
6 changes: 3 additions & 3 deletions Makefile.test
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# only generate a small module: example
verilog-decode:
mill -i XiangShan.test.runMain xiangshan.DecodeMain -td build --output-file DecodeUnit.v
$(MILL) -i XiangShan.test.runMain xiangshan.DecodeMain -td build --output-file DecodeUnit.v

# chiseltest
# autorun all the chiselTest case
test:
mill -i XiangShan.test.test
$(MILL) -i XiangShan.test.test

# only run DecodeUnitTest
test-DecodeUnit:
mill -i XiangShan.test.testOnly xiangshan.DecodeUnitTest
$(MILL) -i XiangShan.test.testOnly xiangshan.DecodeUnitTest
1 change: 1 addition & 0 deletions millw
1 change: 1 addition & 0 deletions tools/millw
Submodule millw added at 2254cf

0 comments on commit 09720f7

Please sign in to comment.