Internals: Make all .h files compilable

This commit is contained in:
Wilson Snyder 2022-01-08 11:18:23 -05:00
parent 78147ee8d7
commit 441ecfedc9
72 changed files with 124 additions and 133 deletions

View File

@ -75,7 +75,9 @@ VPATH += . $(bldsrc) $(srcdir)
TGT = ../../verilator_bin$(EXEEXT)
#################
ifeq ($(VL_DEBUG),)
ifeq ($(VL_NOOPT),1)
CPPFLAGS += -O0
else ifeq ($(VL_DEBUG),)
# Optimize
CPPFLAGS += -O2
else
@ -272,6 +274,11 @@ NC_OBJS += \
VLCOV_OBJS = \
VlcMain.o \
NON_STANDALONE_HEADERS = \
V3AstInlines.h \
V3AstNodes.h \
V3WidthCommit.h \
#### Linking
ifeq ($(VL_VLCOV),)
@ -349,6 +356,15 @@ V3PreLex_pregen.yy.cpp: V3PreLex.l $(HEADERS)
V3PreLex.yy.cpp: V3PreLex_pregen.yy.cpp $(FLEXFIX)
$(PYTHON3) $(FLEXFIX) V3PreLex <$< >$@
# 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
$(PERL) $(srcdir)/../bin/verilator_includer $^ > $@
.SUFFIXES:
######################################################################

View File

@ -20,8 +20,7 @@
#include "config_build.h"
#include "verilatedos.h"
#include "V3Error.h"
#include "V3Ast.h"
class AstNetlist;
//============================================================================

View File

@ -20,8 +20,7 @@
#include "config_build.h"
#include "verilatedos.h"
#include "V3Error.h"
#include "V3Ast.h"
class AstNetlist;
//============================================================================

View File

@ -22,6 +22,7 @@
#include "V3Global.h"
#include "V3AssertPre.h"
#include "V3Ast.h"
//######################################################################
// Assert class functions

View File

@ -20,8 +20,7 @@
#include "config_build.h"
#include "verilatedos.h"
#include "V3Error.h"
#include "V3Ast.h"
class AstNetlist;
//============================================================================

View File

@ -20,8 +20,7 @@
#include "config_build.h"
#include "verilatedos.h"
#include "V3Error.h"
#include "V3Ast.h"
class AstNetlist;
//============================================================================

View File

@ -20,8 +20,7 @@
#include "config_build.h"
#include "verilatedos.h"
#include "V3Error.h"
#include "V3Ast.h"
class AstNetlist;
//============================================================================

View File

