-
Notifications
You must be signed in to change notification settings - Fork 58
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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' | ||
|
@@ -86,7 +87,13 @@ VLT_FLAGS += -Wno-UNSIGNED | |
VLT_FLAGS += -Wno-UNOPTFLAT | ||
VLT_FLAGS += -Wno-fatal | ||
VLT_FLAGS += --unroll-count 1024 | ||
ifneq ($(VLT_NUM_THREADS), 1) | ||
VLT_FLAGS += --threads $(VLT_NUM_THREADS) | ||
endif | ||
VLT_CFLAGS += -std=c++14 -pthread | ||
ifneq ($(VLT_NUM_THREADS), 1) | ||
VLT_CFLAGS += -DVL_THREADED=1 | ||
endif | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Couldn't find much information on this, but perhaps we can also always add this flag, and remove the if statement. I guess it shouldn't break the single-threaded case. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Information is sadly very sparse on the flag and I only found it referenced through GitHub issues such as verilator/verilator#3668 (comment) |
||
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) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe we can drop the
if
statement, as Verilator should by default behave as if--threads 1
is passed.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this is true for Verilator 5 but not the verilator 4 that the repo currently supports until #76 lands.
That said I think you're right and we can drop this as this is almost certainly a premature optimization and I doubt single-threaded usage will see a measureable difference.