Internals: Add format-make rule and standardize Makefile indents. No functional change intended.

This commit is contained in:
Wilson Snyder 2025-06-24 17:58:55 -04:00
parent 6af694b04b
commit 51545b36ca
21 changed files with 535 additions and 494 deletions

30
.bake.toml Normal file
View File

@ -0,0 +1,30 @@
# mbake configuration file
[formatter]
# Indentation settings
use_tabs = true
tab_width = 2
# Spacing settings
space_around_assignment = true
space_before_colon = false
space_after_colon = true
# Line continuation settings
normalize_line_continuations = true
max_line_length = 100
# PHONY settings
group_phony_declarations = false
phony_at_top = false
auto_insert_phony_declarations = false
# General settings
remove_trailing_whitespace = true
ensure_final_newline = true
normalize_empty_lines = true
max_consecutive_empty_lines = 2
# Global settings
debug = false
verbose = false

View File

@ -104,45 +104,45 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
SHELL = /bin/sh SHELL = /bin/sh
SUBDIRS = docs src test_regress \ SUBDIRS = docs src test_regress \
examples/cmake_hello_c \ examples/cmake_hello_c \
examples/cmake_hello_sc \ examples/cmake_hello_sc \
examples/cmake_tracing_c \ examples/cmake_tracing_c \
examples/cmake_tracing_sc \ examples/cmake_tracing_sc \
examples/cmake_protect_lib \ examples/cmake_protect_lib \
examples/make_hello_binary \ examples/make_hello_binary \
examples/make_hello_c \ examples/make_hello_c \
examples/make_hello_sc \ examples/make_hello_sc \
examples/make_tracing_c \ examples/make_tracing_c \
examples/make_tracing_sc \ examples/make_tracing_sc \
examples/make_protect_lib \ examples/make_protect_lib \
examples/json_py \ examples/json_py \
INFOS = verilator.html verilator.pdf INFOS = verilator.html verilator.pdf
INFOS_OLD = README README.html README.pdf INFOS_OLD = README README.html README.pdf
EXAMPLES_FIRST = \ EXAMPLES_FIRST = \
examples/make_hello_c \ examples/make_hello_c \
examples/make_hello_sc \ examples/make_hello_sc \
EXAMPLES = $(EXAMPLES_FIRST) $(filter-out $(EXAMPLES_FIRST), $(sort $(wildcard examples/*))) EXAMPLES = $(EXAMPLES_FIRST) $(filter-out $(EXAMPLES_FIRST), $(sort $(wildcard examples/*)))
# See uninstall also - don't put wildcards in this variable, it might uninstall other stuff # See uninstall also - don't put wildcards in this variable, it might uninstall other stuff
# No verilator_ccache_report.1, verilator_difftree.1 as those are not bin/ installed # No verilator_ccache_report.1, verilator_difftree.1 as those are not bin/ installed
VL_INST_MAN_FILES = \ VL_INST_MAN_FILES = \
verilator.1 \ verilator.1 \
verilator_coverage.1 \ verilator_coverage.1 \
verilator_gantt.1 \ verilator_gantt.1 \
verilator_profcfunc.1 \ verilator_profcfunc.1 \
default: all default: all
all: all_nomsg msg_test all: all_nomsg msg_test
all_nomsg: verilator_exe $(VL_INST_MAN_FILES) all_nomsg: verilator_exe $(VL_INST_MAN_FILES)
.PHONY:verilator_exe .PHONY: verilator_exe
.PHONY:verilator_bin$(EXEEXT) .PHONY: verilator_bin$(EXEEXT)
.PHONY:verilator_bin_dbg$(EXEEXT) .PHONY: verilator_bin_dbg$(EXEEXT)
.PHONY:verilator_coverage_bin_dbg$(EXEEXT) .PHONY: verilator_coverage_bin_dbg$(EXEEXT)
verilator_exe verilator_bin$(EXEEXT) verilator_bin_dbg$(EXEEXT) verilator_coverage_bin_dbg$(EXEEXT): verilator_exe verilator_bin$(EXEEXT) verilator_bin_dbg$(EXEEXT) verilator_coverage_bin_dbg$(EXEEXT):
@echo ------------------------------------------------------------ @echo ------------------------------------------------------------
@echo "making verilator in src" @echo "making verilator in src"
@ -151,7 +151,7 @@ verilator_exe verilator_bin$(EXEEXT) verilator_bin_dbg$(EXEEXT) verilator_covera
###################################################################### ######################################################################
# Tests # Tests
.PHONY:msg_test .PHONY: msg_test
msg_test: all_nomsg msg_test: all_nomsg
@echo "Build complete!" @echo "Build complete!"
@echo @echo
@ -213,8 +213,8 @@ verilator.html:
verilator.pdf: Makefile verilator.pdf: Makefile
$(MAKE) -C docs verilator.pdf $(MAKE) -C docs verilator.pdf
TAGFILES=${srcdir}/*/*.cpp ${srcdir}/*/*.h ${srcdir}/*/*.in \ TAGFILES = ${srcdir}/*/*.cpp ${srcdir}/*/*.h ${srcdir}/*/*.in \
${srcdir}/*.in ${srcdir}/*.pod ${srcdir}/*.in ${srcdir}/*.pod
TAGS: $(TAGFILES) TAGS: $(TAGFILES)
etags $(TAGFILES) etags $(TAGFILES)
@ -228,43 +228,45 @@ doxygen:
spelling: spelling:
$(MAKE) -C docs spelling $(MAKE) -C docs spelling
###################################################################### ######################################################################
# Install # Install
# Public executables intended to be invoked directly by the user # Public executables intended to be invoked directly by the user
# Don't put wildcards in these variables, it might cause an uninstall of other stuff # Don't put wildcards in these variables, it might cause an uninstall of other stuff
VL_INST_PUBLIC_SCRIPT_FILES = verilator \ VL_INST_PUBLIC_SCRIPT_FILES = \
verilator_coverage \ verilator \
verilator_gantt \ verilator_coverage \
verilator_profcfunc \ verilator_gantt \
verilator_profcfunc \
VL_INST_PUBLIC_BIN_FILES = verilator_bin$(EXEEXT) \ VL_INST_PUBLIC_BIN_FILES = \
verilator_bin_dbg$(EXEEXT) \ verilator_bin$(EXEEXT) \
verilator_coverage_bin_dbg$(EXEEXT) \ verilator_bin_dbg$(EXEEXT) \
verilator_coverage_bin_dbg$(EXEEXT) \
# Private executabels intended to be invoked by internals # Private executabels intended to be invoked by internals
# Don't put wildcards in these variables, it might cause an uninstall of other stuff # Don't put wildcards in these variables, it might cause an uninstall of other stuff
VL_INST_PRIVATE_SCRIPT_FILES = verilator_ccache_report \ VL_INST_PRIVATE_SCRIPT_FILES = \
verilator_includer \ verilator_ccache_report \
verilator_includer \
VL_INST_INC_BLDDIR_FILES = \ VL_INST_INC_BLDDIR_FILES = \
include/verilated_config.h \ include/verilated_config.h \
include/verilated.mk \ include/verilated.mk \
# Files under srcdir, instead of build time # Files under srcdir, instead of build time
VL_INST_INC_SRCDIR_FILES = \ VL_INST_INC_SRCDIR_FILES = \
include/*.[chv]* \ include/*.[chv]* \
include/*.vlt \ include/*.vlt \
include/*.sv \ include/*.sv \
include/gtkwave/*.[chv]* \ include/gtkwave/*.[chv]* \
include/vltstd/*.[chv]* \ include/vltstd/*.[chv]* \
VL_INST_DATA_SRCDIR_FILES = \ VL_INST_DATA_SRCDIR_FILES = \
examples/*/*.[chv]* \ examples/*/*.[chv]* \
examples/*/CMakeLists.txt \ examples/*/CMakeLists.txt \
examples/*/Makefile* \ examples/*/Makefile* \
examples/*/vl_* \ examples/*/vl_* \
mkbindirs: mkbindirs:
$(MKINSTALLDIRS) $(DESTDIR)$(pkgdatadir)/bin $(MKINSTALLDIRS) $(DESTDIR)$(pkgdatadir)/bin
@ -400,19 +402,20 @@ CPPCHECK6_CPP = $(wildcard $(srcdir)/src/V3[P-Z]*.cpp)
CPPCHECK7_CPP = $(wildcard $(srcdir)/src/V3[L-R]*.cpp) CPPCHECK7_CPP = $(wildcard $(srcdir)/src/V3[L-R]*.cpp)
CPPCHECK8_CPP = $(wildcard $(srcdir)/src/V3[S-Z]*.cpp) CPPCHECK8_CPP = $(wildcard $(srcdir)/src/V3[S-Z]*.cpp)
CHECK_CPP = $(CPPCHECK1_CPP) $(CPPCHECK2_CPP) $(CPPCHECK3_CPP) $(CPPCHECK4_CPP) \ CHECK_CPP = $(CPPCHECK1_CPP) $(CPPCHECK2_CPP) $(CPPCHECK3_CPP) $(CPPCHECK4_CPP) \
$(CPPCHECK5_CPP) $(CPPCHECK6_CPP) $(CPPCHECK7_CPP) $(CPPCHECK8_CPP) $(CPPCHECK5_CPP) $(CPPCHECK6_CPP) $(CPPCHECK7_CPP) $(CPPCHECK8_CPP)
CHECK_H = $(wildcard \ CHECK_H = $(wildcard \
$(srcdir)/include/*.h \ $(srcdir)/include/*.h \
$(srcdir)/src/*.h ) $(srcdir)/src/*.h )
CHECK_YL = $(wildcard \ CHECK_YL = $(wildcard \
$(srcdir)/src/*.y \ $(srcdir)/src/*.y \
$(srcdir)/src/*.l ) $(srcdir)/src/*.l )
CPPCHECK = src/cppcheck_filtered cppcheck CPPCHECK = src/cppcheck_filtered cppcheck
CPPCHECK_FLAGS = --enable=all --inline-suppr \ CPPCHECK_FLAGS = --enable=all --inline-suppr \
--suppress=cstyleCast --suppress=useInitializationList \ --suppress=cstyleCast --suppress=useInitializationList \
--suppress=nullPointer --suppress=nullPointerRedundantCheck --suppress=ctunullpointer \ --suppress=nullPointer --suppress=nullPointerRedundantCheck --suppress=ctunullpointer \
--suppress=unusedFunction --suppress=unusedScopedObject \ --suppress=unusedFunction --suppress=unusedScopedObject \
--suppress=useStlAlgorithm --suppress=useStlAlgorithm \
CPPCHECK_FLAGS += --xml CPPCHECK_FLAGS += --xml
CPPCHECK_DEP = $(subst .cpp,.cppcheck,$(CHECK_CPP)) CPPCHECK_DEP = $(subst .cpp,.cppcheck,$(CHECK_CPP))
CPPCHECK_INC = -I$(srcdir)/include -I$(srcdir)/include/gtkwave -I$(srcdir)/include/vltstd -I$(srcdir)/src/obj_dbg -I$(srcdir)/src CPPCHECK_INC = -I$(srcdir)/include -I$(srcdir)/include/gtkwave -I$(srcdir)/include/vltstd -I$(srcdir)/src/obj_dbg -I$(srcdir)/src
@ -437,8 +440,8 @@ cppcheck-8:
CLANGTIDY = clang-tidy CLANGTIDY = clang-tidy
CLANGTIDY_FLAGS = -config='' \ CLANGTIDY_FLAGS = -config='' \
-header-filter='.*' \ -header-filter='.*' \
-checks='-fuchsia-*,-cppcoreguidelines-avoid-c-arrays,-cppcoreguidelines-init-variables,-cppcoreguidelines-avoid-goto,-modernize-avoid-c-arrays,-readability-magic-numbers,-readability-simplify-boolean-expr,-cppcoreguidelines-macro-usage' \ -checks='-fuchsia-*,-cppcoreguidelines-avoid-c-arrays,-cppcoreguidelines-init-variables,-cppcoreguidelines-avoid-goto,-modernize-avoid-c-arrays,-readability-magic-numbers,-readability-simplify-boolean-expr,-cppcoreguidelines-macro-usage' \
CLANGTIDY_DEP = $(subst .cpp,.cpp.tidy,$(CHECK_CPP)) CLANGTIDY_DEP = $(subst .cpp,.cpp.tidy,$(CHECK_CPP))
CLANGTIDY_DEFS = -DVL_DEBUG=1 -DVL_CPPCHECK=1 CLANGTIDY_DEFS = -DVL_DEBUG=1 -DVL_CPPCHECK=1
@ -476,50 +479,58 @@ yamlfix:
# CMake files # CMake files
CMAKE_FILES = \ CMAKE_FILES = \
CMakeLists.txt \ CMakeLists.txt \
examples/*/CMakeLists.txt \ examples/*/CMakeLists.txt \
src/CMakeLists.txt \ src/CMakeLists.txt \
test_regress/CMakeLists.txt \ test_regress/CMakeLists.txt \
*.cmake.in \ *.cmake.in \
# Makefiles
MAKE_FILES = \
Makefile*.in \
docs/Makefile* \
include/verilated.mk.in \
examples/*/Makefile* \
src/Makefile*.in \
test_regress/Makefile* \
# Python programs, subject to format and lint # Python programs, subject to format and lint
PY_PROGRAMS = \ PY_PROGRAMS = \
bin/verilator_ccache_report \ bin/verilator_ccache_report \
bin/verilator_difftree \ bin/verilator_difftree \
bin/verilator_gantt \ bin/verilator_gantt \
bin/verilator_includer \ bin/verilator_includer \
bin/verilator_profcfunc \ bin/verilator_profcfunc \
examples/json_py/vl_file_copy \ examples/json_py/vl_file_copy \
examples/json_py/vl_hier_graph \ examples/json_py/vl_hier_graph \
docs/guide/conf.py \ docs/guide/conf.py \
docs/bin/vl_sphinx_extract \ docs/bin/vl_sphinx_extract \
docs/bin/vl_sphinx_fix \ docs/bin/vl_sphinx_fix \
src/astgen \ src/astgen \
src/bisonpre \ src/bisonpre \
src/config_rev \ src/config_rev \
src/cppcheck_filtered \ src/cppcheck_filtered \
src/flexfix \ src/flexfix \
src/vlcovgen \ src/vlcovgen \
src/.gdbinit.py \ src/.gdbinit.py \
test_regress/*.py \ test_regress/*.py \
test_regress/t/*.pf \ test_regress/t/*.pf \
nodist/clang_check_attributes \ nodist/clang_check_attributes \
nodist/code_coverage \ nodist/code_coverage \
nodist/dot_importer \ nodist/dot_importer \
nodist/fuzzer/actual_fail \ nodist/fuzzer/actual_fail \
nodist/fuzzer/generate_dictionary \ nodist/fuzzer/generate_dictionary \
nodist/install_test \ nodist/install_test \
nodist/log_changes \ nodist/log_changes \
# Python files, subject to format but not lint # Python files, subject to format but not lint
PY_FILES = \ PY_FILES = \
$(PY_PROGRAMS) \ $(PY_PROGRAMS) \
nodist/code_coverage.dat \ nodist/code_coverage.dat \
test_regress/t/*.py \ test_regress/t/*.py \
# Python files, test_regress tests # Python files, test_regress tests
PY_TEST_FILES = \ PY_TEST_FILES = test_regress/t/*.py
test_regress/t/*.py \
YAPF = yapf3 YAPF = yapf3
YAPF_FLAGS = -i --parallel YAPF_FLAGS = -i --parallel
@ -533,6 +544,12 @@ GERSEMI_FLAGS = -i
format-cmake: format-cmake:
$(GERSEMI) $(GERSEMI_FLAGS) $(CMAKE_FILES) $(GERSEMI) $(GERSEMI_FLAGS) $(CMAKE_FILES)
MBAKE = mbake
MBAKE_FLAGS = format --config ./.bake.toml
format-make:
$(MBAKE) $(MBAKE_FLAGS) $(MAKE_FILES)
format-yaml: yamlfix format-yaml: yamlfix
PYLINT = pylint PYLINT = pylint

View File

@ -25,7 +25,7 @@ BUILDDIR = _build
SPHINXOPTS ?= -c guide -j 4 SPHINXOPTS ?= -c guide -j 4
ifneq ($(VERILATOR_ANALYTICS_ID),) ifneq ($(VERILATOR_ANALYTICS_ID),)
SPHINXOPTS += -D html_theme_options.analytics_id=$(VERILATOR_ANALYTICS_ID) SPHINXOPTS += -D html_theme_options.analytics_id=$(VERILATOR_ANALYTICS_ID)
endif endif
###################################################################### ######################################################################

View File

@ -20,28 +20,28 @@
# binary relative to $VERILATOR_ROOT (such as when inside the git sources). # binary relative to $VERILATOR_ROOT (such as when inside the git sources).
ifeq ($(VERILATOR_ROOT),) ifeq ($(VERILATOR_ROOT),)
VERILATOR = verilator VERILATOR = verilator
VERILATOR_COVERAGE = verilator_coverage VERILATOR_COVERAGE = verilator_coverage
else else
export VERILATOR_ROOT export VERILATOR_ROOT
VERILATOR = $(VERILATOR_ROOT)/bin/verilator VERILATOR = $(VERILATOR_ROOT)/bin/verilator
VERILATOR_COVERAGE = $(VERILATOR_ROOT)/bin/verilator_coverage VERILATOR_COVERAGE = $(VERILATOR_ROOT)/bin/verilator_coverage
endif endif
###################################################################### ######################################################################
# Check if CMake is installed and of correct version # Check if CMake is installed and of correct version
ifeq ($(shell which cmake),) ifeq ($(shell which cmake),)
TARGET := nocmake TARGET := nocmake
else else
CMAKE_VERSION := $(shell cmake --version | grep -o '[0-9][.0-9]\+') CMAKE_VERSION := $(shell cmake --version | grep -o '[0-9][.0-9]\+')
CMAKE_MAJOR := $(shell echo $(CMAKE_VERSION) | cut -f1 -d.) CMAKE_MAJOR := $(shell echo $(CMAKE_VERSION) | cut -f1 -d.)
CMAKE_MINOR := $(shell echo $(CMAKE_VERSION) | cut -f2 -d.) CMAKE_MINOR := $(shell echo $(CMAKE_VERSION) | cut -f2 -d.)
CMAKE_GT_3_8 := $(shell [ $(CMAKE_MAJOR) -gt 3 -o \( $(CMAKE_MAJOR) -eq 3 -a $(CMAKE_MINOR) -ge 8 \) ] && echo true) CMAKE_GT_3_8 := $(shell [ $(CMAKE_MAJOR) -gt 3 -o \( $(CMAKE_MAJOR) -eq 3 -a $(CMAKE_MINOR) -ge 8 \) ] && echo true)
ifeq ($(CMAKE_GT_3_8),true) ifeq ($(CMAKE_GT_3_8),true)
TARGET := run TARGET := run
else else
TARGET := oldcmake TARGET := oldcmake
endif endif
endif endif
default: $(TARGET) default: $(TARGET)

View File

@ -20,46 +20,44 @@
# binary relative to $VERILATOR_ROOT (such as when inside the git sources). # binary relative to $VERILATOR_ROOT (such as when inside the git sources).
ifeq ($(VERILATOR_ROOT),) ifeq ($(VERILATOR_ROOT),)
VERILATOR = verilator VERILATOR = verilator
VERILATOR_COVERAGE = verilator_coverage VERILATOR_COVERAGE = verilator_coverage
else else
export VERILATOR_ROOT export VERILATOR_ROOT
VERILATOR = $(VERILATOR_ROOT)/bin/verilator VERILATOR = $(VERILATOR_ROOT)/bin/verilator
VERILATOR_COVERAGE = $(VERILATOR_ROOT)/bin/verilator_coverage VERILATOR_COVERAGE = $(VERILATOR_ROOT)/bin/verilator_coverage
endif endif
###################################################################### ######################################################################
# Check if CMake is installed and of correct version # Check if CMake is installed and of correct version
ifeq ($(shell which cmake),) ifeq ($(shell which cmake),)
TARGET := nocmake TARGET := nocmake
else
CMAKE_VERSION := $(shell cmake --version | grep -o '[0-9][.0-9]\+')
CMAKE_MAJOR := $(shell echo $(CMAKE_VERSION) | cut -f1 -d.)
CMAKE_MINOR := $(shell echo $(CMAKE_VERSION) | cut -f2 -d.)
CMAKE_GT_3_8 := $(shell [ $(CMAKE_MAJOR) -gt 3 -o \( $(CMAKE_MAJOR) -eq 3 -a $(CMAKE_MINOR) -ge 8 \) ] && echo true)
ifneq ($(CMAKE_GT_3_8),true)
TARGET := oldcmake
else else
CMAKE_VERSION := $(shell cmake --version | grep -o '[0-9][.0-9]\+')
CMAKE_MAJOR := $(shell echo $(CMAKE_VERSION) | cut -f1 -d.)
CMAKE_MINOR := $(shell echo $(CMAKE_VERSION) | cut -f2 -d.)
CMAKE_GT_3_8 := $(shell [ $(CMAKE_MAJOR) -gt 3 -o \( $(CMAKE_MAJOR) -eq 3 -a $(CMAKE_MINOR) -ge 8 \) ] && echo true)
ifneq ($(CMAKE_GT_3_8),true)
TARGET := oldcmake
else
# Check if SC exists via a verilator call (empty if not)
SYSTEMC_EXISTS := $(shell $(VERILATOR) --get-supported SYSTEMC)
# Check if SC exists via a verilator call (empty if not) # Test whether SystemC is installed with CMake support
SYSTEMC_EXISTS := $(shell $(VERILATOR) --get-supported SYSTEMC) # This will print a CMake error about processing arguments that can (currently) be ignored.
ifneq (,$(SYSTEMC_EXISTS))
FINDSC := $(shell mkdir -p build && cd build && cmake --find-package -DNAME=SystemCLanguage -DCMAKE_USE_PTHREADS_INIT=ON -DCOMPILER_ID=GNU -DLANGUAGE=CXX -DMODE=EXIST -DThreads_FOUND=ON)
ifneq (,$(findstring SystemCLanguage found,$(FINDSC)))
SYSTEMC_SET := true
endif
endif
# Test whether SystemC is installed with CMake support ifeq ($(SYSTEMC_SET), true)
# This will print a CMake error about processing arguments that can (currently) be ignored. TARGET := run
ifneq (,$(SYSTEMC_EXISTS)) else
FINDSC := $(shell mkdir -p build && cd build && cmake --find-package -DNAME=SystemCLanguage -DCMAKE_USE_PTHREADS_INIT=ON -DCOMPILER_ID=GNU -DLANGUAGE=CXX -DMODE=EXIST -DThreads_FOUND=ON) TARGET := nosc
ifneq (,$(findstring SystemCLanguage found,$(FINDSC))) endif
SYSTEMC_SET := true endif
endif
endif
ifeq ($(SYSTEMC_SET), true)
TARGET := run
else
TARGET := nosc
endif
endif
endif endif
default: $(TARGET) default: $(TARGET)

View File

@ -20,28 +20,28 @@
# binary relative to $VERILATOR_ROOT (such as when inside the git sources). # binary relative to $VERILATOR_ROOT (such as when inside the git sources).
ifeq ($(VERILATOR_ROOT),) ifeq ($(VERILATOR_ROOT),)
VERILATOR = verilator VERILATOR = verilator
VERILATOR_COVERAGE = verilator_coverage VERILATOR_COVERAGE = verilator_coverage
else else
export VERILATOR_ROOT export VERILATOR_ROOT
VERILATOR = $(VERILATOR_ROOT)/bin/verilator VERILATOR = $(VERILATOR_ROOT)/bin/verilator
VERILATOR_COVERAGE = $(VERILATOR_ROOT)/bin/verilator_coverage VERILATOR_COVERAGE = $(VERILATOR_ROOT)/bin/verilator_coverage
endif endif
###################################################################### ######################################################################
# Check if CMake is installed and of correct version # Check if CMake is installed and of correct version
ifeq ($(shell which cmake),) ifeq ($(shell which cmake),)
TARGET := nocmake TARGET := nocmake
else else
CMAKE_VERSION := $(shell cmake --version | grep -o '[0-9][.0-9]\+') CMAKE_VERSION := $(shell cmake --version | grep -o '[0-9][.0-9]\+')
CMAKE_MAJOR := $(shell echo $(CMAKE_VERSION) | cut -f1 -d.) CMAKE_MAJOR := $(shell echo $(CMAKE_VERSION) | cut -f1 -d.)
CMAKE_MINOR := $(shell echo $(CMAKE_VERSION) | cut -f2 -d.) CMAKE_MINOR := $(shell echo $(CMAKE_VERSION) | cut -f2 -d.)
CMAKE_GT_3_8 := $(shell [ $(CMAKE_MAJOR) -gt 3 -o \( $(CMAKE_MAJOR) -eq 3 -a $(CMAKE_MINOR) -ge 8 \) ] && echo true) CMAKE_GT_3_8 := $(shell [ $(CMAKE_MAJOR) -gt 3 -o \( $(CMAKE_MAJOR) -eq 3 -a $(CMAKE_MINOR) -ge 8 \) ] && echo true)
ifeq ($(CMAKE_GT_3_8),true) ifeq ($(CMAKE_GT_3_8),true)
TARGET := run TARGET := run
else else
TARGET := oldcmake TARGET := oldcmake
endif endif
endif endif
default: $(TARGET) default: $(TARGET)

View File

@ -20,28 +20,28 @@
# binary relative to $VERILATOR_ROOT (such as when inside the git sources). # binary relative to $VERILATOR_ROOT (such as when inside the git sources).
ifeq ($(VERILATOR_ROOT),) ifeq ($(VERILATOR_ROOT),)
VERILATOR = verilator VERILATOR = verilator
VERILATOR_COVERAGE = verilator_coverage VERILATOR_COVERAGE = verilator_coverage
else else
export VERILATOR_ROOT export VERILATOR_ROOT
VERILATOR = $(VERILATOR_ROOT)/bin/verilator VERILATOR = $(VERILATOR_ROOT)/bin/verilator
VERILATOR_COVERAGE = $(VERILATOR_ROOT)/bin/verilator_coverage VERILATOR_COVERAGE = $(VERILATOR_ROOT)/bin/verilator_coverage
endif endif
###################################################################### ######################################################################
# Check if CMake is installed and of correct version # Check if CMake is installed and of correct version
ifeq ($(shell which cmake),) ifeq ($(shell which cmake),)
TARGET := nocmake TARGET := nocmake
else else
CMAKE_VERSION := $(shell cmake --version | grep -o '[0-9][.0-9]\+') CMAKE_VERSION := $(shell cmake --version | grep -o '[0-9][.0-9]\+')
CMAKE_MAJOR := $(shell echo $(CMAKE_VERSION) | cut -f1 -d.) CMAKE_MAJOR := $(shell echo $(CMAKE_VERSION) | cut -f1 -d.)
CMAKE_MINOR := $(shell echo $(CMAKE_VERSION) | cut -f2 -d.) CMAKE_MINOR := $(shell echo $(CMAKE_VERSION) | cut -f2 -d.)
CMAKE_GT_3_8 := $(shell [ $(CMAKE_MAJOR) -gt 3 -o \( $(CMAKE_MAJOR) -eq 3 -a $(CMAKE_MINOR) -ge 8 \) ] && echo true) CMAKE_GT_3_8 := $(shell [ $(CMAKE_MAJOR) -gt 3 -o \( $(CMAKE_MAJOR) -eq 3 -a $(CMAKE_MINOR) -ge 8 \) ] && echo true)
ifeq ($(CMAKE_GT_3_8),true) ifeq ($(CMAKE_GT_3_8),true)
TARGET := run TARGET := run
else else
TARGET := oldcmake TARGET := oldcmake
endif endif
endif endif
default: $(TARGET) default: $(TARGET)

View File

@ -20,46 +20,44 @@
# binary relative to $VERILATOR_ROOT (such as when inside the git sources). # binary relative to $VERILATOR_ROOT (such as when inside the git sources).
ifeq ($(VERILATOR_ROOT),) ifeq ($(VERILATOR_ROOT),)
VERILATOR = verilator VERILATOR = verilator
VERILATOR_COVERAGE = verilator_coverage VERILATOR_COVERAGE = verilator_coverage
else else
export VERILATOR_ROOT export VERILATOR_ROOT
VERILATOR = $(VERILATOR_ROOT)/bin/verilator VERILATOR = $(VERILATOR_ROOT)/bin/verilator
VERILATOR_COVERAGE = $(VERILATOR_ROOT)/bin/verilator_coverage VERILATOR_COVERAGE = $(VERILATOR_ROOT)/bin/verilator_coverage
endif endif
###################################################################### ######################################################################
# Check if CMake is installed and of correct version # Check if CMake is installed and of correct version
ifeq ($(shell which cmake),) ifeq ($(shell which cmake),)
TARGET := nocmake TARGET := nocmake
else
CMAKE_VERSION := $(shell cmake --version | grep -o '[0-9][.0-9]\+')
CMAKE_MAJOR := $(shell echo $(CMAKE_VERSION) | cut -f1 -d.)
CMAKE_MINOR := $(shell echo $(CMAKE_VERSION) | cut -f2 -d.)
CMAKE_GT_3_8 := $(shell [ $(CMAKE_MAJOR) -gt 3 -o \( $(CMAKE_MAJOR) -eq 3 -a $(CMAKE_MINOR) -ge 8 \) ] && echo true)
ifneq ($(CMAKE_GT_3_8),true)
TARGET := oldcmake
else else
CMAKE_VERSION := $(shell cmake --version | grep -o '[0-9][.0-9]\+')
CMAKE_MAJOR := $(shell echo $(CMAKE_VERSION) | cut -f1 -d.)
CMAKE_MINOR := $(shell echo $(CMAKE_VERSION) | cut -f2 -d.)
CMAKE_GT_3_8 := $(shell [ $(CMAKE_MAJOR) -gt 3 -o \( $(CMAKE_MAJOR) -eq 3 -a $(CMAKE_MINOR) -ge 8 \) ] && echo true)
ifneq ($(CMAKE_GT_3_8),true)
TARGET := oldcmake
else
# Check if SC exists via a verilator call (empty if not)
SYSTEMC_EXISTS := $(shell $(VERILATOR) --get-supported SYSTEMC)
# Check if SC exists via a verilator call (empty if not) # Test whether SystemC is installed with CMake support
SYSTEMC_EXISTS := $(shell $(VERILATOR) --get-supported SYSTEMC) # This will print a CMake error about processing arguments that can (currently) be ignored.
ifneq (,$(SYSTEMC_EXISTS))
FINDSC := $(shell mkdir -p build && cd build && cmake --find-package -DNAME=SystemCLanguage -DCMAKE_USE_PTHREADS_INIT=ON -DCOMPILER_ID=GNU -DLANGUAGE=CXX -DMODE=EXIST -DThreads_FOUND=ON)
ifneq (,$(findstring SystemCLanguage found,$(FINDSC)))
SYSTEMC_SET := true
endif
endif
# Test whether SystemC is installed with CMake support ifeq ($(SYSTEMC_SET), true)
# This will print a CMake error about processing arguments that can (currently) be ignored. TARGET := run
ifneq (,$(SYSTEMC_EXISTS)) else
FINDSC := $(shell mkdir -p build && cd build && cmake --find-package -DNAME=SystemCLanguage -DCMAKE_USE_PTHREADS_INIT=ON -DCOMPILER_ID=GNU -DLANGUAGE=CXX -DMODE=EXIST -DThreads_FOUND=ON) TARGET := nosc
ifneq (,$(findstring SystemCLanguage found,$(FINDSC))) endif
SYSTEMC_SET := true endif
endif
endif
ifeq ($(SYSTEMC_SET), true)
TARGET := run
else
TARGET := nosc
endif
endif
endif endif
default: $(TARGET) default: $(TARGET)

View File

@ -15,10 +15,10 @@
# package install, and verilator is in your path. Otherwise find the # package install, and verilator is in your path. Otherwise find the
# binary relative to $VERILATOR_ROOT (such as when inside the git sources). # binary relative to $VERILATOR_ROOT (such as when inside the git sources).
ifeq ($(VERILATOR_ROOT),) ifeq ($(VERILATOR_ROOT),)
VERILATOR = verilator VERILATOR = verilator
else else
export VERILATOR_ROOT export VERILATOR_ROOT
VERILATOR = $(VERILATOR_ROOT)/bin/verilator VERILATOR = $(VERILATOR_ROOT)/bin/verilator
endif endif
DOT = dot DOT = dot
@ -31,9 +31,9 @@ PYTHON_VERSION_MINOR := $(word 2,${PYTHON_VERSION_FULL})
PYTHON_GE_3_5 := $(shell [ ${PYTHON_VERSION_MAJOR} -eq 3 -a ${PYTHON_VERSION_MINOR} -ge 5 ] && echo true) PYTHON_GE_3_5 := $(shell [ ${PYTHON_VERSION_MAJOR} -eq 3 -a ${PYTHON_VERSION_MINOR} -ge 5 ] && echo true)
ifeq (${PYTHON_GE_3_5},true) ifeq (${PYTHON_GE_3_5},true)
default: test default: test
else else
default: python_message default: python_message
endif endif
python_message: python_message:

View File

@ -13,7 +13,7 @@
# Check for sanity to avoid later confusion # Check for sanity to avoid later confusion
ifneq ($(words $(CURDIR)),1) ifneq ($(words $(CURDIR)),1)
$(error Unsupported: GNU Make cannot build in directories containing spaces, build elsewhere: '$(CURDIR)') $(error Unsupported: GNU Make cannot build in directories containing spaces, build elsewhere: '$(CURDIR)')
endif endif
###################################################################### ######################################################################
@ -26,10 +26,10 @@ endif
# package install, and verilator is in your path. Otherwise find the # package install, and verilator is in your path. Otherwise find the
# binary relative to $VERILATOR_ROOT (such as when inside the git sources). # binary relative to $VERILATOR_ROOT (such as when inside the git sources).
ifeq ($(VERILATOR_ROOT),) ifeq ($(VERILATOR_ROOT),)
VERILATOR = verilator VERILATOR = verilator
else else
export VERILATOR_ROOT export VERILATOR_ROOT
VERILATOR = $(VERILATOR_ROOT)/bin/verilator VERILATOR = $(VERILATOR_ROOT)/bin/verilator
endif endif
default: default:

View File

@ -13,7 +13,7 @@
# Check for sanity to avoid later confusion # Check for sanity to avoid later confusion
ifneq ($(words $(CURDIR)),1) ifneq ($(words $(CURDIR)),1)
$(error Unsupported: GNU Make cannot build in directories containing spaces, build elsewhere: '$(CURDIR)') $(error Unsupported: GNU Make cannot build in directories containing spaces, build elsewhere: '$(CURDIR)')
endif endif
###################################################################### ######################################################################
@ -26,10 +26,10 @@ endif
# package install, and verilator is in your path. Otherwise find the # package install, and verilator is in your path. Otherwise find the
# binary relative to $VERILATOR_ROOT (such as when inside the git sources). # binary relative to $VERILATOR_ROOT (such as when inside the git sources).
ifeq ($(VERILATOR_ROOT),) ifeq ($(VERILATOR_ROOT),)
VERILATOR = verilator VERILATOR = verilator
else else
export VERILATOR_ROOT export VERILATOR_ROOT
VERILATOR = $(VERILATOR_ROOT)/bin/verilator VERILATOR = $(VERILATOR_ROOT)/bin/verilator
endif endif
default: default:

View File

@ -13,7 +13,7 @@
# Check for sanity to avoid later confusion # Check for sanity to avoid later confusion
ifneq ($(words $(CURDIR)),1) ifneq ($(words $(CURDIR)),1)
$(error Unsupported: GNU Make cannot build in directories containing spaces, build elsewhere: '$(CURDIR)') $(error Unsupported: GNU Make cannot build in directories containing spaces, build elsewhere: '$(CURDIR)')
endif endif
###################################################################### ######################################################################
@ -26,19 +26,19 @@ endif
# package install, and verilator is in your path. Otherwise find the # package install, and verilator is in your path. Otherwise find the
# binary relative to $VERILATOR_ROOT (such as when inside the git sources). # binary relative to $VERILATOR_ROOT (such as when inside the git sources).
ifeq ($(VERILATOR_ROOT),) ifeq ($(VERILATOR_ROOT),)
VERILATOR = verilator VERILATOR = verilator
else else
export VERILATOR_ROOT export VERILATOR_ROOT
VERILATOR = $(VERILATOR_ROOT)/bin/verilator VERILATOR = $(VERILATOR_ROOT)/bin/verilator
endif endif
# Check if SC exists via a verilator call (empty if not) # Check if SC exists via a verilator call (empty if not)
SYSTEMC_EXISTS := $(shell $(VERILATOR) --get-supported SYSTEMC) SYSTEMC_EXISTS := $(shell $(VERILATOR) --get-supported SYSTEMC)
ifneq ($(SYSTEMC_EXISTS),) ifneq ($(SYSTEMC_EXISTS),)
default: run default: run
else else
default: nosc default: nosc
endif endif
run: run:

View File

@ -13,7 +13,7 @@
# Check for sanity to avoid later confusion # Check for sanity to avoid later confusion
ifneq ($(words $(CURDIR)),1) ifneq ($(words $(CURDIR)),1)
$(error Unsupported: GNU Make cannot build in directories containing spaces, build elsewhere: '$(CURDIR)') $(error Unsupported: GNU Make cannot build in directories containing spaces, build elsewhere: '$(CURDIR)')
endif endif
###################################################################### ######################################################################
@ -23,10 +23,10 @@ endif
# package install, and verilator is in your path. Otherwise find the # package install, and verilator is in your path. Otherwise find the
# binary relative to $VERILATOR_ROOT (such as when inside the git sources). # binary relative to $VERILATOR_ROOT (such as when inside the git sources).
ifeq ($(VERILATOR_ROOT),) ifeq ($(VERILATOR_ROOT),)
VERILATOR = verilator VERILATOR = verilator
else else
export VERILATOR_ROOT export VERILATOR_ROOT
VERILATOR = $(VERILATOR_ROOT)/bin/verilator VERILATOR = $(VERILATOR_ROOT)/bin/verilator
endif endif
VERILATOR_FLAGS = VERILATOR_FLAGS =
@ -90,7 +90,6 @@ run:
@echo "To see waveforms, open logs/vlt_dump.vcd in a waveform viewer" @echo "To see waveforms, open logs/vlt_dump.vcd in a waveform viewer"
@echo @echo
###################################################################### ######################################################################
# Other targets # Other targets

View File

@ -13,7 +13,7 @@
# Check for sanity to avoid later confusion # Check for sanity to avoid later confusion
ifneq ($(words $(CURDIR)),1) ifneq ($(words $(CURDIR)),1)
$(error Unsupported: GNU Make cannot build in directories containing spaces, build elsewhere: '$(CURDIR)') $(error Unsupported: GNU Make cannot build in directories containing spaces, build elsewhere: '$(CURDIR)')
endif endif
###################################################################### ######################################################################
@ -23,12 +23,12 @@ endif
# package install, and verilator is in your path. Otherwise find the # package install, and verilator is in your path. Otherwise find the
# binary relative to $VERILATOR_ROOT (such as when inside the git sources). # binary relative to $VERILATOR_ROOT (such as when inside the git sources).
ifeq ($(VERILATOR_ROOT),) ifeq ($(VERILATOR_ROOT),)
VERILATOR = verilator VERILATOR = verilator
VERILATOR_COVERAGE = verilator_coverage VERILATOR_COVERAGE = verilator_coverage
else else
export VERILATOR_ROOT export VERILATOR_ROOT
VERILATOR = $(VERILATOR_ROOT)/bin/verilator VERILATOR = $(VERILATOR_ROOT)/bin/verilator
VERILATOR_COVERAGE = $(VERILATOR_ROOT)/bin/verilator_coverage VERILATOR_COVERAGE = $(VERILATOR_ROOT)/bin/verilator_coverage
endif endif
# Generate C++ in executable form # Generate C++ in executable form

View File

@ -32,7 +32,7 @@ CPPFLAGS += -DVL_DEBUG=1
# For testing inside Verilator, "configure --enable-ccwarn" will do this # For testing inside Verilator, "configure --enable-ccwarn" will do this
# automatically; otherwise you may want this unconditionally enabled # automatically; otherwise you may want this unconditionally enabled
ifeq ($(CFG_WITH_CCWARN),yes) # Local... Else don't burden users ifeq ($(CFG_WITH_CCWARN),yes) # Local... Else don't burden users
USER_CPPFLAGS_WALL += -W -Werror -Wall USER_CPPFLAGS_WALL += -W -Werror -Wall
endif endif
# See the benchmarking section of bin/verilator. # See the benchmarking section of bin/verilator.
@ -51,5 +51,5 @@ OPT_FAST = -Os -fstrict-aliasing
DEPS := $(wildcard *.d) DEPS := $(wildcard *.d)
ifneq ($(DEPS),) ifneq ($(DEPS),)
include $(DEPS) include $(DEPS)
endif endif

View File

@ -13,7 +13,7 @@
# Check for sanity to avoid later confusion # Check for sanity to avoid later confusion
ifneq ($(words $(CURDIR)),1) ifneq ($(words $(CURDIR)),1)
$(error Unsupported: GNU Make cannot build in directories containing spaces, build elsewhere: '$(CURDIR)') $(error Unsupported: GNU Make cannot build in directories containing spaces, build elsewhere: '$(CURDIR)')
endif endif
###################################################################### ######################################################################
@ -23,12 +23,12 @@ endif
# package install, and verilator is in your path. Otherwise find the # package install, and verilator is in your path. Otherwise find the
# binary relative to $VERILATOR_ROOT (such as when inside the git sources). # binary relative to $VERILATOR_ROOT (such as when inside the git sources).
ifeq ($(VERILATOR_ROOT),) ifeq ($(VERILATOR_ROOT),)
VERILATOR = verilator VERILATOR = verilator
VERILATOR_COVERAGE = verilator_coverage VERILATOR_COVERAGE = verilator_coverage
else else
export VERILATOR_ROOT export VERILATOR_ROOT
VERILATOR = $(VERILATOR_ROOT)/bin/verilator VERILATOR = $(VERILATOR_ROOT)/bin/verilator
VERILATOR_COVERAGE = $(VERILATOR_ROOT)/bin/verilator_coverage VERILATOR_COVERAGE = $(VERILATOR_ROOT)/bin/verilator_coverage
endif endif
VERILATOR_FLAGS = VERILATOR_FLAGS =
@ -60,9 +60,9 @@ SYSTEMC_EXISTS := $(shell $(VERILATOR) --get-supported SYSTEMC)
###################################################################### ######################################################################
ifneq ($(SYSTEMC_EXISTS),) ifneq ($(SYSTEMC_EXISTS),)
default: run default: run
else else
default: nosc default: nosc
endif endif
run: run:

View File

@ -31,7 +31,7 @@ CPPFLAGS += -Wno-deprecated
# For testing inside Verilator, "configure --enable-ccwarn" will do this # For testing inside Verilator, "configure --enable-ccwarn" will do this
# automatically; otherwise you may want this unconditionally enabled # automatically; otherwise you may want this unconditionally enabled
ifeq ($(CFG_WITH_CCWARN),yes) # Local... Else don't burden users ifeq ($(CFG_WITH_CCWARN),yes) # Local... Else don't burden users
USER_CPPFLAGS_WALL += -W -Werror -Wall USER_CPPFLAGS_WALL += -W -Werror -Wall
endif endif
# If you build your own rules from scratch, note you need to include # If you build your own rules from scratch, note you need to include
@ -61,5 +61,5 @@ sim_main.o: sim_main.cpp $(VM_PREFIX).h
DEPS := $(wildcard *.d) DEPS := $(wildcard *.d)
ifneq ($(DEPS),) ifneq ($(DEPS),)
include $(DEPS) include $(DEPS)
endif endif

View File

@ -69,7 +69,7 @@ export CCACHE_SLOPPINESS
# Make checks # Make checks
ifneq ($(words $(CURDIR)),1) ifneq ($(words $(CURDIR)),1)
$(error Unsupported: GNU Make cannot build in directories containing spaces, build elsewhere: '$(CURDIR)') $(error Unsupported: GNU Make cannot build in directories containing spaces, build elsewhere: '$(CURDIR)')
endif endif
###################################################################### ######################################################################
@ -81,20 +81,20 @@ UNAME_S := $(shell uname -s)
# Add -MMD -MP if you're using a recent version of GCC. # Add -MMD -MP if you're using a recent version of GCC.
VK_CPPFLAGS_ALWAYS += \ VK_CPPFLAGS_ALWAYS += \
-MMD \ -MMD \
-I$(VERILATOR_ROOT)/include \ -I$(VERILATOR_ROOT)/include \
-I$(VERILATOR_ROOT)/include/vltstd \ -I$(VERILATOR_ROOT)/include/vltstd \
-DVM_COVERAGE=$(VM_COVERAGE) \ -DVM_COVERAGE=$(VM_COVERAGE) \
-DVM_SC=$(VM_SC) \ -DVM_SC=$(VM_SC) \
-DVM_TIMING=$(VM_TIMING) \ -DVM_TIMING=$(VM_TIMING) \
-DVM_TRACE=$(VM_TRACE) \ -DVM_TRACE=$(VM_TRACE) \
-DVM_TRACE_FST=$(VM_TRACE_FST) \ -DVM_TRACE_FST=$(VM_TRACE_FST) \
-DVM_TRACE_VCD=$(VM_TRACE_VCD) \ -DVM_TRACE_VCD=$(VM_TRACE_VCD) \
-DVM_TRACE_SAIF=$(VM_TRACE_SAIF) \ -DVM_TRACE_SAIF=$(VM_TRACE_SAIF) \
$(CFG_CXXFLAGS_NO_UNUSED) \ $(CFG_CXXFLAGS_NO_UNUSED) \
ifeq ($(CFG_WITH_CCWARN),yes) # Local... Else don't burden users ifeq ($(CFG_WITH_CCWARN),yes) # Local... Else don't burden users
VK_CPPFLAGS_WALL += -Wall $(CFG_CXXFLAGS_WEXTRA) -Werror VK_CPPFLAGS_WALL += -Wall $(CFG_CXXFLAGS_WEXTRA) -Werror
endif endif
CPPFLAGS += -I. $(VK_CPPFLAGS_WALL) $(VK_CPPFLAGS_ALWAYS) CPPFLAGS += -I. $(VK_CPPFLAGS_WALL) $(VK_CPPFLAGS_ALWAYS)
@ -103,7 +103,7 @@ VPATH += ..
VPATH += $(VERILATOR_ROOT)/include VPATH += $(VERILATOR_ROOT)/include
VPATH += $(VERILATOR_ROOT)/include/vltstd VPATH += $(VERILATOR_ROOT)/include/vltstd
LDFLAGS += $(CFG_LDFLAGS_VERILATED) LDFLAGS += $(CFG_LDFLAGS_VERILATED)
#OPT = -ggdb -DPRINTINITSTR -DDETECTCHANGE #OPT = -ggdb -DPRINTINITSTR -DDETECTCHANGE
#OPT = -ggdb -DPRINTINITSTR #OPT = -ggdb -DPRINTINITSTR
@ -112,19 +112,19 @@ CPPFLAGS += $(OPT)
# On macOS, specify all weak symbols as dynamic_lookup. # On macOS, specify all weak symbols as dynamic_lookup.
# Otherwise, you get undefined symbol errors. # Otherwise, you get undefined symbol errors.
ifeq ($(UNAME_S),Darwin) ifeq ($(UNAME_S),Darwin)
LDFLAGS += -Wl,-U,__Z15vl_time_stamp64v,-U,__Z13sc_time_stampv LDFLAGS += -Wl,-U,__Z15vl_time_stamp64v,-U,__Z13sc_time_stampv
endif endif
# Allow upper level user makefiles to specify flags they want. # Allow upper level user makefiles to specify flags they want.
# These aren't ever set by Verilator, so users are free to override them. # These aren't ever set by Verilator, so users are free to override them.
CPPFLAGS += $(USER_CPPFLAGS) CPPFLAGS += $(USER_CPPFLAGS)
LDFLAGS += $(USER_LDFLAGS) LDFLAGS += $(USER_LDFLAGS)
LDLIBS += $(USER_LDLIBS) LDLIBS += $(USER_LDLIBS)
# Add flags from -CFLAGS and -LDFLAGS on Verilator command line # Add flags from -CFLAGS and -LDFLAGS on Verilator command line
CPPFLAGS += $(VM_USER_CFLAGS) CPPFLAGS += $(VM_USER_CFLAGS)
LDFLAGS += $(VM_USER_LDFLAGS) LDFLAGS += $(VM_USER_LDFLAGS)
LDLIBS += $(VM_USER_LDLIBS) LDLIBS += $(VM_USER_LDLIBS)
###################################################################### ######################################################################
# Optimization control. # Optimization control.
@ -148,7 +148,7 @@ OPT_GLOBAL = -Os
ifeq ($(VM_PROFC),1) ifeq ($(VM_PROFC),1)
CPPFLAGS += $(CFG_CXXFLAGS_PROFILE) CPPFLAGS += $(CFG_CXXFLAGS_PROFILE)
LDFLAGS += $(CFG_CXXFLAGS_PROFILE) LDFLAGS += $(CFG_CXXFLAGS_PROFILE)
endif endif
####################################################################### #######################################################################
@ -156,12 +156,12 @@ endif
ifeq ($(VM_SC),1) ifeq ($(VM_SC),1)
CPPFLAGS += $(SYSTEMC_CXX_FLAGS) $(addprefix -I, $(SYSTEMC_INCLUDE)) CPPFLAGS += $(SYSTEMC_CXX_FLAGS) $(addprefix -I, $(SYSTEMC_INCLUDE))
LDFLAGS += $(SYSTEMC_CXX_FLAGS) $(addprefix -L, $(SYSTEMC_LIBDIR)) LDFLAGS += $(SYSTEMC_CXX_FLAGS) $(addprefix -L, $(SYSTEMC_LIBDIR))
SC_LIBS = -lsystemc SC_LIBS = -lsystemc
ifneq ($(wildcard $(SYSTEMC_LIBDIR)/*numeric_bit*),) ifneq ($(wildcard $(SYSTEMC_LIBDIR)/*numeric_bit*),)
# SystemC 1.2.1beta # SystemC 1.2.1beta
SC_LIBS += -lnumeric_bit -lqt SC_LIBS += -lnumeric_bit -lqt
endif endif
endif endif
####################################################################### #######################################################################
@ -171,12 +171,11 @@ CPPFLAGS += $(CFG_CXXFLAGS_STD)
LDLIBS += $(CFG_LDLIBS_THREADS) LDLIBS += $(CFG_LDLIBS_THREADS)
ifneq ($(VM_TIMING),0) ifneq ($(VM_TIMING),0)
ifneq ($(VM_TIMING),) ifneq ($(VM_TIMING),)
CPPFLAGS += $(CFG_CXXFLAGS_COROUTINES) CPPFLAGS += $(CFG_CXXFLAGS_COROUTINES)
endif endif
endif endif
####################################################################### #######################################################################
### Aggregates ### Aggregates
@ -258,7 +257,6 @@ endif
$(VM_PREFIX)__ALL.a: $(VK_OBJS) $(VM_HIER_LIBS) $(VM_PREFIX)__ALL.a: $(VK_OBJS) $(VM_HIER_LIBS)
###################################################################### ######################################################################
### Compile rules ### Compile rules
@ -269,24 +267,24 @@ ifneq ($(VM_DEFAULT_RULES),0)
# #
# These rules put OPT_FAST/OPT_SLOW/OPT_GLOBAL before the other flags to # These rules put OPT_FAST/OPT_SLOW/OPT_GLOBAL before the other flags to
# allow USER_CPPFLAGS to override them # allow USER_CPPFLAGS to override them
%.o: %.cpp %.o: %.cpp
$(OBJCACHE) $(CXX) $(OPT_FAST) $(CXXFLAGS) $(CPPFLAGS) -c -o $@ $< $(OBJCACHE) $(CXX) $(OPT_FAST) $(CXXFLAGS) $(CPPFLAGS) -c -o $@ $<
$(VK_OBJS_FAST): %.o: %.cpp $(VK_PCH_H).fast.gch $(VK_OBJS_FAST): %.o: %.cpp $(VK_PCH_H).fast.gch
$(OBJCACHE) $(CXX) $(OPT_FAST) $(CXXFLAGS) $(CPPFLAGS) $(VK_PCH_I_FAST) -c -o $@ $< $(OBJCACHE) $(CXX) $(OPT_FAST) $(CXXFLAGS) $(CPPFLAGS) $(VK_PCH_I_FAST) -c -o $@ $<
$(VK_OBJS_SLOW): %.o: %.cpp $(VK_PCH_H).slow.gch $(VK_OBJS_SLOW): %.o: %.cpp $(VK_PCH_H).slow.gch
$(OBJCACHE) $(CXX) $(OPT_SLOW) $(CXXFLAGS) $(CPPFLAGS) $(VK_PCH_I_SLOW) -c -o $@ $< $(OBJCACHE) $(CXX) $(OPT_SLOW) $(CXXFLAGS) $(CPPFLAGS) $(VK_PCH_I_SLOW) -c -o $@ $<
$(VK_GLOBAL_OBJS): %.o: %.cpp $(VK_GLOBAL_OBJS): %.o: %.cpp
$(OBJCACHE) $(CXX) $(OPT_GLOBAL) $(CXXFLAGS) $(CPPFLAGS) -c -o $@ $< $(OBJCACHE) $(CXX) $(OPT_GLOBAL) $(CXXFLAGS) $(CPPFLAGS) -c -o $@ $<
# Precompile a header file # Precompile a header file
# PCH's compiler flags must match exactly the rules' above FAST/SLOW # PCH's compiler flags must match exactly the rules' above FAST/SLOW
# arguments used for the .cpp files, or the PCH file won't be used. # arguments used for the .cpp files, or the PCH file won't be used.
%.fast.gch: % %.fast.gch: %
$(OBJCACHE) $(CXX) $(OPT_FAST) $(CXXFLAGS) $(CPPFLAGS) $(CFG_CXXFLAGS_PCH) $< -o $@ $(OBJCACHE) $(CXX) $(OPT_FAST) $(CXXFLAGS) $(CPPFLAGS) $(CFG_CXXFLAGS_PCH) $< -o $@
%.slow.gch: % %.slow.gch: %
$(OBJCACHE) $(CXX) $(OPT_SLOW) $(CXXFLAGS) $(CPPFLAGS) $(CFG_CXXFLAGS_PCH) $< -o $@ $(OBJCACHE) $(CXX) $(OPT_SLOW) $(CXXFLAGS) $(CPPFLAGS) $(CFG_CXXFLAGS_PCH) $< -o $@
endif endif
@ -313,22 +311,22 @@ ifneq ($(findstring ccache-report,$(MAKECMDGOALS)),)
# Remove previous logfiles and report # Remove previous logfiles and report
$(shell rm -rf $(VK_CCACHE_LOGDIR) $(VK_CCACHE_REPORT)) $(shell rm -rf $(VK_CCACHE_LOGDIR) $(VK_CCACHE_REPORT))
$(VK_CCACHE_LOGDIR): $(VK_CCACHE_LOGDIR):
mkdir -p $@ mkdir -p $@
$(VK_OBJS): | $(VK_CCACHE_LOGDIR) $(VK_OBJS): | $(VK_CCACHE_LOGDIR)
$(VK_OBJS): export CCACHE_LOGFILE=$(VK_CCACHE_LOGDIR)/$@.log $(VK_OBJS): export CCACHE_LOGFILE=$(VK_CCACHE_LOGDIR)/$@.log
$(VK_CCACHE_REPORT): $(VK_OBJS) $(VK_CCACHE_REPORT): $(VK_OBJS)
$(VERILATOR_CCACHE_REPORT) -o $@ $(VK_CCACHE_LOGDIR) $(VERILATOR_CCACHE_REPORT) -o $@ $(VK_CCACHE_LOGDIR)
.PHONY: ccache-report .PHONY: ccache-report
ccache-report: $(VK_CCACHE_REPORT) ccache-report: $(VK_CCACHE_REPORT)
@cat $< @cat $<
# ccache-report runs last # ccache-report runs last
ccache-report: $(VK_OTHER_GOALS) ccache-report: $(VK_OTHER_GOALS)
endif endif
###################################################################### ######################################################################
@ -358,5 +356,5 @@ debug-make::
DEPS := $(wildcard *.d) DEPS := $(wildcard *.d)
ifneq ($(DEPS),) ifneq ($(DEPS),)
include $(DEPS) include $(DEPS)
endif endif

View File

@ -30,7 +30,7 @@ debug: dbg
optimize: opt optimize: opt
ifneq ($(words $(CURDIR)),1) ifneq ($(words $(CURDIR)),1)
$(error Unsupported: GNU Make cannot build in directories containing spaces, build elsewhere: '$(CURDIR)') $(error Unsupported: GNU Make cannot build in directories containing spaces, build elsewhere: '$(CURDIR)')
endif endif
UNDER_GIT = $(wildcard ${srcdir}/../.git/logs/HEAD) UNDER_GIT = $(wildcard ${srcdir}/../.git/logs/HEAD)
@ -50,9 +50,9 @@ else
endif endif
ifneq ($(BEAR),) ifneq ($(BEAR),)
BEAR_OBJ_OPT := $(BEAR) --append --output obj_dbg/compile_commands.json -- BEAR_OBJ_OPT := $(BEAR) --append --output obj_dbg/compile_commands.json --
else else
BEAR_OBJ_OPT := BEAR_OBJ_OPT :=
endif endif
#********************************************************************* #*********************************************************************
@ -70,11 +70,11 @@ obj_dbg:
opt: ../bin/verilator_bin$(EXEEXT) opt: ../bin/verilator_bin$(EXEEXT)
ifeq ($(VERILATOR_NO_OPT_BUILD),1) # Faster laptop development... One build ifeq ($(VERILATOR_NO_OPT_BUILD),1) # Faster laptop development... One build
../bin/verilator_bin$(EXEEXT): ../bin/verilator_bin_dbg$(EXEEXT) ../bin/verilator_bin$(EXEEXT): ../bin/verilator_bin_dbg$(EXEEXT)
-cp -p $< $@.tmp -cp -p $< $@.tmp
-mv -f $@.tmp $@ -mv -f $@.tmp $@
else else
../bin/verilator_bin$(EXEEXT): obj_opt ../bin prefiles ../bin/verilator_bin$(EXEEXT): obj_opt ../bin prefiles
$(MAKE) -C obj_opt -j 1 TGT=../$@ -f ../Makefile_obj serial $(MAKE) -C obj_opt -j 1 TGT=../$@ -f ../Makefile_obj serial
$(MAKE) -C obj_opt TGT=../$@ -f ../Makefile_obj $(MAKE) -C obj_opt TGT=../$@ -f ../Makefile_obj
endif endif
@ -89,9 +89,9 @@ dbg: ../bin/verilator_bin_dbg$(EXEEXT) ../bin/verilator_coverage_bin_dbg$(EXEEXT
$(MAKE) -C obj_dbg TGT=../$@ VL_DEBUG=1 VL_VLCOV=1 -f ../Makefile_obj $(MAKE) -C obj_dbg TGT=../$@ VL_DEBUG=1 VL_VLCOV=1 -f ../Makefile_obj
ifneq ($(VERILATOR_NO_OPT_BUILD),1) # Faster laptop development... don't rebuild each commit ifneq ($(VERILATOR_NO_OPT_BUILD),1) # Faster laptop development... don't rebuild each commit
ifneq ($(UNDER_GIT),) # If local git tree... else don't burden users ifneq ($(UNDER_GIT),) # If local git tree... else don't burden users
GIT_CHANGE_DEP = ${srcdir}/../.git/logs/HEAD GIT_CHANGE_DEP = ${srcdir}/../.git/logs/HEAD
endif endif
endif endif
prefiles:: prefiles::

View File

@ -21,13 +21,13 @@
# from a level lower, so we need to move up if it's relative, not if absolute. # from a level lower, so we need to move up if it's relative, not if absolute.
config_srcdir = @srcdir@ config_srcdir = @srcdir@
ifeq ($(config_srcdir),.) ifeq ($(config_srcdir),.)
srcdir = .. srcdir = ..
else # Run an experiment else # Run an experiment
ifeq ($(wildcard $(config_srcdir)/../Makefile_obj.in),) ifeq ($(wildcard $(config_srcdir)/../Makefile_obj.in),)
srcdir = $(config_srcdir) srcdir = $(config_srcdir)
else else
srcdir = $(config_srcdir)/.. srcdir = $(config_srcdir)/..
endif endif
endif endif
incdir = $(srcdir)/../include incdir = $(srcdir)/../include
@ -81,14 +81,14 @@ TGT = ../../verilator_bin$(EXEEXT)
################# #################
ifeq ($(VL_NOOPT),1) ifeq ($(VL_NOOPT),1)
CPPFLAGS += -O0 CPPFLAGS += -O0
else ifeq ($(VL_DEBUG),) else ifeq ($(VL_DEBUG),)
# Optimize # Optimize
CPPFLAGS += -O3 CPPFLAGS += -O3
else else
# Debug # Debug
CPPFLAGS += @CFG_CXXFLAGS_DEBUG@ -DVL_DEBUG -D_GLIBCXX_DEBUG CPPFLAGS += @CFG_CXXFLAGS_DEBUG@ -DVL_DEBUG -D_GLIBCXX_DEBUG
LDFLAGS += @CFG_LDFLAGS_DEBUG@ LDFLAGS += @CFG_LDFLAGS_DEBUG@
endif endif
################# #################
@ -104,35 +104,35 @@ CPPFLAGS += -I. -I$(bldsrc) -I$(srcdir) -I$(incdir) -I../../include
#CPPFLAGS += -DVL_LEAK_CHECKS # If running valgrind or other hunting tool #CPPFLAGS += -DVL_LEAK_CHECKS # If running valgrind or other hunting tool
CPPFLAGS += -MP # Only works on recent GCC versions CPPFLAGS += -MP # Only works on recent GCC versions
ifeq ($(CFG_WITH_CCWARN),yes) # Local... Else don't burden users ifeq ($(CFG_WITH_CCWARN),yes) # Local... Else don't burden users
CPPFLAGS += -W -Wall $(CFG_CXXFLAGS_WEXTRA) $(CFG_CXXFLAGS_SRC) -Werror CPPFLAGS += -W -Wall $(CFG_CXXFLAGS_WEXTRA) $(CFG_CXXFLAGS_SRC) -Werror
#CPPFLAGS += -pedantic-errors #CPPFLAGS += -pedantic-errors
else else
CPPFLAGS += $(CFG_CXXFLAGS_SRC) CPPFLAGS += $(CFG_CXXFLAGS_SRC)
endif endif
LDFLAGS += $(CFG_LDFLAGS_SRC) LDFLAGS += $(CFG_LDFLAGS_SRC)
CPPFLAGSWALL = $(CPPFLAGS) CPPFLAGSWALL = $(CPPFLAGS)
CPPFLAGSPARSER = $(CPPFLAGS) $(CFG_CXXFLAGS_PARSER) CPPFLAGSPARSER = $(CPPFLAGS) $(CFG_CXXFLAGS_PARSER)
# Allow RPM builds to specify hardcoded data directories # Allow RPM builds to specify hardcoded data directories
# To do this: # To do this:
ifeq ($(CFG_WITH_DEFENV),yes) ifeq ($(CFG_WITH_DEFENV),yes)
CPPFLAGS += -DDEFENV_SYSTEMC=\"$(SYSTEMC)\" CPPFLAGS += -DDEFENV_SYSTEMC=\"$(SYSTEMC)\"
CPPFLAGS += -DDEFENV_SYSTEMC_ARCH=\"$(SYSTEMC_ARCH)\" CPPFLAGS += -DDEFENV_SYSTEMC_ARCH=\"$(SYSTEMC_ARCH)\"
CPPFLAGS += -DDEFENV_SYSTEMC_INCLUDE=\"$(SYSTEMC_INCLUDE)\" CPPFLAGS += -DDEFENV_SYSTEMC_INCLUDE=\"$(SYSTEMC_INCLUDE)\"
CPPFLAGS += -DDEFENV_SYSTEMC_LIBDIR=\"$(SYSTEMC_LIBDIR)\" CPPFLAGS += -DDEFENV_SYSTEMC_LIBDIR=\"$(SYSTEMC_LIBDIR)\"
ifeq ($(VERILATOR_ROOT),) # Use what we're given, or intuit ifeq ($(VERILATOR_ROOT),) # Use what we're given, or intuit
CPPFLAGS += -DDEFENV_VERILATOR_ROOT=\"$(pkgdatadir)\" CPPFLAGS += -DDEFENV_VERILATOR_ROOT=\"$(pkgdatadir)\"
else else
CPPFLAGS += -DDEFENV_VERILATOR_ROOT=\"$(VERILATOR_ROOT)\" CPPFLAGS += -DDEFENV_VERILATOR_ROOT=\"$(VERILATOR_ROOT)\"
endif endif
ifneq ($(CFG_WITH_SOLVER),no) ifneq ($(CFG_WITH_SOLVER),no)
CPPFLAGS += -DDEFENV_VERILATOR_SOLVER='"$(CFG_WITH_SOLVER)"' CPPFLAGS += -DDEFENV_VERILATOR_SOLVER='"$(CFG_WITH_SOLVER)"'
else else
ifneq ($(VERILATOR_SOLVER),) ifneq ($(VERILATOR_SOLVER),)
CPPFLAGS += -DDEFENV_VERILATOR_SOLVER='"$(VERILATOR_SOLVER)"' CPPFLAGS += -DDEFENV_VERILATOR_SOLVER='"$(VERILATOR_SOLVER)"'
endif
endif endif
endif
endif endif
HEADERS = $(wildcard V*.h v*.h) HEADERS = $(wildcard V*.h v*.h)
@ -171,175 +171,175 @@ maintainer-copy::
#### Top executable #### Top executable
RAW_OBJS = \ RAW_OBJS = \
V3Const__gen.o \ V3Const__gen.o \
V3Error.o \ V3Error.o \
V3FileLine.o \ V3FileLine.o \
V3Graph.o \ V3Graph.o \
V3GraphAcyc.o \ V3GraphAcyc.o \
V3GraphAlg.o \ V3GraphAlg.o \
V3GraphPathChecker.o \ V3GraphPathChecker.o \
V3GraphTest.o \ V3GraphTest.o \
V3Hash.o \ V3Hash.o \
V3OptionParser.o \ V3OptionParser.o \
V3Os.o \ V3Os.o \
V3ParseGrammar.o \ V3ParseGrammar.o \
V3ParseImp.o \ V3ParseImp.o \
V3ParseLex.o \ V3ParseLex.o \
V3PreProc.o \ V3PreProc.o \
V3PreShell.o \ V3PreShell.o \
V3String.o \ V3String.o \
V3ThreadPool.o \ V3ThreadPool.o \
V3Waiver.o \ V3Waiver.o \
Verilator.o \ Verilator.o \
RAW_OBJS_PCH_ASTMT = \ RAW_OBJS_PCH_ASTMT = \
V3Ast.o \ V3Ast.o \
V3AstNodes.o \ V3AstNodes.o \
V3Broken.o \ V3Broken.o \
V3Config.o \ V3Config.o \
V3EmitCBase.o \ V3EmitCBase.o \
V3EmitCConstPool.o \ V3EmitCConstPool.o \
V3EmitCFunc.o \ V3EmitCFunc.o \
V3EmitCHeaders.o \ V3EmitCHeaders.o \
V3EmitCImp.o \ V3EmitCImp.o \
V3EmitCInlines.o \ V3EmitCInlines.o \
V3EmitCPch.o \ V3EmitCPch.o \
V3EmitV.o \ V3EmitV.o \
V3File.o \ V3File.o \
V3FuncOpt.o \ V3FuncOpt.o \
V3Global.o \ V3Global.o \
V3Hasher.o \ V3Hasher.o \
V3Number.o \ V3Number.o \
V3Options.o \ V3Options.o \
V3Stats.o \ V3Stats.o \
V3StatsReport.o \ V3StatsReport.o \
V3VariableOrder.o \ V3VariableOrder.o \
RAW_OBJS_PCH_ASTNOMT = \ RAW_OBJS_PCH_ASTNOMT = \
V3Active.o \ V3Active.o \
V3ActiveTop.o \ V3ActiveTop.o \
V3Assert.o \ V3Assert.o \
V3AssertPre.o \ V3AssertPre.o \
V3Begin.o \ V3Begin.o \
V3Branch.o \ V3Branch.o \
V3CCtors.o \ V3CCtors.o \
V3CUse.o \ V3CUse.o \
V3Case.o \ V3Case.o \
V3Cast.o \ V3Cast.o \
V3Class.o \ V3Class.o \
V3Clean.o \ V3Clean.o \
V3Clock.o \ V3Clock.o \
V3Combine.o \ V3Combine.o \
V3Common.o \ V3Common.o \
V3Coverage.o \ V3Coverage.o \
V3CoverageJoin.o \ V3CoverageJoin.o \
V3Dead.o \ V3Dead.o \
V3Delayed.o \ V3Delayed.o \
V3Depth.o \ V3Depth.o \
V3DepthBlock.o \ V3DepthBlock.o \
V3Descope.o \ V3Descope.o \
V3Dfg.o \ V3Dfg.o \
V3DfgAstToDfg.o \ V3DfgAstToDfg.o \
V3DfgCache.o \ V3DfgCache.o \
V3DfgDecomposition.o \ V3DfgDecomposition.o \
V3DfgDfgToAst.o \ V3DfgDfgToAst.o \
V3DfgOptimizer.o \ V3DfgOptimizer.o \
V3DfgPasses.o \ V3DfgPasses.o \
V3DfgPeephole.o \ V3DfgPeephole.o \
V3DfgRegularize.o \ V3DfgRegularize.o \
V3DiagSarif.o \ V3DiagSarif.o \
V3DupFinder.o \ V3DupFinder.o \
V3EmitCMain.o \ V3EmitCMain.o \
V3EmitCMake.o \ V3EmitCMake.o \
V3EmitCModel.o \ V3EmitCModel.o \
V3EmitCSyms.o \ V3EmitCSyms.o \
V3EmitMk.o \ V3EmitMk.o \
V3EmitMkJson.o \ V3EmitMkJson.o \
V3EmitXml.o \ V3EmitXml.o \
V3ExecGraph.o \ V3ExecGraph.o \
V3Expand.o \ V3Expand.o \
V3Force.o \ V3Force.o \
V3Fork.o \ V3Fork.o \
V3Gate.o \ V3Gate.o \
V3HierBlock.o \ V3HierBlock.o \
V3Inline.o \ V3Inline.o \
V3Inst.o \ V3Inst.o \
V3InstrCount.o \ V3InstrCount.o \
V3Interface.o \ V3Interface.o \
V3Life.o \ V3Life.o \
V3LifePost.o \ V3LifePost.o \
V3LinkCells.o \ V3LinkCells.o \
V3LinkDot.o \ V3LinkDot.o \
V3LinkInc.o \ V3LinkInc.o \
V3LinkJump.o \ V3LinkJump.o \
V3LinkLValue.o \ V3LinkLValue.o \
V3LinkLevel.o \ V3LinkLevel.o \
V3LinkParse.o \ V3LinkParse.o \
V3LinkResolve.o \ V3LinkResolve.o \
V3Localize.o \ V3Localize.o \
V3MergeCond.o \ V3MergeCond.o \
V3Name.o \ V3Name.o \
V3Order.o \ V3Order.o \
V3OrderGraphBuilder.o \ V3OrderGraphBuilder.o \
V3OrderMoveGraph.o \ V3OrderMoveGraph.o \
V3OrderParallel.o \ V3OrderParallel.o \
V3OrderProcessDomains.o \ V3OrderProcessDomains.o \
V3OrderSerial.o \ V3OrderSerial.o \
V3Param.o \ V3Param.o \
V3Premit.o \ V3Premit.o \
V3ProtectLib.o \ V3ProtectLib.o \
V3Randomize.o \ V3Randomize.o \
V3Reloop.o \ V3Reloop.o \
V3Sampled.o \ V3Sampled.o \
V3Sched.o \ V3Sched.o \
V3SchedAcyclic.o \ V3SchedAcyclic.o \
V3SchedPartition.o \ V3SchedPartition.o \
V3SchedReplicate.o \ V3SchedReplicate.o \
V3SchedTiming.o \ V3SchedTiming.o \
V3SchedVirtIface.o \ V3SchedVirtIface.o \
V3Scope.o \ V3Scope.o \
V3Scoreboard.o \ V3Scoreboard.o \
V3Slice.o \ V3Slice.o \
V3Split.o \ V3Split.o \
V3SplitAs.o \ V3SplitAs.o \
V3SplitVar.o \ V3SplitVar.o \
V3StackCount.o \ V3StackCount.o \
V3Subst.o \ V3Subst.o \
V3TSP.o \ V3TSP.o \
V3Table.o \ V3Table.o \
V3Task.o \ V3Task.o \
V3Timing.o \ V3Timing.o \
V3Trace.o \ V3Trace.o \
V3TraceDecl.o \ V3TraceDecl.o \
V3Tristate.o \ V3Tristate.o \
V3Udp.o \ V3Udp.o \
V3Undriven.o \ V3Undriven.o \
V3Unknown.o \ V3Unknown.o \
V3Unroll.o \ V3Unroll.o \
V3Width.o \ V3Width.o \
V3WidthCommit.o \ V3WidthCommit.o \
V3WidthSel.o \ V3WidthSel.o \
# verilator_coverage # verilator_coverage
VLCOV_OBJS = \ VLCOV_OBJS = \
VlcMain.o \ VlcMain.o \
NON_STANDALONE_HEADERS = \ NON_STANDALONE_HEADERS = \
V3AstInlines.h \ V3AstInlines.h \
V3AstNodeDType.h \ V3AstNodeDType.h \
V3AstNodeExpr.h \ V3AstNodeExpr.h \
V3AstNodeOther.h \ V3AstNodeOther.h \
V3DfgVertices.h \ V3DfgVertices.h \
V3ThreadPool.h \ V3ThreadPool.h \
V3WidthRemove.h \ V3WidthRemove.h \
AST_DEFS := \ AST_DEFS := \
V3AstNodeDType.h \ V3AstNodeDType.h \
V3AstNodeExpr.h \ V3AstNodeExpr.h \
V3AstNodeOther.h \ V3AstNodeOther.h \
DFG_DEFS := \ DFG_DEFS := \
V3DfgVertices.h V3DfgVertices.h
#### astgen common flags #### astgen common flags
@ -350,11 +350,11 @@ ASTGENFLAGS += $(foreach f,$(DFG_DEFS),--dfgdef $f)
#### Linking #### Linking
ifeq ($(VL_VLCOV),) ifeq ($(VL_VLCOV),)
PREDEP_H = V3Ast__gen_forward_class_decls.h PREDEP_H = V3Ast__gen_forward_class_decls.h
OBJS += $(RAW_OBJS) $(RAW_OBJS_PCH_ASTMT) $(RAW_OBJS_PCH_ASTNOMT) OBJS += $(RAW_OBJS) $(RAW_OBJS_PCH_ASTMT) $(RAW_OBJS_PCH_ASTNOMT)
else else
PREDEP_H = PREDEP_H =
OBJS += $(VLCOV_OBJS) OBJS += $(VLCOV_OBJS)
endif endif
$(TGT): $(PREDEP_H) $(OBJS) $(TGT): $(PREDEP_H) $(OBJS)
@ -454,5 +454,5 @@ header_cc: $(addsuffix __header_cc.o, $(basename $(HEADER_CC_H)))
DEPS := $(wildcard *.d) DEPS := $(wildcard *.d)
ifneq ($(DEPS),) ifneq ($(DEPS),)
include $(DEPS) include $(DEPS)
endif endif

View File

@ -36,7 +36,7 @@ endif
# Run tests in parallel. # Run tests in parallel.
ifeq ($(CFG_WITH_LONGTESTS),yes) ifeq ($(CFG_WITH_LONGTESTS),yes)
DRIVER_FLAGS ?= -j 0 --quiet --rerun DRIVER_FLAGS ?= -j 0 --quiet --rerun
endif endif
.SUFFIXES: .SUFFIXES:
@ -75,7 +75,7 @@ random:
random_forever: random_forever:
while ( VERILATOR_NO_DEBUG=1 CPPFLAGS_ADD=-Wno-error $(MAKE) random ) ; do \ while ( VERILATOR_NO_DEBUG=1 CPPFLAGS_ADD=-Wno-error $(MAKE) random ) ; do \
echo ; \ echo ; \
done done
####################################################################### #######################################################################
@ -102,10 +102,11 @@ TEST_SNAP_DIR ?= snapshot
# Command to diff directories # Command to diff directories
TEST_DIFF_TOOL ?= $(if $(shell which icdiff), icdiff -N -r, diff -r) TEST_DIFF_TOOL ?= $(if $(shell which icdiff), icdiff -N -r, diff -r)
TEST_SNAP_IGNORE := *.status *.log *.dat *.d *.o *.a *.so *stats*.txt *.html \ TEST_SNAP_IGNORE := \
*.includecache *.out *.fst *.fst.vcd *.tree *.tree*.json \ *.status *.log *.dat *.d *.o *.a *.so *stats*.txt *.html \
*.dot *.csv *.xml *.hash *.cmake gmon.out.* CMakeFiles \ *.includecache *.out *.fst *.fst.vcd *.tree *.tree*.json \
profile_exec.vcd t_pgo_threads *.dot *.csv *.xml *.hash *.cmake gmon.out.* CMakeFiles \
profile_exec.vcd t_pgo_threads
define TEST_SNAP_template define TEST_SNAP_template
mkdir -p $(TEST_SNAP_DIR) mkdir -p $(TEST_SNAP_DIR)