@ -23,8 +23,8 @@
//============================================================================
// Forward declare so we can include this in V3Ast.h
class AstNode;
class AstNetlist;
class AstNode;
class V3Broken final {
public:

View File

@ -20,9 +20,6 @@
#include "config_build.h"
#include "verilatedos.h"
#include "V3Error.h"
#include "V3Ast.h"
//============================================================================
class V3CCtors final {

View File

@ -20,9 +20,6 @@
#include "config_build.h"
#include "verilatedos.h"
#include "V3Error.h"
#include "V3Ast.h"
//============================================================================
class V3CUse final {

View File

@ -20,8 +20,8 @@
#include "config_build.h"
#include "verilatedos.h"
#include "V3Error.h"
#include "V3Ast.h"
class AstNetlist;
class AstNodeCase;
//============================================================================

View File

@ -20,8 +20,7 @@
#include "config_build.h"
#include "verilatedos.h"
#include "V3Error.h"
#include "V3Ast.h"
class AstNetlist;
//============================================================================

View File

@ -20,8 +20,7 @@
#include "config_build.h"
#include "verilatedos.h"
#include "V3Error.h"
#include "V3Ast.h"
class AstNetlist;
//============================================================================

View File

@ -20,8 +20,7 @@
#include "config_build.h"
#include "verilatedos.h"
#include "V3Error.h"
#include "V3Ast.h"
class AstNetlist;
//============================================================================

View File

@ -20,8 +20,7 @@
#include "config_build.h"
#include "verilatedos.h"
#include "V3Error.h"
#include "V3Ast.h"
class AstNetlist;
//============================================================================

View File

@ -20,8 +20,7 @@
#include "config_build.h"
#include "verilatedos.h"
#include "V3Error.h"
#include "V3Ast.h"
class AstNetlist;
//============================================================================

View File

@ -20,8 +20,7 @@
#include "config_build.h"
#include "verilatedos.h"
#include "V3Error.h"
#include "V3Ast.h"
class AstNetlist;
//============================================================================

View File

@ -20,8 +20,7 @@
#include "config_build.h"
#include "verilatedos.h"
#include "V3Error.h"
#include "V3Ast.h"
class AstNetlist;
//============================================================================

View File

@ -20,8 +20,8 @@
#include "config_build.h"
#include "verilatedos.h"
#include "V3Error.h"
#include "V3Ast.h"
class AstNetlist;
class AstNode;
//============================================================================

View File

@ -20,8 +20,7 @@
#include "config_build.h"
#include "verilatedos.h"
#include "V3Error.h"
#include "V3Ast.h"
class AstNetlist;
//============================================================================

View File

@ -20,8 +20,7 @@
#include "config_build.h"
#include "verilatedos.h"
#include "V3Error.h"
#include "V3Ast.h"
class AstNetlist;
//============================================================================

View File

@ -20,8 +20,7 @@
#include "config_build.h"
#include "verilatedos.h"
#include "V3Error.h"
#include "V3Ast.h"
class AstNetlist;
//============================================================================

View File

@ -20,8 +20,7 @@
#include "config_build.h"
#include "verilatedos.h"
#include "V3Error.h"
#include "V3Ast.h"
class AstNetlist;
//============================================================================

View File

@ -20,8 +20,7 @@
#include "config_build.h"
#include "verilatedos.h"
#include "V3Error.h"
#include "V3Ast.h"
class AstNetlist;
//============================================================================

View File

@ -20,8 +20,7 @@
#include "config_build.h"
#include "verilatedos.h"
#include "V3Error.h"
#include "V3Ast.h"
class AstNetlist;
//============================================================================

View File

@ -20,8 +20,7 @@
#include "config_build.h"
#include "verilatedos.h"
#include "V3Error.h"
#include "V3Ast.h"
class AstNetlist;
//============================================================================

View File

@ -20,9 +20,6 @@
#include "config_build.h"
#include "verilatedos.h"
#include "V3Error.h"
#include "V3Ast.h"
//============================================================================
class V3EmitC final {

View File

@ -20,8 +20,8 @@
#include "config_build.h"
#include "verilatedos.h"
#include "V3Error.h"
#include "V3Ast.h"
class AstNode;
class AstSenTree;
//============================================================================

View File

@ -20,9 +20,6 @@
#include "config_build.h"
#include "verilatedos.h"
#include "V3Error.h"
#include "V3Ast.h"
//============================================================================
class V3EmitXml final {

View File

@ -20,8 +20,7 @@
#include "config_build.h"
#include "verilatedos.h"
#include "V3Error.h"
#include "V3Ast.h"
class AstNetlist;
//============================================================================

View File

@ -21,8 +21,7 @@
#include "config_build.h"
#include "verilatedos.h"
#include "V3Error.h"
#include "V3Ast.h"
class AstNetlist;
//============================================================================

View File

@ -20,8 +20,7 @@
#include "config_build.h"
#include "verilatedos.h"
#include "V3Error.h"
#include "V3Ast.h"
class AstNetlist;
//============================================================================

View File

@ -20,8 +20,7 @@
#include "config_build.h"
#include "verilatedos.h"
#include "V3Error.h"
#include "V3Ast.h"
class AstNetlist;
//============================================================================

View File

@ -32,8 +32,8 @@
#include <unordered_set>
#include <vector>
class AstNodeModule;
class AstNetlist;
class AstNodeModule;
class AstVar;
//######################################################################

View File

@ -20,8 +20,7 @@
#include "config_build.h"
#include "verilatedos.h"
#include "V3Error.h"
#include "V3Ast.h"
class AstNetlist;
//============================================================================

View File

@ -20,8 +20,10 @@
#include "config_build.h"
#include "verilatedos.h"
#include "V3Error.h"
#include "V3Ast.h"
class AstAssignW;
class AstCell;
class AstNetlist;
class AstPin;
//============================================================================

View File

@ -20,8 +20,7 @@
#include "config_build.h"
#include "verilatedos.h"
#include "V3Error.h"
#include "V3Ast.h"
class AstNetlist;
//============================================================================

View File

@ -20,8 +20,7 @@
#include "config_build.h"
#include "verilatedos.h"
#include "V3Error.h"
#include "V3Ast.h"
class AstNetlist;
//============================================================================

View File

@ -20,9 +20,7 @@
#include "config_build.h"
#include "verilatedos.h"
#include "V3Error.h"
#include "V3Ast.h"
class AstNetlist;
class VInFilter;
class V3ParseSym;

View File

@ -20,8 +20,7 @@
#include "config_build.h"
#include "verilatedos.h"
#include "V3Error.h"
#include "V3Ast.h"
class AstNetlist;
//============================================================================

View File

@ -20,8 +20,7 @@
#include "config_build.h"
#include "verilatedos.h"
#include "V3Error.h"
#include "V3Ast.h"
class AstNetlist;
//============================================================================

View File

@ -20,8 +20,8 @@
#include "config_build.h"
#include "verilatedos.h"
#include "V3Error.h"
#include "V3Ast.h"
class AstNetlist;
class AstNode;
//============================================================================

View File

@ -20,8 +20,7 @@
#include "config_build.h"
#include "verilatedos.h"
#include "V3Error.h"
#include "V3Ast.h"
class AstNetlist;
//============================================================================

View File

@ -20,8 +20,7 @@
#include "config_build.h"
#include "verilatedos.h"
#include "V3Error.h"
#include "V3Ast.h"
class AstNetlist;
//============================================================================

View File

@ -20,8 +20,7 @@
#include "config_build.h"
#include "verilatedos.h"
#include "V3Error.h"
#include "V3Ast.h"
class AstNetlist;
//============================================================================

View File

@ -20,8 +20,7 @@
#include "config_build.h"
#include "verilatedos.h"
#include "V3Error.h"
#include "V3Ast.h"
class AstNetlist;
//============================================================================

View File

@ -20,8 +20,7 @@
#include "config_build.h"
#include "verilatedos.h"
#include "V3Error.h"
#include "V3Ast.h"
class AstNetlist;
//============================================================================

View File

@ -20,7 +20,7 @@
#include "config_build.h"
#include "verilatedos.h"
#include "V3Global.h"
#include "V3Error.h"
#include "V3LangCode.h"
#include <map>

View File

@ -20,8 +20,7 @@
#include "config_build.h"
#include "verilatedos.h"
#include "V3Error.h"
#include "V3Ast.h"
class AstNetlist;
//============================================================================

View File

@ -20,8 +20,7 @@
#include "config_build.h"
#include "verilatedos.h"
#include "V3Error.h"
#include "V3Ast.h"
class AstNetlist;
//============================================================================

View File

@ -22,6 +22,7 @@
#include "V3Error.h"
#include "V3FileLine.h"
#include "V3Global.h"
#include <map>
#include <list>

View File

@ -20,8 +20,7 @@
#include "config_build.h"
#include "verilatedos.h"
#include "V3Error.h"
#include "V3Ast.h"
class AstNetlist;
//============================================================================

View File

@ -20,9 +20,6 @@
#include "config_build.h"
#include "verilatedos.h"
#include "V3Error.h"
#include "V3Ast.h"
//============================================================================
class V3ProtectLib final {

View File

@ -27,6 +27,7 @@
#include "config_build.h"
#include "verilatedos.h"
#include "V3Ast.h"
#include "V3Randomize.h"
//######################################################################

View File

@ -20,7 +20,9 @@
#include "config_build.h"
#include "verilatedos.h"
#include "V3Ast.h"
class AstClass;
class AstFunc;
class AstNetlist;
class V3Randomize final {
public:

View File

@ -20,8 +20,7 @@
#include "config_build.h"
#include "verilatedos.h"
#include "V3Error.h"
#include "V3Ast.h"
class AstNetlist;
//============================================================================

View File

@ -20,8 +20,7 @@
#include "config_build.h"
#include "verilatedos.h"
#include "V3Error.h"
#include "V3Ast.h"
class AstNetlist;
//============================================================================

View File

@ -20,8 +20,7 @@
#include "config_build.h"
#include "verilatedos.h"
#include "V3Error.h"
#include "V3Ast.h"
class AstNetlist;
//============================================================================

View File

@ -20,8 +20,7 @@
#include "config_build.h"
#include "verilatedos.h"
#include "V3Error.h"
#include "V3Ast.h"
class AstNetlist;
//============================================================================

View File

@ -20,8 +20,7 @@
#include "config_build.h"
#include "verilatedos.h"
#include "V3Error.h"
#include "V3Ast.h"
class AstNetlist;
//============================================================================

View File

@ -20,8 +20,7 @@
#include "config_build.h"
#include "verilatedos.h"
#include "V3Error.h"
#include "V3Ast.h"
class AstNetlist;
//============================================================================

View File

@ -20,8 +20,7 @@
#include "config_build.h"
#include "verilatedos.h"
#include "V3Error.h"
#include "V3Ast.h"
class AstNetlist;
//============================================================================

View File

@ -20,8 +20,7 @@
#include "config_build.h"
#include "verilatedos.h"
#include "V3Error.h"
#include "V3Ast.h"
class AstNetlist;
//============================================================================

View File

@ -20,8 +20,7 @@
#include "config_build.h"
#include "verilatedos.h"
#include "V3Error.h"
#include "V3Ast.h"
class AstNetlist;
//============================================================================

View File

@ -20,8 +20,7 @@
#include "config_build.h"
#include "verilatedos.h"
#include "V3Error.h"
#include "V3Ast.h"
class AstNetlist;
//============================================================================

View File

@ -20,8 +20,7 @@
#include "config_build.h"
#include "verilatedos.h"
#include "V3Error.h"
#include "V3Ast.h"
class AstNetlist;
//============================================================================

View File

@ -20,8 +20,7 @@
#include "config_build.h"
#include "verilatedos.h"
#include "V3Error.h"
#include "V3Ast.h"
class AstNetlist;
//============================================================================

View File

@ -20,8 +20,8 @@
#include "config_build.h"
#include "verilatedos.h"
#include "V3Error.h"
#include "V3Ast.h"
class AstNetlist;
class AstNode;
//============================================================================

View File

@ -31,6 +31,7 @@
#include "V3Global.h"
#include "V3Width.h"
#include "V3Ast.h"
#include "V3Const.h"
//######################################################################

View File

@ -20,6 +20,9 @@
#include "config_build.h"
#include "verilatedos.h"
#define V3ERROR_NO_GLOBAL_
#include "V3Error.h"
//********************************************************************
// VlcBuckets - Container of all coverage point hits for a given test
// This is a bitmap array - we store a single bit to indicate a test

View File

@ -20,12 +20,15 @@
#include "config_build.h"
#include "verilatedos.h"
#include "verilated_cov_key.h"
#include <vector>
#include <iomanip>
#include <map>
#include <unordered_map>
#define V3ERROR_NO_GLOBAL_
#include "V3Error.h"
#include "verilated_cov_key.h"
//********************************************************************
// VlcPoint - A coverage point (across all tests)

View File

@ -0,0 +1,26 @@
#!/usr/bin/env perl
if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); die; }
# DESCRIPTION: Verilator: Verilog Test driver/expect definition
#
# Copyright 2003 by Wilson Snyder. This program is free software; you
# can redistribute it and/or modify it under the terms of either the GNU
# Lesser General Public License Version 3 or the Perl Artistic License
# Version 2.0.
# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
use Cwd;
scenarios(dist => 1);
my $root = "..";
if (!-r "$root/.git") {
skip("Not in a git repository");
} else {
run(cmd => ["cd $root/src/obj_dbg && $ENV{MAKE} -j 4 -k -f ../Makefile_obj VL_NOOPT=1 header_cc"],
check_finished => 0);
}
ok(1);
1;