diff --git a/src/V3Ast.h b/src/V3Ast.h index 29e8aa047..a3314f221 100644 --- a/src/V3Ast.h +++ b/src/V3Ast.h @@ -314,7 +314,7 @@ public: bool isSloppy() const { // Don't be as anal about width warnings return !(m_e==LOGIC || m_e==BIT); } - bool isBitLogic() const { // Don't be as anal about width warnings + bool isBitLogic() const { // Bit/logic vector types; can form a packed array return (m_e==LOGIC || m_e==BIT); } bool isDpiUnsupported() const { @@ -868,6 +868,7 @@ public: bool isUnsigned() const { return numeric().isUnsigned(); } void didWidth(bool flag) { m_didWidth=flag; } bool didWidth() const { return m_didWidth; } + bool didWidthAndSet() { if (didWidth()) return true; didWidth(true); return false;} void doingWidth(bool flag) { m_doingWidth=flag; } bool doingWidth() const { return m_doingWidth; } bool isQuad() const { return (width()>VL_WORDSIZE && width()<=VL_QUADSIZE); } diff --git a/src/V3AstNodes.h b/src/V3AstNodes.h index d88fbc2b0..26a3a78fd 100644 --- a/src/V3AstNodes.h +++ b/src/V3AstNodes.h @@ -2864,8 +2864,8 @@ public: m_size=setwidth; if (setwidth) { width(setwidth,setwidth); } } - AstCCast(FileLine* fl, AstNode* lhsp, AstNode* widthFromp) : AstNodeUniop(fl, lhsp) { - if (widthFromp) { widthSignedFrom(widthFromp); } + AstCCast(FileLine* fl, AstNode* lhsp, AstNode* typeFromp) : AstNodeUniop(fl, lhsp) { + if (typeFromp) { widthSignedFrom(typeFromp); } m_size=width(); } ASTNODE_NODE_FUNCS(CCast, CCAST) diff --git a/src/V3Slice.cpp b/src/V3Slice.cpp index 475594fa2..8fe635b69 100644 --- a/src/V3Slice.cpp +++ b/src/V3Slice.cpp @@ -262,6 +262,7 @@ class SliceVisitor : public AstNVisitor { AstArraySel* insertImplicit(AstNode* nodep, unsigned start, unsigned count) { // Insert any implicit slices as explicit slices (ArraySel nodes). // Return a new pointer to replace nodep() in the ArraySel. + UINFO(9," insertImplicit "<user1p()->castNode()->castVarRef(); if (!refp) nodep->v3fatalSrc("No VarRef in user1 of node "<varp(); @@ -276,6 +277,7 @@ class SliceVisitor : public AstNVisitor { // Below code assumes big bit endian; just works out if we swap int x = msb; msb = lsb; lsb = x; } + UINFO(9," ArraySel-child: "<fileline(), topp, new AstConst(nodep->fileline(),lsb)); newp->user1p(refp); newp->start(lsb); diff --git a/src/V3Width.cpp b/src/V3Width.cpp index 26a6f8d7e..7f70f05c4 100644 --- a/src/V3Width.cpp +++ b/src/V3Width.cpp @@ -93,7 +93,12 @@ public: int widthMin() const { return m_widthMin?m_widthMin:m_width; } bool prelim() const { return m_stage&1; } bool final() const { return m_stage&2; } + char stageAscii() const { return "-PFB"[m_stage]; } }; +ostream& operator<<(ostream& str, const WidthVP* vup) { + str<<" VUP(w="<width()<<",wm="<widthMin()<<",s="<stageAscii()<<")"; + return str; +} //######################################################################