Internals: Add format-make rule and standardize Makefile indents. No functional change intended.
This commit is contained in:
parent
6af694b04b
commit
51545b36ca
|
@ -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
|
43
Makefile.in
43
Makefile.in
|
@ -139,10 +139,10 @@ 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,7 +213,7 @@ 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)
|
||||||
|
@ -228,24 +228,26 @@ 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 \
|
||||||
verilator_coverage \
|
verilator_coverage \
|
||||||
verilator_gantt \
|
verilator_gantt \
|
||||||
verilator_profcfunc \
|
verilator_profcfunc \
|
||||||
|
|
||||||
VL_INST_PUBLIC_BIN_FILES = verilator_bin$(EXEEXT) \
|
VL_INST_PUBLIC_BIN_FILES = \
|
||||||
|
verilator_bin$(EXEEXT) \
|
||||||
verilator_bin_dbg$(EXEEXT) \
|
verilator_bin_dbg$(EXEEXT) \
|
||||||
verilator_coverage_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_ccache_report \
|
||||||
verilator_includer \
|
verilator_includer \
|
||||||
|
|
||||||
VL_INST_INC_BLDDIR_FILES = \
|
VL_INST_INC_BLDDIR_FILES = \
|
||||||
|
@ -412,7 +414,8 @@ 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
|
||||||
|
@ -482,6 +485,15 @@ CMAKE_FILES = \
|
||||||
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 \
|
||||||
|
@ -518,8 +530,7 @@ PY_FILES = \
|
||||||
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
|
||||||
|
|
|
@ -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
|
||||||
|
|
||||||
######################################################################
|
######################################################################
|
||||||
|
|
|
@ -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)
|
||||||
|
|
|
@ -20,12 +20,12 @@
|
||||||
# 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
|
||||||
######################################################################
|
######################################################################
|
||||||
|
|
||||||
|
@ -33,33 +33,31 @@ endif
|
||||||
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)
|
||||||
ifneq ($(CMAKE_GT_3_8),true)
|
ifneq ($(CMAKE_GT_3_8),true)
|
||||||
TARGET := oldcmake
|
TARGET := oldcmake
|
||||||
else
|
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)
|
||||||
|
|
|
@ -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)
|
||||||
|
|
|
@ -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)
|
||||||
|
|
|
@ -20,12 +20,12 @@
|
||||||
# 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
|
||||||
######################################################################
|
######################################################################
|
||||||
|
|
||||||
|
@ -33,33 +33,31 @@ endif
|
||||||
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)
|
||||||
ifneq ($(CMAKE_GT_3_8),true)
|
ifneq ($(CMAKE_GT_3_8),true)
|
||||||
TARGET := oldcmake
|
TARGET := oldcmake
|
||||||
else
|
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)
|
||||||
|
|
|
@ -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:
|
||||||
|
|
|
@ -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:
|
||||||
|
|
|
@ -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:
|
||||||
|
|
|
@ -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:
|
||||||
|
|
|
@ -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
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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:
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -94,7 +94,7 @@ VK_CPPFLAGS_ALWAYS += \
|
||||||
$(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)
|
||||||
|
@ -176,7 +176,6 @@ ifneq ($(VM_TIMING),0)
|
||||||
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
|
||||||
|
|
|
@ -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
|
||||||
|
@ -90,7 +90,7 @@ dbg: ../bin/verilator_bin_dbg$(EXEEXT) ../bin/verilator_coverage_bin_dbg$(EXEEXT
|
||||||
|
|
||||||
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
|
||||||
|
|
||||||
|
|
|
@ -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,10 +104,10 @@ 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)
|
||||||
|
|
||||||
|
@ -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
|
||||||
|
|
|
@ -102,7 +102,8 @@ 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 := \
|
||||||
|
*.status *.log *.dat *.d *.o *.a *.so *stats*.txt *.html \
|
||||||
*.includecache *.out *.fst *.fst.vcd *.tree *.tree*.json \
|
*.includecache *.out *.fst *.fst.vcd *.tree *.tree*.json \
|
||||||
*.dot *.csv *.xml *.hash *.cmake gmon.out.* CMakeFiles \
|
*.dot *.csv *.xml *.hash *.cmake gmon.out.* CMakeFiles \
|
||||||
profile_exec.vcd t_pgo_threads
|
profile_exec.vcd t_pgo_threads
|
||||||
|
|
Loading…
Reference in New Issue