From b207f3e29b29cfcfcde2a955ee39e184489f0766 Mon Sep 17 00:00:00 2001 From: Liangfu Chen Date: Tue, 10 Dec 2019 15:40:56 +0800 Subject: [PATCH] [VTA] Speedup TSIM by Multi-threading This PR tries to increase TSIM performance by introducing multi-threading support. --- vta/hardware/chisel/Makefile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/vta/hardware/chisel/Makefile b/vta/hardware/chisel/Makefile index 7c889154df0c..52df5e679a79 100644 --- a/vta/hardware/chisel/Makefile +++ b/vta/hardware/chisel/Makefile @@ -37,6 +37,7 @@ TOP = VTA TOP_TEST = Test BUILD_NAME = build USE_TRACE = 0 +USE_THREADS = $(shell nproc) VTA_LIBNAME = libvta_hw UNITTEST_NAME = all CXX = g++ @@ -92,6 +93,12 @@ else cxx_flags += -DVM_TRACE=0 endif +ifneq ($(USE_THREADS), 0) + verilator_opt += -threads $(USE_THREADS) + cxx_flags += -DVL_THREADED + cxx_objs += $(verilator_build_dir)/verilated_threads.o +endif + VPATH = $(VERILATOR_INC_DIR):$(verilator_build_dir):$(vta_dir)/hardware/dpi # The following is to be consistent with cmake