2008-06-10 03:25:10 +02:00
|
|
|
# -*- Makefile -*-
|
2006-08-26 13:35:28 +02:00
|
|
|
#*****************************************************************************
|
|
|
|
|
#
|
|
|
|
|
# DESCRIPTION: Verilator: Makefile for verilog source
|
|
|
|
|
#
|
2019-11-08 04:33:59 +01:00
|
|
|
# Code available from: https://verilator.org
|
2006-08-26 13:35:28 +02:00
|
|
|
#
|
|
|
|
|
#*****************************************************************************
|
|
|
|
|
#
|
2025-01-01 14:30:25 +01:00
|
|
|
# Copyright 2003-2025 by Wilson Snyder. This program is free software; you
|
2020-03-21 16:24:24 +01:00
|
|
|
# can redistribute it and/or modify it under the terms of either the GNU
|
2009-05-04 23:07:57 +02:00
|
|
|
# Lesser General Public License Version 3 or the Perl Artistic License
|
|
|
|
|
# Version 2.0.
|
2020-03-21 16:24:24 +01:00
|
|
|
# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
2006-08-26 13:35:28 +02:00
|
|
|
#
|
|
|
|
|
#****************************************************************************/
|
|
|
|
|
|
|
|
|
|
#### Start of system configuration section. ####
|
|
|
|
|
|
2009-11-25 23:20:28 +01:00
|
|
|
# Unfortunately configure uses relative paths, and this makefile is called
|
|
|
|
|
# from a level lower, so we need to move up if it's relative, not if absolute.
|
|
|
|
|
config_srcdir = @srcdir@
|
|
|
|
|
ifeq ($(config_srcdir),.)
|
2025-06-24 23:58:55 +02:00
|
|
|
srcdir = ..
|
2009-11-25 23:20:28 +01:00
|
|
|
else # Run an experiment
|
2025-06-24 23:58:55 +02:00
|
|
|
ifeq ($(wildcard $(config_srcdir)/../Makefile_obj.in),)
|
|
|
|
|
srcdir = $(config_srcdir)
|
|
|
|
|
else
|
|
|
|
|
srcdir = $(config_srcdir)/..
|
|
|
|
|
endif
|
2009-11-25 23:20:28 +01:00
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
incdir = $(srcdir)/../include
|
|
|
|
|
# Bldsrc may differ from srcdir if configure wan't run from the kit top
|
|
|
|
|
bldsrc = ..
|
2006-08-26 13:35:28 +02:00
|
|
|
|
2008-06-24 20:50:34 +02:00
|
|
|
# Programs
|
2006-08-26 13:35:28 +02:00
|
|
|
CC = @CC@
|
|
|
|
|
CXX = @CXX@
|
|
|
|
|
LINK = @CXX@
|
2008-06-24 20:50:34 +02:00
|
|
|
LEX = @LEX@
|
|
|
|
|
LFLAGS = -d
|
2020-12-23 21:41:14 +01:00
|
|
|
PYTHON3 = @PYTHON3@
|
2008-06-24 20:50:34 +02:00
|
|
|
YACC = @YACC@
|
2020-04-05 22:10:33 +02:00
|
|
|
OBJCACHE ?= @OBJCACHE@
|
2008-03-18 21:26:37 +01:00
|
|
|
|
|
|
|
|
prefix = @prefix@
|
|
|
|
|
|
2008-04-29 16:14:20 +02:00
|
|
|
# Directory in which to install data across multiple architectures
|
|
|
|
|
datarootdir = @datarootdir@
|
|
|
|
|
|
2024-09-11 01:04:55 +02:00
|
|
|
# Directory in which to install package-specific files
|
2008-03-18 21:26:37 +01:00
|
|
|
# Generally ${prefix}/share/verilator
|
|
|
|
|
pkgdatadir = @pkgdatadir@
|
|
|
|
|
|
2008-06-24 20:50:34 +02:00
|
|
|
# Compile options
|
2011-10-07 12:48:40 +02:00
|
|
|
CFG_WITH_CCWARN = @CFG_WITH_CCWARN@
|
2008-06-24 20:50:34 +02:00
|
|
|
CFG_WITH_DEFENV = @CFG_WITH_DEFENV@
|
2024-05-17 16:38:34 +02:00
|
|
|
CFG_WITH_SOLVER = @CFG_WITH_SOLVER@
|
2011-08-23 03:02:09 +02:00
|
|
|
CPPFLAGS += @CPPFLAGS@
|
2019-07-06 19:02:36 +02:00
|
|
|
CFLAGS += @CFLAGS@
|
|
|
|
|
CXXFLAGS += @CXXFLAGS@
|
2008-06-24 20:50:34 +02:00
|
|
|
LDFLAGS += @LDFLAGS@
|
2011-10-05 23:07:10 +02:00
|
|
|
EXEEXT = @EXEEXT@
|
2015-02-11 04:38:05 +01:00
|
|
|
CFG_CXXFLAGS_SRC = @CFG_CXXFLAGS_SRC@
|
|
|
|
|
CFG_CXXFLAGS_PARSER = @CFG_CXXFLAGS_PARSER@
|
2017-09-15 05:28:02 +02:00
|
|
|
# Compiler flags that turn on extra warnings
|
|
|
|
|
CFG_CXXFLAGS_WEXTRA = @CFG_CXXFLAGS_WEXTRA@
|
2020-02-01 01:13:55 +01:00
|
|
|
CFG_LDFLAGS_SRC = @CFG_LDFLAGS_SRC@
|
2020-01-23 23:32:19 +01:00
|
|
|
CFG_LIBS = @CFG_LIBS@
|
2023-10-18 04:49:28 +02:00
|
|
|
CFG_CXXFLAGS_PCH = -x c++-header
|
|
|
|
|
# Compiler option to put in front of filename to read precompiled header
|
|
|
|
|
CFG_CXXFLAGS_PCH_I = @CFG_CXXFLAGS_PCH_I@
|
|
|
|
|
# Compiler's filename prefix for precompiled headers, .gch if clang, empty if GCC
|
|
|
|
|
CFG_GCH_IF_CLANG = @CFG_GCH_IF_CLANG@
|
2008-06-24 20:50:34 +02:00
|
|
|
|
2006-08-26 13:35:28 +02:00
|
|
|
#### End of system configuration section. ####
|
|
|
|
|
|
2009-11-25 23:20:28 +01:00
|
|
|
VPATH += . $(bldsrc) $(srcdir)
|
2021-06-04 18:04:55 +02:00
|
|
|
TGT = ../../verilator_bin$(EXEEXT)
|
2006-08-26 13:35:28 +02:00
|
|
|
|
|
|
|
|
#################
|
2022-01-08 17:18:23 +01:00
|
|
|
ifeq ($(VL_NOOPT),1)
|
2025-06-24 23:58:55 +02:00
|
|
|
CPPFLAGS += -O0
|
2022-01-08 17:18:23 +01:00
|
|
|
else ifeq ($(VL_DEBUG),)
|
2025-06-24 23:58:55 +02:00
|
|
|
# Optimize
|
|
|
|
|
CPPFLAGS += -O3
|
2006-08-26 13:35:28 +02:00
|
|
|
else
|
2025-06-24 23:58:55 +02:00
|
|
|
# Debug
|
|
|
|
|
CPPFLAGS += @CFG_CXXFLAGS_DEBUG@ -DVL_DEBUG -D_GLIBCXX_DEBUG
|
|
|
|
|
LDFLAGS += @CFG_LDFLAGS_DEBUG@
|
2006-08-26 13:35:28 +02:00
|
|
|
endif
|
|
|
|
|
#################
|
|
|
|
|
|
|
|
|
|
#LIBS += -ldl
|
|
|
|
|
#CCMALLOC = /usr/local/lib/ccmalloc-gcc.o -lccmalloc -ldl
|
|
|
|
|
|
2010-02-01 12:37:39 +01:00
|
|
|
# -lfl not needed as Flex invoked with %nowrap option
|
2020-02-01 01:13:55 +01:00
|
|
|
LIBS = $(CFG_LIBS) -lm
|
2006-08-26 13:35:28 +02:00
|
|
|
|
2023-04-11 13:23:24 +02:00
|
|
|
CPPFLAGS += -DVERILATOR_INTERNAL_
|
2011-08-23 03:02:09 +02:00
|
|
|
CPPFLAGS += -MMD
|
2018-08-25 13:55:48 +02:00
|
|
|
CPPFLAGS += -I. -I$(bldsrc) -I$(srcdir) -I$(incdir) -I../../include
|
2023-01-30 04:39:22 +01:00
|
|
|
#CPPFLAGS += -DVL_LEAK_CHECKS # If running valgrind or other hunting tool
|
2011-08-23 03:02:09 +02:00
|
|
|
CPPFLAGS += -MP # Only works on recent GCC versions
|
2023-01-30 04:39:22 +01:00
|
|
|
ifeq ($(CFG_WITH_CCWARN),yes) # Local... Else don't burden users
|
2025-06-24 23:58:55 +02:00
|
|
|
CPPFLAGS += -W -Wall $(CFG_CXXFLAGS_WEXTRA) $(CFG_CXXFLAGS_SRC) -Werror
|
|
|
|
|
#CPPFLAGS += -pedantic-errors
|
2016-05-17 03:40:49 +02:00
|
|
|
else
|
2025-06-24 23:58:55 +02:00
|
|
|
CPPFLAGS += $(CFG_CXXFLAGS_SRC)
|
2006-08-26 13:35:28 +02:00
|
|
|
endif
|
2020-02-01 01:13:55 +01:00
|
|
|
LDFLAGS += $(CFG_LDFLAGS_SRC)
|
2017-11-02 23:02:11 +01:00
|
|
|
|
2025-06-24 23:58:55 +02:00
|
|
|
CPPFLAGSWALL = $(CPPFLAGS)
|
2015-02-11 04:38:05 +01:00
|
|
|
CPPFLAGSPARSER = $(CPPFLAGS) $(CFG_CXXFLAGS_PARSER)
|
2006-08-26 13:35:28 +02:00
|
|
|
|
2008-03-18 21:26:37 +01:00
|
|
|
# Allow RPM builds to specify hardcoded data directories
|
|
|
|
|
# To do this:
|
2008-03-28 20:42:14 +01:00
|
|
|
ifeq ($(CFG_WITH_DEFENV),yes)
|
2025-06-24 23:58:55 +02:00
|
|
|
CPPFLAGS += -DDEFENV_SYSTEMC=\"$(SYSTEMC)\"
|
|
|
|
|
CPPFLAGS += -DDEFENV_SYSTEMC_ARCH=\"$(SYSTEMC_ARCH)\"
|
|
|
|
|
CPPFLAGS += -DDEFENV_SYSTEMC_INCLUDE=\"$(SYSTEMC_INCLUDE)\"
|
|
|
|
|
CPPFLAGS += -DDEFENV_SYSTEMC_LIBDIR=\"$(SYSTEMC_LIBDIR)\"
|
|
|
|
|
ifeq ($(VERILATOR_ROOT),) # Use what we're given, or intuit
|
|
|
|
|
CPPFLAGS += -DDEFENV_VERILATOR_ROOT=\"$(pkgdatadir)\"
|
|
|
|
|
else
|
|
|
|
|
CPPFLAGS += -DDEFENV_VERILATOR_ROOT=\"$(VERILATOR_ROOT)\"
|
|
|
|
|
endif
|
|
|
|
|
ifneq ($(CFG_WITH_SOLVER),no)
|
|
|
|
|
CPPFLAGS += -DDEFENV_VERILATOR_SOLVER='"$(CFG_WITH_SOLVER)"'
|
|
|
|
|
else
|
|
|
|
|
ifneq ($(VERILATOR_SOLVER),)
|
|
|
|
|
CPPFLAGS += -DDEFENV_VERILATOR_SOLVER='"$(VERILATOR_SOLVER)"'
|
|
|
|
|
endif
|
2024-05-17 16:38:34 +02:00
|
|
|
endif
|
2008-03-18 21:26:37 +01:00
|
|
|
endif
|
|
|
|
|
|
2006-08-26 13:35:28 +02:00
|
|
|
HEADERS = $(wildcard V*.h v*.h)
|
|
|
|
|
|
|
|
|
|
ASTGEN = $(srcdir)/astgen
|
2008-08-06 18:35:34 +02:00
|
|
|
BISONPRE = $(srcdir)/bisonpre
|
2010-02-27 01:50:44 +01:00
|
|
|
FLEXFIX = $(srcdir)/flexfix
|
2014-11-24 03:06:10 +01:00
|
|
|
VLCOVGEN = $(srcdir)/vlcovgen
|
2006-08-26 13:35:28 +02:00
|
|
|
|
2024-12-01 17:35:00 +01:00
|
|
|
# BISON_DEBUG = -Wcounterexamples
|
|
|
|
|
|
2023-10-18 04:49:28 +02:00
|
|
|
######################################################################
|
|
|
|
|
# CCACHE flags (via environment as no command line option available)
|
|
|
|
|
CCACHE_SLOPPINESS ?= pch_defines,time_macros
|
|
|
|
|
export CCACHE_SLOPPINESS
|
|
|
|
|
|
2006-08-26 13:35:28 +02:00
|
|
|
######################################################################
|
|
|
|
|
#### Top level
|
|
|
|
|
|
|
|
|
|
all: make_info $(TGT)
|
|
|
|
|
|
|
|
|
|
make_info:
|
2019-07-06 19:02:36 +02:00
|
|
|
@echo " Compile flags: " $(CXX) ${CFLAGS} ${CXXFLAGS} ${CPPFLAGS}
|
2006-08-26 13:35:28 +02:00
|
|
|
|
|
|
|
|
clean mostlyclean distclean maintainer-clean::
|
2020-12-23 21:41:14 +01:00
|
|
|
-rm -f *.o *.d *_gen_*
|
2006-08-26 13:35:28 +02:00
|
|
|
-rm -f *__gen*
|
|
|
|
|
-rm -f obj_* .objcache*
|
|
|
|
|
|
|
|
|
|
distclean maintainer-clean:: clean
|
|
|
|
|
|
|
|
|
|
maintainer-clean::
|
|
|
|
|
|
|
|
|
|
maintainer-copy::
|
|
|
|
|
|
|
|
|
|
#### Top executable
|
|
|
|
|
|
|
|
|
|
RAW_OBJS = \
|
2025-06-24 23:58:55 +02:00
|
|
|
V3Const__gen.o \
|
|
|
|
|
V3Error.o \
|
|
|
|
|
V3FileLine.o \
|
|
|
|
|
V3Graph.o \
|
|
|
|
|
V3GraphAcyc.o \
|
|
|
|
|
V3GraphAlg.o \
|
|
|
|
|
V3GraphPathChecker.o \
|
|
|
|
|
V3GraphTest.o \
|
|
|
|
|
V3Hash.o \
|
|
|
|
|
V3OptionParser.o \
|
|
|
|
|
V3Os.o \
|
|
|
|
|
V3ParseGrammar.o \
|
|
|
|
|
V3ParseImp.o \
|
|
|
|
|
V3ParseLex.o \
|
|
|
|
|
V3PreProc.o \
|
|
|
|
|
V3PreShell.o \
|
|
|
|
|
V3String.o \
|
|
|
|
|
V3ThreadPool.o \
|
|
|
|
|
V3Waiver.o \
|
|
|
|
|
Verilator.o \
|
2023-10-18 04:49:28 +02:00
|
|
|
|
|
|
|
|
RAW_OBJS_PCH_ASTMT = \
|
2025-06-24 23:58:55 +02:00
|
|
|
V3Ast.o \
|
|
|
|
|
V3AstNodes.o \
|
|
|
|
|
V3Broken.o \
|
2025-06-28 02:38:01 +02:00
|
|
|
V3Control.o \
|
2025-06-24 23:58:55 +02:00
|
|
|
V3EmitCBase.o \
|
|
|
|
|
V3EmitCConstPool.o \
|
|
|
|
|
V3EmitCFunc.o \
|
|
|
|
|
V3EmitCHeaders.o \
|
|
|
|
|
V3EmitCImp.o \
|
|
|
|
|
V3EmitCInlines.o \
|
|
|
|
|
V3EmitCPch.o \
|
|
|
|
|
V3EmitV.o \
|
|
|
|
|
V3File.o \
|
|
|
|
|
V3FuncOpt.o \
|
|
|
|
|
V3Global.o \
|
|
|
|
|
V3Hasher.o \
|
|
|
|
|
V3Number.o \
|
|
|
|
|
V3Options.o \
|
|
|
|
|
V3Stats.o \
|
|
|
|
|
V3StatsReport.o \
|
|
|
|
|
V3VariableOrder.o \
|
2023-10-18 04:49:28 +02:00
|
|
|
|
|
|
|
|
RAW_OBJS_PCH_ASTNOMT = \
|
2025-06-24 23:58:55 +02:00
|
|
|
V3Active.o \
|
|
|
|
|
V3ActiveTop.o \
|
|
|
|
|
V3Assert.o \
|
|
|
|
|
V3AssertPre.o \
|
|
|
|
|
V3Begin.o \
|
|
|
|
|
V3Branch.o \
|
|
|
|
|
V3CCtors.o \
|
|
|
|
|
V3CUse.o \
|
|
|
|
|
V3Case.o \
|
|
|
|
|
V3Cast.o \
|
Optimize complex combinational logic in DFG (#6298)
This patch adds DfgLogic, which is a vertex that represents a whole,
arbitrarily complex combinational AstAlways or AstAssignW in the
DfgGraph.
Implementing this requires computing the variables live at entry to the
AstAlways (variables read by the block), so there is a new
ControlFlowGraph data structure and a classical data-flow analysis based
live variable analysis to do that at the variable level (as opposed to
bit/element level).
The actual CFG construction and live variable analysis is best effort,
and might fail for currently unhandled constructs or data types. This
can be extended later.
V3DfgAstToDfg is changed to convert the Ast into an initial DfgGraph
containing only DfgLogic, DfgVertexSplice and DfgVertexVar vertices.
The DfgLogic are then subsequently synthesized into primitive operations
by the new V3DfgSynthesize pass, which is a combination of the old
V3DfgAstToDfg conversion and new code to handle AstAlways blocks with
complex flow control.
V3DfgSynthesize by default will synthesize roughly the same constructs
as V3DfgAstToDfg used to handle before, plus any logic that is part of a
combinational cycle within the DfgGraph. This enables breaking up these
cycles, for which there are extensions to V3DfgBreakCycles in this patch
as well. V3DfgSynthesize will then delete all non synthesized or non
synthesizable DfgLogic vertices and the rest of the Dfg pipeline is
identical, with minor changes to adjust for the changed representation.
Because with this change we can now eliminate many more UNOPTFLAT, DFG
has been disabled in all the tests that specifically target testing the
scheduling and reporting of circular combinational logic.
2025-08-19 16:06:38 +02:00
|
|
|
V3Cfg.o \
|
|
|
|
|
V3CfgBuilder.o \
|
|
|
|
|
V3CfgLiveVariables.o \
|
2025-06-24 23:58:55 +02:00
|
|
|
V3Class.o \
|
|
|
|
|
V3Clean.o \
|
|
|
|
|
V3Clock.o \
|
|
|
|
|
V3Combine.o \
|
|
|
|
|
V3Common.o \
|
|
|
|
|
V3Coverage.o \
|
|
|
|
|
V3CoverageJoin.o \
|
|
|
|
|
V3Dead.o \
|
|
|
|
|
V3Delayed.o \
|
|
|
|
|
V3Depth.o \
|
|
|
|
|
V3DepthBlock.o \
|
|
|
|
|
V3Descope.o \
|
|
|
|
|
V3Dfg.o \
|
|
|
|
|
V3DfgAstToDfg.o \
|
2025-07-10 19:46:45 +02:00
|
|
|
V3DfgBreakCycles.o \
|
2025-06-24 23:58:55 +02:00
|
|
|
V3DfgCache.o \
|
2025-08-05 14:03:30 +02:00
|
|
|
V3DfgColorSCCs.o \
|
2025-09-03 18:34:55 +02:00
|
|
|
V3DfgCse.o \
|
2025-09-07 21:38:50 +02:00
|
|
|
V3DfgDataType.o \
|
2025-06-24 23:58:55 +02:00
|
|
|
V3DfgDecomposition.o \
|
|
|
|
|
V3DfgDfgToAst.o \
|
|
|
|
|
V3DfgOptimizer.o \
|
|
|
|
|
V3DfgPasses.o \
|
|
|
|
|
V3DfgPeephole.o \
|
|
|
|
|
V3DfgRegularize.o \
|
Optimize complex combinational logic in DFG (#6298)
This patch adds DfgLogic, which is a vertex that represents a whole,
arbitrarily complex combinational AstAlways or AstAssignW in the
DfgGraph.
Implementing this requires computing the variables live at entry to the
AstAlways (variables read by the block), so there is a new
ControlFlowGraph data structure and a classical data-flow analysis based
live variable analysis to do that at the variable level (as opposed to
bit/element level).
The actual CFG construction and live variable analysis is best effort,
and might fail for currently unhandled constructs or data types. This
can be extended later.
V3DfgAstToDfg is changed to convert the Ast into an initial DfgGraph
containing only DfgLogic, DfgVertexSplice and DfgVertexVar vertices.
The DfgLogic are then subsequently synthesized into primitive operations
by the new V3DfgSynthesize pass, which is a combination of the old
V3DfgAstToDfg conversion and new code to handle AstAlways blocks with
complex flow control.
V3DfgSynthesize by default will synthesize roughly the same constructs
as V3DfgAstToDfg used to handle before, plus any logic that is part of a
combinational cycle within the DfgGraph. This enables breaking up these
cycles, for which there are extensions to V3DfgBreakCycles in this patch
as well. V3DfgSynthesize will then delete all non synthesized or non
synthesizable DfgLogic vertices and the rest of the Dfg pipeline is
identical, with minor changes to adjust for the changed representation.
Because with this change we can now eliminate many more UNOPTFLAT, DFG
has been disabled in all the tests that specifically target testing the
scheduling and reporting of circular combinational logic.
2025-08-19 16:06:38 +02:00
|
|
|
V3DfgSynthesize.o \
|
2025-06-24 23:58:55 +02:00
|
|
|
V3DiagSarif.o \
|
|
|
|
|
V3DupFinder.o \
|
|
|
|
|
V3EmitCMain.o \
|
|
|
|
|
V3EmitCMake.o \
|
|
|
|
|
V3EmitCModel.o \
|
|
|
|
|
V3EmitCSyms.o \
|
|
|
|
|
V3EmitMk.o \
|
|
|
|
|
V3EmitMkJson.o \
|
|
|
|
|
V3EmitXml.o \
|
|
|
|
|
V3ExecGraph.o \
|
|
|
|
|
V3Expand.o \
|
|
|
|
|
V3Force.o \
|
|
|
|
|
V3Fork.o \
|
|
|
|
|
V3Gate.o \
|
|
|
|
|
V3HierBlock.o \
|
|
|
|
|
V3Inline.o \
|
|
|
|
|
V3Inst.o \
|
|
|
|
|
V3InstrCount.o \
|
|
|
|
|
V3Interface.o \
|
|
|
|
|
V3Life.o \
|
|
|
|
|
V3LifePost.o \
|
|
|
|
|
V3LinkCells.o \
|
|
|
|
|
V3LinkDot.o \
|
|
|
|
|
V3LinkInc.o \
|
|
|
|
|
V3LinkJump.o \
|
|
|
|
|
V3LinkLValue.o \
|
|
|
|
|
V3LinkLevel.o \
|
|
|
|
|
V3LinkParse.o \
|
|
|
|
|
V3LinkResolve.o \
|
|
|
|
|
V3Localize.o \
|
|
|
|
|
V3MergeCond.o \
|
|
|
|
|
V3Name.o \
|
|
|
|
|
V3Order.o \
|
|
|
|
|
V3OrderGraphBuilder.o \
|
|
|
|
|
V3OrderMoveGraph.o \
|
|
|
|
|
V3OrderParallel.o \
|
|
|
|
|
V3OrderProcessDomains.o \
|
|
|
|
|
V3OrderSerial.o \
|
|
|
|
|
V3Param.o \
|
|
|
|
|
V3Premit.o \
|
|
|
|
|
V3ProtectLib.o \
|
|
|
|
|
V3Randomize.o \
|
|
|
|
|
V3Reloop.o \
|
|
|
|
|
V3Sampled.o \
|
|
|
|
|
V3Sched.o \
|
|
|
|
|
V3SchedAcyclic.o \
|
|
|
|
|
V3SchedPartition.o \
|
|
|
|
|
V3SchedReplicate.o \
|
|
|
|
|
V3SchedTiming.o \
|
|
|
|
|
V3SchedVirtIface.o \
|
|
|
|
|
V3Scope.o \
|
|
|
|
|
V3Scoreboard.o \
|
|
|
|
|
V3Slice.o \
|
|
|
|
|
V3Split.o \
|
|
|
|
|
V3SplitAs.o \
|
|
|
|
|
V3SplitVar.o \
|
|
|
|
|
V3StackCount.o \
|
|
|
|
|
V3Subst.o \
|
|
|
|
|
V3TSP.o \
|
|
|
|
|
V3Table.o \
|
|
|
|
|
V3Task.o \
|
|
|
|
|
V3Timing.o \
|
|
|
|
|
V3Trace.o \
|
|
|
|
|
V3TraceDecl.o \
|
|
|
|
|
V3Tristate.o \
|
|
|
|
|
V3Udp.o \
|
|
|
|
|
V3Undriven.o \
|
|
|
|
|
V3Unknown.o \
|
|
|
|
|
V3Unroll.o \
|
|
|
|
|
V3Width.o \
|
|
|
|
|
V3WidthCommit.o \
|
|
|
|
|
V3WidthSel.o \
|
2006-08-26 13:35:28 +02:00
|
|
|
|
2014-11-24 03:06:10 +01:00
|
|
|
# verilator_coverage
|
|
|
|
|
VLCOV_OBJS = \
|
2025-06-24 23:58:55 +02:00
|
|
|
VlcMain.o \
|
2014-11-24 03:06:10 +01:00
|
|
|
|
2022-01-08 17:18:23 +01:00
|
|
|
NON_STANDALONE_HEADERS = \
|
2025-06-24 23:58:55 +02:00
|
|
|
V3AstInlines.h \
|
|
|
|
|
V3AstNodeDType.h \
|
|
|
|
|
V3AstNodeExpr.h \
|
|
|
|
|
V3AstNodeOther.h \
|
2025-08-16 10:46:18 +02:00
|
|
|
V3AstNodeStmt.h \
|
2025-06-24 23:58:55 +02:00
|
|
|
V3DfgVertices.h \
|
|
|
|
|
V3ThreadPool.h \
|
|
|
|
|
V3WidthRemove.h \
|
2022-01-08 17:18:23 +01:00
|
|
|
|
2022-09-15 14:10:39 +02:00
|
|
|
AST_DEFS := \
|
2025-06-24 23:58:55 +02:00
|
|
|
V3AstNodeDType.h \
|
|
|
|
|
V3AstNodeExpr.h \
|
|
|
|
|
V3AstNodeOther.h \
|
2025-08-16 10:46:18 +02:00
|
|
|
V3AstNodeStmt.h \
|
2022-09-15 14:10:39 +02:00
|
|
|
|
2022-10-04 12:03:41 +02:00
|
|
|
DFG_DEFS := \
|
2025-06-24 23:58:55 +02:00
|
|
|
V3DfgVertices.h
|
2022-10-04 12:03:41 +02:00
|
|
|
|
|
|
|
|
#### astgen common flags
|
|
|
|
|
|
|
|
|
|
ASTGENFLAGS = -I $(srcdir)
|
|
|
|
|
ASTGENFLAGS += $(foreach f,$(AST_DEFS),--astdef $f)
|
|
|
|
|
ASTGENFLAGS += $(foreach f,$(DFG_DEFS),--dfgdef $f)
|
|
|
|
|
|
2006-08-26 13:35:28 +02:00
|
|
|
#### Linking
|
|
|
|
|
|
2014-11-24 03:06:10 +01:00
|
|
|
ifeq ($(VL_VLCOV),)
|
2025-06-24 23:58:55 +02:00
|
|
|
PREDEP_H = V3Ast__gen_forward_class_decls.h
|
|
|
|
|
OBJS += $(RAW_OBJS) $(RAW_OBJS_PCH_ASTMT) $(RAW_OBJS_PCH_ASTNOMT)
|
2006-08-26 13:35:28 +02:00
|
|
|
else
|
2025-06-24 23:58:55 +02:00
|
|
|
PREDEP_H =
|
|
|
|
|
OBJS += $(VLCOV_OBJS)
|
2006-08-26 13:35:28 +02:00
|
|
|
endif
|
|
|
|
|
|
2014-11-24 03:06:10 +01:00
|
|
|
$(TGT): $(PREDEP_H) $(OBJS)
|
2006-08-26 13:35:28 +02:00
|
|
|
@echo " Linking $@..."
|
|
|
|
|
${LINK} ${LDFLAGS} -o $@ $(OBJS) $(CCMALLOC) ${LIBS}
|
|
|
|
|
|
|
|
|
|
#### Modules
|
|
|
|
|
|
2023-01-30 04:39:22 +01:00
|
|
|
%__gen.cpp: %.cpp $(ASTGEN) $(AST_DEFS) $(DFG_DEFS)
|
2022-10-04 12:03:41 +02:00
|
|
|
$(PYTHON3) $(ASTGEN) $(ASTGENFLAGS) $*.cpp
|
2006-08-26 13:35:28 +02:00
|
|
|
|
2022-12-16 01:53:51 +01:00
|
|
|
.SECONDARY:
|
2022-12-16 01:26:54 +01:00
|
|
|
|
2023-10-18 04:49:28 +02:00
|
|
|
%.gch: %
|
2024-10-24 13:53:11 +02:00
|
|
|
$(OBJCACHE) ${CXX} ${CXXFLAGS} ${CPPFLAGSWALL} ${CFG_CXXFLAGS_PCH} -c $< -o $@
|
2023-01-30 04:39:22 +01:00
|
|
|
%.o: %.cpp
|
2020-05-28 23:39:20 +02:00
|
|
|
$(OBJCACHE) ${CXX} ${CXXFLAGS} ${CPPFLAGSWALL} -c $< -o $@
|
2023-01-30 04:39:22 +01:00
|
|
|
%.o: %.c
|
2020-05-28 23:39:20 +02:00
|
|
|
$(OBJCACHE) ${CC} ${CFLAGS} ${CPPFLAGSWALL} -c $< -o $@
|
2006-08-26 13:35:28 +02:00
|
|
|
|
2023-01-30 04:39:22 +01:00
|
|
|
V3ParseLex.o: V3ParseLex.cpp V3Lexer.yy.cpp V3ParseBison.c
|
2020-05-28 23:39:20 +02:00
|
|
|
$(OBJCACHE) ${CXX} ${CXXFLAGS} ${CPPFLAGSPARSER} -c $< -o $@
|
2006-08-26 13:35:28 +02:00
|
|
|
|
2023-01-30 04:39:22 +01:00
|
|
|
V3ParseGrammar.o: V3ParseGrammar.cpp V3ParseBison.c
|
2020-05-28 23:39:20 +02:00
|
|
|
$(OBJCACHE) ${CXX} ${CXXFLAGS} ${CPPFLAGSPARSER} -c $< -o $@
|
2009-10-31 15:08:38 +01:00
|
|
|
|
2023-01-30 04:39:22 +01:00
|
|
|
V3ParseImp.o: V3ParseImp.cpp V3ParseBison.c
|
2020-05-28 23:39:20 +02:00
|
|
|
$(OBJCACHE) ${CXX} ${CXXFLAGS} ${CPPFLAGSPARSER} -c $< -o $@
|
2006-08-26 13:35:28 +02:00
|
|
|
|
2023-01-30 04:39:22 +01:00
|
|
|
V3PreProc.o: V3PreProc.cpp V3PreLex.yy.cpp
|
2020-05-28 23:39:20 +02:00
|
|
|
$(OBJCACHE) ${CXX} ${CXXFLAGS} ${CPPFLAGSPARSER} -c $< -o $@
|
2006-08-26 13:35:28 +02:00
|
|
|
|
2023-10-18 04:49:28 +02:00
|
|
|
define CXX_ASTMT_template
|
|
|
|
|
$(1): $(basename $(1)).cpp V3PchAstMT.h.gch
|
|
|
|
|
$(OBJCACHE) ${CXX} ${CXXFLAGS} ${CPPFLAGSWALL} ${CFG_CXXFLAGS_PCH_I} V3PchAstMT.h${CFG_GCH_IF_CLANG} -c $(srcdir)/$(basename $(1)).cpp -o $(1)
|
|
|
|
|
|
|
|
|
|
endef
|
|
|
|
|
|
|
|
|
|
$(foreach obj,$(RAW_OBJS_PCH_ASTMT),$(eval $(call CXX_ASTMT_template,$(obj))))
|
|
|
|
|
|
|
|
|
|
define CXX_ASTNOMT_template
|
|
|
|
|
$(1): $(basename $(1)).cpp V3PchAstNoMT.h.gch
|
|
|
|
|
$(OBJCACHE) ${CXX} ${CXXFLAGS} ${CPPFLAGSWALL} ${CFG_CXXFLAGS_PCH_I} V3PchAstNoMT.h${CFG_GCH_IF_CLANG} -c $(srcdir)/$(basename $(1)).cpp -o $(1)
|
|
|
|
|
|
|
|
|
|
endef
|
|
|
|
|
|
|
|
|
|
$(foreach obj,$(RAW_OBJS_PCH_ASTNOMT),$(eval $(call CXX_ASTNOMT_template,$(obj))))
|
|
|
|
|
|
2006-08-26 13:35:28 +02:00
|
|
|
#### Generated files
|
|
|
|
|
|
|
|
|
|
# Target rule called before parallel build to make generated files
|
2022-10-04 12:03:41 +02:00
|
|
|
serial:: V3Ast__gen_forward_class_decls.h V3ParseBison.c
|
2006-08-26 13:35:28 +02:00
|
|
|
|
2014-11-24 03:06:10 +01:00
|
|
|
serial_vlcov:: vlcovgen.d
|
|
|
|
|
|
2016-11-19 03:13:56 +01:00
|
|
|
vlcovgen.d: $(VLCOVGEN) $(srcdir)/../include/verilated_cov_key.h
|
2021-01-28 21:01:33 +01:00
|
|
|
$(PYTHON3) $(VLCOVGEN) --srcdir $(srcdir)
|
2014-11-24 03:06:10 +01:00
|
|
|
touch $@
|
|
|
|
|
|
2022-10-04 12:03:41 +02:00
|
|
|
V3Ast__gen_forward_class_decls.h: $(ASTGEN) $(AST_DEFS) $(DFG_DEFS)
|
|
|
|
|
$(PYTHON3) $(ASTGEN) $(ASTGENFLAGS) --classes
|
2006-08-26 13:35:28 +02:00
|
|
|
|
2009-05-05 03:54:44 +02:00
|
|
|
V3ParseBison.h: V3ParseBison.c
|
2008-05-06 17:45:41 +02:00
|
|
|
|
|
|
|
|
# Have only one output file in this rule to prevent parallel make issues
|
2009-05-08 00:28:05 +02:00
|
|
|
V3ParseBison.c: verilog.y $(BISONPRE)
|
2006-08-26 13:35:28 +02:00
|
|
|
@echo "If you get errors from verilog.y below, try upgrading bison to version 1.875 or newer."
|
2024-12-01 17:35:00 +01:00
|
|
|
$(PYTHON3) $(BISONPRE) --yacc ${YACC} -d -v -o V3ParseBison.c $(BISON_DEBUG) $<
|
2006-08-26 13:35:28 +02:00
|
|
|
|
2023-01-30 04:39:22 +01:00
|
|
|
V3Lexer_pregen.yy.cpp: verilog.l V3ParseBison.h $(HEADERS)
|
2009-04-09 03:47:48 +02:00
|
|
|
${LEX} --version
|
2006-08-26 13:35:28 +02:00
|
|
|
${LEX} ${LFLAGS} -o$@ $<
|
|
|
|
|
|
2023-01-30 04:39:22 +01:00
|
|
|
V3Lexer.yy.cpp: V3Lexer_pregen.yy.cpp $(FLEXFIX)
|
2020-12-23 21:41:14 +01:00
|
|
|
$(PYTHON3) $(FLEXFIX) V3Lexer <$< >$@
|
2006-08-26 13:35:28 +02:00
|
|
|
|
2023-01-30 04:39:22 +01:00
|
|
|
V3PreLex_pregen.yy.cpp: V3PreLex.l $(HEADERS)
|
2009-04-09 03:47:48 +02:00
|
|
|
${LEX} --version
|
2006-08-26 13:35:28 +02:00
|
|
|
${LEX} ${LFLAGS} -o$@ $<
|
|
|
|
|
|
2010-02-27 01:50:44 +01:00
|
|
|
V3PreLex.yy.cpp: V3PreLex_pregen.yy.cpp $(FLEXFIX)
|
2021-02-26 03:19:37 +01:00
|
|
|
$(PYTHON3) $(FLEXFIX) V3PreLex <$< >$@
|
2006-08-26 13:35:28 +02:00
|
|
|
|
2022-01-08 17:18:23 +01:00
|
|
|
# For t_dist_header_cc
|
|
|
|
|
HEADER_CC_H := $(filter-out $(NON_STANDALONE_HEADERS), $(notdir $(wildcard $(srcdir)/*.h)))
|
|
|
|
|
|
|
|
|
|
.PHONY: header_cc
|
|
|
|
|
header_cc: $(addsuffix __header_cc.o, $(basename $(HEADER_CC_H)))
|
|
|
|
|
|
|
|
|
|
%__header_cc.cpp: %.h
|
2023-09-25 04:12:23 +02:00
|
|
|
$(PYTHON3) $(srcdir)/../bin/verilator_includer -DVL_MT_DISABLED_CODE_UNIT=1 $^ > $@
|
2022-01-08 17:18:23 +01:00
|
|
|
|
2015-11-28 23:33:01 +01:00
|
|
|
.SUFFIXES:
|
|
|
|
|
|
2006-08-26 13:35:28 +02:00
|
|
|
######################################################################
|
|
|
|
|
######################################################################
|
|
|
|
|
|
|
|
|
|
DEPS := $(wildcard *.d)
|
|
|
|
|
ifneq ($(DEPS),)
|
2025-06-24 23:58:55 +02:00
|
|
|
include $(DEPS)
|
2006-08-26 13:35:28 +02:00
|
|
|
endif
|