Internals: Fix some unnecessary member paddings. No functional change intended.

This commit is contained in:
Wilson Snyder 2022-11-13 09:26:46 -05:00
parent 201419c646
commit 818347f99b
11 changed files with 41 additions and 40 deletions

View File

@ -364,8 +364,8 @@ protected:
// assumption is that the restore is allowed to pass different arguments
struct NonSerializedCommandArgs {
// Medium speed
bool m_argVecLoaded = false; // Ever loaded argument list
std::vector<std::string> m_argVec; // Aargument list
bool m_argVecLoaded = false; // Ever loaded argument list
} m_args VL_GUARDED_BY(m_argMutex);
// Implementation details

View File

@ -1179,9 +1179,9 @@ class VBasicTypeKey final {
public:
const int m_width; // From AstNodeDType: Bit width of operation
const int m_widthMin; // From AstNodeDType: If unsized, bitwidth of minimum implementation
const VNumRange m_nrange; // From AstBasicDType: Numeric msb/lsb (if non-opaque keyword)
const VSigning m_numeric; // From AstNodeDType: Node is signed
const VBasicDTypeKwd m_keyword; // From AstBasicDType: What keyword created basic type
const VNumRange m_nrange; // From AstBasicDType: Numeric msb/lsb (if non-opaque keyword)
bool operator==(const VBasicTypeKey& rhs) const {
return m_width == rhs.m_width && m_widthMin == rhs.m_widthMin && m_numeric == rhs.m_numeric
&& m_keyword == rhs.m_keyword && m_nrange == rhs.m_nrange;
@ -1203,9 +1203,9 @@ public:
const VNumRange& nrange)
: m_width{width}
, m_widthMin{widthMin}
, m_nrange{nrange}
, m_numeric{numeric}
, m_keyword{kwd}
, m_nrange{nrange} {}
, m_keyword{kwd} {}
~VBasicTypeKey() = default;
};
@ -1419,8 +1419,8 @@ protected:
};
AstNode* m_oldp = nullptr; // The old node that was linked to this point in the tree
AstNode* m_backp = nullptr;
RelinkWhatEn m_chg = RELINK_BAD;
AstNode** m_iterpp = nullptr;
RelinkWhatEn m_chg = RELINK_BAD;
public:
VNRelinker() = default;

View File

@ -200,10 +200,10 @@ private:
using MemberNameMap = std::map<const std::string, AstMemberDType*>;
// MEMBERS
string m_name; // Name from upper typedef, if any
bool m_packed;
bool m_isFourstate = false; // V3Width computes
MemberNameMap m_members;
const int m_uniqueNum;
bool m_packed;
bool m_isFourstate = false; // V3Width computes
protected:
AstNodeUOrStructDType(VNType t, FileLine* fl, VSigning numericUnpack)

View File

@ -201,6 +201,11 @@ private:
const string m_origName; // Name of the module, ignoring name() changes, for dot lookup
string m_someInstanceName; // Hierarchical name of some arbitrary instance of this module.
// Used for user messages only.
int m_level = 0; // 1=top module, 2=cell off top module, ...
VLifetime m_lifetime; // Lifetime
VTimescale m_timeunit; // Global time unit
VOptionBool m_unconnectedDrive; // State of `unconnected_drive
bool m_modPublic : 1; // Module has public references
bool m_modTrace : 1; // Tracing this module
bool m_inLibrary : 1; // From a library, no error if not used, never top level
@ -209,10 +214,6 @@ private:
bool m_internal : 1; // Internally created
bool m_recursive : 1; // Recursive module
bool m_recursiveClone : 1; // If recursive, what module it clones, otherwise nullptr
int m_level = 0; // 1=top module, 2=cell off top module, ...
VLifetime m_lifetime; // Lifetime
VTimescale m_timeunit; // Global time unit
VOptionBool m_unconnectedDrive; // State of `unconnected_drive
protected:
AstNodeModule(VNType t, FileLine* fl, const string& name)
: AstNode{t, fl}
@ -356,14 +357,14 @@ class AstNodeCoverOrAssert VL_NOT_FINAL : public AstNodeStmt {
// @astgen op2 := sentreep : Optional[AstSenTree]
// op3 used by some sub-types only
// @astgen op4 := passsp: List[AstNode] // Statments when propp is passing/truthly
const bool m_immediate; // Immediate assertion/cover
string m_name; // Name to report
const bool m_immediate; // Immediate assertion/cover
public:
AstNodeCoverOrAssert(VNType t, FileLine* fl, AstNode* propp, AstNode* passsp, bool immediate,
const string& name = "")
: AstNodeStmt{t, fl}
, m_immediate{immediate}
, m_name{name} {
, m_name{name}
, m_immediate{immediate} {
this->propp(propp);
this->addPasssp(passsp);
}
@ -702,14 +703,14 @@ class AstCUse final : public AstNode {
// C++ use of a class or #include; indicates need of forward declaration
// Parents: NODEMODULE
private:
const VUseType m_useType; // What sort of use this is
const string m_name;
const VUseType m_useType; // What sort of use this is
public:
AstCUse(FileLine* fl, VUseType useType, const string& name)
: ASTGEN_SUPER_CUse(fl)
, m_useType{useType}
, m_name{name} {}
, m_name{name}
, m_useType{useType} {}
ASTGEN_MEMBERS_AstCUse;
void dump(std::ostream& str = std::cout) const override;
string name() const override { return m_name; }
@ -1170,8 +1171,8 @@ class AstModportFTaskRef final : public AstNode {
// PARENT: AstModport
private:
string m_name; // Name of the variable referenced
bool m_export; // Type of the function (import/export)
AstNodeFTask* m_ftaskp = nullptr; // Link to the function
bool m_export; // Type of the function (import/export)
public:
AstModportFTaskRef(FileLine* fl, const string& name, bool isExport)
: ASTGEN_SUPER_ModportFTaskRef(fl)
@ -1193,8 +1194,8 @@ class AstModportVarRef final : public AstNode {
// PARENT: AstModport
private:
string m_name; // Name of the variable referenced
VDirection m_direction; // Direction of the variable (in/out)
AstVar* m_varp = nullptr; // Link to the actual Var
VDirection m_direction; // Direction of the variable (in/out)
public:
AstModportVarRef(FileLine* fl, const string& name, VDirection::en direction)
: ASTGEN_SUPER_ModportVarRef(fl)
@ -1627,8 +1628,8 @@ class AstTypedef final : public AstNode {
// @astgen op4 := attrsp : List[AstNode] // Attributes during early parse
string m_name;
bool m_attrPublic = false;
string m_tag; // Holds the string of the verilator tag -- used in XML output.
bool m_attrPublic = false;
public:
AstTypedef(FileLine* fl, const string& name, AstNode* attrsp, VFlagChildDType,
AstNodeDType* dtp)
@ -2515,13 +2516,13 @@ public:
class AstComment final : public AstNodeStmt {
// Some comment to put into the output stream
// Parents: {statement list}
const bool m_showAt; // Show "at <fileline>"
const string m_name; // Text of comment
const bool m_showAt; // Show "at <fileline>"
public:
AstComment(FileLine* fl, const string& name, bool showAt = false)
: ASTGEN_SUPER_Comment(fl)
, m_showAt{showAt}
, m_name{name} {}
, m_name{name}
, m_showAt{showAt} {}
ASTGEN_MEMBERS_AstComment;
string name() const override { return m_name; } // * = Text
bool same(const AstNode* samep) const override { return true; } // Ignore name in comments
@ -3227,15 +3228,15 @@ class AstTraceInc final : public AstNodeStmt {
private:
AstTraceDecl* m_declp; // Pointer to declaration
const bool m_full; // Is this a full vs incremental dump
const uint32_t m_baseCode; // Trace code base value in function containing this AstTraceInc
const bool m_full; // Is this a full vs incremental dump
public:
AstTraceInc(FileLine* fl, AstTraceDecl* declp, bool full, uint32_t baseCode = 0)
: ASTGEN_SUPER_TraceInc(fl)
, m_declp{declp}
, m_full{full}
, m_baseCode{baseCode} {
, m_baseCode{baseCode}
, m_full{full} {
dtypeFrom(declp);
this->valuep(
declp->valuep()->cloneTree(true)); // TODO: maybe use reference to TraceDecl instead?

View File

@ -177,8 +177,8 @@ public:
class CdcWidthVisitor final : public CdcBaseVisitor {
private:
int m_maxLineno = 0;
size_t m_maxFilenameLen = 0;
int m_maxLineno = 0;
void visit(AstNode* nodep) override {
iterateChildren(nodep);

View File

@ -28,8 +28,8 @@
class EmitCConstInit VL_NOT_FINAL : public EmitCBaseVisitor {
// MEMBERS
bool m_inUnpacked = false;
uint32_t m_unpackedWord = 0;
bool m_inUnpacked = false;
// METHODS

View File

@ -195,9 +195,9 @@ class V3OutFile VL_NOT_FINAL : public V3OutFormatter {
static constexpr std::size_t WRITE_BUFFER_SIZE_BYTES = 128 * 1024;
// MEMBERS
std::unique_ptr<std::array<char, WRITE_BUFFER_SIZE_BYTES>> m_bufferp; // Write buffer
std::size_t m_usedBytes = 0; // Number of bytes stored in m_bufferp
FILE* m_fp = nullptr;
std::size_t m_usedBytes = 0; // Number of bytes stored in m_bufferp
std::unique_ptr<std::array<char, WRITE_BUFFER_SIZE_BYTES>> m_bufferp; // Write buffer
public:
V3OutFile(const string& filename, V3OutFormatter::Language lang);

View File

@ -132,9 +132,9 @@ public:
V3PreLex* const m_lexp; // Lexer, for resource tracking
std::deque<string> m_buffers; // Buffer of characters to process
int m_ignNewlines = 0; // Ignore multiline newlines
int m_termState = 0; // Termination fsm
bool m_eof = false; // "EOF" buffer
bool m_file = false; // Buffer is start of new file
int m_termState = 0; // Termination fsm
VPreStream(FileLine* fl, V3PreLex* lexp)
: m_curFilelinep{fl}
, m_lexp{lexp} {

View File

@ -132,8 +132,8 @@ class VHashSha256 final {
// MEMBERS
uint32_t m_inthash[8]; // Intermediate hash, in host order
string m_remainder; // Unhashed data
bool m_final = false; // Finalized
size_t m_totLength = 0; // Total all-chunk length as needed by output digest
bool m_final = false; // Finalized
public:
// CONSTRUCTORS
VHashSha256() {

View File

@ -67,8 +67,8 @@ public:
private:
// MEMBERS
string m_name; //< Name of the source file
bool m_needed = false; //< Need to annotate; has low coverage
LinenoMap m_lines; //< Map of each annotated line
bool m_needed = false; //< Need to annotate; has low coverage
public:
// CONSTRUCTORS

View File

@ -75,11 +75,6 @@
class V3ParseGrammar {
public:
bool m_impliedDecl = false; // Allow implied wire declarations
VVarType m_varDecl; // Type for next signal declaration (reg/wire/etc)
bool m_varDeclTyped = false; // Var got reg/wire for dedup check
VDirection m_varIO; // Direction for next signal declaration (reg/wire/etc)
VLifetime m_varLifetime; // Static/Automatic for next signal
AstVar* m_varAttrp = nullptr; // Current variable for attribute adding
AstRange* m_gateRangep = nullptr; // Current range for gate declarations
AstCase* m_caseAttrp = nullptr; // Current case statement for attribute adding
@ -88,10 +83,15 @@ public:
AstDelay* m_netDelayp = nullptr; // Pointer to delay for next signal declaration
AstStrengthSpec* m_netStrengthp = nullptr; // Pointer to strength for next net declaration
AstNodeModule* m_modp = nullptr; // Last module for timeunits
bool m_pinAnsi = false; // In ANSI port list
FileLine* m_instModuleFl = nullptr; // Fileline of module referenced for instantiations
string m_instModule; // Name of module referenced for instantiations
AstPin* m_instParamp = nullptr; // Parameters for instantiations
string m_instModule; // Name of module referenced for instantiations
VVarType m_varDecl; // Type for next signal declaration (reg/wire/etc)
VDirection m_varIO; // Direction for next signal declaration (reg/wire/etc)
VLifetime m_varLifetime; // Static/Automatic for next signal
bool m_impliedDecl = false; // Allow implied wire declarations
bool m_varDeclTyped = false; // Var got reg/wire for dedup check
bool m_pinAnsi = false; // In ANSI port list
bool m_tracingParse = true; // Tracing disable for parser
bool m_insideProperty = false; // Is inside property declaration
bool m_typedPropertyPort = false; // True if typed property port occured on port lists