From 61c9866a1e1e8d5b7bf37377cdf34f7bcaca963c Mon Sep 17 00:00:00 2001 From: Geza Lore Date: Sat, 22 May 2021 11:13:02 +0100 Subject: [PATCH] Internals: Generate ASTGEN_SUPER_* macros instead of expanding. (#2975) astgen now generates ASTGEN_SUPER_* macros, instead of expanding the ASTGEN_SUPER itself. This means that V3AstNodes.h itself can be included in V3Ast.h, which helps IDEs (namely CLion) find definitions in V3AstNodes.h a lot better. Albeit this is a little bit more boilerplate, writing constructors of Ast nodes should be a lot rarer than trying to find their definitions, so hopefully this is an improvement overall. astgen will error if the developer calls the wrong superclass constructor. --- src/V3Ast.h | 2 +- src/V3AstNodes.cpp | 4 +- src/V3AstNodes.h | 843 ++++++++++++++++++++++----------------------- src/astgen | 27 +- 4 files changed, 439 insertions(+), 437 deletions(-) diff --git a/src/V3Ast.h b/src/V3Ast.h index 827b9649a..d915ff156 100644 --- a/src/V3Ast.h +++ b/src/V3Ast.h @@ -2916,7 +2916,7 @@ public: //###################################################################### -#include "V3AstNodes__gen.h" +#include "V3AstNodes.h" //###################################################################### // Inline AstNVisitor METHODS diff --git a/src/V3AstNodes.cpp b/src/V3AstNodes.cpp index a5c17b50a..4a6f99d6d 100644 --- a/src/V3AstNodes.cpp +++ b/src/V3AstNodes.cpp @@ -25,6 +25,8 @@ #include "V3String.h" #include "V3EmitCBase.h" +#include "V3AstNodes__gen_macros.h" // Generated by 'astgen' + #include #include @@ -214,7 +216,7 @@ AstNodeBiop* AstEqWild::newTyped(FileLine* fl, AstNode* lhsp, AstNode* rhsp) { } AstExecGraph::AstExecGraph(FileLine* fileline) - : AstNode{AstType::atExecGraph, fileline} { + : ASTGEN_SUPER_ExecGraph(fileline) { m_depGraphp = new V3Graph; } AstExecGraph::~AstExecGraph() { VL_DO_DANGLING(delete m_depGraphp, m_depGraphp); } diff --git a/src/V3AstNodes.h b/src/V3AstNodes.h index d88e700fe..8a2da1368 100644 --- a/src/V3AstNodes.h +++ b/src/V3AstNodes.h @@ -40,9 +40,9 @@ ASTNODE_NODE_FUNCS_NO_DTOR(name) //###################################################################### -// Macros replaced by 'astgen' +// Macros generated by 'astgen' -#define ASTGEN_SUPER(...) // Roughly: (AstType::at, ...) +#include "V3AstNodes__gen_macros.h" //###################################################################### //=== Ast* : Specific types @@ -66,96 +66,96 @@ private: public: AstConst(FileLine* fl, const V3Number& num) - : ASTGEN_SUPER(fl) + : ASTGEN_SUPER_Const(fl) , m_num(num) { initWithNumber(); } class WidthedValue {}; // for creator type-overload selection AstConst(FileLine* fl, WidthedValue, int width, uint32_t value) - : ASTGEN_SUPER(fl) + : ASTGEN_SUPER_Const(fl) , m_num(this, width, value) { initWithNumber(); } class DtypedValue {}; // for creator type-overload selection AstConst(FileLine* fl, DtypedValue, AstNodeDType* nodedtypep, uint32_t value) - : ASTGEN_SUPER(fl) + : ASTGEN_SUPER_Const(fl) , m_num(this, nodedtypep->width(), value, nodedtypep->widthSized()) { initWithNumber(); } class StringToParse {}; // for creator type-overload selection AstConst(FileLine* fl, StringToParse, const char* sourcep) - : ASTGEN_SUPER(fl) + : ASTGEN_SUPER_Const(fl) , m_num(this, sourcep) { initWithNumber(); } class VerilogStringLiteral {}; // for creator type-overload selection AstConst(FileLine* fl, VerilogStringLiteral, const string& str) - : ASTGEN_SUPER(fl) + : ASTGEN_SUPER_Const(fl) , m_num(V3Number::VerilogStringLiteral(), this, str) { initWithNumber(); } AstConst(FileLine* fl, uint32_t num) - : ASTGEN_SUPER(fl) + : ASTGEN_SUPER_Const(fl) , m_num(this, 32, num) { dtypeSetLogicUnsized(m_num.width(), 0, VSigning::UNSIGNED); } class Unsized32 {}; // for creator type-overload selection AstConst(FileLine* fl, Unsized32, uint32_t num) // Unsized 32-bit integer of specified value - : ASTGEN_SUPER(fl) + : ASTGEN_SUPER_Const(fl) , m_num(this, 32, num) { m_num.width(32, false); dtypeSetLogicUnsized(32, m_num.widthMin(), VSigning::UNSIGNED); } class Signed32 {}; // for creator type-overload selection AstConst(FileLine* fl, Signed32, int32_t num) // Signed 32-bit integer of specified value - : ASTGEN_SUPER(fl) + : ASTGEN_SUPER_Const(fl) , m_num(this, 32, num) { m_num.width(32, true); dtypeSetLogicUnsized(32, m_num.widthMin(), VSigning::SIGNED); } class Unsized64 {}; // for creator type-overload selection AstConst(FileLine* fl, Unsized64, vluint64_t num) - : ASTGEN_SUPER(fl) + : ASTGEN_SUPER_Const(fl) , m_num(this, 64, 0) { m_num.setQuad(num); dtypeSetLogicSized(64, VSigning::UNSIGNED); } class SizedEData {}; // for creator type-overload selection AstConst(FileLine* fl, SizedEData, vluint64_t num) - : ASTGEN_SUPER(fl) + : ASTGEN_SUPER_Const(fl) , m_num(this, VL_EDATASIZE, 0) { m_num.setQuad(num); dtypeSetLogicSized(VL_EDATASIZE, VSigning::UNSIGNED); } class RealDouble {}; // for creator type-overload selection AstConst(FileLine* fl, RealDouble, double num) - : ASTGEN_SUPER(fl) + : ASTGEN_SUPER_Const(fl) , m_num(this, 64) { m_num.setDouble(num); dtypeSetDouble(); } class String {}; // for creator type-overload selection AstConst(FileLine* fl, String, const string& num) - : ASTGEN_SUPER(fl) + : ASTGEN_SUPER_Const(fl) , m_num(V3Number::String(), this, num) { dtypeSetString(); } class BitFalse {}; AstConst(FileLine* fl, BitFalse) // Shorthand const 0, dtype should be a logic of size 1 - : ASTGEN_SUPER(fl) + : ASTGEN_SUPER_Const(fl) , m_num(this, 1, 0) { dtypeSetBit(); } // Shorthand const 1 (or with argument 0/1), dtype should be a logic of size 1 class BitTrue {}; AstConst(FileLine* fl, BitTrue, bool on = true) - : ASTGEN_SUPER(fl) + : ASTGEN_SUPER_Const(fl) , m_num(this, 1, on) { dtypeSetBit(); } class Null {}; AstConst(FileLine* fl, Null) - : ASTGEN_SUPER(fl) + : ASTGEN_SUPER_Const(fl) , m_num(V3Number::Null{}, this) { dtypeSetBit(); // Events 1 bit, objects 64 bits, so autoExtend=1 and use bit here initWithNumber(); @@ -186,17 +186,17 @@ class AstRange final : public AstNodeRange { // Range specification, for use under variables and cells public: AstRange(FileLine* fl, AstNode* leftp, AstNode* rightp) - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_Range(fl) { setOp2p(leftp); setOp3p(rightp); } AstRange(FileLine* fl, int left, int right) - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_Range(fl) { setOp2p(new AstConst(fl, left)); setOp3p(new AstConst(fl, right)); } AstRange(FileLine* fl, const VNumRange& range) - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_Range(fl) { setOp2p(new AstConst(fl, range.left())); setOp3p(new AstConst(fl, range.right())); } @@ -233,7 +233,7 @@ class AstBracketRange final : public AstNodeRange { // unknown until lhsp type is determined public: AstBracketRange(FileLine* fl, AstNode* elementsp) - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_BracketRange(fl) { setOp1p(elementsp); } ASTNODE_NODE_FUNCS(BracketRange) @@ -250,7 +250,7 @@ class AstUnsizedRange final : public AstNodeRange { // Unsized range specification, for open arrays public: explicit AstUnsizedRange(FileLine* fl) - : ASTGEN_SUPER(fl) {} + : ASTGEN_SUPER_UnsizedRange(fl) {} ASTNODE_NODE_FUNCS(UnsizedRange) virtual string emitC() { V3ERROR_NA_RETURN(""); } virtual string emitVerilog() { return "[]"; } @@ -261,7 +261,7 @@ class AstGatePin final : public AstNodeMath { // Possibly expand a gate primitive input pin value to match the range of the gate primitive public: AstGatePin(FileLine* fl, AstNode* lhsp, AstRange* rangep) - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_GatePin(fl) { setOp1p(lhsp); setOp2p(rangep); } @@ -282,7 +282,7 @@ class AstClassPackage final : public AstNodeModule { = nullptr; // Class package this is under (weak pointer, hard link is other way) public: AstClassPackage(FileLine* fl, const string& name) - : ASTGEN_SUPER(fl, name) {} + : ASTGEN_SUPER_ClassPackage(fl, name) {} ASTNODE_NODE_FUNCS(ClassPackage) virtual string verilogKwd() const override { return "/*class*/package"; } virtual const char* broken() const override; @@ -303,7 +303,7 @@ class AstClass final : public AstNodeModule { public: AstClass(FileLine* fl, const string& name) - : ASTGEN_SUPER(fl, name) {} + : ASTGEN_SUPER_Class(fl, name) {} ASTNODE_NODE_FUNCS(Class) virtual string verilogKwd() const override { return "class"; } virtual bool isHeavy() const override { return true; } @@ -345,7 +345,7 @@ class AstClassExtends final : public AstNode { // during early parse, then moves to dtype public: AstClassExtends(FileLine* fl, AstNode* classOrPkgsp) - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_ClassExtends(fl) { setNOp2p(classOrPkgsp); // Only for parser } ASTNODE_NODE_FUNCS(ClassExtends) @@ -370,7 +370,7 @@ private: public: AstParamTypeDType(FileLine* fl, AstVarType type, const string& name, VFlagChildDType, AstNodeDType* dtp) - : ASTGEN_SUPER(fl) + : ASTGEN_SUPER_ParamTypeDType(fl) , m_varType{type} , m_name{name} { childDTypep(dtp); // Only for parser @@ -419,7 +419,7 @@ private: public: AstTypedef(FileLine* fl, const string& name, AstNode* attrsp, VFlagChildDType, AstNodeDType* dtp) - : ASTGEN_SUPER(fl) + : ASTGEN_SUPER_Typedef(fl) , m_name{name} { childDTypep(dtp); // Only for parser addAttrsp(attrsp); @@ -453,7 +453,7 @@ private: public: AstTypedefFwd(FileLine* fl, const string& name) - : ASTGEN_SUPER(fl) + : ASTGEN_SUPER_TypedefFwd(fl) , m_name{name} {} ASTNODE_NODE_FUNCS(TypedefFwd) // METHODS @@ -474,7 +474,7 @@ private: public: AstDefImplicitDType(FileLine* fl, const string& name, void* containerp, VFlagChildDType, AstNodeDType* dtp) - : ASTGEN_SUPER(fl) + : ASTGEN_SUPER_DefImplicitDType(fl) , m_name{name} , m_containerp{containerp} , m_uniqueNum{uniqueNumInc()} { @@ -521,7 +521,7 @@ private: AstNodeDType* m_keyDTypep; // Keys of this type (after widthing) public: AstAssocArrayDType(FileLine* fl, VFlagChildDType, AstNodeDType* dtp, AstNodeDType* keyDtp) - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_AssocArrayDType(fl) { childDTypep(dtp); // Only for parser keyChildDTypep(keyDtp); // Only for parser refDTypep(nullptr); @@ -590,7 +590,7 @@ class AstBracketArrayDType final : public AstNodeDType { // Children: DTYPE (the key) public: AstBracketArrayDType(FileLine* fl, VFlagChildDType, AstNodeDType* dtp, AstNode* elementsp) - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_BracketArrayDType(fl) { setOp1p(dtp); // Only for parser setOp2p(elementsp); // Only for parser } @@ -621,13 +621,13 @@ private: AstNodeDType* m_refDTypep; // Elements of this type (after widthing) public: AstDynArrayDType(FileLine* fl, VFlagChildDType, AstNodeDType* dtp) - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_DynArrayDType(fl) { childDTypep(dtp); // Only for parser refDTypep(nullptr); dtypep(nullptr); // V3Width will resolve } AstDynArrayDType(FileLine* fl, AstNodeDType* dtp) - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_DynArrayDType(fl) { refDTypep(dtp); dtypep(nullptr); // V3Width will resolve } @@ -679,7 +679,7 @@ class AstPackArrayDType final : public AstNodeArrayDType { // Children: RANGE (array bounds) public: AstPackArrayDType(FileLine* fl, VFlagChildDType, AstNodeDType* dtp, AstRange* rangep) - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_PackArrayDType(fl) { childDTypep(dtp); // Only for parser refDTypep(nullptr); setOp2p(rangep); @@ -688,7 +688,7 @@ public: widthForce(width, width); } AstPackArrayDType(FileLine* fl, AstNodeDType* dtp, AstRange* rangep) - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_PackArrayDType(fl) { refDTypep(dtp); setOp2p(rangep); dtypep(this); @@ -707,7 +707,7 @@ class AstUnpackArrayDType final : public AstNodeArrayDType { bool m_isCompound = false; // Non-POD subDType, or parent requires compound public: AstUnpackArrayDType(FileLine* fl, VFlagChildDType, AstNodeDType* dtp, AstRange* rangep) - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_UnpackArrayDType(fl) { childDTypep(dtp); // Only for parser refDTypep(nullptr); setOp2p(rangep); @@ -717,7 +717,7 @@ public: widthFromSub(subDTypep()); } AstUnpackArrayDType(FileLine* fl, AstNodeDType* dtp, AstRange* rangep) - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_UnpackArrayDType(fl) { refDTypep(dtp); setOp2p(rangep); dtypep(this); @@ -744,7 +744,7 @@ private: AstNodeDType* m_refDTypep; // Elements of this type (after widthing) public: AstUnsizedArrayDType(FileLine* fl, VFlagChildDType, AstNodeDType* dtp) - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_UnsizedArrayDType(fl) { childDTypep(dtp); // Only for parser refDTypep(nullptr); dtypep(nullptr); // V3Width will resolve @@ -803,24 +803,24 @@ private: // See also in AstNodeDType: m_width, m_widthMin, m_numeric(issigned) public: AstBasicDType(FileLine* fl, AstBasicDTypeKwd kwd, const VSigning& signst = VSigning::NOSIGN) - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_BasicDType(fl) { init(kwd, signst, 0, -1, nullptr); } AstBasicDType(FileLine* fl, VFlagLogicPacked, int wantwidth) - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_BasicDType(fl) { init(AstBasicDTypeKwd::LOGIC, VSigning::NOSIGN, wantwidth, -1, nullptr); } AstBasicDType(FileLine* fl, VFlagBitPacked, int wantwidth) - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_BasicDType(fl) { init(AstBasicDTypeKwd::BIT, VSigning::NOSIGN, wantwidth, -1, nullptr); } AstBasicDType(FileLine* fl, AstBasicDTypeKwd kwd, VSigning numer, int wantwidth, int widthmin) - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_BasicDType(fl) { init(kwd, numer, wantwidth, widthmin, nullptr); } AstBasicDType(FileLine* fl, AstBasicDTypeKwd kwd, VSigning numer, VNumRange range, int widthmin) - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_BasicDType(fl) { init(kwd, numer, range.elements(), widthmin, nullptr); m.m_nrange = range; // as init() presumes lsb==0, but range.lsb() might not be } @@ -951,7 +951,7 @@ private: AstNodeDType* m_refDTypep; // Inherit from this base data type public: AstConstDType(FileLine* fl, VFlagChildDType, AstNodeDType* dtp) - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_ConstDType(fl) { childDTypep(dtp); // Only for parser refDTypep(nullptr); // V3Width will resolve dtypep(nullptr); // V3Width will resolve @@ -1004,7 +1004,7 @@ private: AstNodeModule* m_classOrPackagep = nullptr; // Package hierarchy public: AstClassRefDType(FileLine* fl, AstClass* classp, AstNode* paramsp) - : ASTGEN_SUPER(fl) + : ASTGEN_SUPER_ClassRefDType(fl) , m_classp{classp} { dtypep(this); addNOp4p(paramsp); @@ -1057,14 +1057,14 @@ private: AstModport* m_modportp = nullptr; // nullptr = unlinked or no modport public: AstIfaceRefDType(FileLine* fl, const string& cellName, const string& ifaceName) - : ASTGEN_SUPER(fl) + : ASTGEN_SUPER_IfaceRefDType(fl) , m_modportFileline{nullptr} , m_cellName{cellName} , m_ifaceName{ifaceName} , m_modportName{""} {} AstIfaceRefDType(FileLine* fl, FileLine* modportFl, const string& cellName, const string& ifaceName, const string& modport) - : ASTGEN_SUPER(fl) + : ASTGEN_SUPER_IfaceRefDType(fl) , m_modportFileline{modportFl} , m_cellName{cellName} , m_ifaceName{ifaceName} @@ -1107,14 +1107,14 @@ private: AstNodeDType* m_refDTypep; // Elements of this type (after widthing) public: AstQueueDType(FileLine* fl, VFlagChildDType, AstNodeDType* dtp, AstNode* boundp) - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_QueueDType(fl) { setNOp2p(boundp); childDTypep(dtp); // Only for parser refDTypep(nullptr); dtypep(nullptr); // V3Width will resolve } AstQueueDType(FileLine* fl, AstNodeDType* dtp, AstNode* boundp) - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_QueueDType(fl) { setNOp2p(boundp); refDTypep(dtp); dtypep(dtp); @@ -1181,17 +1181,17 @@ private: AstNodeModule* m_classOrPackagep = nullptr; // Package hierarchy public: AstRefDType(FileLine* fl, const string& name) - : ASTGEN_SUPER(fl) + : ASTGEN_SUPER_RefDType(fl) , m_name{name} {} AstRefDType(FileLine* fl, const string& name, AstNode* classOrPackagep, AstNode* paramsp) - : ASTGEN_SUPER(fl) + : ASTGEN_SUPER_RefDType(fl) , m_name{name} { setNOp3p(classOrPackagep); addNOp4p(paramsp); } class FlagTypeOfExpr {}; // type(expr) for parser only AstRefDType(FileLine* fl, FlagTypeOfExpr, AstNode* typeofp) - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_RefDType(fl) { setOp2p(typeofp); } ASTNODE_NODE_FUNCS(RefDType) @@ -1276,7 +1276,7 @@ class AstStructDType final : public AstNodeUOrStructDType { public: // VSigning below is mispurposed to indicate if packed or not AstStructDType(FileLine* fl, VSigning numericUnpack) - : ASTGEN_SUPER(fl, numericUnpack) {} + : ASTGEN_SUPER_StructDType(fl, numericUnpack) {} ASTNODE_NODE_FUNCS(StructDType) virtual string verilogKwd() const override { return "struct"; } }; @@ -1286,7 +1286,7 @@ public: // UNSUP: bool isTagged; // VSigning below is mispurposed to indicate if packed or not AstUnionDType(FileLine* fl, VSigning numericUnpack) - : ASTGEN_SUPER(fl, numericUnpack) {} + : ASTGEN_SUPER_UnionDType(fl, numericUnpack) {} ASTNODE_NODE_FUNCS(UnionDType) virtual string verilogKwd() const override { return "union"; } }; @@ -1302,14 +1302,14 @@ private: // UNSUP: int m_randType; // Randomization type (IEEE) public: AstMemberDType(FileLine* fl, const string& name, VFlagChildDType, AstNodeDType* dtp) - : ASTGEN_SUPER(fl) + : ASTGEN_SUPER_MemberDType(fl) , m_name{name} { childDTypep(dtp); // Only for parser dtypep(nullptr); // V3Width will resolve refDTypep(nullptr); } AstMemberDType(FileLine* fl, const string& name, AstNodeDType* dtp) - : ASTGEN_SUPER(fl) + : ASTGEN_SUPER_MemberDType(fl) , m_name{name} { UASSERT(dtp, "AstMember created with no dtype"); refDTypep(dtp); @@ -1362,7 +1362,7 @@ class AstVoidDType final : public AstNodeDType { // For e.g. a function returning void public: explicit AstVoidDType(FileLine* fl) - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_VoidDType(fl) { dtypep(this); } ASTNODE_NODE_FUNCS(VoidDType) @@ -1392,7 +1392,7 @@ private: public: // Parents: ENUM AstEnumItem(FileLine* fl, const string& name, AstNode* rangep, AstNode* initp) - : ASTGEN_SUPER(fl) + : ASTGEN_SUPER_EnumItem(fl) , m_name{name} { addNOp1p(rangep); addNOp2p(initp); @@ -1414,7 +1414,7 @@ private: AstNodeModule* m_classOrPackagep; // Package hierarchy public: AstEnumItemRef(FileLine* fl, AstEnumItem* itemp, AstNodeModule* classOrPackagep) - : ASTGEN_SUPER(fl) + : ASTGEN_SUPER_EnumItemRef(fl) , m_itemp{itemp} , m_classOrPackagep{classOrPackagep} { dtypeFrom(m_itemp); @@ -1452,7 +1452,7 @@ private: public: AstEnumDType(FileLine* fl, VFlagChildDType, AstNodeDType* dtp, AstNode* itemsp) - : ASTGEN_SUPER(fl) + : ASTGEN_SUPER_EnumDType(fl) , m_uniqueNum{uniqueNumInc()} { childDTypep(dtp); // Only for parser refDTypep(nullptr); @@ -1513,7 +1513,7 @@ class AstParseTypeDType final : public AstNodeDType { // e.g. the data type is a container of any data type public: explicit AstParseTypeDType(FileLine* fl) - : ASTGEN_SUPER(fl) {} + : ASTGEN_SUPER_ParseTypeDType(fl) {} ASTNODE_NODE_FUNCS(ParseTypeDType) AstNodeDType* dtypep() const { return nullptr; } // METHODS @@ -1547,11 +1547,11 @@ private: public: AstArraySel(FileLine* fl, AstNode* fromp, AstNode* bitp) - : ASTGEN_SUPER(fl, fromp, bitp) { + : ASTGEN_SUPER_ArraySel(fl, fromp, bitp) { init(fromp); } AstArraySel(FileLine* fl, AstNode* fromp, int bit) - : ASTGEN_SUPER(fl, fromp, new AstConst(fl, bit)) { + : ASTGEN_SUPER_ArraySel(fl, fromp, new AstConst(fl, bit)) { init(fromp); } ASTNODE_NODE_FUNCS(ArraySel) @@ -1592,7 +1592,7 @@ private: public: AstAssocSel(FileLine* fl, AstNode* fromp, AstNode* bitp) - : ASTGEN_SUPER(fl, fromp, bitp) { + : ASTGEN_SUPER_AssocSel(fl, fromp, bitp) { init(fromp); } ASTNODE_NODE_FUNCS(AssocSel) @@ -1621,7 +1621,7 @@ class AstWordSel final : public AstNodeSel { // Select a single word from a multi-word wide value public: AstWordSel(FileLine* fl, AstNode* fromp, AstNode* bitp) - : ASTGEN_SUPER(fl, fromp, bitp) { + : ASTGEN_SUPER_WordSel(fl, fromp, bitp) { dtypeSetUInt32(); // Always used on WData arrays so returns edata size } ASTNODE_NODE_FUNCS(WordSel) @@ -1648,7 +1648,7 @@ class AstSelLoopVars final : public AstNode { // Unlike normal selects elements is a list public: AstSelLoopVars(FileLine* fl, AstNode* fromp, AstNode* elementsp) - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_SelLoopVars(fl) { setOp1p(fromp); addNOp2p(elementsp); } @@ -1663,7 +1663,7 @@ class AstSelExtract final : public AstNodePreSel { // Range extraction, gets replaced with AstSel public: AstSelExtract(FileLine* fl, AstNode* fromp, AstNode* msbp, AstNode* lsbp) - : ASTGEN_SUPER(fl, fromp, msbp, lsbp) {} + : ASTGEN_SUPER_SelExtract(fl, fromp, msbp, lsbp) {} ASTNODE_NODE_FUNCS(SelExtract) AstNode* leftp() const { return rhsp(); } AstNode* rightp() const { return thsp(); } @@ -1674,7 +1674,7 @@ class AstSelBit final : public AstNodePreSel { // Gets replaced during link with AstArraySel or AstSel public: AstSelBit(FileLine* fl, AstNode* fromp, AstNode* bitp) - : ASTGEN_SUPER(fl, fromp, bitp, nullptr) { + : ASTGEN_SUPER_SelBit(fl, fromp, bitp, nullptr) { UASSERT_OBJ(!v3Global.assertDTypesResolved(), this, "not coded to create after dtypes resolved"); } @@ -1687,7 +1687,7 @@ class AstSelPlus final : public AstNodePreSel { // Gets replaced during link with AstSel public: AstSelPlus(FileLine* fl, AstNode* fromp, AstNode* bitp, AstNode* widthp) - : ASTGEN_SUPER(fl, fromp, bitp, widthp) {} + : ASTGEN_SUPER_SelPlus(fl, fromp, bitp, widthp) {} ASTNODE_NODE_FUNCS(SelPlus) AstNode* bitp() const { return rhsp(); } AstNode* widthp() const { return thsp(); } @@ -1698,7 +1698,7 @@ class AstSelMinus final : public AstNodePreSel { // Gets replaced during link with AstSel public: AstSelMinus(FileLine* fl, AstNode* fromp, AstNode* bitp, AstNode* widthp) - : ASTGEN_SUPER(fl, fromp, bitp, widthp) {} + : ASTGEN_SUPER_SelMinus(fl, fromp, bitp, widthp) {} ASTNODE_NODE_FUNCS(SelMinus) AstNode* bitp() const { return rhsp(); } AstNode* widthp() const { return thsp(); } @@ -1715,14 +1715,14 @@ private: int m_declElWidth; // If a packed array, the number of bits per element public: AstSel(FileLine* fl, AstNode* fromp, AstNode* lsbp, AstNode* widthp) - : ASTGEN_SUPER(fl, fromp, lsbp, widthp) + : ASTGEN_SUPER_Sel(fl, fromp, lsbp, widthp) , m_declElWidth{1} { if (VN_IS(widthp, Const)) { dtypeSetLogicSized(VN_CAST(widthp, Const)->toUInt(), VSigning::UNSIGNED); } } AstSel(FileLine* fl, AstNode* fromp, int lsb, int bitwidth) - : ASTGEN_SUPER(fl, fromp, new AstConst(fl, lsb), new AstConst(fl, bitwidth)) + : ASTGEN_SUPER_Sel(fl, fromp, new AstConst(fl, lsb), new AstConst(fl, bitwidth)) , m_declElWidth{1} { dtypeSetLogicSized(bitwidth, VSigning::UNSIGNED); } @@ -1771,8 +1771,8 @@ private: VNumRange m_declRange; // Range of the 'from' array if isRanged() is set, else invalid public: AstSliceSel(FileLine* fl, AstNode* fromp, const VNumRange& declRange) - : ASTGEN_SUPER(fl, fromp, new AstConst(fl, declRange.lo()), - new AstConst(fl, declRange.elements())) + : ASTGEN_SUPER_SliceSel(fl, fromp, new AstConst(fl, declRange.lo()), + new AstConst(fl, declRange.elements())) , m_declRange{declRange} {} ASTNODE_NODE_FUNCS(SliceSel) virtual void dump(std::ostream& str) const override; @@ -1808,12 +1808,12 @@ class AstMethodCall final : public AstNodeFTaskRef { public: AstMethodCall(FileLine* fl, AstNode* fromp, VFlagChildDType, const string& name, AstNode* pinsp) - : ASTGEN_SUPER(fl, false, name, pinsp) { + : ASTGEN_SUPER_MethodCall(fl, false, name, pinsp) { setOp2p(fromp); dtypep(nullptr); // V3Width will resolve } AstMethodCall(FileLine* fl, AstNode* fromp, const string& name, AstNode* pinsp) - : ASTGEN_SUPER(fl, false, name, pinsp) { + : ASTGEN_SUPER_MethodCall(fl, false, name, pinsp) { setOp2p(fromp); } ASTNODE_NODE_FUNCS(MethodCall) @@ -1844,14 +1844,14 @@ private: public: AstCMethodHard(FileLine* fl, AstNode* fromp, VFlagChildDType, const string& name, AstNode* pinsp) - : ASTGEN_SUPER(fl, false) + : ASTGEN_SUPER_CMethodHard(fl, false) , m_name{name} { setOp1p(fromp); dtypep(nullptr); // V3Width will resolve addNOp2p(pinsp); } AstCMethodHard(FileLine* fl, AstNode* fromp, const string& name, AstNode* pinsp) - : ASTGEN_SUPER(fl, false) + : ASTGEN_SUPER_CMethodHard(fl, false) , m_name{name} { setOp1p(fromp); addNOp2p(pinsp); @@ -1970,7 +1970,7 @@ private: public: AstVar(FileLine* fl, AstVarType type, const string& name, VFlagChildDType, AstNodeDType* dtp) - : ASTGEN_SUPER(fl) + : ASTGEN_SUPER_Var(fl) , m_name{name} , m_origName{name} { init(); @@ -1984,7 +1984,7 @@ public: } } AstVar(FileLine* fl, AstVarType type, const string& name, AstNodeDType* dtp) - : ASTGEN_SUPER(fl) + : ASTGEN_SUPER_Var(fl) , m_name{name} , m_origName{name} { init(); @@ -1998,7 +1998,7 @@ public: } } AstVar(FileLine* fl, AstVarType type, const string& name, VFlagLogicPacked, int wantwidth) - : ASTGEN_SUPER(fl) + : ASTGEN_SUPER_Var(fl) , m_name{name} , m_origName{name} { init(); @@ -2007,7 +2007,7 @@ public: m_declKwd = AstBasicDTypeKwd::LOGIC; } AstVar(FileLine* fl, AstVarType type, const string& name, VFlagBitPacked, int wantwidth) - : ASTGEN_SUPER(fl) + : ASTGEN_SUPER_Var(fl) , m_name{name} , m_origName{name} { init(); @@ -2016,7 +2016,7 @@ public: m_declKwd = AstBasicDTypeKwd::BIT; } AstVar(FileLine* fl, AstVarType type, const string& name, AstVar* examplep) - : ASTGEN_SUPER(fl) + : ASTGEN_SUPER_Var(fl) , m_name{name} , m_origName{name} { init(); @@ -2237,7 +2237,7 @@ private: string m_path; // Dotted cellname to set parameter of public: AstDefParam(FileLine* fl, const string& path, const string& name, AstNode* rhsp) - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_DefParam(fl) { setOp1p(rhsp); m_name = name; m_path = path; @@ -2254,7 +2254,7 @@ class AstImplicit final : public AstNode { // Parents: MODULE public: AstImplicit(FileLine* fl, AstNode* exprsp) - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_Implicit(fl) { addNOp1p(exprsp); } ASTNODE_NODE_FUNCS(Implicit) @@ -2274,7 +2274,7 @@ private: public: AstScope(FileLine* fl, AstNodeModule* modp, const string& name, AstScope* aboveScopep, AstCell* aboveCellp) - : ASTGEN_SUPER(fl) + : ASTGEN_SUPER_Scope(fl) , m_name{name} , m_aboveScopep{aboveScopep} , m_aboveCellp{aboveCellp} @@ -2307,7 +2307,7 @@ class AstTopScope final : public AstNode { // Children: SCOPEs public: AstTopScope(FileLine* fl, AstScope* ascopep) - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_TopScope(fl) { addNOp2p(ascopep); } ASTNODE_NODE_FUNCS(TopScope) @@ -2329,7 +2329,7 @@ private: bool m_trace : 1; // Tracing is turned on for this scope public: AstVarScope(FileLine* fl, AstScope* scopep, AstVar* varp) - : ASTGEN_SUPER(fl) + : ASTGEN_SUPER_VarScope(fl) , m_scopep{scopep} , m_varp{varp} { m_circular = false; @@ -2368,14 +2368,14 @@ class AstVarRef final : public AstNodeVarRef { // A reference to a variable (lvalue or rvalue) public: AstVarRef(FileLine* fl, const string& name, const VAccess& access) - : ASTGEN_SUPER(fl, name, nullptr, access) {} + : ASTGEN_SUPER_VarRef(fl, name, nullptr, access) {} // This form only allowed post-link because output/wire compression may // lead to deletion of AstVar's AstVarRef(FileLine* fl, AstVar* varp, const VAccess& access) - : ASTGEN_SUPER(fl, varp->name(), varp, access) {} + : ASTGEN_SUPER_VarRef(fl, varp->name(), varp, access) {} // This form only allowed post-link (see above) AstVarRef(FileLine* fl, AstVarScope* varscp, const VAccess& access) - : ASTGEN_SUPER(fl, varscp->varp()->name(), varscp->varp(), access) { + : ASTGEN_SUPER_VarRef(fl, varscp->varp()->name(), varscp->varp(), access) { varScopep(varscp); } ASTNODE_NODE_FUNCS(VarRef) @@ -2418,10 +2418,10 @@ private: string m_inlinedDots; // Dotted hierarchy flattened out public: AstVarXRef(FileLine* fl, const string& name, const string& dotted, const VAccess& access) - : ASTGEN_SUPER(fl, name, nullptr, access) + : ASTGEN_SUPER_VarXRef(fl, name, nullptr, access) , m_dotted{dotted} {} AstVarXRef(FileLine* fl, AstVar* varp, const string& dotted, const VAccess& access) - : ASTGEN_SUPER(fl, varp->name(), varp, access) + : ASTGEN_SUPER_VarXRef(fl, varp->name(), varp, access) , m_dotted{dotted} { dtypeFrom(varp); } @@ -2455,13 +2455,13 @@ private: bool m_svImplicit = false; // Pin is SystemVerilog .name'ed public: AstPin(FileLine* fl, int pinNum, const string& name, AstNode* exprp) - : ASTGEN_SUPER(fl) + : ASTGEN_SUPER_Pin(fl) , m_pinNum{pinNum} , m_name{name} { setNOp1p(exprp); } AstPin(FileLine* fl, int pinNum, AstVarRef* varname, AstNode* exprp) - : ASTGEN_SUPER(fl) + : ASTGEN_SUPER_Pin(fl) , m_pinNum{pinNum} , m_name{varname->name()} { setNOp1p(exprp); @@ -2504,7 +2504,7 @@ private: string m_name; // Pin name, or "" for number based interconnect public: AstArg(FileLine* fl, const string& name, AstNode* exprp) - : ASTGEN_SUPER(fl) + : ASTGEN_SUPER_Arg(fl) , m_name{name} { setNOp1p(exprp); } @@ -2523,7 +2523,7 @@ private: bool m_isProgram; // Module represents a program public: AstModule(FileLine* fl, const string& name, bool program = false) - : ASTGEN_SUPER(fl, name) + : ASTGEN_SUPER_Module(fl, name) , m_isProgram{program} {} ASTNODE_NODE_FUNCS(Module) virtual string verilogKwd() const override { return m_isProgram ? "program" : "module"; } @@ -2534,7 +2534,7 @@ class AstNotFoundModule final : public AstNodeModule { // A missing module declaration public: AstNotFoundModule(FileLine* fl, const string& name) - : ASTGEN_SUPER(fl, name) {} + : ASTGEN_SUPER_NotFoundModule(fl, name) {} ASTNODE_NODE_FUNCS(NotFoundModule) virtual string verilogKwd() const override { return "/*not-found-*/ module"; } virtual bool timescaleMatters() const override { return false; } @@ -2544,7 +2544,7 @@ class AstPackage final : public AstNodeModule { // A package declaration public: AstPackage(FileLine* fl, const string& name) - : ASTGEN_SUPER(fl, name) {} + : ASTGEN_SUPER_Package(fl, name) {} ASTNODE_NODE_FUNCS(Package) virtual string verilogKwd() const override { return "package"; } virtual bool timescaleMatters() const override { return !isDollarUnit(); } @@ -2556,7 +2556,7 @@ class AstPrimitive final : public AstNodeModule { // A primitive declaration public: AstPrimitive(FileLine* fl, const string& name) - : ASTGEN_SUPER(fl, name) {} + : ASTGEN_SUPER_Primitive(fl, name) {} ASTNODE_NODE_FUNCS(Primitive) virtual string verilogKwd() const override { return "primitive"; } virtual bool timescaleMatters() const override { return false; } @@ -2567,7 +2567,7 @@ class AstPackageExportStarStar final : public AstNode { public: // cppcheck-suppress noExplicitConstructor AstPackageExportStarStar(FileLine* fl) - : ASTGEN_SUPER(fl) {} + : ASTGEN_SUPER_PackageExportStarStar(fl) {} ASTNODE_NODE_FUNCS(PackageExportStarStar) }; @@ -2578,7 +2578,7 @@ private: AstPackage* m_packagep; // Package hierarchy public: AstPackageExport(FileLine* fl, AstPackage* packagep, const string& name) - : ASTGEN_SUPER(fl) + : ASTGEN_SUPER_PackageExport(fl) , m_name{name} , m_packagep{packagep} {} ASTNODE_NODE_FUNCS(PackageExport) @@ -2602,7 +2602,7 @@ private: AstPackage* m_packagep; // Package hierarchy public: AstPackageImport(FileLine* fl, AstPackage* packagep, const string& name) - : ASTGEN_SUPER(fl) + : ASTGEN_SUPER_PackageImport(fl) , m_name{name} , m_packagep{packagep} {} ASTNODE_NODE_FUNCS(PackageImport) @@ -2623,7 +2623,7 @@ class AstIface final : public AstNodeModule { // A module declaration public: AstIface(FileLine* fl, const string& name) - : ASTGEN_SUPER(fl, name) {} + : ASTGEN_SUPER_Iface(fl, name) {} ASTNODE_NODE_FUNCS(Iface) // Interfaces have `timescale applicability but lots of code seems to // get false warnings if we enable this @@ -2639,13 +2639,13 @@ private: AstVar* m_varp = nullptr; // Post link, variable within class that is target of selection public: AstMemberSel(FileLine* fl, AstNode* fromp, VFlagChildDType, const string& name) - : ASTGEN_SUPER(fl) + : ASTGEN_SUPER_MemberSel(fl) , m_name{name} { setOp1p(fromp); dtypep(nullptr); // V3Width will resolve } AstMemberSel(FileLine* fl, AstNode* fromp, AstNodeDType* dtp) - : ASTGEN_SUPER(fl) + : ASTGEN_SUPER_MemberSel(fl) , m_name{dtp->name()} { setOp1p(fromp); dtypep(dtp); @@ -2686,7 +2686,7 @@ private: AstNodeFTask* m_ftaskp = nullptr; // Link to the function public: AstModportFTaskRef(FileLine* fl, const string& name, bool isExport) - : ASTGEN_SUPER(fl) + : ASTGEN_SUPER_ModportFTaskRef(fl) , m_name{name} , m_export{isExport} {} ASTNODE_NODE_FUNCS(ModportFTaskRef) @@ -2715,7 +2715,7 @@ private: AstVar* m_varp = nullptr; // Link to the actual Var public: AstModportVarRef(FileLine* fl, const string& name, VDirection::en direction) - : ASTGEN_SUPER(fl) + : ASTGEN_SUPER_ModportVarRef(fl) , m_name{name} , m_direction{direction} {} ASTNODE_NODE_FUNCS(ModportVarRef) @@ -2740,7 +2740,7 @@ private: string m_name; // Name of the modport public: AstModport(FileLine* fl, const string& name, AstNode* varsp) - : ASTGEN_SUPER(fl) + : ASTGEN_SUPER_Modport(fl) , m_name{name} { addNOp1p(varsp); } @@ -2756,7 +2756,7 @@ private: string m_name; // Name of the reference public: AstIntfRef(FileLine* fl, const string& name) - : ASTGEN_SUPER(fl) + : ASTGEN_SUPER_IntfRef(fl) , m_name{name} {} virtual string name() const override { return m_name; } ASTNODE_NODE_FUNCS(IntfRef) @@ -2776,7 +2776,7 @@ private: public: AstCell(FileLine* fl, FileLine* mfl, const string& instName, const string& modName, AstPin* pinsp, AstPin* paramsp, AstRange* rangep) - : ASTGEN_SUPER(fl) + : ASTGEN_SUPER_Cell(fl) , m_modNameFileline{mfl} , m_name{instName} , m_origName{instName} @@ -2838,7 +2838,7 @@ private: public: AstCellInline(FileLine* fl, const string& name, const string& origModName, const VTimescale& timeunit) - : ASTGEN_SUPER(fl) + : ASTGEN_SUPER_CellInline(fl) , m_name{name} , m_origModName{origModName} , m_timeunit{timeunit} {} @@ -2864,7 +2864,7 @@ private: string m_name; // Cell name public: AstCellRef(FileLine* fl, const string& name, AstNode* cellp, AstNode* exprp) - : ASTGEN_SUPER(fl) + : ASTGEN_SUPER_CellRef(fl) , m_name{name} { addNOp1p(cellp); addNOp2p(exprp); @@ -2882,7 +2882,7 @@ private: string m_name; // Array name public: AstCellArrayRef(FileLine* fl, const string& name, AstNode* selectExprp) - : ASTGEN_SUPER(fl) + : ASTGEN_SUPER_CellArrayRef(fl) , m_name{name} { addNOp1p(selectExprp); } @@ -2898,7 +2898,7 @@ private: string m_name; // Var name public: AstUnlinkedRef(FileLine* fl, AstNode* refp, const string& name, AstNode* crp) - : ASTGEN_SUPER(fl) + : ASTGEN_SUPER_UnlinkedRef(fl) , m_name{name} { addNOp1p(refp); addNOp2p(crp); @@ -2917,7 +2917,7 @@ private: string m_name; // Binding to name public: AstBind(FileLine* fl, const string& name, AstNode* cellsp) - : ASTGEN_SUPER(fl) + : ASTGEN_SUPER_Bind(fl) , m_name{name} { UASSERT_OBJ(VN_IS(cellsp, Cell), cellsp, "Only instances allowed to be bound"); addNOp1p(cellsp); @@ -2936,7 +2936,7 @@ private: string m_name; // Name of pin public: AstPort(FileLine* fl, int pinnum, const string& name) - : ASTGEN_SUPER(fl) + : ASTGEN_SUPER_Port(fl) , m_pinNum{pinnum} , m_name{name} {} ASTNODE_NODE_FUNCS(Port) @@ -2960,7 +2960,7 @@ private: public: AstParseRef(FileLine* fl, VParseRefExp expect, const string& name, AstNode* lhsp = nullptr, AstNodeFTaskRef* ftaskrefp = nullptr) - : ASTGEN_SUPER(fl) + : ASTGEN_SUPER_ParseRef(fl) , m_expect{expect} , m_name{name} { setNOp1p(lhsp); @@ -2990,7 +2990,7 @@ private: public: AstClassOrPackageRef(FileLine* fl, const string& name, AstNode* classOrPackageNodep, AstNode* paramsp) - : ASTGEN_SUPER(fl) + : ASTGEN_SUPER_ClassOrPackageRef(fl) , m_name{name} , m_classOrPackageNodep{classOrPackageNodep} { addNOp4p(paramsp); @@ -3026,7 +3026,7 @@ class AstDot final : public AstNode { bool m_colon; // Is a "::" instead of a "." (lhs must be package/class) public: AstDot(FileLine* fl, bool colon, AstNode* lhsp, AstNode* rhsp) - : ASTGEN_SUPER(fl) + : ASTGEN_SUPER_Dot(fl) , m_colon{colon} { setOp1p(lhsp); setOp2p(rhsp); @@ -3048,7 +3048,7 @@ class AstUnbounded final : public AstNodeMath { // Due to where is used, treated as Signed32 public: explicit AstUnbounded(FileLine* fl) - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_Unbounded(fl) { dtypeSetSigned32(); } ASTNODE_NODE_FUNCS(Unbounded) @@ -3063,7 +3063,7 @@ class AstTask final : public AstNodeFTask { // A task inside a module public: AstTask(FileLine* fl, const string& name, AstNode* stmtp) - : ASTGEN_SUPER(fl, name, stmtp) {} + : ASTGEN_SUPER_Task(fl, name, stmtp) {} ASTNODE_NODE_FUNCS(Task) }; @@ -3071,7 +3071,7 @@ class AstFunc final : public AstNodeFTask { // A function inside a module public: AstFunc(FileLine* fl, const string& name, AstNode* stmtp, AstNode* fvarsp) - : ASTGEN_SUPER(fl, name, stmtp) { + : ASTGEN_SUPER_Func(fl, name, stmtp) { addNOp1p(fvarsp); } ASTNODE_NODE_FUNCS(Func) @@ -3082,11 +3082,11 @@ class AstTaskRef final : public AstNodeFTaskRef { // A reference to a task public: AstTaskRef(FileLine* fl, AstParseRef* namep, AstNode* pinsp) - : ASTGEN_SUPER(fl, true, namep, pinsp) { + : ASTGEN_SUPER_TaskRef(fl, true, namep, pinsp) { statement(true); } AstTaskRef(FileLine* fl, const string& name, AstNode* pinsp) - : ASTGEN_SUPER(fl, true, name, pinsp) {} + : ASTGEN_SUPER_TaskRef(fl, true, name, pinsp) {} ASTNODE_NODE_FUNCS(TaskRef) }; @@ -3094,9 +3094,9 @@ class AstFuncRef final : public AstNodeFTaskRef { // A reference to a function public: AstFuncRef(FileLine* fl, AstParseRef* namep, AstNode* pinsp) - : ASTGEN_SUPER(fl, false, namep, pinsp) {} + : ASTGEN_SUPER_FuncRef(fl, false, namep, pinsp) {} AstFuncRef(FileLine* fl, const string& name, AstNode* pinsp) - : ASTGEN_SUPER(fl, false, name, pinsp) {} + : ASTGEN_SUPER_FuncRef(fl, false, name, pinsp) {} ASTNODE_NODE_FUNCS(FuncRef) virtual bool hasDType() const override { return true; } }; @@ -3110,7 +3110,7 @@ private: string m_cname; // Name of function on c side public: AstDpiExport(FileLine* fl, const string& vname, const string& cname) - : ASTGEN_SUPER(fl) + : ASTGEN_SUPER_DpiExport(fl) , m_name{vname} , m_cname{cname} {} ASTNODE_NODE_FUNCS(DpiExport) @@ -3127,7 +3127,7 @@ class AstWithParse final : public AstNodeStmt { // Children: funcref, math public: AstWithParse(FileLine* fl, bool stmt, AstNode* funcrefp, AstNode* exprp) - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_WithParse(fl) { statement(stmt); setOp1p(funcrefp); addNOp2p(exprp); @@ -3149,7 +3149,7 @@ private: public: AstLambdaArgRef(FileLine* fl, const string& name, bool index) - : ASTGEN_SUPER(fl) + : ASTGEN_SUPER_LambdaArgRef(fl) , m_name{name} , m_index(index) {} ASTNODE_NODE_FUNCS(LambdaArgRef) @@ -3174,7 +3174,7 @@ class AstWith final : public AstNodeStmt { public: AstWith(FileLine* fl, AstLambdaArgRef* indexArgRefp, AstLambdaArgRef* valueArgRefp, AstNode* exprp) - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_With(fl) { addOp1p(indexArgRefp); addOp2p(valueArgRefp); addNOp3p(exprp); @@ -3207,24 +3207,24 @@ public: class Settle {}; // for creator type-overload selection class Never {}; // for creator type-overload selection AstSenItem(FileLine* fl, VEdgeType edgeType, AstNode* varrefp) - : ASTGEN_SUPER(fl) + : ASTGEN_SUPER_SenItem(fl) , m_edgeType{edgeType} { setOp1p(varrefp); } AstSenItem(FileLine* fl, Combo) - : ASTGEN_SUPER(fl) + : ASTGEN_SUPER_SenItem(fl) , m_edgeType{VEdgeType::ET_COMBO} {} AstSenItem(FileLine* fl, Illegal) - : ASTGEN_SUPER(fl) + : ASTGEN_SUPER_SenItem(fl) , m_edgeType{VEdgeType::ET_ILLEGAL} {} AstSenItem(FileLine* fl, Initial) - : ASTGEN_SUPER(fl) + : ASTGEN_SUPER_SenItem(fl) , m_edgeType{VEdgeType::ET_INITIAL} {} AstSenItem(FileLine* fl, Settle) - : ASTGEN_SUPER(fl) + : ASTGEN_SUPER_SenItem(fl) , m_edgeType{VEdgeType::ET_SETTLE} {} AstSenItem(FileLine* fl, Never) - : ASTGEN_SUPER(fl) + : ASTGEN_SUPER_SenItem(fl) , m_edgeType{VEdgeType::ET_NEVER} {} ASTNODE_NODE_FUNCS(SenItem) virtual void dump(std::ostream& str) const override; @@ -3258,7 +3258,7 @@ private: bool m_multi = false; // Created from combo logic by ORing multiple clock domains public: AstSenTree(FileLine* fl, AstSenItem* sensesp) - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_SenTree(fl) { addNOp1p(sensesp); } ASTNODE_NODE_FUNCS(SenTree) @@ -3279,14 +3279,14 @@ public: class AstFinal final : public AstNodeProcedure { public: AstFinal(FileLine* fl, AstNode* bodysp) - : ASTGEN_SUPER(fl, bodysp) {} + : ASTGEN_SUPER_Final(fl, bodysp) {} ASTNODE_NODE_FUNCS(Final) }; class AstInitial final : public AstNodeProcedure { public: AstInitial(FileLine* fl, AstNode* bodysp) - : ASTGEN_SUPER(fl, bodysp) {} + : ASTGEN_SUPER_Initial(fl, bodysp) {} ASTNODE_NODE_FUNCS(Initial) }; @@ -3295,7 +3295,7 @@ class AstAlways final : public AstNodeProcedure { public: AstAlways(FileLine* fl, VAlwaysKwd keyword, AstSenTree* sensesp, AstNode* bodysp) - : ASTGEN_SUPER(fl, bodysp) + : ASTGEN_SUPER_Always(fl, bodysp) , m_keyword{keyword} { addNOp1p(sensesp); } @@ -3312,7 +3312,7 @@ class AstAlwaysPostponed final : public AstNodeProcedure { public: AstAlwaysPostponed(FileLine* fl, AstNode* bodysp) - : ASTGEN_SUPER(fl, bodysp) {} + : ASTGEN_SUPER_AlwaysPostponed(fl, bodysp) {} ASTNODE_NODE_FUNCS(AlwaysPostponed) }; @@ -3320,7 +3320,7 @@ class AstAlwaysPost final : public AstNodeProcedure { // Like always but post assignments for memory assignment IFs public: AstAlwaysPost(FileLine* fl, AstSenTree* sensesp, AstNode* bodysp) - : ASTGEN_SUPER(fl, bodysp) { + : ASTGEN_SUPER_AlwaysPost(fl, bodysp) { addNOp1p(sensesp); } ASTNODE_NODE_FUNCS(AlwaysPost) @@ -3331,7 +3331,7 @@ class AstAlwaysPublic final : public AstNodeStmt { // Body statements are just AstVarRefs to the public signals public: AstAlwaysPublic(FileLine* fl, AstSenTree* sensesp, AstNode* bodysp) - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_AlwaysPublic(fl) { addNOp1p(sensesp); addNOp2p(bodysp); } @@ -3348,7 +3348,7 @@ public: class AstAssign final : public AstNodeAssign { public: AstAssign(FileLine* fl, AstNode* lhsp, AstNode* rhsp) - : ASTGEN_SUPER(fl, lhsp, rhsp) { + : ASTGEN_SUPER_Assign(fl, lhsp, rhsp) { dtypeFrom(lhsp); } ASTNODE_NODE_FUNCS(Assign) @@ -3363,7 +3363,7 @@ class AstAssignAlias final : public AstNodeAssign { // If both sides are wires, there's no LHS vs RHS, public: AstAssignAlias(FileLine* fl, AstVarRef* lhsp, AstVarRef* rhsp) - : ASTGEN_SUPER(fl, lhsp, rhsp) {} + : ASTGEN_SUPER_AssignAlias(fl, lhsp, rhsp) {} ASTNODE_NODE_FUNCS(AssignAlias) virtual AstNode* cloneType(AstNode* lhsp, AstNode* rhsp) override { V3ERROR_NA_RETURN(nullptr); @@ -3374,7 +3374,7 @@ public: class AstAssignDly final : public AstNodeAssign { public: AstAssignDly(FileLine* fl, AstNode* lhsp, AstNode* rhsp) - : ASTGEN_SUPER(fl, lhsp, rhsp) {} + : ASTGEN_SUPER_AssignDly(fl, lhsp, rhsp) {} ASTNODE_NODE_FUNCS(AssignDly) virtual AstNode* cloneType(AstNode* lhsp, AstNode* rhsp) override { return new AstAssignDly(this->fileline(), lhsp, rhsp); @@ -3388,7 +3388,7 @@ class AstAssignW final : public AstNodeAssign { // Like assign, but wire/assign's in verilog, the only setting of the specified variable public: AstAssignW(FileLine* fl, AstNode* lhsp, AstNode* rhsp) - : ASTGEN_SUPER(fl, lhsp, rhsp) {} + : ASTGEN_SUPER_AssignW(fl, lhsp, rhsp) {} ASTNODE_NODE_FUNCS(AssignW) virtual AstNode* cloneType(AstNode* lhsp, AstNode* rhsp) override { return new AstAssignW(this->fileline(), lhsp, rhsp); @@ -3408,7 +3408,7 @@ class AstAssignVarScope final : public AstNodeAssign { // Assign two VarScopes to each other public: AstAssignVarScope(FileLine* fl, AstNode* lhsp, AstNode* rhsp) - : ASTGEN_SUPER(fl, lhsp, rhsp) { + : ASTGEN_SUPER_AssignVarScope(fl, lhsp, rhsp) { dtypeFrom(rhsp); } ASTNODE_NODE_FUNCS(AssignVarScope) @@ -3424,7 +3424,7 @@ private: public: AstPull(FileLine* fl, AstNode* lhsp, bool direction) - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_Pull(fl) { setOp1p(lhsp); m_direction = direction; } @@ -3441,7 +3441,7 @@ class AstAssignPre final : public AstNodeAssign { // Like Assign, but predelayed assignment requiring special order handling public: AstAssignPre(FileLine* fl, AstNode* lhsp, AstNode* rhsp) - : ASTGEN_SUPER(fl, lhsp, rhsp) {} + : ASTGEN_SUPER_AssignPre(fl, lhsp, rhsp) {} ASTNODE_NODE_FUNCS(AssignPre) virtual AstNode* cloneType(AstNode* lhsp, AstNode* rhsp) override { return new AstAssignPre(this->fileline(), lhsp, rhsp); @@ -3453,7 +3453,7 @@ class AstAssignPost final : public AstNodeAssign { // Like Assign, but predelayed assignment requiring special order handling public: AstAssignPost(FileLine* fl, AstNode* lhsp, AstNode* rhsp) - : ASTGEN_SUPER(fl, lhsp, rhsp) {} + : ASTGEN_SUPER_AssignPost(fl, lhsp, rhsp) {} ASTNODE_NODE_FUNCS(AssignPost) virtual AstNode* cloneType(AstNode* lhsp, AstNode* rhsp) override { return new AstAssignPost(this->fileline(), lhsp, rhsp); @@ -3467,7 +3467,7 @@ class AstExprStmt final : public AstNodeMath { // resultp is evaluated AFTER the statement(s). public: AstExprStmt(FileLine* fl, AstNode* stmtsp, AstNode* resultp) - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_ExprStmt(fl) { addOp1p(stmtsp); setOp2p(resultp); // Possibly in future nullptr could mean return rhsp() dtypeFrom(resultp); @@ -3493,7 +3493,7 @@ private: string m_name; // Text of comment public: AstComment(FileLine* fl, const string& name, bool showAt = false) - : ASTGEN_SUPER(fl) + : ASTGEN_SUPER_Comment(fl) , m_showAt{showAt} , m_name{name} {} ASTNODE_NODE_FUNCS(Comment) @@ -3510,7 +3510,7 @@ class AstCond final : public AstNodeCond { // Children: MATH public: AstCond(FileLine* fl, AstNode* condp, AstNode* expr1p, AstNode* expr2p) - : ASTGEN_SUPER(fl, condp, expr1p, expr2p) {} + : ASTGEN_SUPER_Cond(fl, condp, expr1p, expr2p) {} ASTNODE_NODE_FUNCS(Cond) virtual AstNode* cloneType(AstNode* condp, AstNode* expr1p, AstNode* expr2p) override { return new AstCond(this->fileline(), condp, expr1p, expr2p); @@ -3523,7 +3523,7 @@ class AstCondBound final : public AstNodeCond { // Children: MATH public: AstCondBound(FileLine* fl, AstNode* condp, AstNode* expr1p, AstNode* expr2p) - : ASTGEN_SUPER(fl, condp, expr1p, expr2p) {} + : ASTGEN_SUPER_CondBound(fl, condp, expr1p, expr2p) {} ASTNODE_NODE_FUNCS(CondBound) virtual AstNode* cloneType(AstNode* condp, AstNode* expr1p, AstNode* expr2p) override { return new AstCondBound(this->fileline(), condp, expr1p, expr2p); @@ -3546,7 +3546,7 @@ private: public: AstCoverDecl(FileLine* fl, const string& page, const string& comment, const string& linescov, int offset) - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_CoverDecl(fl) { m_page = page; m_text = comment; m_linescov = linescov; @@ -3598,7 +3598,7 @@ private: AstCoverDecl* m_declp; // [After V3Coverage] Pointer to declaration public: AstCoverInc(FileLine* fl, AstCoverDecl* declp) - : ASTGEN_SUPER(fl) + : ASTGEN_SUPER_CoverInc(fl) , m_declp{declp} {} ASTNODE_NODE_FUNCS(CoverInc) virtual const char* broken() const override { @@ -3626,7 +3626,7 @@ class AstCoverToggle final : public AstNodeStmt { // Children: AstCoverInc, orig var, change det var public: AstCoverToggle(FileLine* fl, AstCoverInc* incp, AstNode* origp, AstNode* changep) - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_CoverToggle(fl) { setOp1p(incp); setOp2p(origp); setOp3p(changep); @@ -3650,7 +3650,7 @@ class AstDelay final : public AstNodeStmt { // Delay statement public: AstDelay(FileLine* fl, AstNode* lhsp) - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_Delay(fl) { setOp1p(lhsp); } ASTNODE_NODE_FUNCS(Delay) @@ -3667,7 +3667,7 @@ class AstGenCase final : public AstNodeCase { // casesp Children: CASEITEMs public: AstGenCase(FileLine* fl, AstNode* exprp, AstNode* casesp) - : ASTGEN_SUPER(fl, exprp, casesp) {} + : ASTGEN_SUPER_GenCase(fl, exprp, casesp) {} ASTNODE_NODE_FUNCS(GenCase) }; @@ -3685,7 +3685,7 @@ private: bool m_priorityPragma = false; // priority case public: AstCase(FileLine* fl, VCaseType casex, AstNode* exprp, AstNode* casesp) - : ASTGEN_SUPER(fl, exprp, casesp) + : ASTGEN_SUPER_Case(fl, exprp, casesp) , m_casex{casex} {} ASTNODE_NODE_FUNCS(Case) virtual string verilogKwd() const override { @@ -3720,7 +3720,7 @@ private: bool m_ignoreOverlap = false; // Default created by assertions; ignore overlaps public: AstCaseItem(FileLine* fl, AstNode* condsp, AstNode* bodysp) - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_CaseItem(fl) { addNOp1p(condsp); addNOp2p(bodysp); } @@ -3747,7 +3747,7 @@ public: class NoFormat {}; AstSFormatF(FileLine* fl, const string& text, bool hidden, AstNode* exprsp, char missingArgChar = 'd') - : ASTGEN_SUPER(fl) + : ASTGEN_SUPER_SFormatF(fl) , m_text{text} , m_hidden{hidden} , m_hasFormat{true} @@ -3758,7 +3758,7 @@ public: } AstSFormatF(FileLine* fl, NoFormat, AstNode* exprsp, char missingArgChar = 'd', bool hidden = true) - : ASTGEN_SUPER(fl) + : ASTGEN_SUPER_SFormatF(fl) , m_text{""} , m_hidden{hidden} , m_hasFormat{false} @@ -3802,14 +3802,14 @@ private: public: AstDisplay(FileLine* fl, AstDisplayType dispType, const string& text, AstNode* filep, AstNode* exprsp, char missingArgChar = 'd') - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_Display(fl) { setOp1p(new AstSFormatF(fl, text, true, exprsp, missingArgChar)); setNOp3p(filep); m_displayType = dispType; } AstDisplay(FileLine* fl, AstDisplayType dispType, AstNode* filep, AstNode* exprsp, char missingArgChar = 'd') - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_Display(fl) { setOp1p(new AstSFormatF(fl, AstSFormatF::NoFormat(), exprsp, missingArgChar)); setNOp3p(filep); m_displayType = dispType; @@ -3852,7 +3852,7 @@ class AstDumpCtl final : public AstNodeStmt { VDumpCtlType m_ctlType; // Type of operation public: AstDumpCtl(FileLine* fl, VDumpCtlType ctlType, AstNode* exprp = nullptr) - : ASTGEN_SUPER(fl) + : ASTGEN_SUPER_DumpCtl(fl) , m_ctlType{ctlType} { setNOp1p(exprp); } @@ -3877,7 +3877,7 @@ private: public: AstElabDisplay(FileLine* fl, AstDisplayType dispType, AstNode* exprsp) - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_ElabDisplay(fl) { setOp1p(new AstSFormatF(fl, AstSFormatF::NoFormat(), exprsp)); m_displayType = dispType; } @@ -3913,12 +3913,12 @@ class AstSFormat final : public AstNodeStmt { public: AstSFormat(FileLine* fl, AstNode* lhsp, const string& text, AstNode* exprsp, char missingArgChar = 'd') - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_SFormat(fl) { setOp1p(new AstSFormatF(fl, text, true, exprsp, missingArgChar)); setOp3p(lhsp); } AstSFormat(FileLine* fl, AstNode* lhsp, AstNode* exprsp, char missingArgChar = 'd') - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_SFormat(fl) { setOp1p(new AstSFormatF(fl, AstSFormatF::NoFormat(), exprsp, missingArgChar)); setOp3p(lhsp); } @@ -3947,7 +3947,7 @@ class AstSysFuncAsTask final : public AstNodeStmt { // Children: a system function public: AstSysFuncAsTask(FileLine* fl, AstNode* exprsp) - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_SysFuncAsTask(fl) { addNOp1p(exprsp); } ASTNODE_NODE_FUNCS(SysFuncAsTask) @@ -3967,7 +3967,7 @@ class AstSysIgnore final : public AstNodeStmt { // Children: varrefs or exprs public: AstSysIgnore(FileLine* fl, AstNode* exprsp) - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_SysIgnore(fl) { addNOp1p(exprsp); } ASTNODE_NODE_FUNCS(SysIgnore) @@ -3988,7 +3988,7 @@ class AstFClose final : public AstNodeStmt { // Children: file which must be a varref public: AstFClose(FileLine* fl, AstNode* filep) - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_FClose(fl) { setNOp2p(filep); } ASTNODE_NODE_FUNCS(FClose) @@ -4007,7 +4007,7 @@ class AstFOpen final : public AstNodeStmt { // Although a system function in IEEE, here a statement which sets the file pointer (MCD) public: AstFOpen(FileLine* fl, AstNode* filep, AstNode* filenamep, AstNode* modep) - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_FOpen(fl) { setOp1p(filep); setOp2p(filenamep); setOp3p(modep); @@ -4030,7 +4030,7 @@ class AstFOpenMcd final : public AstNodeStmt { // Although a system function in IEEE, here a statement which sets the file pointer (MCD) public: AstFOpenMcd(FileLine* fl, AstNode* filep, AstNode* filenamep) - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_FOpenMcd(fl) { setOp1p(filep); setOp2p(filenamep); } @@ -4052,7 +4052,7 @@ class AstFFlush final : public AstNodeStmt { // Children: file which must be a varref public: AstFFlush(FileLine* fl, AstNode* filep) - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_FFlush(fl) { setNOp2p(filep); } ASTNODE_NODE_FUNCS(FFlush) @@ -4075,7 +4075,7 @@ class AstFRead final : public AstNodeMath { // Children: count public: AstFRead(FileLine* fl, AstNode* memp, AstNode* filep, AstNode* startp, AstNode* countp) - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_FRead(fl) { setOp1p(memp); setOp2p(filep); setNOp3p(startp); @@ -4106,7 +4106,7 @@ class AstFRewind final : public AstNodeMath { // Children: file which must be a varref public: AstFRewind(FileLine* fl, AstNode* filep) - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_FRewind(fl) { setNOp2p(filep); } ASTNODE_NODE_FUNCS(FRewind) @@ -4129,7 +4129,7 @@ class AstFTell final : public AstNodeMath { // Children: file which must be a varref public: AstFTell(FileLine* fl, AstNode* filep) - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_FTell(fl) { setNOp2p(filep); } ASTNODE_NODE_FUNCS(FTell) @@ -4154,7 +4154,7 @@ class AstFSeek final : public AstNodeMath { // Children: operation public: AstFSeek(FileLine* fl, AstNode* filep, AstNode* offset, AstNode* operation) - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_FSeek(fl) { setOp2p(filep); setNOp3p(offset); setNOp4p(operation); @@ -4186,7 +4186,7 @@ private: public: AstFScanF(FileLine* fl, const string& text, AstNode* filep, AstNode* exprsp) - : ASTGEN_SUPER(fl) + : ASTGEN_SUPER_FScanF(fl) , m_text{text} { addNOp1p(exprsp); setNOp2p(filep); @@ -4221,7 +4221,7 @@ private: public: AstSScanF(FileLine* fl, const string& text, AstNode* fromp, AstNode* exprsp) - : ASTGEN_SUPER(fl) + : ASTGEN_SUPER_SScanF(fl) , m_text{text} { addNOp1p(exprsp); setOp2p(fromp); @@ -4281,7 +4281,7 @@ class AstReadMem final : public AstNodeReadWriteMem { public: AstReadMem(FileLine* fl, bool hex, AstNode* filenamep, AstNode* memp, AstNode* lsbp, AstNode* msbp) - : ASTGEN_SUPER(fl, hex, filenamep, memp, lsbp, msbp) {} + : ASTGEN_SUPER_ReadMem(fl, hex, filenamep, memp, lsbp, msbp) {} ASTNODE_NODE_FUNCS(ReadMem); virtual string verilogKwd() const override { return (isHex() ? "$readmemh" : "$readmemb"); } virtual const char* cFuncPrefixp() const override { return "VL_READMEM_"; } @@ -4291,7 +4291,7 @@ class AstWriteMem final : public AstNodeReadWriteMem { public: AstWriteMem(FileLine* fl, bool hex, AstNode* filenamep, AstNode* memp, AstNode* lsbp, AstNode* msbp) - : ASTGEN_SUPER(fl, hex, filenamep, memp, lsbp, msbp) {} + : ASTGEN_SUPER_WriteMem(fl, hex, filenamep, memp, lsbp, msbp) {} ASTNODE_NODE_FUNCS(WriteMem) virtual string verilogKwd() const override { return (isHex() ? "$writememh" : "$writememb"); } virtual const char* cFuncPrefixp() const override { return "VL_WRITEMEM_"; } @@ -4302,7 +4302,7 @@ class AstMonitorOff final : public AstNodeStmt { public: AstMonitorOff(FileLine* fl, bool off) - : ASTGEN_SUPER(fl) + : ASTGEN_SUPER_MonitorOff(fl) , m_off{off} {} ASTNODE_NODE_FUNCS(MonitorOff) virtual string verilogKwd() const override { return m_off ? "$monitoroff" : "$monitoron"; } @@ -4323,7 +4323,7 @@ class AstSystemT final : public AstNodeStmt { // $system used as task public: AstSystemT(FileLine* fl, AstNode* lhsp) - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_SystemT(fl) { setOp1p(lhsp); } ASTNODE_NODE_FUNCS(SystemT) @@ -4341,7 +4341,7 @@ class AstSystemF final : public AstNodeMath { // $system used as function public: AstSystemF(FileLine* fl, AstNode* lhsp) - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_SystemF(fl) { setOp1p(lhsp); } ASTNODE_NODE_FUNCS(SystemF) @@ -4363,7 +4363,7 @@ class AstValuePlusArgs final : public AstNodeMath { // Child: variable to set. If nullptr then this is a $test$plusargs instead of $value$plusargs public: AstValuePlusArgs(FileLine* fl, AstNode* searchp, AstNode* outp) - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_ValuePlusArgs(fl) { setOp1p(searchp); setOp2p(outp); } @@ -4390,7 +4390,7 @@ private: public: AstTestPlusArgs(FileLine* fl, const string& text) - : ASTGEN_SUPER(fl) + : ASTGEN_SUPER_TestPlusArgs(fl) , m_text{text} {} ASTNODE_NODE_FUNCS(TestPlusArgs) virtual string name() const override { return m_text; } @@ -4410,14 +4410,14 @@ public: class AstGenFor final : public AstNodeFor { public: AstGenFor(FileLine* fl, AstNode* initsp, AstNode* condp, AstNode* incsp, AstNode* bodysp) - : ASTGEN_SUPER(fl, initsp, condp, incsp, bodysp) {} + : ASTGEN_SUPER_GenFor(fl, initsp, condp, incsp, bodysp) {} ASTNODE_NODE_FUNCS(GenFor) }; class AstForeach final : public AstNodeStmt { public: AstForeach(FileLine* fl, AstNode* arrayp, AstNode* bodysp) - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_Foreach(fl) { setOp1p(arrayp); addNOp4p(bodysp); } @@ -4432,7 +4432,7 @@ public: class AstRepeat final : public AstNodeStmt { public: AstRepeat(FileLine* fl, AstNode* countp, AstNode* bodysp) - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_Repeat(fl) { setOp2p(countp); addNOp3p(bodysp); } @@ -4449,7 +4449,7 @@ public: class AstWait final : public AstNodeStmt { public: AstWait(FileLine* fl, AstNode* condp, AstNode* bodysp) - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_Wait(fl) { setOp2p(condp); addNOp3p(bodysp); } @@ -4460,7 +4460,7 @@ public: class AstWhile final : public AstNodeStmt { public: AstWhile(FileLine* fl, AstNode* condp, AstNode* bodysp, AstNode* incsp = nullptr) - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_While(fl) { setOp2p(condp); addNOp3p(bodysp); addNOp4p(incsp); @@ -4486,7 +4486,7 @@ public: class AstBreak final : public AstNodeStmt { public: explicit AstBreak(FileLine* fl) - : ASTGEN_SUPER(fl) {} + : ASTGEN_SUPER_Break(fl) {} ASTNODE_NODE_FUNCS(Break) virtual string verilogKwd() const override { return "break"; } virtual bool isBrancher() const override { @@ -4497,7 +4497,7 @@ public: class AstContinue final : public AstNodeStmt { public: explicit AstContinue(FileLine* fl) - : ASTGEN_SUPER(fl) {} + : ASTGEN_SUPER_Continue(fl) {} ASTNODE_NODE_FUNCS(Continue) virtual string verilogKwd() const override { return "continue"; } virtual bool isBrancher() const override { @@ -4510,7 +4510,7 @@ private: string m_name; // Name of block public: AstDisable(FileLine* fl, const string& name) - : ASTGEN_SUPER(fl) + : ASTGEN_SUPER_Disable(fl) , m_name{name} {} ASTNODE_NODE_FUNCS(Disable) virtual string name() const override { return m_name; } // * = Block name @@ -4524,7 +4524,7 @@ class AstDisableFork final : public AstNodeStmt { // A "disable fork" statement public: explicit AstDisableFork(FileLine* fl) - : ASTGEN_SUPER(fl) {} + : ASTGEN_SUPER_DisableFork(fl) {} ASTNODE_NODE_FUNCS(DisableFork) }; @@ -4532,14 +4532,14 @@ class AstWaitFork final : public AstNodeStmt { // A "wait fork" statement public: explicit AstWaitFork(FileLine* fl) - : ASTGEN_SUPER(fl) {} + : ASTGEN_SUPER_WaitFork(fl) {} ASTNODE_NODE_FUNCS(WaitFork) }; class AstReturn final : public AstNodeStmt { public: explicit AstReturn(FileLine* fl, AstNode* lhsp = nullptr) - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_Return(fl) { setNOp1p(lhsp); } ASTNODE_NODE_FUNCS(Return) @@ -4553,7 +4553,7 @@ public: class AstGenIf final : public AstNodeIf { public: AstGenIf(FileLine* fl, AstNode* condp, AstNode* ifsp, AstNode* elsesp) - : ASTGEN_SUPER(fl, condp, ifsp, elsesp) {} + : ASTGEN_SUPER_GenIf(fl, condp, ifsp, elsesp) {} ASTNODE_NODE_FUNCS(GenIf) }; @@ -4564,7 +4564,7 @@ private: bool m_priorityPragma; // priority case public: AstIf(FileLine* fl, AstNode* condp, AstNode* ifsp, AstNode* elsesp = nullptr) - : ASTGEN_SUPER(fl, condp, ifsp, elsesp) { + : ASTGEN_SUPER_If(fl, condp, ifsp, elsesp) { m_uniquePragma = false; m_unique0Pragma = false; m_priorityPragma = false; @@ -4588,7 +4588,7 @@ private: public: // After construction must call ->labelp to associate with appropriate label AstJumpBlock(FileLine* fl, AstNode* stmtsp) - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_JumpBlock(fl) { addNOp1p(stmtsp); } virtual const char* broken() const override; @@ -4616,7 +4616,7 @@ private: AstJumpBlock* m_blockp; // [After V3Jump] Pointer to declaration public: AstJumpLabel(FileLine* fl, AstJumpBlock* blockp) - : ASTGEN_SUPER(fl) + : ASTGEN_SUPER_JumpLabel(fl) , m_blockp{blockp} {} ASTNODE_NODE_FUNCS(JumpLabel) virtual bool maybePointedTo() const override { return true; } @@ -4645,7 +4645,7 @@ private: AstJumpLabel* m_labelp; // [After V3Jump] Pointer to declaration public: AstJumpGo(FileLine* fl, AstJumpLabel* labelp) - : ASTGEN_SUPER(fl) + : ASTGEN_SUPER_JumpGo(fl) , m_labelp{labelp} {} ASTNODE_NODE_FUNCS(JumpGo); virtual const char* broken() const override { @@ -4674,7 +4674,7 @@ class AstChangeXor final : public AstNodeBiComAsv { // Children: VARREF public: AstChangeXor(FileLine* fl, AstNode* lhsp, AstNode* rhsp) - : ASTGEN_SUPER(fl, lhsp, rhsp) { + : ASTGEN_SUPER_ChangeXor(fl, lhsp, rhsp) { dtypeSetUInt32(); // Always used on, and returns word entities } ASTNODE_NODE_FUNCS(ChangeXor) @@ -4702,7 +4702,7 @@ private: public: // Null lhs+rhs used to indicate change needed with no spec vars AstChangeDet(FileLine* fl, AstNode* lhsp, AstNode* rhsp, bool clockReq) - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_ChangeDet(fl) { setNOp1p(lhsp); setNOp2p(rhsp); m_clockReq = clockReq; @@ -4723,7 +4723,7 @@ class AstConsAssoc final : public AstNodeMath { // Children: expression (elements or other queues) public: AstConsAssoc(FileLine* fl, AstNode* defaultp) - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_ConsAssoc(fl) { setNOp1p(defaultp); } ASTNODE_NODE_FUNCS(ConsAssoc) @@ -4741,7 +4741,7 @@ class AstSetAssoc final : public AstNodeMath { // Children: expression (elements or other queues) public: AstSetAssoc(FileLine* fl, AstNode* lhsp, AstNode* keyp, AstNode* valuep) - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_SetAssoc(fl) { setOp1p(lhsp); setNOp2p(keyp); setOp3p(valuep); @@ -4764,7 +4764,7 @@ class AstConsDynArray final : public AstNodeMath { // Children: expression (elements or other queues) public: explicit AstConsDynArray(FileLine* fl, AstNode* lhsp = nullptr, AstNode* rhsp = nullptr) - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_ConsDynArray(fl) { setNOp1p(lhsp); setNOp2p(rhsp); } @@ -4785,7 +4785,7 @@ class AstConsQueue final : public AstNodeMath { // Children: expression (elements or other queues) public: explicit AstConsQueue(FileLine* fl, AstNode* lhsp = nullptr, AstNode* rhsp = nullptr) - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_ConsQueue(fl) { setNOp1p(lhsp); setNOp2p(rhsp); } @@ -4811,7 +4811,7 @@ public: // Node that simply puts name into the output stream AstBegin(FileLine* fl, const string& name, AstNode* stmtsp, bool generate = false, bool implied = false) - : ASTGEN_SUPER(fl, name, stmtsp) + : ASTGEN_SUPER_Begin(fl, name, stmtsp) , m_generate{generate} , m_implied{implied} {} ASTNODE_NODE_FUNCS(Begin) @@ -4834,7 +4834,7 @@ private: public: // Node that simply puts name into the output stream AstFork(FileLine* fl, const string& name, AstNode* stmtsp) - : ASTGEN_SUPER(fl, name, stmtsp) {} + : ASTGEN_SUPER_Fork(fl, name, stmtsp) {} ASTNODE_NODE_FUNCS(Fork) virtual void dump(std::ostream& str) const override; VJoinType joinType() const { return m_joinType; } @@ -4844,7 +4844,7 @@ public: class AstInside final : public AstNodeMath { public: AstInside(FileLine* fl, AstNode* exprp, AstNode* itemsp) - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_Inside(fl) { addOp1p(exprp); addOp2p(itemsp); dtypeSetBit(); @@ -4861,7 +4861,7 @@ public: class AstInsideRange final : public AstNodeMath { public: AstInsideRange(FileLine* fl, AstNode* lhsp, AstNode* rhsp) - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_InsideRange(fl) { addOp1p(lhsp); addOp2p(rhsp); } @@ -4882,7 +4882,7 @@ class AstInitItem final : public AstNode { public: // Parents: INITARRAY AstInitItem(FileLine* fl, AstNode* valuep) - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_InitItem(fl) { addOp1p(valuep); } ASTNODE_NODE_FUNCS(InitItem) @@ -4906,7 +4906,7 @@ private: KeyItemMap m_map; // Node value for each array index public: AstInitArray(FileLine* fl, AstNodeArrayDType* newDTypep, AstNode* defaultp) - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_InitArray(fl) { dtypep(newDTypep); addNOp1p(defaultp); } @@ -4971,7 +4971,7 @@ class AstNew final : public AstNodeFTaskRef { // Children: varref|arraysel, math public: AstNew(FileLine* fl, AstNode* pinsp) - : ASTGEN_SUPER(fl, false, "new", pinsp) {} + : ASTGEN_SUPER_New(fl, false, "new", pinsp) {} ASTNODE_NODE_FUNCS(New) virtual bool cleanOut() const { return true; } virtual bool same(const AstNode* samep) const override { return true; } @@ -4985,7 +4985,7 @@ class AstNewCopy final : public AstNodeMath { // Children: varref|arraysel, math public: AstNewCopy(FileLine* fl, AstNode* rhsp) - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_NewCopy(fl) { dtypeFrom(rhsp); // otherwise V3Width will resolve setNOp1p(rhsp); } @@ -5004,7 +5004,7 @@ class AstNewDynamic final : public AstNodeMath { // Children: varref|arraysel, math public: AstNewDynamic(FileLine* fl, AstNode* sizep, AstNode* rhsp) - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_NewDynamic(fl) { dtypeFrom(rhsp); // otherwise V3Width will resolve setNOp1p(sizep); setNOp2p(rhsp); @@ -5026,7 +5026,7 @@ public: // Pragmas don't result in any output code, they're just flags that affect // other processing in verilator. AstPragma(FileLine* fl, AstPragmaType pragType) - : ASTGEN_SUPER(fl) + : ASTGEN_SUPER_Pragma(fl) , m_pragType{pragType} {} ASTNODE_NODE_FUNCS(Pragma) AstPragmaType pragType() const { return m_pragType; } // *=type of the pragma @@ -5042,7 +5042,7 @@ class AstPrintTimeScale final : public AstNodeStmt { VTimescale m_timeunit; // Parent module time unit public: explicit AstPrintTimeScale(FileLine* fl) - : ASTGEN_SUPER(fl) {} + : ASTGEN_SUPER_PrintTimeScale(fl) {} ASTNODE_NODE_FUNCS(PrintTimeScale) virtual void name(const string& name) override { m_name = name; } virtual string name() const override { return m_name; } // * = Var name @@ -5060,7 +5060,7 @@ public: class AstStop final : public AstNodeStmt { public: AstStop(FileLine* fl, bool maybe) - : ASTGEN_SUPER(fl) {} + : ASTGEN_SUPER_Stop(fl) {} ASTNODE_NODE_FUNCS(Stop) virtual bool isGateOptimizable() const override { return false; } virtual bool isPredictOptimizable() const override { return false; } @@ -5078,7 +5078,7 @@ public: class AstFinish final : public AstNodeStmt { public: explicit AstFinish(FileLine* fl) - : ASTGEN_SUPER(fl) {} + : ASTGEN_SUPER_Finish(fl) {} ASTNODE_NODE_FUNCS(Finish) virtual bool isGateOptimizable() const override { return false; } virtual bool isPredictOptimizable() const override { return false; } @@ -5098,7 +5098,7 @@ class AstNullCheck final : public AstNodeUniop { // Children: VarRef or something returning pointer public: AstNullCheck(FileLine* fl, AstNode* lhsp) - : ASTGEN_SUPER(fl, lhsp) { + : ASTGEN_SUPER_NullCheck(fl, lhsp) { dtypeFrom(lhsp); } ASTNODE_NODE_FUNCS(NullCheck) @@ -5119,7 +5119,7 @@ class AstTimingControl final : public AstNodeStmt { // Parents: stmtlist public: AstTimingControl(FileLine* fl, AstSenTree* sensesp, AstNode* stmtsp) - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_TimingControl(fl) { setNOp1p(sensesp); setNOp2p(stmtsp); } @@ -5139,7 +5139,7 @@ class AstTimeFormat final : public AstNodeStmt { public: AstTimeFormat(FileLine* fl, AstNode* unitsp, AstNode* precisionp, AstNode* suffixp, AstNode* widthp) - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_TimeFormat(fl) { setOp1p(unitsp); setOp2p(precisionp); setOp3p(suffixp); @@ -5178,7 +5178,7 @@ public: AstVar* varp, // For input/output state etc AstNode* valuep, const VNumRange& bitRange, const VNumRange& arrayRange, bool isScoped) - : ASTGEN_SUPER(fl) + : ASTGEN_SUPER_TraceDecl(fl) , m_showname{showname} , m_bitRange{bitRange} , m_arrayRange{arrayRange} @@ -5223,7 +5223,7 @@ private: const bool m_full; // Is this a full vs incremental dump public: AstTraceInc(FileLine* fl, AstTraceDecl* declp, bool full) - : ASTGEN_SUPER(fl) + : ASTGEN_SUPER_TraceInc(fl) , m_declp{declp} , m_full{full} { dtypeFrom(declp); @@ -5265,7 +5265,7 @@ private: public: AstActive(FileLine* fl, const string& name, AstSenTree* sensesp) - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_Active(fl) { m_name = name; // Copy it UASSERT(sensesp, "Sensesp required arg"); m_sensesp = sensesp; @@ -5305,7 +5305,7 @@ private: public: AstAttrOf(FileLine* fl, AstAttrType attrtype, AstNode* fromp = nullptr, AstNode* dimp = nullptr) - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_AttrOf(fl) { setNOp1p(fromp); setNOp2p(dimp); m_attrType = attrtype; @@ -5328,7 +5328,7 @@ private: public: explicit AstScopeName(FileLine* fl) - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_ScopeName(fl) { dtypeSetUInt64(); } ASTNODE_NODE_FUNCS(ScopeName) @@ -5361,7 +5361,7 @@ public: class AstUdpTable final : public AstNode { public: AstUdpTable(FileLine* fl, AstNode* bodysp) - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_UdpTable(fl) { addNOp1p(bodysp); } ASTNODE_NODE_FUNCS(UdpTable) @@ -5374,7 +5374,7 @@ class AstUdpTableLine final : public AstNode { public: AstUdpTableLine(FileLine* fl, const string& text) - : ASTGEN_SUPER(fl) + : ASTGEN_SUPER_UdpTableLine(fl) , m_text{text} {} ASTNODE_NODE_FUNCS(UdpTableLine) virtual string name() const override { return m_text; } @@ -5393,12 +5393,12 @@ private: public: class Reset {}; AstRand(FileLine* fl, Reset, AstNodeDType* dtp, bool reset) - : ASTGEN_SUPER(fl) + : ASTGEN_SUPER_Rand(fl) , m_reset{reset} { dtypep(dtp); } AstRand(FileLine* fl, AstNode* seedp, bool urandom) - : ASTGEN_SUPER(fl) + : ASTGEN_SUPER_Rand(fl) , m_urandom(urandom) { setNOp1p(seedp); } @@ -5408,9 +5408,9 @@ public: : (m_urandom ? "%f$urandom()" : "%f$random()"); } virtual string emitC() override { - return m_reset - ? "VL_RAND_RESET_%nq(%nw, %P)" - : seedp() ? "VL_RANDOM_SEEDED_%nq%lq(%nw, %P, %li)" : "VL_RANDOM_%nq(%nw, %P)"; + return m_reset ? "VL_RAND_RESET_%nq(%nw, %P)" + : seedp() ? "VL_RANDOM_SEEDED_%nq%lq(%nw, %P, %li)" + : "VL_RANDOM_%nq(%nw, %P)"; } virtual bool cleanOut() const override { return true; } virtual bool isGateOptimizable() const override { return false; } @@ -5426,7 +5426,7 @@ class AstURandomRange final : public AstNodeBiop { // $urandom_range public: explicit AstURandomRange(FileLine* fl, AstNode* lhsp, AstNode* rhsp) - : ASTGEN_SUPER(fl, lhsp, rhsp) { + : ASTGEN_SUPER_URandomRange(fl, lhsp, rhsp) { dtypeSetUInt32(); // Says IEEE } ASTNODE_NODE_FUNCS(URandomRange) @@ -5452,7 +5452,7 @@ class AstTime final : public AstNodeTermop { VTimescale m_timeunit; // Parent module time unit public: AstTime(FileLine* fl, const VTimescale& timeunit) - : ASTGEN_SUPER(fl) + : ASTGEN_SUPER_Time(fl) , m_timeunit{timeunit} { dtypeSetUInt64(); } @@ -5473,7 +5473,7 @@ class AstTimeD final : public AstNodeTermop { VTimescale m_timeunit; // Parent module time unit public: AstTimeD(FileLine* fl, const VTimescale& timeunit) - : ASTGEN_SUPER(fl) + : ASTGEN_SUPER_TimeD(fl) , m_timeunit{timeunit} { dtypeSetDouble(); } @@ -5495,7 +5495,7 @@ class AstUCFunc final : public AstNodeMath { // Perhaps this should be an AstNodeListop; but there's only one list math right now public: AstUCFunc(FileLine* fl, AstNode* exprsp) - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_UCFunc(fl) { addNOp1p(exprsp); } ASTNODE_NODE_FUNCS(UCFunc) @@ -5518,7 +5518,7 @@ public: class AstNegate final : public AstNodeUniop { public: AstNegate(FileLine* fl, AstNode* lhsp) - : ASTGEN_SUPER(fl, lhsp) { + : ASTGEN_SUPER_Negate(fl, lhsp) { dtypeFrom(lhsp); } ASTNODE_NODE_FUNCS(Negate) @@ -5533,7 +5533,7 @@ public: class AstNegateD final : public AstNodeUniop { public: AstNegateD(FileLine* fl, AstNode* lhsp) - : ASTGEN_SUPER(fl, lhsp) { + : ASTGEN_SUPER_NegateD(fl, lhsp) { dtypeSetDouble(); } ASTNODE_NODE_FUNCS(NegateD) @@ -5550,7 +5550,7 @@ public: class AstRedAnd final : public AstNodeUniop { public: AstRedAnd(FileLine* fl, AstNode* lhsp) - : ASTGEN_SUPER(fl, lhsp) { + : ASTGEN_SUPER_RedAnd(fl, lhsp) { dtypeSetBit(); } ASTNODE_NODE_FUNCS(RedAnd) @@ -5564,7 +5564,7 @@ public: class AstRedOr final : public AstNodeUniop { public: AstRedOr(FileLine* fl, AstNode* lhsp) - : ASTGEN_SUPER(fl, lhsp) { + : ASTGEN_SUPER_RedOr(fl, lhsp) { dtypeSetBit(); } ASTNODE_NODE_FUNCS(RedOr) @@ -5578,7 +5578,7 @@ public: class AstRedXor final : public AstNodeUniop { public: AstRedXor(FileLine* fl, AstNode* lhsp) - : ASTGEN_SUPER(fl, lhsp) { + : ASTGEN_SUPER_RedXor(fl, lhsp) { dtypeSetBit(); } ASTNODE_NODE_FUNCS(RedXor) @@ -5598,7 +5598,7 @@ class AstLenN final : public AstNodeUniop { // Length of a string public: AstLenN(FileLine* fl, AstNode* lhsp) - : ASTGEN_SUPER(fl, lhsp) { + : ASTGEN_SUPER_LenN(fl, lhsp) { dtypeSetSigned32(); } ASTNODE_NODE_FUNCS(LenN) @@ -5612,7 +5612,7 @@ public: class AstLogNot final : public AstNodeUniop { public: AstLogNot(FileLine* fl, AstNode* lhsp) - : ASTGEN_SUPER(fl, lhsp) { + : ASTGEN_SUPER_LogNot(fl, lhsp) { dtypeSetBit(); } ASTNODE_NODE_FUNCS(LogNot) @@ -5627,7 +5627,7 @@ public: class AstNot final : public AstNodeUniop { public: AstNot(FileLine* fl, AstNode* lhsp) - : ASTGEN_SUPER(fl, lhsp) { + : ASTGEN_SUPER_Not(fl, lhsp) { dtypeFrom(lhsp); } ASTNODE_NODE_FUNCS(Not) @@ -5643,9 +5643,9 @@ class AstExtend final : public AstNodeUniop { // Expand a value into a wider entity by 0 extension. Width is implied from nodep->width() public: AstExtend(FileLine* fl, AstNode* lhsp) - : ASTGEN_SUPER(fl, lhsp) {} + : ASTGEN_SUPER_Extend(fl, lhsp) {} AstExtend(FileLine* fl, AstNode* lhsp, int width) - : ASTGEN_SUPER(fl, lhsp) { + : ASTGEN_SUPER_Extend(fl, lhsp) { dtypeSetLogicSized(width, VSigning::UNSIGNED); } ASTNODE_NODE_FUNCS(Extend) @@ -5663,10 +5663,10 @@ class AstExtendS final : public AstNodeUniop { // Expand a value into a wider entity by sign extension. Width is implied from nodep->width() public: AstExtendS(FileLine* fl, AstNode* lhsp) - : ASTGEN_SUPER(fl, lhsp) {} + : ASTGEN_SUPER_ExtendS(fl, lhsp) {} AstExtendS(FileLine* fl, AstNode* lhsp, int width) // Important that widthMin be correct, as opExtend requires it after V3Expand - : ASTGEN_SUPER(fl, lhsp) { + : ASTGEN_SUPER_ExtendS(fl, lhsp) { dtypeSetLogicSized(width, VSigning::UNSIGNED); } ASTNODE_NODE_FUNCS(ExtendS) @@ -5687,7 +5687,7 @@ class AstSigned final : public AstNodeUniop { // $signed(lhs) public: AstSigned(FileLine* fl, AstNode* lhsp) - : ASTGEN_SUPER(fl, lhsp) { + : ASTGEN_SUPER_Signed(fl, lhsp) { UASSERT_OBJ(!v3Global.assertDTypesResolved(), this, "not coded to create after dtypes resolved"); } @@ -5707,7 +5707,7 @@ class AstUnsigned final : public AstNodeUniop { // $unsigned(lhs) public: AstUnsigned(FileLine* fl, AstNode* lhsp) - : ASTGEN_SUPER(fl, lhsp) { + : ASTGEN_SUPER_Unsigned(fl, lhsp) { UASSERT_OBJ(!v3Global.assertDTypesResolved(), this, "not coded to create after dtypes resolved"); } @@ -5727,7 +5727,7 @@ class AstRToIS final : public AstNodeUniop { // $rtoi(lhs) public: AstRToIS(FileLine* fl, AstNode* lhsp) - : ASTGEN_SUPER(fl, lhsp) { + : ASTGEN_SUPER_RToIS(fl, lhsp) { dtypeSetSigned32(); } ASTNODE_NODE_FUNCS(RToIS) @@ -5743,7 +5743,7 @@ class AstRToIRoundS final : public AstNodeUniop { // Convert real to integer, with arbitrary sized output (not just "integer" format) public: AstRToIRoundS(FileLine* fl, AstNode* lhsp) - : ASTGEN_SUPER(fl, lhsp) { + : ASTGEN_SUPER_RToIRoundS(fl, lhsp) { dtypeSetSigned32(); } ASTNODE_NODE_FUNCS(RToIRoundS) @@ -5761,7 +5761,7 @@ class AstIToRD final : public AstNodeUniop { // $itor where lhs is unsigned public: AstIToRD(FileLine* fl, AstNode* lhsp) - : ASTGEN_SUPER(fl, lhsp) { + : ASTGEN_SUPER_IToRD(fl, lhsp) { dtypeSetDouble(); } ASTNODE_NODE_FUNCS(IToRD) @@ -5777,7 +5777,7 @@ class AstISToRD final : public AstNodeUniop { // $itor where lhs is signed public: AstISToRD(FileLine* fl, AstNode* lhsp) - : ASTGEN_SUPER(fl, lhsp) { + : ASTGEN_SUPER_ISToRD(fl, lhsp) { dtypeSetDouble(); } ASTNODE_NODE_FUNCS(ISToRD) @@ -5793,7 +5793,7 @@ public: class AstRealToBits final : public AstNodeUniop { public: AstRealToBits(FileLine* fl, AstNode* lhsp) - : ASTGEN_SUPER(fl, lhsp) { + : ASTGEN_SUPER_RealToBits(fl, lhsp) { dtypeSetUInt64(); } ASTNODE_NODE_FUNCS(RealToBits) @@ -5810,7 +5810,7 @@ public: class AstBitsToRealD final : public AstNodeUniop { public: AstBitsToRealD(FileLine* fl, AstNode* lhsp) - : ASTGEN_SUPER(fl, lhsp) { + : ASTGEN_SUPER_BitsToRealD(fl, lhsp) { dtypeSetDouble(); } ASTNODE_NODE_FUNCS(BitsToRealD) @@ -5828,7 +5828,7 @@ public: class AstCLog2 final : public AstNodeUniop { public: AstCLog2(FileLine* fl, AstNode* lhsp) - : ASTGEN_SUPER(fl, lhsp) {} + : ASTGEN_SUPER_CLog2(fl, lhsp) {} ASTNODE_NODE_FUNCS(CLog2) virtual void numberOperate(V3Number& out, const V3Number& lhs) override { out.opCLog2(lhs); } virtual string emitVerilog() override { return "%f$clog2(%l)"; } @@ -5842,11 +5842,12 @@ class AstCountBits final : public AstNodeQuadop { // Number of bits set in vector public: AstCountBits(FileLine* fl, AstNode* exprp, AstNode* ctrl1p) - : ASTGEN_SUPER(fl, exprp, ctrl1p, ctrl1p->cloneTree(false), ctrl1p->cloneTree(false)) {} + : ASTGEN_SUPER_CountBits(fl, exprp, ctrl1p, ctrl1p->cloneTree(false), + ctrl1p->cloneTree(false)) {} AstCountBits(FileLine* fl, AstNode* exprp, AstNode* ctrl1p, AstNode* ctrl2p) - : ASTGEN_SUPER(fl, exprp, ctrl1p, ctrl2p, ctrl2p->cloneTree(false)) {} + : ASTGEN_SUPER_CountBits(fl, exprp, ctrl1p, ctrl2p, ctrl2p->cloneTree(false)) {} AstCountBits(FileLine* fl, AstNode* exprp, AstNode* ctrl1p, AstNode* ctrl2p, AstNode* ctrl3p) - : ASTGEN_SUPER(fl, exprp, ctrl1p, ctrl2p, ctrl3p) {} + : ASTGEN_SUPER_CountBits(fl, exprp, ctrl1p, ctrl2p, ctrl3p) {} ASTNODE_NODE_FUNCS(CountBits) virtual void numberOperate(V3Number& out, const V3Number& expr, const V3Number& ctrl1, const V3Number& ctrl2, const V3Number& ctrl3) override { @@ -5869,7 +5870,7 @@ class AstCountOnes final : public AstNodeUniop { // Number of bits set in vector public: AstCountOnes(FileLine* fl, AstNode* lhsp) - : ASTGEN_SUPER(fl, lhsp) {} + : ASTGEN_SUPER_CountOnes(fl, lhsp) {} ASTNODE_NODE_FUNCS(CountOnes) virtual void numberOperate(V3Number& out, const V3Number& lhs) override { out.opCountOnes(lhs); @@ -5885,7 +5886,7 @@ class AstIsUnknown final : public AstNodeUniop { // True if any unknown bits public: AstIsUnknown(FileLine* fl, AstNode* lhsp) - : ASTGEN_SUPER(fl, lhsp) { + : ASTGEN_SUPER_IsUnknown(fl, lhsp) { dtypeSetBit(); } ASTNODE_NODE_FUNCS(IsUnknown) @@ -5902,7 +5903,7 @@ class AstIsUnbounded final : public AstNodeUniop { // True if is unmbounded ($) public: AstIsUnbounded(FileLine* fl, AstNode* lhsp) - : ASTGEN_SUPER(fl, lhsp) { + : ASTGEN_SUPER_IsUnbounded(fl, lhsp) { dtypeSetBit(); } ASTNODE_NODE_FUNCS(IsUnbounded) @@ -5920,7 +5921,7 @@ class AstOneHot final : public AstNodeUniop { // True if only single bit set in vector public: AstOneHot(FileLine* fl, AstNode* lhsp) - : ASTGEN_SUPER(fl, lhsp) { + : ASTGEN_SUPER_OneHot(fl, lhsp) { dtypeSetBit(); } ASTNODE_NODE_FUNCS(OneHot) @@ -5936,7 +5937,7 @@ class AstOneHot0 final : public AstNodeUniop { // True if only single bit, or no bits set in vector public: AstOneHot0(FileLine* fl, AstNode* lhsp) - : ASTGEN_SUPER(fl, lhsp) { + : ASTGEN_SUPER_OneHot0(fl, lhsp) { dtypeSetBit(); } ASTNODE_NODE_FUNCS(OneHot0) @@ -5953,13 +5954,13 @@ class AstCast final : public AstNode { // Cast to appropriate data type - note lhsp is value, to match AstTypedef, AstCCast, etc public: AstCast(FileLine* fl, AstNode* lhsp, VFlagChildDType, AstNodeDType* dtp) - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_Cast(fl) { setOp1p(lhsp); setOp2p(dtp); dtypeFrom(dtp); } AstCast(FileLine* fl, AstNode* lhsp, AstNodeDType* dtp) - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_Cast(fl) { setOp1p(lhsp); dtypeFrom(dtp); } @@ -5987,7 +5988,7 @@ class AstCastDynamic final : public AstNodeBiop { // value reading from. Suggest use fromp()/top() instead of lhsp/rhsp(). public: AstCastDynamic(FileLine* fl, AstNode* lhsp, AstNode* rhsp) - : ASTGEN_SUPER(fl, lhsp, rhsp) {} + : ASTGEN_SUPER_CastDynamic(fl, lhsp, rhsp) {} ASTNODE_NODE_FUNCS(CastDynamic) virtual void numberOperate(V3Number& out, const V3Number& lhs, const V3Number& rhs) override { V3ERROR_NA; @@ -6012,7 +6013,7 @@ class AstCastParse final : public AstNode { // Cast to appropriate type, where we haven't determined yet what the data type is public: AstCastParse(FileLine* fl, AstNode* lhsp, AstNode* dtp) - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_CastParse(fl) { setOp1p(lhsp); setOp2p(dtp); } @@ -6030,7 +6031,7 @@ class AstCastSize final : public AstNode { // Cast to specific size; signed/twostate inherited from lower element per IEEE public: AstCastSize(FileLine* fl, AstNode* lhsp, AstConst* rhsp) - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_CastSize(fl) { setOp1p(lhsp); setOp2p(rhsp); } @@ -6051,7 +6052,7 @@ private: public: AstCCast(FileLine* fl, AstNode* lhsp, int setwidth, int minwidth = -1) - : ASTGEN_SUPER(fl, lhsp) { + : ASTGEN_SUPER_CCast(fl, lhsp) { m_size = setwidth; if (setwidth) { if (minwidth == -1) minwidth = setwidth; @@ -6059,7 +6060,7 @@ public: } } AstCCast(FileLine* fl, AstNode* lhsp, AstNode* typeFromp) - : ASTGEN_SUPER(fl, lhsp) { + : ASTGEN_SUPER_CCast(fl, lhsp) { dtypeFrom(typeFromp); m_size = width(); } @@ -6082,7 +6083,7 @@ class AstCvtPackString final : public AstNodeUniop { // Convert to Verilator Packed String (aka verilog "string") public: AstCvtPackString(FileLine* fl, AstNode* lhsp) - : ASTGEN_SUPER(fl, lhsp) { + : ASTGEN_SUPER_CvtPackString(fl, lhsp) { dtypeSetString(); } ASTNODE_NODE_FUNCS(CvtPackString) @@ -6098,7 +6099,7 @@ public: class AstFEof final : public AstNodeUniop { public: AstFEof(FileLine* fl, AstNode* lhsp) - : ASTGEN_SUPER(fl, lhsp) {} + : ASTGEN_SUPER_FEof(fl, lhsp) {} ASTNODE_NODE_FUNCS(FEof) virtual void numberOperate(V3Number& out, const V3Number& lhs) override { V3ERROR_NA; } virtual string emitVerilog() override { return "%f$feof(%l)"; } @@ -6116,7 +6117,7 @@ public: class AstFError final : public AstNodeMath { public: AstFError(FileLine* fl, AstNode* filep, AstNode* strp) - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_FError(fl) { setOp1p(filep); setOp2p(strp); } @@ -6140,7 +6141,7 @@ public: class AstFGetC final : public AstNodeUniop { public: AstFGetC(FileLine* fl, AstNode* lhsp) - : ASTGEN_SUPER(fl, lhsp) {} + : ASTGEN_SUPER_FGetC(fl, lhsp) {} ASTNODE_NODE_FUNCS(FGetC) virtual void numberOperate(V3Number& out, const V3Number& lhs) override { V3ERROR_NA; } virtual string emitVerilog() override { return "%f$fgetc(%l)"; } @@ -6159,7 +6160,7 @@ public: class AstFUngetC final : public AstNodeBiop { public: AstFUngetC(FileLine* fl, AstNode* lhsp, AstNode* rhsp) - : ASTGEN_SUPER(fl, lhsp, rhsp) {} + : ASTGEN_SUPER_FUngetC(fl, lhsp, rhsp) {} ASTNODE_NODE_FUNCS(FUngetC) virtual void numberOperate(V3Number& out, const V3Number& lhs, const V3Number& rhs) override { V3ERROR_NA; @@ -6202,7 +6203,7 @@ public: class AstLogD final : public AstNodeSystemUniop { public: AstLogD(FileLine* fl, AstNode* lhsp) - : ASTGEN_SUPER(fl, lhsp) {} + : ASTGEN_SUPER_LogD(fl, lhsp) {} ASTNODE_NODE_FUNCS(LogD) virtual void numberOperate(V3Number& out, const V3Number& lhs) override { out.setDouble(std::log(lhs.toDouble())); @@ -6213,7 +6214,7 @@ public: class AstLog10D final : public AstNodeSystemUniop { public: AstLog10D(FileLine* fl, AstNode* lhsp) - : ASTGEN_SUPER(fl, lhsp) {} + : ASTGEN_SUPER_Log10D(fl, lhsp) {} ASTNODE_NODE_FUNCS(Log10D) virtual void numberOperate(V3Number& out, const V3Number& lhs) override { out.setDouble(std::log10(lhs.toDouble())); @@ -6225,7 +6226,7 @@ public: class AstExpD final : public AstNodeSystemUniop { public: AstExpD(FileLine* fl, AstNode* lhsp) - : ASTGEN_SUPER(fl, lhsp) {} + : ASTGEN_SUPER_ExpD(fl, lhsp) {} ASTNODE_NODE_FUNCS(ExpD) virtual void numberOperate(V3Number& out, const V3Number& lhs) override { out.setDouble(std::exp(lhs.toDouble())); @@ -6237,7 +6238,7 @@ public: class AstSqrtD final : public AstNodeSystemUniop { public: AstSqrtD(FileLine* fl, AstNode* lhsp) - : ASTGEN_SUPER(fl, lhsp) {} + : ASTGEN_SUPER_SqrtD(fl, lhsp) {} ASTNODE_NODE_FUNCS(SqrtD) virtual void numberOperate(V3Number& out, const V3Number& lhs) override { out.setDouble(std::sqrt(lhs.toDouble())); @@ -6249,7 +6250,7 @@ public: class AstFloorD final : public AstNodeSystemUniop { public: AstFloorD(FileLine* fl, AstNode* lhsp) - : ASTGEN_SUPER(fl, lhsp) {} + : ASTGEN_SUPER_FloorD(fl, lhsp) {} ASTNODE_NODE_FUNCS(FloorD) virtual void numberOperate(V3Number& out, const V3Number& lhs) override { out.setDouble(std::floor(lhs.toDouble())); @@ -6261,7 +6262,7 @@ public: class AstCeilD final : public AstNodeSystemUniop { public: AstCeilD(FileLine* fl, AstNode* lhsp) - : ASTGEN_SUPER(fl, lhsp) {} + : ASTGEN_SUPER_CeilD(fl, lhsp) {} ASTNODE_NODE_FUNCS(CeilD) virtual void numberOperate(V3Number& out, const V3Number& lhs) override { out.setDouble(std::ceil(lhs.toDouble())); @@ -6273,7 +6274,7 @@ public: class AstSinD final : public AstNodeSystemUniop { public: AstSinD(FileLine* fl, AstNode* lhsp) - : ASTGEN_SUPER(fl, lhsp) {} + : ASTGEN_SUPER_SinD(fl, lhsp) {} ASTNODE_NODE_FUNCS(SinD) virtual void numberOperate(V3Number& out, const V3Number& lhs) override { out.setDouble(std::sin(lhs.toDouble())); @@ -6285,7 +6286,7 @@ public: class AstCosD final : public AstNodeSystemUniop { public: AstCosD(FileLine* fl, AstNode* lhsp) - : ASTGEN_SUPER(fl, lhsp) {} + : ASTGEN_SUPER_CosD(fl, lhsp) {} ASTNODE_NODE_FUNCS(CosD) virtual void numberOperate(V3Number& out, const V3Number& lhs) override { out.setDouble(std::cos(lhs.toDouble())); @@ -6297,7 +6298,7 @@ public: class AstTanD final : public AstNodeSystemUniop { public: AstTanD(FileLine* fl, AstNode* lhsp) - : ASTGEN_SUPER(fl, lhsp) {} + : ASTGEN_SUPER_TanD(fl, lhsp) {} ASTNODE_NODE_FUNCS(TanD) virtual void numberOperate(V3Number& out, const V3Number& lhs) override { out.setDouble(std::tan(lhs.toDouble())); @@ -6309,7 +6310,7 @@ public: class AstAsinD final : public AstNodeSystemUniop { public: AstAsinD(FileLine* fl, AstNode* lhsp) - : ASTGEN_SUPER(fl, lhsp) {} + : ASTGEN_SUPER_AsinD(fl, lhsp) {} ASTNODE_NODE_FUNCS(AsinD) virtual void numberOperate(V3Number& out, const V3Number& lhs) override { out.setDouble(std::asin(lhs.toDouble())); @@ -6321,7 +6322,7 @@ public: class AstAcosD final : public AstNodeSystemUniop { public: AstAcosD(FileLine* fl, AstNode* lhsp) - : ASTGEN_SUPER(fl, lhsp) {} + : ASTGEN_SUPER_AcosD(fl, lhsp) {} ASTNODE_NODE_FUNCS(AcosD) virtual void numberOperate(V3Number& out, const V3Number& lhs) override { out.setDouble(std::acos(lhs.toDouble())); @@ -6333,7 +6334,7 @@ public: class AstAtanD final : public AstNodeSystemUniop { public: AstAtanD(FileLine* fl, AstNode* lhsp) - : ASTGEN_SUPER(fl, lhsp) {} + : ASTGEN_SUPER_AtanD(fl, lhsp) {} ASTNODE_NODE_FUNCS(AtanD) virtual void numberOperate(V3Number& out, const V3Number& lhs) override { out.setDouble(std::atan(lhs.toDouble())); @@ -6345,7 +6346,7 @@ public: class AstSinhD final : public AstNodeSystemUniop { public: AstSinhD(FileLine* fl, AstNode* lhsp) - : ASTGEN_SUPER(fl, lhsp) {} + : ASTGEN_SUPER_SinhD(fl, lhsp) {} ASTNODE_NODE_FUNCS(SinhD) virtual void numberOperate(V3Number& out, const V3Number& lhs) override { out.setDouble(std::sinh(lhs.toDouble())); @@ -6357,7 +6358,7 @@ public: class AstCoshD final : public AstNodeSystemUniop { public: AstCoshD(FileLine* fl, AstNode* lhsp) - : ASTGEN_SUPER(fl, lhsp) {} + : ASTGEN_SUPER_CoshD(fl, lhsp) {} ASTNODE_NODE_FUNCS(CoshD) virtual void numberOperate(V3Number& out, const V3Number& lhs) override { out.setDouble(std::cosh(lhs.toDouble())); @@ -6369,7 +6370,7 @@ public: class AstTanhD final : public AstNodeSystemUniop { public: AstTanhD(FileLine* fl, AstNode* lhsp) - : ASTGEN_SUPER(fl, lhsp) {} + : ASTGEN_SUPER_TanhD(fl, lhsp) {} ASTNODE_NODE_FUNCS(TanhD) virtual void numberOperate(V3Number& out, const V3Number& lhs) override { out.setDouble(std::tanh(lhs.toDouble())); @@ -6381,7 +6382,7 @@ public: class AstAsinhD final : public AstNodeSystemUniop { public: AstAsinhD(FileLine* fl, AstNode* lhsp) - : ASTGEN_SUPER(fl, lhsp) {} + : ASTGEN_SUPER_AsinhD(fl, lhsp) {} ASTNODE_NODE_FUNCS(AsinhD) virtual void numberOperate(V3Number& out, const V3Number& lhs) override { out.setDouble(std::asinh(lhs.toDouble())); @@ -6393,7 +6394,7 @@ public: class AstAcoshD final : public AstNodeSystemUniop { public: AstAcoshD(FileLine* fl, AstNode* lhsp) - : ASTGEN_SUPER(fl, lhsp) {} + : ASTGEN_SUPER_AcoshD(fl, lhsp) {} ASTNODE_NODE_FUNCS(AcoshD) virtual void numberOperate(V3Number& out, const V3Number& lhs) override { out.setDouble(std::acosh(lhs.toDouble())); @@ -6405,7 +6406,7 @@ public: class AstAtanhD final : public AstNodeSystemUniop { public: AstAtanhD(FileLine* fl, AstNode* lhsp) - : ASTGEN_SUPER(fl, lhsp) {} + : ASTGEN_SUPER_AtanhD(fl, lhsp) {} ASTNODE_NODE_FUNCS(AtanhD) virtual void numberOperate(V3Number& out, const V3Number& lhs) override { out.setDouble(std::atanh(lhs.toDouble())); @@ -6417,7 +6418,7 @@ class AstToLowerN final : public AstNodeUniop { // string.tolower() public: AstToLowerN(FileLine* fl, AstNode* lhsp) - : ASTGEN_SUPER(fl, lhsp) { + : ASTGEN_SUPER_ToLowerN(fl, lhsp) { dtypeSetString(); } ASTNODE_NODE_FUNCS(ToLowerN) @@ -6434,7 +6435,7 @@ class AstToUpperN final : public AstNodeUniop { // string.toupper() public: AstToUpperN(FileLine* fl, AstNode* lhsp) - : ASTGEN_SUPER(fl, lhsp) { + : ASTGEN_SUPER_ToUpperN(fl, lhsp) { dtypeSetString(); } ASTNODE_NODE_FUNCS(ToUpperN) @@ -6452,7 +6453,7 @@ class AstTimeImport final : public AstNodeUniop { VTimescale m_timeunit; // Parent module time unit public: AstTimeImport(FileLine* fl, AstNode* lhsp) - : ASTGEN_SUPER(fl, lhsp) {} + : ASTGEN_SUPER_TimeImport(fl, lhsp) {} ASTNODE_NODE_FUNCS(TimeImport) virtual void numberOperate(V3Number& out, const V3Number& lhs) override { V3ERROR_NA; } virtual string emitVerilog() override { return "%l"; } @@ -6474,7 +6475,7 @@ private: FmtType m_fmt; // Operation type public: AstAtoN(FileLine* fl, AstNode* lhsp, FmtType fmt) - : ASTGEN_SUPER(fl, lhsp) + : ASTGEN_SUPER_AtoN(fl, lhsp) , m_fmt{fmt} { fmt == ATOREAL ? dtypeSetDouble() : dtypeSetSigned32(); } @@ -6516,7 +6517,7 @@ public: class AstLogOr final : public AstNodeBiop { public: AstLogOr(FileLine* fl, AstNode* lhsp, AstNode* rhsp) - : ASTGEN_SUPER(fl, lhsp, rhsp) { + : ASTGEN_SUPER_LogOr(fl, lhsp, rhsp) { dtypeSetBit(); } ASTNODE_NODE_FUNCS(LogOr) @@ -6539,7 +6540,7 @@ public: class AstLogAnd final : public AstNodeBiop { public: AstLogAnd(FileLine* fl, AstNode* lhsp, AstNode* rhsp) - : ASTGEN_SUPER(fl, lhsp, rhsp) { + : ASTGEN_SUPER_LogAnd(fl, lhsp, rhsp) { dtypeSetBit(); } ASTNODE_NODE_FUNCS(LogAnd) @@ -6562,7 +6563,7 @@ public: class AstLogEq final : public AstNodeBiCom { public: AstLogEq(FileLine* fl, AstNode* lhsp, AstNode* rhsp) - : ASTGEN_SUPER(fl, lhsp, rhsp) { + : ASTGEN_SUPER_LogEq(fl, lhsp, rhsp) { dtypeSetBit(); } ASTNODE_NODE_FUNCS(LogEq) @@ -6585,7 +6586,7 @@ public: class AstLogIf final : public AstNodeBiop { public: AstLogIf(FileLine* fl, AstNode* lhsp, AstNode* rhsp) - : ASTGEN_SUPER(fl, lhsp, rhsp) { + : ASTGEN_SUPER_LogIf(fl, lhsp, rhsp) { dtypeSetBit(); } ASTNODE_NODE_FUNCS(LogIf) @@ -6608,7 +6609,7 @@ public: class AstOr final : public AstNodeBiComAsv { public: AstOr(FileLine* fl, AstNode* lhsp, AstNode* rhsp) - : ASTGEN_SUPER(fl, lhsp, rhsp) { + : ASTGEN_SUPER_Or(fl, lhsp, rhsp) { dtypeFrom(lhsp); } ASTNODE_NODE_FUNCS(Or) @@ -6630,7 +6631,7 @@ public: class AstAnd final : public AstNodeBiComAsv { public: AstAnd(FileLine* fl, AstNode* lhsp, AstNode* rhsp) - : ASTGEN_SUPER(fl, lhsp, rhsp) { + : ASTGEN_SUPER_And(fl, lhsp, rhsp) { dtypeFrom(lhsp); } ASTNODE_NODE_FUNCS(And) @@ -6652,7 +6653,7 @@ public: class AstXor final : public AstNodeBiComAsv { public: AstXor(FileLine* fl, AstNode* lhsp, AstNode* rhsp) - : ASTGEN_SUPER(fl, lhsp, rhsp) { + : ASTGEN_SUPER_Xor(fl, lhsp, rhsp) { dtypeFrom(lhsp); } ASTNODE_NODE_FUNCS(Xor) @@ -6674,7 +6675,7 @@ public: class AstEq final : public AstNodeBiCom { public: AstEq(FileLine* fl, AstNode* lhsp, AstNode* rhsp) - : ASTGEN_SUPER(fl, lhsp, rhsp) { + : ASTGEN_SUPER_Eq(fl, lhsp, rhsp) { dtypeSetBit(); } ASTNODE_NODE_FUNCS(Eq) @@ -6698,7 +6699,7 @@ public: class AstEqD final : public AstNodeBiCom { public: AstEqD(FileLine* fl, AstNode* lhsp, AstNode* rhsp) - : ASTGEN_SUPER(fl, lhsp, rhsp) { + : ASTGEN_SUPER_EqD(fl, lhsp, rhsp) { dtypeSetBit(); } ASTNODE_NODE_FUNCS(EqD) @@ -6722,7 +6723,7 @@ public: class AstEqN final : public AstNodeBiCom { public: AstEqN(FileLine* fl, AstNode* lhsp, AstNode* rhsp) - : ASTGEN_SUPER(fl, lhsp, rhsp) { + : ASTGEN_SUPER_EqN(fl, lhsp, rhsp) { dtypeSetBit(); } ASTNODE_NODE_FUNCS(EqN) @@ -6746,7 +6747,7 @@ public: class AstNeq final : public AstNodeBiCom { public: AstNeq(FileLine* fl, AstNode* lhsp, AstNode* rhsp) - : ASTGEN_SUPER(fl, lhsp, rhsp) { + : ASTGEN_SUPER_Neq(fl, lhsp, rhsp) { dtypeSetBit(); } ASTNODE_NODE_FUNCS(Neq) @@ -6768,7 +6769,7 @@ public: class AstNeqD final : public AstNodeBiCom { public: AstNeqD(FileLine* fl, AstNode* lhsp, AstNode* rhsp) - : ASTGEN_SUPER(fl, lhsp, rhsp) { + : ASTGEN_SUPER_NeqD(fl, lhsp, rhsp) { dtypeSetBit(); } ASTNODE_NODE_FUNCS(NeqD) @@ -6792,7 +6793,7 @@ public: class AstNeqN final : public AstNodeBiCom { public: AstNeqN(FileLine* fl, AstNode* lhsp, AstNode* rhsp) - : ASTGEN_SUPER(fl, lhsp, rhsp) { + : ASTGEN_SUPER_NeqN(fl, lhsp, rhsp) { dtypeSetBit(); } ASTNODE_NODE_FUNCS(NeqN) @@ -6816,7 +6817,7 @@ public: class AstLt final : public AstNodeBiop { public: AstLt(FileLine* fl, AstNode* lhsp, AstNode* rhsp) - : ASTGEN_SUPER(fl, lhsp, rhsp) { + : ASTGEN_SUPER_Lt(fl, lhsp, rhsp) { dtypeSetBit(); } ASTNODE_NODE_FUNCS(Lt) @@ -6838,7 +6839,7 @@ public: class AstLtD final : public AstNodeBiop { public: AstLtD(FileLine* fl, AstNode* lhsp, AstNode* rhsp) - : ASTGEN_SUPER(fl, lhsp, rhsp) { + : ASTGEN_SUPER_LtD(fl, lhsp, rhsp) { dtypeSetBit(); } ASTNODE_NODE_FUNCS(LtD) @@ -6862,7 +6863,7 @@ public: class AstLtS final : public AstNodeBiop { public: AstLtS(FileLine* fl, AstNode* lhsp, AstNode* rhsp) - : ASTGEN_SUPER(fl, lhsp, rhsp) { + : ASTGEN_SUPER_LtS(fl, lhsp, rhsp) { dtypeSetBit(); } ASTNODE_NODE_FUNCS(LtS) @@ -6885,7 +6886,7 @@ public: class AstLtN final : public AstNodeBiop { public: AstLtN(FileLine* fl, AstNode* lhsp, AstNode* rhsp) - : ASTGEN_SUPER(fl, lhsp, rhsp) { + : ASTGEN_SUPER_LtN(fl, lhsp, rhsp) { dtypeSetBit(); } ASTNODE_NODE_FUNCS(LtN) @@ -6909,7 +6910,7 @@ public: class AstGt final : public AstNodeBiop { public: AstGt(FileLine* fl, AstNode* lhsp, AstNode* rhsp) - : ASTGEN_SUPER(fl, lhsp, rhsp) { + : ASTGEN_SUPER_Gt(fl, lhsp, rhsp) { dtypeSetBit(); } ASTNODE_NODE_FUNCS(Gt) @@ -6931,7 +6932,7 @@ public: class AstGtD final : public AstNodeBiop { public: AstGtD(FileLine* fl, AstNode* lhsp, AstNode* rhsp) - : ASTGEN_SUPER(fl, lhsp, rhsp) { + : ASTGEN_SUPER_GtD(fl, lhsp, rhsp) { dtypeSetBit(); } ASTNODE_NODE_FUNCS(GtD) @@ -6955,7 +6956,7 @@ public: class AstGtS final : public AstNodeBiop { public: AstGtS(FileLine* fl, AstNode* lhsp, AstNode* rhsp) - : ASTGEN_SUPER(fl, lhsp, rhsp) { + : ASTGEN_SUPER_GtS(fl, lhsp, rhsp) { dtypeSetBit(); } ASTNODE_NODE_FUNCS(GtS) @@ -6978,7 +6979,7 @@ public: class AstGtN final : public AstNodeBiop { public: AstGtN(FileLine* fl, AstNode* lhsp, AstNode* rhsp) - : ASTGEN_SUPER(fl, lhsp, rhsp) { + : ASTGEN_SUPER_GtN(fl, lhsp, rhsp) { dtypeSetBit(); } ASTNODE_NODE_FUNCS(GtN) @@ -7002,7 +7003,7 @@ public: class AstGte final : public AstNodeBiop { public: AstGte(FileLine* fl, AstNode* lhsp, AstNode* rhsp) - : ASTGEN_SUPER(fl, lhsp, rhsp) { + : ASTGEN_SUPER_Gte(fl, lhsp, rhsp) { dtypeSetBit(); } ASTNODE_NODE_FUNCS(Gte) @@ -7026,7 +7027,7 @@ public: class AstGteD final : public AstNodeBiop { public: AstGteD(FileLine* fl, AstNode* lhsp, AstNode* rhsp) - : ASTGEN_SUPER(fl, lhsp, rhsp) { + : ASTGEN_SUPER_GteD(fl, lhsp, rhsp) { dtypeSetBit(); } ASTNODE_NODE_FUNCS(GteD) @@ -7050,7 +7051,7 @@ public: class AstGteS final : public AstNodeBiop { public: AstGteS(FileLine* fl, AstNode* lhsp, AstNode* rhsp) - : ASTGEN_SUPER(fl, lhsp, rhsp) { + : ASTGEN_SUPER_GteS(fl, lhsp, rhsp) { dtypeSetBit(); } ASTNODE_NODE_FUNCS(GteS) @@ -7073,7 +7074,7 @@ public: class AstGteN final : public AstNodeBiop { public: AstGteN(FileLine* fl, AstNode* lhsp, AstNode* rhsp) - : ASTGEN_SUPER(fl, lhsp, rhsp) { + : ASTGEN_SUPER_GteN(fl, lhsp, rhsp) { dtypeSetBit(); } ASTNODE_NODE_FUNCS(GteN) @@ -7097,7 +7098,7 @@ public: class AstLte final : public AstNodeBiop { public: AstLte(FileLine* fl, AstNode* lhsp, AstNode* rhsp) - : ASTGEN_SUPER(fl, lhsp, rhsp) { + : ASTGEN_SUPER_Lte(fl, lhsp, rhsp) { dtypeSetBit(); } ASTNODE_NODE_FUNCS(Lte) @@ -7121,7 +7122,7 @@ public: class AstLteD final : public AstNodeBiop { public: AstLteD(FileLine* fl, AstNode* lhsp, AstNode* rhsp) - : ASTGEN_SUPER(fl, lhsp, rhsp) { + : ASTGEN_SUPER_LteD(fl, lhsp, rhsp) { dtypeSetBit(); } ASTNODE_NODE_FUNCS(LteD) @@ -7145,7 +7146,7 @@ public: class AstLteS final : public AstNodeBiop { public: AstLteS(FileLine* fl, AstNode* lhsp, AstNode* rhsp) - : ASTGEN_SUPER(fl, lhsp, rhsp) { + : ASTGEN_SUPER_LteS(fl, lhsp, rhsp) { dtypeSetBit(); } ASTNODE_NODE_FUNCS(LteS) @@ -7168,7 +7169,7 @@ public: class AstLteN final : public AstNodeBiop { public: AstLteN(FileLine* fl, AstNode* lhsp, AstNode* rhsp) - : ASTGEN_SUPER(fl, lhsp, rhsp) { + : ASTGEN_SUPER_LteN(fl, lhsp, rhsp) { dtypeSetBit(); } ASTNODE_NODE_FUNCS(LteN) @@ -7192,7 +7193,7 @@ public: class AstShiftL final : public AstNodeBiop { public: AstShiftL(FileLine* fl, AstNode* lhsp, AstNode* rhsp, int setwidth = 0) - : ASTGEN_SUPER(fl, lhsp, rhsp) { + : ASTGEN_SUPER_ShiftL(fl, lhsp, rhsp) { if (setwidth) dtypeSetLogicSized(setwidth, VSigning::UNSIGNED); } ASTNODE_NODE_FUNCS(ShiftL) @@ -7216,7 +7217,7 @@ public: class AstShiftR final : public AstNodeBiop { public: AstShiftR(FileLine* fl, AstNode* lhsp, AstNode* rhsp, int setwidth = 0) - : ASTGEN_SUPER(fl, lhsp, rhsp) { + : ASTGEN_SUPER_ShiftR(fl, lhsp, rhsp) { if (setwidth) dtypeSetLogicSized(setwidth, VSigning::UNSIGNED); } ASTNODE_NODE_FUNCS(ShiftR) @@ -7243,7 +7244,7 @@ class AstShiftRS final : public AstNodeBiop { // Output data type's width determines which bit is used for sign extension public: AstShiftRS(FileLine* fl, AstNode* lhsp, AstNode* rhsp, int setwidth = 0) - : ASTGEN_SUPER(fl, lhsp, rhsp) { + : ASTGEN_SUPER_ShiftRS(fl, lhsp, rhsp) { // Important that widthMin be correct, as opExtend requires it after V3Expand if (setwidth) dtypeSetLogicSized(setwidth, VSigning::SIGNED); } @@ -7267,7 +7268,7 @@ public: class AstAdd final : public AstNodeBiComAsv { public: AstAdd(FileLine* fl, AstNode* lhsp, AstNode* rhsp) - : ASTGEN_SUPER(fl, lhsp, rhsp) { + : ASTGEN_SUPER_Add(fl, lhsp, rhsp) { dtypeFrom(lhsp); } ASTNODE_NODE_FUNCS(Add) @@ -7289,7 +7290,7 @@ public: class AstAddD final : public AstNodeBiComAsv { public: AstAddD(FileLine* fl, AstNode* lhsp, AstNode* rhsp) - : ASTGEN_SUPER(fl, lhsp, rhsp) { + : ASTGEN_SUPER_AddD(fl, lhsp, rhsp) { dtypeSetDouble(); } ASTNODE_NODE_FUNCS(AddD) @@ -7313,7 +7314,7 @@ public: class AstSub final : public AstNodeBiop { public: AstSub(FileLine* fl, AstNode* lhsp, AstNode* rhsp) - : ASTGEN_SUPER(fl, lhsp, rhsp) { + : ASTGEN_SUPER_Sub(fl, lhsp, rhsp) { dtypeFrom(lhsp); } ASTNODE_NODE_FUNCS(Sub) @@ -7335,7 +7336,7 @@ public: class AstSubD final : public AstNodeBiop { public: AstSubD(FileLine* fl, AstNode* lhsp, AstNode* rhsp) - : ASTGEN_SUPER(fl, lhsp, rhsp) { + : ASTGEN_SUPER_SubD(fl, lhsp, rhsp) { dtypeSetDouble(); } ASTNODE_NODE_FUNCS(SubD) @@ -7359,7 +7360,7 @@ public: class AstMul final : public AstNodeBiComAsv { public: AstMul(FileLine* fl, AstNode* lhsp, AstNode* rhsp) - : ASTGEN_SUPER(fl, lhsp, rhsp) { + : ASTGEN_SUPER_Mul(fl, lhsp, rhsp) { dtypeFrom(lhsp); } ASTNODE_NODE_FUNCS(Mul) @@ -7382,7 +7383,7 @@ public: class AstMulD final : public AstNodeBiComAsv { public: AstMulD(FileLine* fl, AstNode* lhsp, AstNode* rhsp) - : ASTGEN_SUPER(fl, lhsp, rhsp) { + : ASTGEN_SUPER_MulD(fl, lhsp, rhsp) { dtypeSetDouble(); } ASTNODE_NODE_FUNCS(MulD) @@ -7406,7 +7407,7 @@ public: class AstMulS final : public AstNodeBiComAsv { public: AstMulS(FileLine* fl, AstNode* lhsp, AstNode* rhsp) - : ASTGEN_SUPER(fl, lhsp, rhsp) { + : ASTGEN_SUPER_MulS(fl, lhsp, rhsp) { dtypeFrom(lhsp); } ASTNODE_NODE_FUNCS(MulS) @@ -7431,7 +7432,7 @@ public: class AstDiv final : public AstNodeBiop { public: AstDiv(FileLine* fl, AstNode* lhsp, AstNode* rhsp) - : ASTGEN_SUPER(fl, lhsp, rhsp) { + : ASTGEN_SUPER_Div(fl, lhsp, rhsp) { dtypeFrom(lhsp); } ASTNODE_NODE_FUNCS(Div) @@ -7453,7 +7454,7 @@ public: class AstDivD final : public AstNodeBiop { public: AstDivD(FileLine* fl, AstNode* lhsp, AstNode* rhsp) - : ASTGEN_SUPER(fl, lhsp, rhsp) { + : ASTGEN_SUPER_DivD(fl, lhsp, rhsp) { dtypeSetDouble(); } ASTNODE_NODE_FUNCS(DivD) @@ -7477,7 +7478,7 @@ public: class AstDivS final : public AstNodeBiop { public: AstDivS(FileLine* fl, AstNode* lhsp, AstNode* rhsp) - : ASTGEN_SUPER(fl, lhsp, rhsp) { + : ASTGEN_SUPER_DivS(fl, lhsp, rhsp) { dtypeFrom(lhsp); } ASTNODE_NODE_FUNCS(DivS) @@ -7500,7 +7501,7 @@ public: class AstModDiv final : public AstNodeBiop { public: AstModDiv(FileLine* fl, AstNode* lhsp, AstNode* rhsp) - : ASTGEN_SUPER(fl, lhsp, rhsp) { + : ASTGEN_SUPER_ModDiv(fl, lhsp, rhsp) { dtypeFrom(lhsp); } ASTNODE_NODE_FUNCS(ModDiv) @@ -7522,7 +7523,7 @@ public: class AstModDivS final : public AstNodeBiop { public: AstModDivS(FileLine* fl, AstNode* lhsp, AstNode* rhsp) - : ASTGEN_SUPER(fl, lhsp, rhsp) { + : ASTGEN_SUPER_ModDivS(fl, lhsp, rhsp) { dtypeFrom(lhsp); } ASTNODE_NODE_FUNCS(ModDivS) @@ -7545,7 +7546,7 @@ public: class AstPow final : public AstNodeBiop { public: AstPow(FileLine* fl, AstNode* lhsp, AstNode* rhsp) - : ASTGEN_SUPER(fl, lhsp, rhsp) { + : ASTGEN_SUPER_Pow(fl, lhsp, rhsp) { dtypeFrom(lhsp); } ASTNODE_NODE_FUNCS(Pow) @@ -7568,7 +7569,7 @@ public: class AstPowD final : public AstNodeBiop { public: AstPowD(FileLine* fl, AstNode* lhsp, AstNode* rhsp) - : ASTGEN_SUPER(fl, lhsp, rhsp) { + : ASTGEN_SUPER_PowD(fl, lhsp, rhsp) { dtypeSetDouble(); } ASTNODE_NODE_FUNCS(PowD) @@ -7591,7 +7592,7 @@ public: class AstPowSU final : public AstNodeBiop { public: AstPowSU(FileLine* fl, AstNode* lhsp, AstNode* rhsp) - : ASTGEN_SUPER(fl, lhsp, rhsp) { + : ASTGEN_SUPER_PowSU(fl, lhsp, rhsp) { dtypeFrom(lhsp); } ASTNODE_NODE_FUNCS(PowSU) @@ -7617,7 +7618,7 @@ public: class AstPowSS final : public AstNodeBiop { public: AstPowSS(FileLine* fl, AstNode* lhsp, AstNode* rhsp) - : ASTGEN_SUPER(fl, lhsp, rhsp) { + : ASTGEN_SUPER_PowSS(fl, lhsp, rhsp) { dtypeFrom(lhsp); } ASTNODE_NODE_FUNCS(PowSS) @@ -7643,7 +7644,7 @@ public: class AstPowUS final : public AstNodeBiop { public: AstPowUS(FileLine* fl, AstNode* lhsp, AstNode* rhsp) - : ASTGEN_SUPER(fl, lhsp, rhsp) { + : ASTGEN_SUPER_PowUS(fl, lhsp, rhsp) { dtypeFrom(lhsp); } ASTNODE_NODE_FUNCS(PowUS) @@ -7674,7 +7675,7 @@ class AstPreAdd final : public AstNodeTriop { // Children: thsp: tree with AstVarRef LValue that is stored after operation public: AstPreAdd(FileLine* fl, AstNode* lhsp, AstNode* rhsp, AstNode* thsp) - : ASTGEN_SUPER(fl, lhsp, rhsp, thsp) {} + : ASTGEN_SUPER_PreAdd(fl, lhsp, rhsp, thsp) {} ASTNODE_NODE_FUNCS(PreAdd) virtual void numberOperate(V3Number& out, const V3Number& lhs, const V3Number& rhs, const V3Number& ths) override { @@ -7699,7 +7700,7 @@ class AstPreSub final : public AstNodeTriop { // Children: thsp: tree with AstVarRef LValue that is stored after operation public: AstPreSub(FileLine* fl, AstNode* lhsp, AstNode* rhsp, AstNode* thsp) - : ASTGEN_SUPER(fl, lhsp, rhsp, thsp) {} + : ASTGEN_SUPER_PreSub(fl, lhsp, rhsp, thsp) {} ASTNODE_NODE_FUNCS(PreSub) virtual void numberOperate(V3Number& out, const V3Number& lhs, const V3Number& rhs, const V3Number& ths) override { @@ -7724,7 +7725,7 @@ class AstPostAdd final : public AstNodeTriop { // Children: thsp: tree with AstVarRef LValue that is stored after operation public: AstPostAdd(FileLine* fl, AstNode* lhsp, AstNode* rhsp, AstNode* thsp) - : ASTGEN_SUPER(fl, lhsp, rhsp, thsp) {} + : ASTGEN_SUPER_PostAdd(fl, lhsp, rhsp, thsp) {} ASTNODE_NODE_FUNCS(PostAdd) virtual void numberOperate(V3Number& out, const V3Number& lhs, const V3Number& rhs, const V3Number& ths) override { @@ -7749,7 +7750,7 @@ class AstPostSub final : public AstNodeTriop { // Children: thsp: tree with AstVarRef LValue that is stored after operation public: AstPostSub(FileLine* fl, AstNode* lhsp, AstNode* rhsp, AstNode* thsp) - : ASTGEN_SUPER(fl, lhsp, rhsp, thsp) {} + : ASTGEN_SUPER_PostSub(fl, lhsp, rhsp, thsp) {} ASTNODE_NODE_FUNCS(PostSub) virtual void numberOperate(V3Number& out, const V3Number& lhs, const V3Number& rhs, const V3Number& ths) override { @@ -7769,7 +7770,7 @@ public: class AstEqCase final : public AstNodeBiCom { public: AstEqCase(FileLine* fl, AstNode* lhsp, AstNode* rhsp) - : ASTGEN_SUPER(fl, lhsp, rhsp) { + : ASTGEN_SUPER_EqCase(fl, lhsp, rhsp) { dtypeSetBit(); } ASTNODE_NODE_FUNCS(EqCase) @@ -7791,7 +7792,7 @@ public: class AstNeqCase final : public AstNodeBiCom { public: AstNeqCase(FileLine* fl, AstNode* lhsp, AstNode* rhsp) - : ASTGEN_SUPER(fl, lhsp, rhsp) { + : ASTGEN_SUPER_NeqCase(fl, lhsp, rhsp) { dtypeSetBit(); } ASTNODE_NODE_FUNCS(NeqCase) @@ -7814,7 +7815,7 @@ class AstEqWild final : public AstNodeBiop { // Note wildcard operator rhs differs from lhs public: AstEqWild(FileLine* fl, AstNode* lhsp, AstNode* rhsp) - : ASTGEN_SUPER(fl, lhsp, rhsp) { + : ASTGEN_SUPER_EqWild(fl, lhsp, rhsp) { dtypeSetBit(); } ASTNODE_NODE_FUNCS(EqWild) @@ -7838,7 +7839,7 @@ public: class AstNeqWild final : public AstNodeBiop { public: AstNeqWild(FileLine* fl, AstNode* lhsp, AstNode* rhsp) - : ASTGEN_SUPER(fl, lhsp, rhsp) { + : ASTGEN_SUPER_NeqWild(fl, lhsp, rhsp) { dtypeSetBit(); } ASTNODE_NODE_FUNCS(NeqWild) @@ -7861,7 +7862,7 @@ class AstConcat final : public AstNodeBiop { // If you're looking for {#{}}, see AstReplicate public: AstConcat(FileLine* fl, AstNode* lhsp, AstNode* rhsp) - : ASTGEN_SUPER(fl, lhsp, rhsp) { + : ASTGEN_SUPER_Concat(fl, lhsp, rhsp) { if (lhsp->dtypep() && rhsp->dtypep()) { dtypeSetLogicSized(lhsp->dtypep()->width() + rhsp->dtypep()->width(), VSigning::UNSIGNED); @@ -7887,7 +7888,7 @@ class AstConcatN final : public AstNodeBiop { // String concatenate public: AstConcatN(FileLine* fl, AstNode* lhsp, AstNode* rhsp) - : ASTGEN_SUPER(fl, lhsp, rhsp) { + : ASTGEN_SUPER_ConcatN(fl, lhsp, rhsp) { dtypeSetString(); } ASTNODE_NODE_FUNCS(ConcatN) @@ -7912,7 +7913,7 @@ class AstReplicate final : public AstNodeBiop { // Verilog {rhs{lhs}} - Note rhsp() is the replicate value, not the lhsp() public: AstReplicate(FileLine* fl, AstNode* lhsp, AstNode* rhsp) - : ASTGEN_SUPER(fl, lhsp, rhsp) { + : ASTGEN_SUPER_Replicate(fl, lhsp, rhsp) { if (lhsp) { if (const AstConst* constp = VN_CAST(rhsp, Const)) { dtypeSetLogicSized(lhsp->width() * constp->toUInt(), VSigning::UNSIGNED); @@ -7941,7 +7942,7 @@ class AstReplicateN final : public AstNodeBiop { // String replicate public: AstReplicateN(FileLine* fl, AstNode* lhsp, AstNode* rhsp) - : ASTGEN_SUPER(fl, lhsp, rhsp) { + : ASTGEN_SUPER_ReplicateN(fl, lhsp, rhsp) { dtypeSetString(); } AstReplicateN(FileLine* fl, AstNode* lhsp, uint32_t repCount) @@ -7967,7 +7968,7 @@ class AstStreamL final : public AstNodeStream { // Verilog {rhs{lhs}} - Note rhsp() is the slice size, not the lhsp() public: AstStreamL(FileLine* fl, AstNode* lhsp, AstNode* rhsp) - : ASTGEN_SUPER(fl, lhsp, rhsp) {} + : ASTGEN_SUPER_StreamL(fl, lhsp, rhsp) {} ASTNODE_NODE_FUNCS(StreamL) virtual AstNode* cloneType(AstNode* lhsp, AstNode* rhsp) override { return new AstStreamL(this->fileline(), lhsp, rhsp); @@ -7988,7 +7989,7 @@ class AstStreamR final : public AstNodeStream { // Verilog {rhs{lhs}} - Note rhsp() is the slice size, not the lhsp() public: AstStreamR(FileLine* fl, AstNode* lhsp, AstNode* rhsp) - : ASTGEN_SUPER(fl, lhsp, rhsp) {} + : ASTGEN_SUPER_StreamR(fl, lhsp, rhsp) {} ASTNODE_NODE_FUNCS(StreamR) virtual AstNode* cloneType(AstNode* lhsp, AstNode* rhsp) override { return new AstStreamR(this->fileline(), lhsp, rhsp); @@ -8011,7 +8012,7 @@ class AstBufIf1 final : public AstNodeBiop { // bit enables respective rhsp bit public: AstBufIf1(FileLine* fl, AstNode* lhsp, AstNode* rhsp) - : ASTGEN_SUPER(fl, lhsp, rhsp) { + : ASTGEN_SUPER_BufIf1(fl, lhsp, rhsp) { dtypeFrom(lhsp); } ASTNODE_NODE_FUNCS(BufIf1) @@ -8033,7 +8034,7 @@ public: class AstFGetS final : public AstNodeBiop { public: AstFGetS(FileLine* fl, AstNode* lhsp, AstNode* rhsp) - : ASTGEN_SUPER(fl, lhsp, rhsp) {} + : ASTGEN_SUPER_FGetS(fl, lhsp, rhsp) {} ASTNODE_NODE_FUNCS(FGetS) virtual AstNode* cloneType(AstNode* lhsp, AstNode* rhsp) override { return new AstFGetS(this->fileline(), lhsp, rhsp); @@ -8074,7 +8075,7 @@ public: class AstAtan2D final : public AstNodeSystemBiop { public: AstAtan2D(FileLine* fl, AstNode* lhsp, AstNode* rhsp) - : ASTGEN_SUPER(fl, lhsp, rhsp) {} + : ASTGEN_SUPER_Atan2D(fl, lhsp, rhsp) {} ASTNODE_NODE_FUNCS(Atan2D) virtual AstNode* cloneType(AstNode* lhsp, AstNode* rhsp) override { return new AstAtan2D(this->fileline(), lhsp, rhsp); @@ -8089,7 +8090,7 @@ public: class AstHypotD final : public AstNodeSystemBiop { public: AstHypotD(FileLine* fl, AstNode* lhsp, AstNode* rhsp) - : ASTGEN_SUPER(fl, lhsp, rhsp) {} + : ASTGEN_SUPER_HypotD(fl, lhsp, rhsp) {} ASTNODE_NODE_FUNCS(HypotD) virtual AstNode* cloneType(AstNode* lhsp, AstNode* rhsp) override { return new AstHypotD(this->fileline(), lhsp, rhsp); @@ -8105,7 +8106,7 @@ class AstPutcN final : public AstNodeTriop { // Verilog string.putc() public: AstPutcN(FileLine* fl, AstNode* lhsp, AstNode* rhsp, AstNode* ths) - : ASTGEN_SUPER(fl, lhsp, rhsp, ths) { + : ASTGEN_SUPER_PutcN(fl, lhsp, rhsp, ths) { dtypeSetString(); } ASTNODE_NODE_FUNCS(PutcN) @@ -8131,7 +8132,7 @@ class AstGetcN final : public AstNodeBiop { // Verilog string.getc() public: AstGetcN(FileLine* fl, AstNode* lhsp, AstNode* rhsp) - : ASTGEN_SUPER(fl, lhsp, rhsp) { + : ASTGEN_SUPER_GetcN(fl, lhsp, rhsp) { dtypeSetBitSized(8, VSigning::UNSIGNED); } ASTNODE_NODE_FUNCS(GetcN) @@ -8158,7 +8159,7 @@ class AstGetcRefN final : public AstNodeBiop { // Spec says is of type byte (not string of single character) public: AstGetcRefN(FileLine* fl, AstNode* lhsp, AstNode* rhsp) - : ASTGEN_SUPER(fl, lhsp, rhsp) { + : ASTGEN_SUPER_GetcRefN(fl, lhsp, rhsp) { dtypeSetBitSized(8, VSigning::UNSIGNED); } ASTNODE_NODE_FUNCS(GetcRefN) @@ -8183,7 +8184,7 @@ class AstSubstrN final : public AstNodeTriop { // Verilog string.substr() public: AstSubstrN(FileLine* fl, AstNode* lhsp, AstNode* rhsp, AstNode* ths) - : ASTGEN_SUPER(fl, lhsp, rhsp, ths) { + : ASTGEN_SUPER_SubstrN(fl, lhsp, rhsp, ths) { dtypeSetString(); } ASTNODE_NODE_FUNCS(SubstrN) @@ -8211,7 +8212,7 @@ private: bool m_ignoreCase; // True for str.icompare() public: AstCompareNN(FileLine* fl, AstNode* lhsp, AstNode* rhsp, bool ignoreCase) - : ASTGEN_SUPER(fl, lhsp, rhsp) + : ASTGEN_SUPER_CompareNN(fl, lhsp, rhsp) , m_ignoreCase{ignoreCase} { dtypeSetUInt32(); } @@ -8244,7 +8245,7 @@ class AstFell final : public AstNodeMath { // Children: expression public: AstFell(FileLine* fl, AstNode* exprp) - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_Fell(fl) { addOp1p(exprp); } ASTNODE_NODE_FUNCS(Fell) @@ -8265,7 +8266,7 @@ class AstPast final : public AstNodeMath { // Children: expression public: AstPast(FileLine* fl, AstNode* exprp, AstNode* ticksp) - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_Past(fl) { addOp1p(exprp); addNOp2p(ticksp); } @@ -8288,7 +8289,7 @@ class AstRose final : public AstNodeMath { // Children: expression public: AstRose(FileLine* fl, AstNode* exprp) - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_Rose(fl) { addOp1p(exprp); } ASTNODE_NODE_FUNCS(Rose) @@ -8309,7 +8310,7 @@ class AstSampled final : public AstNodeMath { // Children: expression public: AstSampled(FileLine* fl, AstNode* exprp) - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_Sampled(fl) { addOp1p(exprp); } ASTNODE_NODE_FUNCS(Sampled) @@ -8328,7 +8329,7 @@ class AstStable final : public AstNodeMath { // Children: expression public: AstStable(FileLine* fl, AstNode* exprp) - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_Stable(fl) { addOp1p(exprp); } ASTNODE_NODE_FUNCS(Stable) @@ -8349,7 +8350,7 @@ class AstPattern final : public AstNodeMath { // Children: expression, AstPattern, AstPatReplicate public: AstPattern(FileLine* fl, AstNode* itemsp) - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_Pattern(fl) { addNOp2p(itemsp); } ASTNODE_NODE_FUNCS(Pattern) @@ -8374,7 +8375,7 @@ private: public: AstPatMember(FileLine* fl, AstNode* lhsp, AstNode* keyp, AstNode* repp) - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_PatMember(fl) { addOp1p(lhsp), setNOp2p(keyp), setNOp3p(repp); } ASTNODE_NODE_FUNCS(PatMember) @@ -8398,7 +8399,7 @@ class AstImplication final : public AstNodeMath { // Children: expression public: AstImplication(FileLine* fl, AstNode* lhs, AstNode* rhs) - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_Implication(fl) { setOp1p(lhs); setOp2p(rhs); } @@ -8426,7 +8427,7 @@ class AstClocking final : public AstNode { // Children: Assertions public: AstClocking(FileLine* fl, AstSenItem* sensesp, AstNode* bodysp) - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_Clocking(fl) { addOp1p(sensesp); addNOp2p(bodysp); } @@ -8445,7 +8446,7 @@ class AstPropClocked final : public AstNode { // Children: SENITEM, Properties public: AstPropClocked(FileLine* fl, AstSenItem* sensesp, AstNode* disablep, AstNode* propp) - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_PropClocked(fl) { addNOp1p(sensesp); addNOp2p(disablep); addOp3p(propp); @@ -8492,7 +8493,7 @@ public: ASTNODE_NODE_FUNCS(Assert) AstAssert(FileLine* fl, AstNode* propp, AstNode* passsp, AstNode* failsp, bool immediate, const string& name = "") - : ASTGEN_SUPER(fl, propp, passsp, immediate, name) { + : ASTGEN_SUPER_Assert(fl, propp, passsp, immediate, name) { addNOp3p(failsp); } AstNode* failsp() const { return op3p(); } // op3 = if assertion fails @@ -8504,7 +8505,7 @@ public: ASTNODE_NODE_FUNCS(AssertIntrinsic) AstAssertIntrinsic(FileLine* fl, AstNode* propp, AstNode* passsp, AstNode* failsp, bool immediate, const string& name = "") - : ASTGEN_SUPER(fl, propp, passsp, immediate, name) { + : ASTGEN_SUPER_AssertIntrinsic(fl, propp, passsp, immediate, name) { addNOp3p(failsp); } AstNode* failsp() const { return op3p(); } // op3 = if assertion fails @@ -8515,7 +8516,7 @@ public: ASTNODE_NODE_FUNCS(Cover) AstCover(FileLine* fl, AstNode* propp, AstNode* stmtsp, bool immediate, const string& name = "") - : ASTGEN_SUPER(fl, propp, stmtsp, immediate, name) {} + : ASTGEN_SUPER_Cover(fl, propp, stmtsp, immediate, name) {} AstNode* coverincp() const { return op3p(); } // op3 = coverage node void coverincp(AstCoverInc* nodep) { addOp3p(nodep); } // op3 = coverage node virtual bool immediate() const { return false; } @@ -8525,7 +8526,7 @@ class AstRestrict final : public AstNodeCoverOrAssert { public: ASTNODE_NODE_FUNCS(Restrict) AstRestrict(FileLine* fl, AstNode* propp) - : ASTGEN_SUPER(fl, propp, nullptr, false, "") {} + : ASTGEN_SUPER_Restrict(fl, propp, nullptr, false, "") {} }; //====================================================================== @@ -8546,7 +8547,7 @@ public: class AstText final : public AstNodeSimpleText { public: AstText(FileLine* fl, const string& textp, bool tracking = false) - : ASTGEN_SUPER(fl, textp, tracking) {} + : ASTGEN_SUPER_Text(fl, textp, tracking) {} ASTNODE_NODE_FUNCS(Text) }; @@ -8556,7 +8557,7 @@ private: public: explicit AstTextBlock(FileLine* fl, const string& textp = "", bool tracking = false, bool commas = false) - : ASTGEN_SUPER(fl, textp, tracking) + : ASTGEN_SUPER_TextBlock(fl, textp, tracking) , m_commas(commas) {} ASTNODE_NODE_FUNCS(TextBlock) void commas(bool flag) { m_commas = flag; } @@ -8571,7 +8572,7 @@ public: class AstScCtor final : public AstNodeText { public: AstScCtor(FileLine* fl, const string& textp) - : ASTGEN_SUPER(fl, textp) {} + : ASTGEN_SUPER_ScCtor(fl, textp) {} ASTNODE_NODE_FUNCS(ScCtor) virtual bool isPure() const override { return false; } // SPECIAL: User may order w/other sigs virtual bool isOutputter() const override { return true; } @@ -8580,7 +8581,7 @@ public: class AstScDtor final : public AstNodeText { public: AstScDtor(FileLine* fl, const string& textp) - : ASTGEN_SUPER(fl, textp) {} + : ASTGEN_SUPER_ScDtor(fl, textp) {} ASTNODE_NODE_FUNCS(ScDtor) virtual bool isPure() const override { return false; } // SPECIAL: User may order w/other sigs virtual bool isOutputter() const override { return true; } @@ -8589,7 +8590,7 @@ public: class AstScHdr final : public AstNodeText { public: AstScHdr(FileLine* fl, const string& textp) - : ASTGEN_SUPER(fl, textp) {} + : ASTGEN_SUPER_ScHdr(fl, textp) {} ASTNODE_NODE_FUNCS(ScHdr) virtual bool isPure() const override { return false; } // SPECIAL: User may order w/other sigs virtual bool isOutputter() const override { return true; } @@ -8598,7 +8599,7 @@ public: class AstScImp final : public AstNodeText { public: AstScImp(FileLine* fl, const string& textp) - : ASTGEN_SUPER(fl, textp) {} + : ASTGEN_SUPER_ScImp(fl, textp) {} ASTNODE_NODE_FUNCS(ScImp) virtual bool isPure() const override { return false; } // SPECIAL: User may order w/other sigs virtual bool isOutputter() const override { return true; } @@ -8607,7 +8608,7 @@ public: class AstScImpHdr final : public AstNodeText { public: AstScImpHdr(FileLine* fl, const string& textp) - : ASTGEN_SUPER(fl, textp) {} + : ASTGEN_SUPER_ScImpHdr(fl, textp) {} ASTNODE_NODE_FUNCS(ScImpHdr) virtual bool isPure() const override { return false; } // SPECIAL: User may order w/other sigs virtual bool isOutputter() const override { return true; } @@ -8616,7 +8617,7 @@ public: class AstScInt final : public AstNodeText { public: AstScInt(FileLine* fl, const string& textp) - : ASTGEN_SUPER(fl, textp) {} + : ASTGEN_SUPER_ScInt(fl, textp) {} ASTNODE_NODE_FUNCS(ScInt) virtual bool isPure() const override { return false; } // SPECIAL: User may order w/other sigs virtual bool isOutputter() const override { return true; } @@ -8626,7 +8627,7 @@ class AstUCStmt final : public AstNodeStmt { // User $c statement public: AstUCStmt(FileLine* fl, AstNode* exprsp) - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_UCStmt(fl) { addNOp1p(exprsp); } ASTNODE_NODE_FUNCS(UCStmt) @@ -8668,7 +8669,7 @@ class AstVFile final : public AstNodeFile { // Parents: NETLIST public: AstVFile(FileLine* fl, const string& name) - : ASTGEN_SUPER(fl, name) {} + : ASTGEN_SUPER_VFile(fl, name) {} ASTNODE_NODE_FUNCS(VFile) virtual void dump(std::ostream& str = std::cout) const override; }; @@ -8685,7 +8686,7 @@ private: bool m_support : 1; ///< Support file (non systemc) public: AstCFile(FileLine* fl, const string& name) - : ASTGEN_SUPER(fl, name) + : ASTGEN_SUPER_CFile(fl, name) , m_slow{false} , m_source{false} , m_support{false} {} @@ -8734,7 +8735,7 @@ private: bool m_dpiImportWrapper : 1; // Wrapper from dpi import public: AstCFunc(FileLine* fl, const string& name, AstScope* scopep, const string& rtnType = "") - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_CFunc(fl) { m_funcType = AstCFuncType::FT_NORMAL; m_isConst = VBoolOrUnknown::BU_UNKNOWN; // Unknown until analyzed m_isStatic = VBoolOrUnknown::BU_UNKNOWN; // Unknown until see where thisp needed @@ -8856,7 +8857,7 @@ class AstCCall final : public AstNodeCCall { // Children: Args to the function public: AstCCall(FileLine* fl, AstCFunc* funcp, AstNode* argsp = nullptr) - : ASTGEN_SUPER(fl, funcp, argsp) {} + : ASTGEN_SUPER_CCall(fl, funcp, argsp) {} ASTNODE_NODE_FUNCS(CCall) }; @@ -8866,7 +8867,7 @@ class AstCMethodCall final : public AstNodeCCall { // Children: Args to the function public: AstCMethodCall(FileLine* fl, AstNode* fromp, AstCFunc* funcp, AstNode* argsp = nullptr) - : ASTGEN_SUPER(fl, funcp, argsp) { + : ASTGEN_SUPER_CMethodCall(fl, funcp, argsp) { setOp1p(fromp); } ASTNODE_NODE_FUNCS(CMethodCall) @@ -8887,7 +8888,7 @@ class AstCNew final : public AstNodeCCall { // Children: Args to the function public: AstCNew(FileLine* fl, AstCFunc* funcp, AstNode* argsp = nullptr) - : ASTGEN_SUPER(fl, funcp, argsp) { + : ASTGEN_SUPER_CNew(fl, funcp, argsp) { statement(false); } virtual bool hasDType() const override { return true; } @@ -8900,7 +8901,7 @@ class AstCReturn final : public AstNodeStmt { // Children: Math public: AstCReturn(FileLine* fl, AstNode* lhsp) - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_CReturn(fl) { setOp1p(lhsp); } ASTNODE_NODE_FUNCS(CReturn) @@ -8917,14 +8918,14 @@ private: public: // Emit C textual math function (like AstUCFunc) AstCMath(FileLine* fl, AstNode* exprsp) - : ASTGEN_SUPER(fl) + : ASTGEN_SUPER_CMath(fl) , m_cleanOut{true} , m_pure{false} { addOp1p(exprsp); dtypeFrom(exprsp); } AstCMath(FileLine* fl, const string& textStmt, int setwidth, bool cleanOut = true) - : ASTGEN_SUPER(fl) + : ASTGEN_SUPER_CMath(fl) , m_cleanOut{cleanOut} , m_pure{true} { addNOp1p(new AstText(fl, textStmt, true)); @@ -8947,7 +8948,7 @@ class AstCReset final : public AstNodeStmt { // Reset variable at startup public: AstCReset(FileLine* fl, AstNode* exprsp) - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_CReset(fl) { addNOp1p(exprsp); } ASTNODE_NODE_FUNCS(CReset) @@ -8961,11 +8962,11 @@ class AstCStmt final : public AstNodeStmt { // Emit C statement public: AstCStmt(FileLine* fl, AstNode* exprsp) - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_CStmt(fl) { addNOp1p(exprsp); } AstCStmt(FileLine* fl, const string& textStmt) - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_CStmt(fl) { addNOp1p(new AstText(fl, textStmt, true)); } ASTNODE_NODE_FUNCS(CStmt) @@ -8985,7 +8986,7 @@ private: public: AstCUse(FileLine* fl, VUseType useType, const string& name) - : ASTGEN_SUPER(fl) + : ASTGEN_SUPER_CUse(fl) , m_useType{useType} , m_name{name} {} ASTNODE_NODE_FUNCS(CUse) @@ -9002,7 +9003,7 @@ private: public: explicit AstMTaskBody(FileLine* fl) - : ASTGEN_SUPER(fl) {} + : ASTGEN_SUPER_MTaskBody(fl) {} ASTNODE_NODE_FUNCS(MTaskBody); virtual const char* broken() const override { BROKEN_RTN(!m_execMTaskp); @@ -9043,7 +9044,7 @@ class AstSplitPlaceholder final : public AstNode { public: // Dummy node used within V3Split; never exists outside of V3Split. explicit AstSplitPlaceholder(FileLine* fl) - : ASTGEN_SUPER(fl) {} + : ASTGEN_SUPER_SplitPlaceholder(fl) {} ASTNODE_NODE_FUNCS(SplitPlaceholder) }; @@ -9062,7 +9063,7 @@ class AstTypeTable final : public AstNode { public: explicit AstTypeTable(FileLine* fl) - : ASTGEN_SUPER(fl) { + : ASTGEN_SUPER_TypeTable(fl) { for (int i = 0; i < AstBasicDTypeKwd::_ENUM_MAX; ++i) m_basicps[i] = nullptr; } ASTNODE_NODE_FUNCS(TypeTable) @@ -9098,7 +9099,7 @@ private: bool m_timescaleSpecified = false; // Input HDL specified timescale public: AstNetlist() - : ASTGEN_SUPER(new FileLine(FileLine::builtInFilename())) {} + : ASTGEN_SUPER_Netlist(new FileLine(FileLine::builtInFilename())) {} ASTNODE_NODE_FUNCS(Netlist) virtual const char* broken() const override { BROKEN_RTN(m_dollarUnitPkgp && !m_dollarUnitPkgp->brokeExists()); @@ -9153,6 +9154,4 @@ public: //###################################################################### -#undef ASTGEN_SUPER - #endif // Guard diff --git a/src/astgen b/src/astgen index a5057b7a8..a66bf3526 100755 --- a/src/astgen +++ b/src/astgen @@ -621,7 +621,7 @@ def write_types(filename): fh.write(" }\n") -def write_header(filename): +def write_macros(filename): with open_file(filename) as fh: typen = "None" base = "None" @@ -629,10 +629,7 @@ def write_header(filename): in_filename = "V3AstNodes.h" ifile = Args.I + "/" + in_filename with open(ifile) as ifh: - - fh.write("#line 1 \"../" + in_filename + "\"\n") - - for line in ifh: + for (lineno, line) in enumerate(ifh, 1): # Drop expanded macro definitions - but keep empty line so compiler # message locations are accurate line = re.sub(r'^\s*#(define|undef)\s+ASTGEN_.*$', '', line) @@ -644,14 +641,18 @@ def write_header(filename): if match: typen = match.group(1) base = match.group(4) + if not typen.startswith("Node"): + macro = "#define ASTGEN_SUPER_{t}(...) {b}(AstType::at{t}, __VA_ARGS__)\n" \ + .format(b=base, t=typen) + fh.write(macro) - # Substitute macros - line = re.sub(r'\bASTGEN_SUPER\s*\(', - base + "(AstType::at" + typen + ", ", line) - - # Emit the line - fh.write(line) - + match = re.search(r"ASTGEN_SUPER_(\w+)", line) + if match: + if typen != match.group(1): + print(("V3AstNodes.h:{l} ERROR: class Ast{t} calls wrong superclass " + + "constructor macro (should call ASTGEN_SUPER_{t})") + .format(l=lineno, t=typen)) + sys.exit(1) ###################################################################### # main @@ -708,7 +709,7 @@ if Args.classes: write_visitor("V3Ast__gen_visitor.h") write_impl("V3Ast__gen_impl.h") write_types("V3Ast__gen_types.h") - write_header("V3AstNodes__gen.h") + write_macros("V3AstNodes__gen_macros.h") for cpt in Args.infiles: if not re.search(r'.cpp$', cpt):