Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

target: Add VLT_NUM_THREADS to configure threads used by verilator #148

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions target/common/common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ EVENTVIS_PY ?= $(UTIL_DIR)/trace/eventvis.py
# a two-liner with the OS on the first line, hence the tail -n1
VERILATOR_ROOT ?= $(dir $(shell $(VERILATOR_SEPP) which verilator | tail -n1))..
VLT_ROOT ?= ${VERILATOR_ROOT}
VLT_NUM_THREADS ?= 1

MATCH_END := '/+incdir+/ s/$$/\/*\/*/'
MATCH_BGN := 's/+incdir+//g'
Expand Down Expand Up @@ -86,7 +87,11 @@ VLT_FLAGS += -Wno-UNSIGNED
VLT_FLAGS += -Wno-UNOPTFLAT
VLT_FLAGS += -Wno-fatal
VLT_FLAGS += --unroll-count 1024
VLT_FLAGS += --threads $(VLT_NUM_THREADS)
VLT_CFLAGS += -std=c++14 -pthread
# Custom test benches including the harness must manually define 'VL_THREADED' if multithreaded.
# See https://github.com/verilator/verilator/issues/3668#issuecomment-1288989145.
VLT_CFLAGS += -DVL_THREADED
VLT_CFLAGS +=-I ${VLT_BUILDDIR} -I $(VLT_ROOT)/include -I $(VLT_ROOT)/include/vltstd -I $(VLT_FESVR)/include -I $(TB_DIR) -I ${MKFILE_DIR}/test

ANNOTATE_FLAGS ?= -q --keep-time --addr2line=$(ADDR2LINE)
Expand Down
1 change: 1 addition & 0 deletions target/snitch_cluster/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ VLT_COBJ += $(VLT_BUILDDIR)/tb/tb_bin.o
VLT_COBJ += $(VLT_BUILDDIR)/vlt/verilated.o
VLT_COBJ += $(VLT_BUILDDIR)/vlt/verilated_dpi.o
VLT_COBJ += $(VLT_BUILDDIR)/vlt/verilated_vcd_c.o
VLT_COBJ += $(VLT_BUILDDIR)/vlt/verilated_threads.o
# Bootdata
VLT_COBJ += $(VLT_BUILDDIR)/generated/bootdata.o

Expand Down
Loading