Commit 30f757ed by Luis Vega Committed by eqy

add another default location to verilator (#3324)

parent 084e338e
......@@ -113,7 +113,13 @@ else()
# Build shared library (.so)
set(VTA_HW_DPI_DIR ${VTA_DIR}/hardware/dpi)
set(VERILATOR_INC_DIR /usr/local/share/verilator/include)
if (EXISTS /usr/local/share/verilator/include)
set(VERILATOR_INC_DIR /usr/local/share/verilator/include)
elseif (EXISTS /usr/share/verilator/include)
set(VERILATOR_INC_DIR /usr/share/verilator/include)
else()
message(FATAL_ERROR "[TSIM_HW] Verilator include directory not found")
endif()
set(VERILATOR_LIB_SRC ${VERILATOR_INC_DIR}/verilated.cpp ${VERILATOR_INC_DIR}/verilated_dpi.cpp)
if (NOT TSIM_USE_TRACE STREQUAL "off")
......
......@@ -15,15 +15,21 @@
# specific language governing permissions and limitations
# under the License.
# Change this variable if Verilator is installed on a different location
VERILATOR_INC_DIR ?= /usr/local/share/verilator/include
ifeq (, $(shell which verilator))
$(error "No Verilator in $(PATH), consider doing apt-get install verilator")
endif
ifeq (, $(wildcard $(VERILATOR_INC_DIR)/*))
$(error "Verilator include directory is not set properly")
# Change VERILATOR_INC_DIR if Verilator is installed on a different location
ifeq (, $(VERILATOR_INC_DIR))
ifeq (, $(wildcard /usr/local/share/verilator/include/*))
ifeq (, $(wildcard /usr/share/verilator/include/*))
$(error "Verilator include directory is not set properly")
else
VERILATOR_INC_DIR := /usr/share/verilator/include
endif
else
VERILATOR_INC_DIR := /usr/local/share/verilator/include
endif
endif
CONFIG = DefaultF1Config
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment