Skip to content

Commit

Permalink
ci: Cache verilator build
Browse files Browse the repository at this point in the history
  • Loading branch information
fischeti committed Sep 4, 2024
1 parent d8eabaa commit e7a4839
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,25 @@ jobs:
run: |
bender vendor init
make CFG_OVERRIDE=cfg/github-ci.hjson sw
- name: Generate the RTL
working-directory: target/snitch_cluster
run: |
make CFG_OVERRIDE=cfg/github-ci.hjson rtl
- name: Extract file list for Verilator build
run: |
echo "VLT_SOURCES=$(make echo-vlt-flist) >> $GITHUB_ENV
echo $VLT_SOURCES
echo $GITHUB_ENV
- name: Set up cache for Verilator build
id: verilator-cache
uses: actions/cache@v3
with:
path: target/snitch_cluster/bin # Cache the directory where the simulator binary is stored
key: verilator-${{ hashFiles(env.VLT_SOURCES) }}
restore-keys: |
verilator-
- name: Build Hardware
if: steps.verilator-cache.outputs.cache-hit != 'true'
working-directory: target/snitch_cluster
run: |
make CFG_OVERRIDE=cfg/github-ci.hjson VLT_JOBS=1 bin/snitch_cluster.vlt
Expand Down
8 changes: 8 additions & 0 deletions target/common/verilator.mk
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0

VLT_FLIST = $(VLT_SOURCES)
VLT_FLIST += $(TB_CC_SOURCES)
VLT_FLIST += $(VLT_CC_SOURCES)

.PHONY: vlt-flist
vlt-flist:
@echo $(VLT_FLIST)

$(BIN_DIR)/$(TARGET).vlt: $(VLT_SOURCES) $(TB_CC_SOURCES) $(VLT_CC_SOURCES) $(VLT_BUILDDIR)/lib/libfesvr.a | $(BIN_DIR)
$(VLT) $(shell $(BENDER) script verilator $(VLT_BENDER)) \
$(VLT_FLAGS) -Mdir $(VLT_BUILDDIR) \
Expand Down

0 comments on commit e7a4839

Please sign in to comment.