mirror of
https://github.com/verilator/verilator.git
synced 2025-05-04 22:46:57 +00:00
Internals: Rename dtypeChg to dtypeSet. No functional change
This commit is contained in:
parent
de696b7092
commit
6dfddaa453
10
src/V3Ast.h
10
src/V3Ast.h
@ -938,11 +938,11 @@ public:
|
|||||||
bool isAllOnesV(); // Verilog width rules apply
|
bool isAllOnesV(); // Verilog width rules apply
|
||||||
|
|
||||||
// METHODS - data type changes especially for initial creation
|
// METHODS - data type changes especially for initial creation
|
||||||
void dtypeChgLogicBool() { numeric(AstNumeric::UNSIGNED); width(1,1); }
|
void dtypeSetLogicBool() { numeric(AstNumeric::UNSIGNED); width(1,1); }
|
||||||
void dtypeChgDouble() { numeric(AstNumeric::DOUBLE); }
|
void dtypeSetDouble() { numeric(AstNumeric::DOUBLE); }
|
||||||
void dtypeChgSigned32() { numeric(AstNumeric::SIGNED); width(VL_WORDSIZE,VL_WORDSIZE); }
|
void dtypeSetSigned32() { numeric(AstNumeric::SIGNED); width(VL_WORDSIZE,VL_WORDSIZE); }
|
||||||
void dtypeChgUInt32() { numeric(AstNumeric::UNSIGNED); width(VL_WORDSIZE,VL_WORDSIZE); }
|
void dtypeSetUInt32() { numeric(AstNumeric::UNSIGNED); width(VL_WORDSIZE,VL_WORDSIZE); }
|
||||||
void dtypeChgUInt64() { numeric(AstNumeric::UNSIGNED); width(VL_QUADSIZE,VL_QUADSIZE); }
|
void dtypeSetUInt64() { numeric(AstNumeric::UNSIGNED); width(VL_QUADSIZE,VL_QUADSIZE); }
|
||||||
|
|
||||||
// METHODS - dump and error
|
// METHODS - dump and error
|
||||||
void v3errorEnd(ostringstream& str) const;
|
void v3errorEnd(ostringstream& str) const;
|
||||||
|
122
src/V3AstNodes.h
122
src/V3AstNodes.h
@ -50,7 +50,7 @@ public:
|
|||||||
:AstNodeMath(fl)
|
:AstNodeMath(fl)
|
||||||
,m_num(num) {
|
,m_num(num) {
|
||||||
if (m_num.isDouble()) {
|
if (m_num.isDouble()) {
|
||||||
dtypeChgDouble();
|
dtypeSetDouble();
|
||||||
} else {
|
} else {
|
||||||
width(m_num.width(), m_num.sized()?0:m_num.widthMin());
|
width(m_num.width(), m_num.sized()?0:m_num.widthMin());
|
||||||
numeric(m_num.isSigned() ? AstNumeric::SIGNED
|
numeric(m_num.isSigned() ? AstNumeric::SIGNED
|
||||||
@ -67,15 +67,15 @@ public:
|
|||||||
class RealDouble {}; // for creator type-overload selection
|
class RealDouble {}; // for creator type-overload selection
|
||||||
AstConst(FileLine* fl, RealDouble, double num)
|
AstConst(FileLine* fl, RealDouble, double num)
|
||||||
:AstNodeMath(fl)
|
:AstNodeMath(fl)
|
||||||
,m_num(V3Number(fl,64)) { m_num.setDouble(num); dtypeChgDouble(); }
|
,m_num(V3Number(fl,64)) { m_num.setDouble(num); dtypeSetDouble(); }
|
||||||
class LogicFalse {};
|
class LogicFalse {};
|
||||||
AstConst(FileLine* fl, LogicFalse) // Shorthand const 0, know the dtype should be a logic of size 1
|
AstConst(FileLine* fl, LogicFalse) // Shorthand const 0, know the dtype should be a logic of size 1
|
||||||
:AstNodeMath(fl)
|
:AstNodeMath(fl)
|
||||||
,m_num(V3Number(fl,1,0)) { dtypeChgLogicBool(); }
|
,m_num(V3Number(fl,1,0)) { dtypeSetLogicBool(); }
|
||||||
class LogicTrue {};
|
class LogicTrue {};
|
||||||
AstConst(FileLine* fl, LogicTrue) // Shorthand const 1, know the dtype should be a logic of size 1
|
AstConst(FileLine* fl, LogicTrue) // Shorthand const 1, know the dtype should be a logic of size 1
|
||||||
:AstNodeMath(fl)
|
:AstNodeMath(fl)
|
||||||
,m_num(V3Number(fl,1,1)) { dtypeChgLogicBool(); }
|
,m_num(V3Number(fl,1,1)) { dtypeSetLogicBool(); }
|
||||||
|
|
||||||
ASTNODE_NODE_FUNCS(Const, CONST)
|
ASTNODE_NODE_FUNCS(Const, CONST)
|
||||||
virtual string name() const { return num().ascii(); } // * = Value
|
virtual string name() const { return num().ascii(); } // * = Value
|
||||||
@ -279,7 +279,7 @@ private:
|
|||||||
if (keyword().isSigned()) signst = signedst_SIGNED;
|
if (keyword().isSigned()) signst = signedst_SIGNED;
|
||||||
else m_nosigned = true;
|
else m_nosigned = true;
|
||||||
}
|
}
|
||||||
if (keyword().isDouble()) dtypeChgDouble();
|
if (keyword().isDouble()) dtypeSetDouble();
|
||||||
else setSignedState(signst);
|
else setSignedState(signst);
|
||||||
if (!rangep && wantwidth) { // Constant width
|
if (!rangep && wantwidth) { // Constant width
|
||||||
m_msb = wantwidth - 1;
|
m_msb = wantwidth - 1;
|
||||||
@ -500,7 +500,7 @@ struct AstWordSel : public AstNodeSel {
|
|||||||
// Select a single word from a multi-word wide value
|
// Select a single word from a multi-word wide value
|
||||||
AstWordSel(FileLine* fl, AstNode* fromp, AstNode* bitp)
|
AstWordSel(FileLine* fl, AstNode* fromp, AstNode* bitp)
|
||||||
:AstNodeSel(fl, fromp, bitp) {
|
:AstNodeSel(fl, fromp, bitp) {
|
||||||
dtypeChgUInt32(); // Always used on IData arrays so returns word entities
|
dtypeSetUInt32(); // Always used on IData arrays so returns word entities
|
||||||
}
|
}
|
||||||
ASTNODE_NODE_FUNCS(WordSel, WORDSEL)
|
ASTNODE_NODE_FUNCS(WordSel, WORDSEL)
|
||||||
virtual void numberOperate(V3Number& out, const V3Number& from, const V3Number& bit) { V3ERROR_NA; }
|
virtual void numberOperate(V3Number& out, const V3Number& from, const V3Number& bit) { V3ERROR_NA; }
|
||||||
@ -1319,7 +1319,7 @@ struct AstSenGate : public AstNodeSenItem {
|
|||||||
// AND as applied to a sensitivity list and a gating expression
|
// AND as applied to a sensitivity list and a gating expression
|
||||||
// Performing this gating is optional; it may be removed by later optimizations
|
// Performing this gating is optional; it may be removed by later optimizations
|
||||||
AstSenGate(FileLine* fl, AstSenItem* sensesp, AstNode* rhsp) : AstNodeSenItem(fl) {
|
AstSenGate(FileLine* fl, AstSenItem* sensesp, AstNode* rhsp) : AstNodeSenItem(fl) {
|
||||||
dtypeChgLogicBool(); addOp1p(sensesp); setOp2p(rhsp);
|
dtypeSetLogicBool(); addOp1p(sensesp); setOp2p(rhsp);
|
||||||
}
|
}
|
||||||
ASTNODE_NODE_FUNCS(SenGate, SENGATE)
|
ASTNODE_NODE_FUNCS(SenGate, SENGATE)
|
||||||
virtual string emitVerilog() { return "(%l) %f&& (%r)"; }
|
virtual string emitVerilog() { return "(%l) %f&& (%r)"; }
|
||||||
@ -2215,7 +2215,7 @@ struct AstChangeXor : public AstNodeBiComAsv {
|
|||||||
// Children: VARREF
|
// Children: VARREF
|
||||||
AstChangeXor(FileLine* fl, AstNode* lhsp, AstNode* rhsp)
|
AstChangeXor(FileLine* fl, AstNode* lhsp, AstNode* rhsp)
|
||||||
: AstNodeBiComAsv(fl, lhsp, rhsp) {
|
: AstNodeBiComAsv(fl, lhsp, rhsp) {
|
||||||
dtypeChgUInt32(); // Always used on, and returns word entities
|
dtypeSetUInt32(); // Always used on, and returns word entities
|
||||||
}
|
}
|
||||||
ASTNODE_NODE_FUNCS(ChangeXor, CHANGEXOR)
|
ASTNODE_NODE_FUNCS(ChangeXor, CHANGEXOR)
|
||||||
virtual void numberOperate(V3Number& out, const V3Number& lhs, const V3Number& rhs) { out.opChangeXor(lhs,rhs); }
|
virtual void numberOperate(V3Number& out, const V3Number& lhs, const V3Number& rhs) { out.opChangeXor(lhs,rhs); }
|
||||||
@ -2474,7 +2474,7 @@ private:
|
|||||||
bool m_dpiExport; // Is for dpiExport
|
bool m_dpiExport; // Is for dpiExport
|
||||||
public:
|
public:
|
||||||
AstScopeName(FileLine* fl) : AstNodeMath(fl), m_dpiExport(false) {
|
AstScopeName(FileLine* fl) : AstNodeMath(fl), m_dpiExport(false) {
|
||||||
dtypeChgUInt64(); }
|
dtypeSetUInt64(); }
|
||||||
ASTNODE_NODE_FUNCS(ScopeName, SCOPENAME)
|
ASTNODE_NODE_FUNCS(ScopeName, SCOPENAME)
|
||||||
virtual V3Hash sameHash() const { return V3Hash(); }
|
virtual V3Hash sameHash() const { return V3Hash(); }
|
||||||
virtual bool same(AstNode* samep) const { return m_dpiExport==samep->castScopeName()->m_dpiExport; }
|
virtual bool same(AstNode* samep) const { return m_dpiExport==samep->castScopeName()->m_dpiExport; }
|
||||||
@ -2535,7 +2535,7 @@ public:
|
|||||||
|
|
||||||
struct AstTime : public AstNodeTermop {
|
struct AstTime : public AstNodeTermop {
|
||||||
AstTime(FileLine* fl) : AstNodeTermop(fl) {
|
AstTime(FileLine* fl) : AstNodeTermop(fl) {
|
||||||
dtypeChgUInt64(); }
|
dtypeSetUInt64(); }
|
||||||
ASTNODE_NODE_FUNCS(Time, TIME)
|
ASTNODE_NODE_FUNCS(Time, TIME)
|
||||||
virtual string emitVerilog() { return "%f$time"; }
|
virtual string emitVerilog() { return "%f$time"; }
|
||||||
virtual string emitC() { return "VL_TIME_%nq()"; }
|
virtual string emitC() { return "VL_TIME_%nq()"; }
|
||||||
@ -2549,7 +2549,7 @@ struct AstTime : public AstNodeTermop {
|
|||||||
|
|
||||||
struct AstTimeD : public AstNodeTermop {
|
struct AstTimeD : public AstNodeTermop {
|
||||||
AstTimeD(FileLine* fl) : AstNodeTermop(fl) {
|
AstTimeD(FileLine* fl) : AstNodeTermop(fl) {
|
||||||
dtypeChgDouble(); }
|
dtypeSetDouble(); }
|
||||||
ASTNODE_NODE_FUNCS(TimeD, TIMED)
|
ASTNODE_NODE_FUNCS(TimeD, TIMED)
|
||||||
virtual string emitVerilog() { return "%f$realtime"; }
|
virtual string emitVerilog() { return "%f$realtime"; }
|
||||||
virtual string emitC() { return "VL_TIME_D()"; }
|
virtual string emitC() { return "VL_TIME_D()"; }
|
||||||
@ -2598,7 +2598,7 @@ struct AstNegate : public AstNodeUniop {
|
|||||||
};
|
};
|
||||||
struct AstNegateD : public AstNodeUniop {
|
struct AstNegateD : public AstNodeUniop {
|
||||||
AstNegateD(FileLine* fl, AstNode* lhsp) : AstNodeUniop(fl, lhsp) {
|
AstNegateD(FileLine* fl, AstNode* lhsp) : AstNodeUniop(fl, lhsp) {
|
||||||
dtypeChgDouble(); }
|
dtypeSetDouble(); }
|
||||||
ASTNODE_NODE_FUNCS(NegateD, NEGATED)
|
ASTNODE_NODE_FUNCS(NegateD, NEGATED)
|
||||||
virtual void numberOperate(V3Number& out, const V3Number& lhs) { out.opNegateD(lhs); }
|
virtual void numberOperate(V3Number& out, const V3Number& lhs) { out.opNegateD(lhs); }
|
||||||
virtual string emitVerilog() { return "%f(- %l)"; }
|
virtual string emitVerilog() { return "%f(- %l)"; }
|
||||||
@ -2611,7 +2611,7 @@ struct AstNegateD : public AstNodeUniop {
|
|||||||
};
|
};
|
||||||
struct AstRedAnd : public AstNodeUniop {
|
struct AstRedAnd : public AstNodeUniop {
|
||||||
AstRedAnd(FileLine* fl, AstNode* lhsp) : AstNodeUniop(fl, lhsp) {
|
AstRedAnd(FileLine* fl, AstNode* lhsp) : AstNodeUniop(fl, lhsp) {
|
||||||
dtypeChgLogicBool(); }
|
dtypeSetLogicBool(); }
|
||||||
ASTNODE_NODE_FUNCS(RedAnd, REDAND)
|
ASTNODE_NODE_FUNCS(RedAnd, REDAND)
|
||||||
virtual void numberOperate(V3Number& out, const V3Number& lhs) { out.opRedAnd(lhs); }
|
virtual void numberOperate(V3Number& out, const V3Number& lhs) { out.opRedAnd(lhs); }
|
||||||
virtual string emitVerilog() { return "%f(& %l)"; }
|
virtual string emitVerilog() { return "%f(& %l)"; }
|
||||||
@ -2621,7 +2621,7 @@ struct AstRedAnd : public AstNodeUniop {
|
|||||||
};
|
};
|
||||||
struct AstRedOr : public AstNodeUniop {
|
struct AstRedOr : public AstNodeUniop {
|
||||||
AstRedOr(FileLine* fl, AstNode* lhsp) : AstNodeUniop(fl, lhsp) {
|
AstRedOr(FileLine* fl, AstNode* lhsp) : AstNodeUniop(fl, lhsp) {
|
||||||
dtypeChgLogicBool(); }
|
dtypeSetLogicBool(); }
|
||||||
ASTNODE_NODE_FUNCS(RedOr, REDOR)
|
ASTNODE_NODE_FUNCS(RedOr, REDOR)
|
||||||
virtual void numberOperate(V3Number& out, const V3Number& lhs) { out.opRedOr(lhs); }
|
virtual void numberOperate(V3Number& out, const V3Number& lhs) { out.opRedOr(lhs); }
|
||||||
virtual string emitVerilog() { return "%f(| %l)"; }
|
virtual string emitVerilog() { return "%f(| %l)"; }
|
||||||
@ -2631,7 +2631,7 @@ struct AstRedOr : public AstNodeUniop {
|
|||||||
};
|
};
|
||||||
struct AstRedXor : public AstNodeUniop {
|
struct AstRedXor : public AstNodeUniop {
|
||||||
AstRedXor(FileLine* fl, AstNode* lhsp) : AstNodeUniop(fl, lhsp) {
|
AstRedXor(FileLine* fl, AstNode* lhsp) : AstNodeUniop(fl, lhsp) {
|
||||||
dtypeChgLogicBool(); }
|
dtypeSetLogicBool(); }
|
||||||
ASTNODE_NODE_FUNCS(RedXor, REDXOR)
|
ASTNODE_NODE_FUNCS(RedXor, REDXOR)
|
||||||
virtual void numberOperate(V3Number& out, const V3Number& lhs) { out.opRedXor(lhs); }
|
virtual void numberOperate(V3Number& out, const V3Number& lhs) { out.opRedXor(lhs); }
|
||||||
virtual string emitVerilog() { return "%f(^ %l)"; }
|
virtual string emitVerilog() { return "%f(^ %l)"; }
|
||||||
@ -2645,7 +2645,7 @@ struct AstRedXor : public AstNodeUniop {
|
|||||||
struct AstRedXnor : public AstNodeUniop {
|
struct AstRedXnor : public AstNodeUniop {
|
||||||
// AstRedXnors are replaced with AstRedXors in V3Const.
|
// AstRedXnors are replaced with AstRedXors in V3Const.
|
||||||
AstRedXnor(FileLine* fl, AstNode* lhsp) : AstNodeUniop(fl, lhsp) {
|
AstRedXnor(FileLine* fl, AstNode* lhsp) : AstNodeUniop(fl, lhsp) {
|
||||||
dtypeChgLogicBool(); }
|
dtypeSetLogicBool(); }
|
||||||
ASTNODE_NODE_FUNCS(RedXnor, REDXNOR)
|
ASTNODE_NODE_FUNCS(RedXnor, REDXNOR)
|
||||||
virtual void numberOperate(V3Number& out, const V3Number& lhs) { out.opRedXnor(lhs); }
|
virtual void numberOperate(V3Number& out, const V3Number& lhs) { out.opRedXnor(lhs); }
|
||||||
virtual string emitVerilog() { return "%f(~^ %l)"; }
|
virtual string emitVerilog() { return "%f(~^ %l)"; }
|
||||||
@ -2657,7 +2657,7 @@ struct AstRedXnor : public AstNodeUniop {
|
|||||||
|
|
||||||
struct AstLogNot : public AstNodeUniop {
|
struct AstLogNot : public AstNodeUniop {
|
||||||
AstLogNot(FileLine* fl, AstNode* lhsp) : AstNodeUniop(fl, lhsp) {
|
AstLogNot(FileLine* fl, AstNode* lhsp) : AstNodeUniop(fl, lhsp) {
|
||||||
dtypeChgLogicBool(); }
|
dtypeSetLogicBool(); }
|
||||||
ASTNODE_NODE_FUNCS(LogNot, LOGNOT)
|
ASTNODE_NODE_FUNCS(LogNot, LOGNOT)
|
||||||
virtual void numberOperate(V3Number& out, const V3Number& lhs) { out.opLogNot(lhs); }
|
virtual void numberOperate(V3Number& out, const V3Number& lhs) { out.opLogNot(lhs); }
|
||||||
virtual string emitVerilog() { return "%f(! %l)"; }
|
virtual string emitVerilog() { return "%f(! %l)"; }
|
||||||
@ -2729,7 +2729,7 @@ struct AstUnsigned : public AstNodeUniop {
|
|||||||
struct AstRToIS : public AstNodeUniop {
|
struct AstRToIS : public AstNodeUniop {
|
||||||
// $rtoi(lhs)
|
// $rtoi(lhs)
|
||||||
AstRToIS(FileLine* fl, AstNode* lhsp) : AstNodeUniop(fl, lhsp) {
|
AstRToIS(FileLine* fl, AstNode* lhsp) : AstNodeUniop(fl, lhsp) {
|
||||||
dtypeChgSigned32(); }
|
dtypeSetSigned32(); }
|
||||||
ASTNODE_NODE_FUNCS(RToIS, RTOIS)
|
ASTNODE_NODE_FUNCS(RToIS, RTOIS)
|
||||||
virtual void numberOperate(V3Number& out, const V3Number& lhs) { out.opRToIS(lhs); }
|
virtual void numberOperate(V3Number& out, const V3Number& lhs) { out.opRToIS(lhs); }
|
||||||
virtual string emitVerilog() { return "%f$rtoi(%l)"; }
|
virtual string emitVerilog() { return "%f$rtoi(%l)"; }
|
||||||
@ -2740,7 +2740,7 @@ struct AstRToIS : public AstNodeUniop {
|
|||||||
};
|
};
|
||||||
struct AstRToIRoundS : public AstNodeUniop {
|
struct AstRToIRoundS : public AstNodeUniop {
|
||||||
AstRToIRoundS(FileLine* fl, AstNode* lhsp) : AstNodeUniop(fl, lhsp) {
|
AstRToIRoundS(FileLine* fl, AstNode* lhsp) : AstNodeUniop(fl, lhsp) {
|
||||||
dtypeChgSigned32(); }
|
dtypeSetSigned32(); }
|
||||||
ASTNODE_NODE_FUNCS(RToIRoundS, RTOIROUNDS)
|
ASTNODE_NODE_FUNCS(RToIRoundS, RTOIROUNDS)
|
||||||
virtual void numberOperate(V3Number& out, const V3Number& lhs) { out.opRToIRoundS(lhs); }
|
virtual void numberOperate(V3Number& out, const V3Number& lhs) { out.opRToIRoundS(lhs); }
|
||||||
virtual string emitVerilog() { return "%f$rtoi_rounded(%l)"; }
|
virtual string emitVerilog() { return "%f$rtoi_rounded(%l)"; }
|
||||||
@ -2751,7 +2751,7 @@ struct AstRToIRoundS : public AstNodeUniop {
|
|||||||
};
|
};
|
||||||
struct AstIToRD : public AstNodeUniop {
|
struct AstIToRD : public AstNodeUniop {
|
||||||
AstIToRD(FileLine* fl, AstNode* lhsp) : AstNodeUniop(fl, lhsp) {
|
AstIToRD(FileLine* fl, AstNode* lhsp) : AstNodeUniop(fl, lhsp) {
|
||||||
dtypeChgDouble(); }
|
dtypeSetDouble(); }
|
||||||
ASTNODE_NODE_FUNCS(IToRD, ITORD)
|
ASTNODE_NODE_FUNCS(IToRD, ITORD)
|
||||||
virtual void numberOperate(V3Number& out, const V3Number& lhs) { out.opIToRD(lhs); }
|
virtual void numberOperate(V3Number& out, const V3Number& lhs) { out.opIToRD(lhs); }
|
||||||
virtual string emitVerilog() { return "%f$itor(%l)"; }
|
virtual string emitVerilog() { return "%f$itor(%l)"; }
|
||||||
@ -2762,7 +2762,7 @@ struct AstIToRD : public AstNodeUniop {
|
|||||||
};
|
};
|
||||||
struct AstRealToBits : public AstNodeUniop {
|
struct AstRealToBits : public AstNodeUniop {
|
||||||
AstRealToBits(FileLine* fl, AstNode* lhsp) : AstNodeUniop(fl, lhsp) {
|
AstRealToBits(FileLine* fl, AstNode* lhsp) : AstNodeUniop(fl, lhsp) {
|
||||||
dtypeChgUInt64(); }
|
dtypeSetUInt64(); }
|
||||||
ASTNODE_NODE_FUNCS(RealToBits, REALTOBITS)
|
ASTNODE_NODE_FUNCS(RealToBits, REALTOBITS)
|
||||||
virtual void numberOperate(V3Number& out, const V3Number& lhs) { out.opRealToBits(lhs); }
|
virtual void numberOperate(V3Number& out, const V3Number& lhs) { out.opRealToBits(lhs); }
|
||||||
virtual string emitVerilog() { return "%f$realtobits(%l)"; }
|
virtual string emitVerilog() { return "%f$realtobits(%l)"; }
|
||||||
@ -2773,7 +2773,7 @@ struct AstRealToBits : public AstNodeUniop {
|
|||||||
};
|
};
|
||||||
struct AstBitsToRealD : public AstNodeUniop {
|
struct AstBitsToRealD : public AstNodeUniop {
|
||||||
AstBitsToRealD(FileLine* fl, AstNode* lhsp) : AstNodeUniop(fl, lhsp) {
|
AstBitsToRealD(FileLine* fl, AstNode* lhsp) : AstNodeUniop(fl, lhsp) {
|
||||||
dtypeChgDouble(); }
|
dtypeSetDouble(); }
|
||||||
ASTNODE_NODE_FUNCS(BitsToRealD, BITSTOREALD)
|
ASTNODE_NODE_FUNCS(BitsToRealD, BITSTOREALD)
|
||||||
virtual void numberOperate(V3Number& out, const V3Number& lhs) { out.opBitsToRealD(lhs); }
|
virtual void numberOperate(V3Number& out, const V3Number& lhs) { out.opBitsToRealD(lhs); }
|
||||||
virtual string emitVerilog() { return "%f$bitstoreal(%l)"; }
|
virtual string emitVerilog() { return "%f$bitstoreal(%l)"; }
|
||||||
@ -2807,7 +2807,7 @@ struct AstCountOnes : public AstNodeUniop {
|
|||||||
struct AstIsUnknown : public AstNodeUniop {
|
struct AstIsUnknown : public AstNodeUniop {
|
||||||
// True if any unknown bits
|
// True if any unknown bits
|
||||||
AstIsUnknown(FileLine* fl, AstNode* lhsp) : AstNodeUniop(fl, lhsp) {
|
AstIsUnknown(FileLine* fl, AstNode* lhsp) : AstNodeUniop(fl, lhsp) {
|
||||||
dtypeChgLogicBool(); }
|
dtypeSetLogicBool(); }
|
||||||
ASTNODE_NODE_FUNCS(IsUnknown, ISUNKNOWN)
|
ASTNODE_NODE_FUNCS(IsUnknown, ISUNKNOWN)
|
||||||
virtual void numberOperate(V3Number& out, const V3Number& lhs) { out.opIsUnknown(lhs); }
|
virtual void numberOperate(V3Number& out, const V3Number& lhs) { out.opIsUnknown(lhs); }
|
||||||
virtual string emitVerilog() { return "%f$isunknown(%l)"; }
|
virtual string emitVerilog() { return "%f$isunknown(%l)"; }
|
||||||
@ -2818,7 +2818,7 @@ struct AstIsUnknown : public AstNodeUniop {
|
|||||||
struct AstOneHot : public AstNodeUniop {
|
struct AstOneHot : public AstNodeUniop {
|
||||||
// True if only single bit set in vector
|
// True if only single bit set in vector
|
||||||
AstOneHot(FileLine* fl, AstNode* lhsp) : AstNodeUniop(fl, lhsp) {
|
AstOneHot(FileLine* fl, AstNode* lhsp) : AstNodeUniop(fl, lhsp) {
|
||||||
dtypeChgLogicBool(); }
|
dtypeSetLogicBool(); }
|
||||||
ASTNODE_NODE_FUNCS(OneHot, ONEHOT)
|
ASTNODE_NODE_FUNCS(OneHot, ONEHOT)
|
||||||
virtual void numberOperate(V3Number& out, const V3Number& lhs) { out.opOneHot(lhs); }
|
virtual void numberOperate(V3Number& out, const V3Number& lhs) { out.opOneHot(lhs); }
|
||||||
virtual string emitVerilog() { return "%f$onehot(%l)"; }
|
virtual string emitVerilog() { return "%f$onehot(%l)"; }
|
||||||
@ -2830,7 +2830,7 @@ struct AstOneHot : public AstNodeUniop {
|
|||||||
struct AstOneHot0 : public AstNodeUniop {
|
struct AstOneHot0 : public AstNodeUniop {
|
||||||
// True if only single bit, or no bits set in vector
|
// True if only single bit, or no bits set in vector
|
||||||
AstOneHot0(FileLine* fl, AstNode* lhsp) : AstNodeUniop(fl, lhsp) {
|
AstOneHot0(FileLine* fl, AstNode* lhsp) : AstNodeUniop(fl, lhsp) {
|
||||||
dtypeChgLogicBool(); }
|
dtypeSetLogicBool(); }
|
||||||
ASTNODE_NODE_FUNCS(OneHot0, ONEHOT0)
|
ASTNODE_NODE_FUNCS(OneHot0, ONEHOT0)
|
||||||
virtual void numberOperate(V3Number& out, const V3Number& lhs) { out.opOneHot0(lhs); }
|
virtual void numberOperate(V3Number& out, const V3Number& lhs) { out.opOneHot0(lhs); }
|
||||||
virtual string emitVerilog() { return "%f$onehot0(%l)"; }
|
virtual string emitVerilog() { return "%f$onehot0(%l)"; }
|
||||||
@ -2884,7 +2884,7 @@ public:
|
|||||||
struct AstCvtPackString : public AstNodeUniop {
|
struct AstCvtPackString : public AstNodeUniop {
|
||||||
// Convert to Verilator Packed Pack (aka Pack)
|
// Convert to Verilator Packed Pack (aka Pack)
|
||||||
AstCvtPackString(FileLine* fl, AstNode* lhsp) : AstNodeUniop(fl, lhsp) {
|
AstCvtPackString(FileLine* fl, AstNode* lhsp) : AstNodeUniop(fl, lhsp) {
|
||||||
dtypeChgUInt64(); } // Really, width should be dtypep -> STRING
|
dtypeSetUInt64(); } // Really, width should be dtypep -> STRING
|
||||||
ASTNODE_NODE_FUNCS(CvtPackString, CVTPACKSTRING)
|
ASTNODE_NODE_FUNCS(CvtPackString, CVTPACKSTRING)
|
||||||
virtual void numberOperate(V3Number& out, const V3Number& lhs) { V3ERROR_NA; }
|
virtual void numberOperate(V3Number& out, const V3Number& lhs) { V3ERROR_NA; }
|
||||||
virtual string emitVerilog() { return "%f$_CAST(%l)"; }
|
virtual string emitVerilog() { return "%f$_CAST(%l)"; }
|
||||||
@ -2922,7 +2922,7 @@ struct AstFGetC : public AstNodeUniop {
|
|||||||
|
|
||||||
struct AstCeilD : public AstNodeUniop {
|
struct AstCeilD : public AstNodeUniop {
|
||||||
AstCeilD(FileLine* fl, AstNode* lhsp) : AstNodeUniop(fl, lhsp) {
|
AstCeilD(FileLine* fl, AstNode* lhsp) : AstNodeUniop(fl, lhsp) {
|
||||||
dtypeChgDouble(); }
|
dtypeSetDouble(); }
|
||||||
ASTNODE_NODE_FUNCS(CeilD, CEILD)
|
ASTNODE_NODE_FUNCS(CeilD, CEILD)
|
||||||
virtual void numberOperate(V3Number& out, const V3Number& lhs) {
|
virtual void numberOperate(V3Number& out, const V3Number& lhs) {
|
||||||
out.setDouble(ceil(lhs.toDouble())); }
|
out.setDouble(ceil(lhs.toDouble())); }
|
||||||
@ -2936,7 +2936,7 @@ struct AstCeilD : public AstNodeUniop {
|
|||||||
|
|
||||||
struct AstExpD : public AstNodeUniop {
|
struct AstExpD : public AstNodeUniop {
|
||||||
AstExpD(FileLine* fl, AstNode* lhsp) : AstNodeUniop(fl, lhsp) {
|
AstExpD(FileLine* fl, AstNode* lhsp) : AstNodeUniop(fl, lhsp) {
|
||||||
dtypeChgDouble(); }
|
dtypeSetDouble(); }
|
||||||
ASTNODE_NODE_FUNCS(ExpD, EXPD)
|
ASTNODE_NODE_FUNCS(ExpD, EXPD)
|
||||||
virtual void numberOperate(V3Number& out, const V3Number& lhs) {
|
virtual void numberOperate(V3Number& out, const V3Number& lhs) {
|
||||||
out.setDouble(exp(lhs.toDouble())); }
|
out.setDouble(exp(lhs.toDouble())); }
|
||||||
@ -2950,7 +2950,7 @@ struct AstExpD : public AstNodeUniop {
|
|||||||
|
|
||||||
struct AstFloorD : public AstNodeUniop {
|
struct AstFloorD : public AstNodeUniop {
|
||||||
AstFloorD(FileLine* fl, AstNode* lhsp) : AstNodeUniop(fl, lhsp) {
|
AstFloorD(FileLine* fl, AstNode* lhsp) : AstNodeUniop(fl, lhsp) {
|
||||||
dtypeChgDouble(); }
|
dtypeSetDouble(); }
|
||||||
ASTNODE_NODE_FUNCS(FloorD, FLOORD)
|
ASTNODE_NODE_FUNCS(FloorD, FLOORD)
|
||||||
virtual void numberOperate(V3Number& out, const V3Number& lhs) {
|
virtual void numberOperate(V3Number& out, const V3Number& lhs) {
|
||||||
out.setDouble(floor(lhs.toDouble())); }
|
out.setDouble(floor(lhs.toDouble())); }
|
||||||
@ -2964,7 +2964,7 @@ struct AstFloorD : public AstNodeUniop {
|
|||||||
|
|
||||||
struct AstLogD : public AstNodeUniop {
|
struct AstLogD : public AstNodeUniop {
|
||||||
AstLogD(FileLine* fl, AstNode* lhsp) : AstNodeUniop(fl, lhsp) {
|
AstLogD(FileLine* fl, AstNode* lhsp) : AstNodeUniop(fl, lhsp) {
|
||||||
dtypeChgDouble(); }
|
dtypeSetDouble(); }
|
||||||
ASTNODE_NODE_FUNCS(LogD, LOGD)
|
ASTNODE_NODE_FUNCS(LogD, LOGD)
|
||||||
virtual void numberOperate(V3Number& out, const V3Number& lhs) {
|
virtual void numberOperate(V3Number& out, const V3Number& lhs) {
|
||||||
out.setDouble(log(lhs.toDouble())); }
|
out.setDouble(log(lhs.toDouble())); }
|
||||||
@ -2978,7 +2978,7 @@ struct AstLogD : public AstNodeUniop {
|
|||||||
|
|
||||||
struct AstLog10D : public AstNodeUniop {
|
struct AstLog10D : public AstNodeUniop {
|
||||||
AstLog10D(FileLine* fl, AstNode* lhsp) : AstNodeUniop(fl, lhsp) {
|
AstLog10D(FileLine* fl, AstNode* lhsp) : AstNodeUniop(fl, lhsp) {
|
||||||
dtypeChgDouble(); }
|
dtypeSetDouble(); }
|
||||||
ASTNODE_NODE_FUNCS(Log10D, LOG10D)
|
ASTNODE_NODE_FUNCS(Log10D, LOG10D)
|
||||||
virtual void numberOperate(V3Number& out, const V3Number& lhs) {
|
virtual void numberOperate(V3Number& out, const V3Number& lhs) {
|
||||||
out.setDouble(log10(lhs.toDouble())); }
|
out.setDouble(log10(lhs.toDouble())); }
|
||||||
@ -2992,7 +2992,7 @@ struct AstLog10D : public AstNodeUniop {
|
|||||||
|
|
||||||
struct AstSqrtD : public AstNodeUniop {
|
struct AstSqrtD : public AstNodeUniop {
|
||||||
AstSqrtD(FileLine* fl, AstNode* lhsp) : AstNodeUniop(fl, lhsp) {
|
AstSqrtD(FileLine* fl, AstNode* lhsp) : AstNodeUniop(fl, lhsp) {
|
||||||
dtypeChgDouble(); }
|
dtypeSetDouble(); }
|
||||||
ASTNODE_NODE_FUNCS(SqrtD, SQRTD)
|
ASTNODE_NODE_FUNCS(SqrtD, SQRTD)
|
||||||
virtual void numberOperate(V3Number& out, const V3Number& lhs) {
|
virtual void numberOperate(V3Number& out, const V3Number& lhs) {
|
||||||
out.setDouble(sqrt(lhs.toDouble())); }
|
out.setDouble(sqrt(lhs.toDouble())); }
|
||||||
@ -3009,7 +3009,7 @@ struct AstSqrtD : public AstNodeUniop {
|
|||||||
|
|
||||||
struct AstLogOr : public AstNodeBiop {
|
struct AstLogOr : public AstNodeBiop {
|
||||||
AstLogOr(FileLine* fl, AstNode* lhsp, AstNode* rhsp) : AstNodeBiop(fl, lhsp, rhsp) {
|
AstLogOr(FileLine* fl, AstNode* lhsp, AstNode* rhsp) : AstNodeBiop(fl, lhsp, rhsp) {
|
||||||
dtypeChgLogicBool(); }
|
dtypeSetLogicBool(); }
|
||||||
ASTNODE_NODE_FUNCS(LogOr, LOGOR)
|
ASTNODE_NODE_FUNCS(LogOr, LOGOR)
|
||||||
virtual void numberOperate(V3Number& out, const V3Number& lhs, const V3Number& rhs) { out.opLogOr(lhs,rhs); }
|
virtual void numberOperate(V3Number& out, const V3Number& lhs, const V3Number& rhs) { out.opLogOr(lhs,rhs); }
|
||||||
virtual string emitVerilog() { return "%k(%l %f|| %r)"; }
|
virtual string emitVerilog() { return "%k(%l %f|| %r)"; }
|
||||||
@ -3022,7 +3022,7 @@ struct AstLogOr : public AstNodeBiop {
|
|||||||
};
|
};
|
||||||
struct AstLogAnd : public AstNodeBiop {
|
struct AstLogAnd : public AstNodeBiop {
|
||||||
AstLogAnd(FileLine* fl, AstNode* lhsp, AstNode* rhsp) : AstNodeBiop(fl, lhsp, rhsp) {
|
AstLogAnd(FileLine* fl, AstNode* lhsp, AstNode* rhsp) : AstNodeBiop(fl, lhsp, rhsp) {
|
||||||
dtypeChgLogicBool(); }
|
dtypeSetLogicBool(); }
|
||||||
ASTNODE_NODE_FUNCS(LogAnd, LOGAND)
|
ASTNODE_NODE_FUNCS(LogAnd, LOGAND)
|
||||||
virtual void numberOperate(V3Number& out, const V3Number& lhs, const V3Number& rhs) { out.opLogAnd(lhs,rhs); }
|
virtual void numberOperate(V3Number& out, const V3Number& lhs, const V3Number& rhs) { out.opLogAnd(lhs,rhs); }
|
||||||
virtual string emitVerilog() { return "%k(%l %f&& %r)"; }
|
virtual string emitVerilog() { return "%k(%l %f&& %r)"; }
|
||||||
@ -3035,7 +3035,7 @@ struct AstLogAnd : public AstNodeBiop {
|
|||||||
};
|
};
|
||||||
struct AstLogIf : public AstNodeBiop {
|
struct AstLogIf : public AstNodeBiop {
|
||||||
AstLogIf(FileLine* fl, AstNode* lhsp, AstNode* rhsp) : AstNodeBiop(fl, lhsp, rhsp) {
|
AstLogIf(FileLine* fl, AstNode* lhsp, AstNode* rhsp) : AstNodeBiop(fl, lhsp, rhsp) {
|
||||||
dtypeChgLogicBool(); }
|
dtypeSetLogicBool(); }
|
||||||
ASTNODE_NODE_FUNCS(LogIf, LOGIF)
|
ASTNODE_NODE_FUNCS(LogIf, LOGIF)
|
||||||
virtual void numberOperate(V3Number& out, const V3Number& lhs, const V3Number& rhs) { V3ERROR_NA; }
|
virtual void numberOperate(V3Number& out, const V3Number& lhs, const V3Number& rhs) { V3ERROR_NA; }
|
||||||
virtual string emitVerilog() { return "%k(%l %f-> %r)"; }
|
virtual string emitVerilog() { return "%k(%l %f-> %r)"; }
|
||||||
@ -3048,7 +3048,7 @@ struct AstLogIf : public AstNodeBiop {
|
|||||||
};
|
};
|
||||||
struct AstLogIff : public AstNodeBiCom {
|
struct AstLogIff : public AstNodeBiCom {
|
||||||
AstLogIff(FileLine* fl, AstNode* lhsp, AstNode* rhsp) : AstNodeBiCom(fl, lhsp, rhsp) {
|
AstLogIff(FileLine* fl, AstNode* lhsp, AstNode* rhsp) : AstNodeBiCom(fl, lhsp, rhsp) {
|
||||||
dtypeChgLogicBool(); }
|
dtypeSetLogicBool(); }
|
||||||
ASTNODE_NODE_FUNCS(LogIff, LOGIFF)
|
ASTNODE_NODE_FUNCS(LogIff, LOGIFF)
|
||||||
virtual void numberOperate(V3Number& out, const V3Number& lhs, const V3Number& rhs) { V3ERROR_NA; }
|
virtual void numberOperate(V3Number& out, const V3Number& lhs, const V3Number& rhs) { V3ERROR_NA; }
|
||||||
virtual string emitVerilog() { return "%k(%l %f<-> %r)"; }
|
virtual string emitVerilog() { return "%k(%l %f<-> %r)"; }
|
||||||
@ -3109,7 +3109,7 @@ struct AstXnor : public AstNodeBiComAsv {
|
|||||||
};
|
};
|
||||||
struct AstEq : public AstNodeBiCom {
|
struct AstEq : public AstNodeBiCom {
|
||||||
AstEq(FileLine* fl, AstNode* lhsp, AstNode* rhsp) : AstNodeBiCom(fl, lhsp, rhsp) {
|
AstEq(FileLine* fl, AstNode* lhsp, AstNode* rhsp) : AstNodeBiCom(fl, lhsp, rhsp) {
|
||||||
dtypeChgLogicBool(); }
|
dtypeSetLogicBool(); }
|
||||||
ASTNODE_NODE_FUNCS(Eq, EQ)
|
ASTNODE_NODE_FUNCS(Eq, EQ)
|
||||||
virtual void numberOperate(V3Number& out, const V3Number& lhs, const V3Number& rhs) { out.opEq(lhs,rhs); }
|
virtual void numberOperate(V3Number& out, const V3Number& lhs, const V3Number& rhs) { out.opEq(lhs,rhs); }
|
||||||
virtual string emitVerilog() { return "%k(%l %f== %r)"; }
|
virtual string emitVerilog() { return "%k(%l %f== %r)"; }
|
||||||
@ -3121,7 +3121,7 @@ struct AstEq : public AstNodeBiCom {
|
|||||||
};
|
};
|
||||||
struct AstEqD : public AstNodeBiCom {
|
struct AstEqD : public AstNodeBiCom {
|
||||||
AstEqD(FileLine* fl, AstNode* lhsp, AstNode* rhsp) : AstNodeBiCom(fl, lhsp, rhsp) {
|
AstEqD(FileLine* fl, AstNode* lhsp, AstNode* rhsp) : AstNodeBiCom(fl, lhsp, rhsp) {
|
||||||
dtypeChgLogicBool(); }
|
dtypeSetLogicBool(); }
|
||||||
ASTNODE_NODE_FUNCS(EqD, EQD)
|
ASTNODE_NODE_FUNCS(EqD, EQD)
|
||||||
virtual void numberOperate(V3Number& out, const V3Number& lhs, const V3Number& rhs) { out.opEqD(lhs,rhs); }
|
virtual void numberOperate(V3Number& out, const V3Number& lhs, const V3Number& rhs) { out.opEqD(lhs,rhs); }
|
||||||
virtual string emitVerilog() { return "%k(%l %f== %r)"; }
|
virtual string emitVerilog() { return "%k(%l %f== %r)"; }
|
||||||
@ -3135,7 +3135,7 @@ struct AstEqD : public AstNodeBiCom {
|
|||||||
};
|
};
|
||||||
struct AstNeq : public AstNodeBiCom {
|
struct AstNeq : public AstNodeBiCom {
|
||||||
AstNeq(FileLine* fl, AstNode* lhsp, AstNode* rhsp) : AstNodeBiCom(fl, lhsp, rhsp) {
|
AstNeq(FileLine* fl, AstNode* lhsp, AstNode* rhsp) : AstNodeBiCom(fl, lhsp, rhsp) {
|
||||||
dtypeChgLogicBool(); }
|
dtypeSetLogicBool(); }
|
||||||
ASTNODE_NODE_FUNCS(Neq, NEQ)
|
ASTNODE_NODE_FUNCS(Neq, NEQ)
|
||||||
virtual void numberOperate(V3Number& out, const V3Number& lhs, const V3Number& rhs) { out.opNeq(lhs,rhs); }
|
virtual void numberOperate(V3Number& out, const V3Number& lhs, const V3Number& rhs) { out.opNeq(lhs,rhs); }
|
||||||
virtual string emitVerilog() { return "%k(%l %f!= %r)"; }
|
virtual string emitVerilog() { return "%k(%l %f!= %r)"; }
|
||||||
@ -3147,7 +3147,7 @@ struct AstNeq : public AstNodeBiCom {
|
|||||||
};
|
};
|
||||||
struct AstNeqD : public AstNodeBiCom {
|
struct AstNeqD : public AstNodeBiCom {
|
||||||
AstNeqD(FileLine* fl, AstNode* lhsp, AstNode* rhsp) : AstNodeBiCom(fl, lhsp, rhsp) {
|
AstNeqD(FileLine* fl, AstNode* lhsp, AstNode* rhsp) : AstNodeBiCom(fl, lhsp, rhsp) {
|
||||||
dtypeChgLogicBool(); }
|
dtypeSetLogicBool(); }
|
||||||
ASTNODE_NODE_FUNCS(NeqD, NEQD)
|
ASTNODE_NODE_FUNCS(NeqD, NEQD)
|
||||||
virtual void numberOperate(V3Number& out, const V3Number& lhs, const V3Number& rhs) { out.opNeqD(lhs,rhs); }
|
virtual void numberOperate(V3Number& out, const V3Number& lhs, const V3Number& rhs) { out.opNeqD(lhs,rhs); }
|
||||||
virtual string emitVerilog() { return "%k(%l %f!= %r)"; }
|
virtual string emitVerilog() { return "%k(%l %f!= %r)"; }
|
||||||
@ -3161,7 +3161,7 @@ struct AstNeqD : public AstNodeBiCom {
|
|||||||
};
|
};
|
||||||
struct AstLt : public AstNodeBiop {
|
struct AstLt : public AstNodeBiop {
|
||||||
AstLt(FileLine* fl, AstNode* lhsp, AstNode* rhsp) : AstNodeBiop(fl, lhsp, rhsp) {
|
AstLt(FileLine* fl, AstNode* lhsp, AstNode* rhsp) : AstNodeBiop(fl, lhsp, rhsp) {
|
||||||
dtypeChgLogicBool(); }
|
dtypeSetLogicBool(); }
|
||||||
ASTNODE_NODE_FUNCS(Lt, LT)
|
ASTNODE_NODE_FUNCS(Lt, LT)
|
||||||
virtual void numberOperate(V3Number& out, const V3Number& lhs, const V3Number& rhs) { out.opLt(lhs,rhs); }
|
virtual void numberOperate(V3Number& out, const V3Number& lhs, const V3Number& rhs) { out.opLt(lhs,rhs); }
|
||||||
virtual string emitVerilog() { return "%k(%l %f< %r)"; }
|
virtual string emitVerilog() { return "%k(%l %f< %r)"; }
|
||||||
@ -3173,7 +3173,7 @@ struct AstLt : public AstNodeBiop {
|
|||||||
};
|
};
|
||||||
struct AstLtD : public AstNodeBiop {
|
struct AstLtD : public AstNodeBiop {
|
||||||
AstLtD(FileLine* fl, AstNode* lhsp, AstNode* rhsp) : AstNodeBiop(fl, lhsp, rhsp) {
|
AstLtD(FileLine* fl, AstNode* lhsp, AstNode* rhsp) : AstNodeBiop(fl, lhsp, rhsp) {
|
||||||
dtypeChgLogicBool(); }
|
dtypeSetLogicBool(); }
|
||||||
ASTNODE_NODE_FUNCS(LtD, LTD)
|
ASTNODE_NODE_FUNCS(LtD, LTD)
|
||||||
virtual void numberOperate(V3Number& out, const V3Number& lhs, const V3Number& rhs) { out.opLtD(lhs,rhs); }
|
virtual void numberOperate(V3Number& out, const V3Number& lhs, const V3Number& rhs) { out.opLtD(lhs,rhs); }
|
||||||
virtual string emitVerilog() { return "%k(%l %f< %r)"; }
|
virtual string emitVerilog() { return "%k(%l %f< %r)"; }
|
||||||
@ -3187,7 +3187,7 @@ struct AstLtD : public AstNodeBiop {
|
|||||||
};
|
};
|
||||||
struct AstLtS : public AstNodeBiop {
|
struct AstLtS : public AstNodeBiop {
|
||||||
AstLtS(FileLine* fl, AstNode* lhsp, AstNode* rhsp) : AstNodeBiop(fl, lhsp, rhsp) {
|
AstLtS(FileLine* fl, AstNode* lhsp, AstNode* rhsp) : AstNodeBiop(fl, lhsp, rhsp) {
|
||||||
dtypeChgLogicBool(); }
|
dtypeSetLogicBool(); }
|
||||||
ASTNODE_NODE_FUNCS(LtS, LTS)
|
ASTNODE_NODE_FUNCS(LtS, LTS)
|
||||||
virtual void numberOperate(V3Number& out, const V3Number& lhs, const V3Number& rhs) { out.opLtS(lhs,rhs); }
|
virtual void numberOperate(V3Number& out, const V3Number& lhs, const V3Number& rhs) { out.opLtS(lhs,rhs); }
|
||||||
virtual string emitVerilog() { return "%k(%l %f< %r)"; }
|
virtual string emitVerilog() { return "%k(%l %f< %r)"; }
|
||||||
@ -3200,7 +3200,7 @@ struct AstLtS : public AstNodeBiop {
|
|||||||
};
|
};
|
||||||
struct AstGt : public AstNodeBiop {
|
struct AstGt : public AstNodeBiop {
|
||||||
AstGt(FileLine* fl, AstNode* lhsp, AstNode* rhsp) : AstNodeBiop(fl, lhsp, rhsp) {
|
AstGt(FileLine* fl, AstNode* lhsp, AstNode* rhsp) : AstNodeBiop(fl, lhsp, rhsp) {
|
||||||
dtypeChgLogicBool(); }
|
dtypeSetLogicBool(); }
|
||||||
ASTNODE_NODE_FUNCS(Gt, GT)
|
ASTNODE_NODE_FUNCS(Gt, GT)
|
||||||
virtual void numberOperate(V3Number& out, const V3Number& lhs, const V3Number& rhs) { out.opGt(lhs,rhs); }
|
virtual void numberOperate(V3Number& out, const V3Number& lhs, const V3Number& rhs) { out.opGt(lhs,rhs); }
|
||||||
virtual string emitVerilog() { return "%k(%l %f> %r)"; }
|
virtual string emitVerilog() { return "%k(%l %f> %r)"; }
|
||||||
@ -3212,7 +3212,7 @@ struct AstGt : public AstNodeBiop {
|
|||||||
};
|
};
|
||||||
struct AstGtD : public AstNodeBiop {
|
struct AstGtD : public AstNodeBiop {
|
||||||
AstGtD(FileLine* fl, AstNode* lhsp, AstNode* rhsp) : AstNodeBiop(fl, lhsp, rhsp) {
|
AstGtD(FileLine* fl, AstNode* lhsp, AstNode* rhsp) : AstNodeBiop(fl, lhsp, rhsp) {
|
||||||
dtypeChgLogicBool(); }
|
dtypeSetLogicBool(); }
|
||||||
ASTNODE_NODE_FUNCS(GtD, GTD)
|
ASTNODE_NODE_FUNCS(GtD, GTD)
|
||||||
virtual void numberOperate(V3Number& out, const V3Number& lhs, const V3Number& rhs) { out.opGtD(lhs,rhs); }
|
virtual void numberOperate(V3Number& out, const V3Number& lhs, const V3Number& rhs) { out.opGtD(lhs,rhs); }
|
||||||
virtual string emitVerilog() { return "%k(%l %f> %r)"; }
|
virtual string emitVerilog() { return "%k(%l %f> %r)"; }
|
||||||
@ -3226,7 +3226,7 @@ struct AstGtD : public AstNodeBiop {
|
|||||||
};
|
};
|
||||||
struct AstGtS : public AstNodeBiop {
|
struct AstGtS : public AstNodeBiop {
|
||||||
AstGtS(FileLine* fl, AstNode* lhsp, AstNode* rhsp) : AstNodeBiop(fl, lhsp, rhsp) {
|
AstGtS(FileLine* fl, AstNode* lhsp, AstNode* rhsp) : AstNodeBiop(fl, lhsp, rhsp) {
|
||||||
dtypeChgLogicBool(); }
|
dtypeSetLogicBool(); }
|
||||||
ASTNODE_NODE_FUNCS(GtS, GTS)
|
ASTNODE_NODE_FUNCS(GtS, GTS)
|
||||||
virtual void numberOperate(V3Number& out, const V3Number& lhs, const V3Number& rhs) { out.opGtS(lhs,rhs); }
|
virtual void numberOperate(V3Number& out, const V3Number& lhs, const V3Number& rhs) { out.opGtS(lhs,rhs); }
|
||||||
virtual string emitVerilog() { return "%k(%l %f> %r)"; }
|
virtual string emitVerilog() { return "%k(%l %f> %r)"; }
|
||||||
@ -3239,7 +3239,7 @@ struct AstGtS : public AstNodeBiop {
|
|||||||
};
|
};
|
||||||
struct AstGte : public AstNodeBiop {
|
struct AstGte : public AstNodeBiop {
|
||||||
AstGte(FileLine* fl, AstNode* lhsp, AstNode* rhsp) : AstNodeBiop(fl, lhsp, rhsp) {
|
AstGte(FileLine* fl, AstNode* lhsp, AstNode* rhsp) : AstNodeBiop(fl, lhsp, rhsp) {
|
||||||
dtypeChgLogicBool(); }
|
dtypeSetLogicBool(); }
|
||||||
ASTNODE_NODE_FUNCS(Gte, GTE)
|
ASTNODE_NODE_FUNCS(Gte, GTE)
|
||||||
virtual void numberOperate(V3Number& out, const V3Number& lhs, const V3Number& rhs) { out.opGte(lhs,rhs); }
|
virtual void numberOperate(V3Number& out, const V3Number& lhs, const V3Number& rhs) { out.opGte(lhs,rhs); }
|
||||||
virtual string emitVerilog() { return "%k(%l %f>= %r)"; }
|
virtual string emitVerilog() { return "%k(%l %f>= %r)"; }
|
||||||
@ -3251,7 +3251,7 @@ struct AstGte : public AstNodeBiop {
|
|||||||
};
|
};
|
||||||
struct AstGteD : public AstNodeBiop {
|
struct AstGteD : public AstNodeBiop {
|
||||||
AstGteD(FileLine* fl, AstNode* lhsp, AstNode* rhsp) : AstNodeBiop(fl, lhsp, rhsp) {
|
AstGteD(FileLine* fl, AstNode* lhsp, AstNode* rhsp) : AstNodeBiop(fl, lhsp, rhsp) {
|
||||||
dtypeChgLogicBool(); }
|
dtypeSetLogicBool(); }
|
||||||
ASTNODE_NODE_FUNCS(GteD, GTED)
|
ASTNODE_NODE_FUNCS(GteD, GTED)
|
||||||
virtual void numberOperate(V3Number& out, const V3Number& lhs, const V3Number& rhs) { out.opGteD(lhs,rhs); }
|
virtual void numberOperate(V3Number& out, const V3Number& lhs, const V3Number& rhs) { out.opGteD(lhs,rhs); }
|
||||||
virtual string emitVerilog() { return "%k(%l %f>= %r)"; }
|
virtual string emitVerilog() { return "%k(%l %f>= %r)"; }
|
||||||
@ -3265,7 +3265,7 @@ struct AstGteD : public AstNodeBiop {
|
|||||||
};
|
};
|
||||||
struct AstGteS : public AstNodeBiop {
|
struct AstGteS : public AstNodeBiop {
|
||||||
AstGteS(FileLine* fl, AstNode* lhsp, AstNode* rhsp) : AstNodeBiop(fl, lhsp, rhsp) {
|
AstGteS(FileLine* fl, AstNode* lhsp, AstNode* rhsp) : AstNodeBiop(fl, lhsp, rhsp) {
|
||||||
dtypeChgLogicBool(); }
|
dtypeSetLogicBool(); }
|
||||||
ASTNODE_NODE_FUNCS(GteS, GTES)
|
ASTNODE_NODE_FUNCS(GteS, GTES)
|
||||||
virtual void numberOperate(V3Number& out, const V3Number& lhs, const V3Number& rhs) { out.opGteS(lhs,rhs); }
|
virtual void numberOperate(V3Number& out, const V3Number& lhs, const V3Number& rhs) { out.opGteS(lhs,rhs); }
|
||||||
virtual string emitVerilog() { return "%k(%l %f>= %r)"; }
|
virtual string emitVerilog() { return "%k(%l %f>= %r)"; }
|
||||||
@ -3278,7 +3278,7 @@ struct AstGteS : public AstNodeBiop {
|
|||||||
};
|
};
|
||||||
struct AstLte : public AstNodeBiop {
|
struct AstLte : public AstNodeBiop {
|
||||||
AstLte(FileLine* fl, AstNode* lhsp, AstNode* rhsp) : AstNodeBiop(fl, lhsp, rhsp) {
|
AstLte(FileLine* fl, AstNode* lhsp, AstNode* rhsp) : AstNodeBiop(fl, lhsp, rhsp) {
|
||||||
dtypeChgLogicBool(); }
|
dtypeSetLogicBool(); }
|
||||||
ASTNODE_NODE_FUNCS(Lte, LTE)
|
ASTNODE_NODE_FUNCS(Lte, LTE)
|
||||||
virtual void numberOperate(V3Number& out, const V3Number& lhs, const V3Number& rhs) { out.opLte(lhs,rhs); }
|
virtual void numberOperate(V3Number& out, const V3Number& lhs, const V3Number& rhs) { out.opLte(lhs,rhs); }
|
||||||
virtual string emitVerilog() { return "%k(%l %f<= %r)"; }
|
virtual string emitVerilog() { return "%k(%l %f<= %r)"; }
|
||||||
@ -3290,7 +3290,7 @@ struct AstLte : public AstNodeBiop {
|
|||||||
};
|
};
|
||||||
struct AstLteD : public AstNodeBiop {
|
struct AstLteD : public AstNodeBiop {
|
||||||
AstLteD(FileLine* fl, AstNode* lhsp, AstNode* rhsp) : AstNodeBiop(fl, lhsp, rhsp) {
|
AstLteD(FileLine* fl, AstNode* lhsp, AstNode* rhsp) : AstNodeBiop(fl, lhsp, rhsp) {
|
||||||
dtypeChgLogicBool(); }
|
dtypeSetLogicBool(); }
|
||||||
ASTNODE_NODE_FUNCS(LteD, LTED)
|
ASTNODE_NODE_FUNCS(LteD, LTED)
|
||||||
virtual void numberOperate(V3Number& out, const V3Number& lhs, const V3Number& rhs) { out.opLteD(lhs,rhs); }
|
virtual void numberOperate(V3Number& out, const V3Number& lhs, const V3Number& rhs) { out.opLteD(lhs,rhs); }
|
||||||
virtual string emitVerilog() { return "%k(%l %f<= %r)"; }
|
virtual string emitVerilog() { return "%k(%l %f<= %r)"; }
|
||||||
@ -3304,7 +3304,7 @@ struct AstLteD : public AstNodeBiop {
|
|||||||
};
|
};
|
||||||
struct AstLteS : public AstNodeBiop {
|
struct AstLteS : public AstNodeBiop {
|
||||||
AstLteS(FileLine* fl, AstNode* lhsp, AstNode* rhsp) : AstNodeBiop(fl, lhsp, rhsp) {
|
AstLteS(FileLine* fl, AstNode* lhsp, AstNode* rhsp) : AstNodeBiop(fl, lhsp, rhsp) {
|
||||||
dtypeChgLogicBool(); }
|
dtypeSetLogicBool(); }
|
||||||
ASTNODE_NODE_FUNCS(LteS, LTES)
|
ASTNODE_NODE_FUNCS(LteS, LTES)
|
||||||
virtual void numberOperate(V3Number& out, const V3Number& lhs, const V3Number& rhs) { out.opLteS(lhs,rhs); }
|
virtual void numberOperate(V3Number& out, const V3Number& lhs, const V3Number& rhs) { out.opLteS(lhs,rhs); }
|
||||||
virtual string emitVerilog() { return "%k(%l %f<= %r)"; }
|
virtual string emitVerilog() { return "%k(%l %f<= %r)"; }
|
||||||
@ -3372,7 +3372,7 @@ struct AstAdd : public AstNodeBiComAsv {
|
|||||||
};
|
};
|
||||||
struct AstAddD : public AstNodeBiComAsv {
|
struct AstAddD : public AstNodeBiComAsv {
|
||||||
AstAddD(FileLine* fl, AstNode* lhsp, AstNode* rhsp) : AstNodeBiComAsv(fl, lhsp, rhsp) {
|
AstAddD(FileLine* fl, AstNode* lhsp, AstNode* rhsp) : AstNodeBiComAsv(fl, lhsp, rhsp) {
|
||||||
dtypeChgDouble(); }
|
dtypeSetDouble(); }
|
||||||
ASTNODE_NODE_FUNCS(AddD, ADDD)
|
ASTNODE_NODE_FUNCS(AddD, ADDD)
|
||||||
virtual void numberOperate(V3Number& out, const V3Number& lhs, const V3Number& rhs) { out.opAddD(lhs,rhs); }
|
virtual void numberOperate(V3Number& out, const V3Number& lhs, const V3Number& rhs) { out.opAddD(lhs,rhs); }
|
||||||
virtual string emitVerilog() { return "%k(%l %f+ %r)"; }
|
virtual string emitVerilog() { return "%k(%l %f+ %r)"; }
|
||||||
@ -3398,7 +3398,7 @@ struct AstSub : public AstNodeBiop {
|
|||||||
};
|
};
|
||||||
struct AstSubD : public AstNodeBiop {
|
struct AstSubD : public AstNodeBiop {
|
||||||
AstSubD(FileLine* fl, AstNode* lhsp, AstNode* rhsp) : AstNodeBiop(fl, lhsp, rhsp) {
|
AstSubD(FileLine* fl, AstNode* lhsp, AstNode* rhsp) : AstNodeBiop(fl, lhsp, rhsp) {
|
||||||
dtypeChgDouble(); }
|
dtypeSetDouble(); }
|
||||||
ASTNODE_NODE_FUNCS(SubD, SUBD)
|
ASTNODE_NODE_FUNCS(SubD, SUBD)
|
||||||
virtual void numberOperate(V3Number& out, const V3Number& lhs, const V3Number& rhs) { out.opSubD(lhs,rhs); }
|
virtual void numberOperate(V3Number& out, const V3Number& lhs, const V3Number& rhs) { out.opSubD(lhs,rhs); }
|
||||||
virtual string emitVerilog() { return "%k(%l %f- %r)"; }
|
virtual string emitVerilog() { return "%k(%l %f- %r)"; }
|
||||||
@ -3425,7 +3425,7 @@ struct AstMul : public AstNodeBiComAsv {
|
|||||||
};
|
};
|
||||||
struct AstMulD : public AstNodeBiComAsv {
|
struct AstMulD : public AstNodeBiComAsv {
|
||||||
AstMulD(FileLine* fl, AstNode* lhsp, AstNode* rhsp) : AstNodeBiComAsv(fl, lhsp, rhsp) {
|
AstMulD(FileLine* fl, AstNode* lhsp, AstNode* rhsp) : AstNodeBiComAsv(fl, lhsp, rhsp) {
|
||||||
dtypeChgDouble(); }
|
dtypeSetDouble(); }
|
||||||
ASTNODE_NODE_FUNCS(MulD, MULD)
|
ASTNODE_NODE_FUNCS(MulD, MULD)
|
||||||
virtual void numberOperate(V3Number& out, const V3Number& lhs, const V3Number& rhs) { out.opMulD(lhs,rhs); }
|
virtual void numberOperate(V3Number& out, const V3Number& lhs, const V3Number& rhs) { out.opMulD(lhs,rhs); }
|
||||||
virtual string emitVerilog() { return "%k(%l %f* %r)"; }
|
virtual string emitVerilog() { return "%k(%l %f* %r)"; }
|
||||||
@ -3465,7 +3465,7 @@ struct AstDiv : public AstNodeBiop {
|
|||||||
};
|
};
|
||||||
struct AstDivD : public AstNodeBiop {
|
struct AstDivD : public AstNodeBiop {
|
||||||
AstDivD(FileLine* fl, AstNode* lhsp, AstNode* rhsp) : AstNodeBiop(fl, lhsp, rhsp) {
|
AstDivD(FileLine* fl, AstNode* lhsp, AstNode* rhsp) : AstNodeBiop(fl, lhsp, rhsp) {
|
||||||
dtypeChgDouble(); }
|
dtypeSetDouble(); }
|
||||||
ASTNODE_NODE_FUNCS(DivD, DIVD)
|
ASTNODE_NODE_FUNCS(DivD, DIVD)
|
||||||
virtual void numberOperate(V3Number& out, const V3Number& lhs, const V3Number& rhs) { out.opDivD(lhs,rhs); }
|
virtual void numberOperate(V3Number& out, const V3Number& lhs, const V3Number& rhs) { out.opDivD(lhs,rhs); }
|
||||||
virtual string emitVerilog() { return "%k(%l %f/ %r)"; }
|
virtual string emitVerilog() { return "%k(%l %f/ %r)"; }
|
||||||
@ -3529,7 +3529,7 @@ struct AstPow : public AstNodeBiop {
|
|||||||
};
|
};
|
||||||
struct AstPowD : public AstNodeBiop {
|
struct AstPowD : public AstNodeBiop {
|
||||||
AstPowD(FileLine* fl, AstNode* lhsp, AstNode* rhsp) : AstNodeBiop(fl, lhsp, rhsp) {
|
AstPowD(FileLine* fl, AstNode* lhsp, AstNode* rhsp) : AstNodeBiop(fl, lhsp, rhsp) {
|
||||||
dtypeChgDouble(); }
|
dtypeSetDouble(); }
|
||||||
ASTNODE_NODE_FUNCS(PowD, POWD)
|
ASTNODE_NODE_FUNCS(PowD, POWD)
|
||||||
virtual void numberOperate(V3Number& out, const V3Number& lhs, const V3Number& rhs) { out.opPowD(lhs,rhs); }
|
virtual void numberOperate(V3Number& out, const V3Number& lhs, const V3Number& rhs) { out.opPowD(lhs,rhs); }
|
||||||
virtual string emitVerilog() { return "%k(%l %f** %r)"; }
|
virtual string emitVerilog() { return "%k(%l %f** %r)"; }
|
||||||
@ -3555,7 +3555,7 @@ struct AstPowS : public AstNodeBiop {
|
|||||||
};
|
};
|
||||||
struct AstEqCase : public AstNodeBiCom {
|
struct AstEqCase : public AstNodeBiCom {
|
||||||
AstEqCase(FileLine* fl, AstNode* lhsp, AstNode* rhsp) : AstNodeBiCom(fl, lhsp, rhsp) {
|
AstEqCase(FileLine* fl, AstNode* lhsp, AstNode* rhsp) : AstNodeBiCom(fl, lhsp, rhsp) {
|
||||||
dtypeChgLogicBool(); }
|
dtypeSetLogicBool(); }
|
||||||
ASTNODE_NODE_FUNCS(EqCase, EQCASE)
|
ASTNODE_NODE_FUNCS(EqCase, EQCASE)
|
||||||
virtual void numberOperate(V3Number& out, const V3Number& lhs, const V3Number& rhs) { out.opCaseEq(lhs,rhs); }
|
virtual void numberOperate(V3Number& out, const V3Number& lhs, const V3Number& rhs) { out.opCaseEq(lhs,rhs); }
|
||||||
virtual string emitVerilog() { return "%k(%l %f=== %r)"; }
|
virtual string emitVerilog() { return "%k(%l %f=== %r)"; }
|
||||||
@ -3567,7 +3567,7 @@ struct AstEqCase : public AstNodeBiCom {
|
|||||||
};
|
};
|
||||||
struct AstNeqCase : public AstNodeBiCom {
|
struct AstNeqCase : public AstNodeBiCom {
|
||||||
AstNeqCase(FileLine* fl, AstNode* lhsp, AstNode* rhsp) : AstNodeBiCom(fl, lhsp, rhsp) {
|
AstNeqCase(FileLine* fl, AstNode* lhsp, AstNode* rhsp) : AstNodeBiCom(fl, lhsp, rhsp) {
|
||||||
dtypeChgLogicBool(); }
|
dtypeSetLogicBool(); }
|
||||||
ASTNODE_NODE_FUNCS(NeqCase, NEQCASE)
|
ASTNODE_NODE_FUNCS(NeqCase, NEQCASE)
|
||||||
virtual void numberOperate(V3Number& out, const V3Number& lhs, const V3Number& rhs) { out.opCaseNeq(lhs,rhs); }
|
virtual void numberOperate(V3Number& out, const V3Number& lhs, const V3Number& rhs) { out.opCaseNeq(lhs,rhs); }
|
||||||
virtual string emitVerilog() { return "%k(%l %f!== %r)"; }
|
virtual string emitVerilog() { return "%k(%l %f!== %r)"; }
|
||||||
@ -3580,7 +3580,7 @@ struct AstNeqCase : public AstNodeBiCom {
|
|||||||
struct AstEqWild : public AstNodeBiop {
|
struct AstEqWild : public AstNodeBiop {
|
||||||
// Note wildcard operator rhs differs from lhs
|
// Note wildcard operator rhs differs from lhs
|
||||||
AstEqWild(FileLine* fl, AstNode* lhsp, AstNode* rhsp) : AstNodeBiop(fl, lhsp, rhsp) {
|
AstEqWild(FileLine* fl, AstNode* lhsp, AstNode* rhsp) : AstNodeBiop(fl, lhsp, rhsp) {
|
||||||
dtypeChgLogicBool(); }
|
dtypeSetLogicBool(); }
|
||||||
ASTNODE_NODE_FUNCS(EqWild, EQWILD)
|
ASTNODE_NODE_FUNCS(EqWild, EQWILD)
|
||||||
virtual void numberOperate(V3Number& out, const V3Number& lhs, const V3Number& rhs) { out.opWildEq(lhs,rhs); }
|
virtual void numberOperate(V3Number& out, const V3Number& lhs, const V3Number& rhs) { out.opWildEq(lhs,rhs); }
|
||||||
virtual string emitVerilog() { return "%k(%l %f==? %r)"; }
|
virtual string emitVerilog() { return "%k(%l %f==? %r)"; }
|
||||||
@ -3592,7 +3592,7 @@ struct AstEqWild : public AstNodeBiop {
|
|||||||
};
|
};
|
||||||
struct AstNeqWild : public AstNodeBiop {
|
struct AstNeqWild : public AstNodeBiop {
|
||||||
AstNeqWild(FileLine* fl, AstNode* lhsp, AstNode* rhsp) : AstNodeBiop(fl, lhsp, rhsp) {
|
AstNeqWild(FileLine* fl, AstNode* lhsp, AstNode* rhsp) : AstNodeBiop(fl, lhsp, rhsp) {
|
||||||
dtypeChgLogicBool(); }
|
dtypeSetLogicBool(); }
|
||||||
ASTNODE_NODE_FUNCS(NeqWild, NEQWILD)
|
ASTNODE_NODE_FUNCS(NeqWild, NEQWILD)
|
||||||
virtual void numberOperate(V3Number& out, const V3Number& lhs, const V3Number& rhs) { out.opWildNeq(lhs,rhs); }
|
virtual void numberOperate(V3Number& out, const V3Number& lhs, const V3Number& rhs) { out.opWildNeq(lhs,rhs); }
|
||||||
virtual string emitVerilog() { return "%k(%l %f!=? %r)"; }
|
virtual string emitVerilog() { return "%k(%l %f!=? %r)"; }
|
||||||
|
@ -245,10 +245,10 @@ private:
|
|||||||
virtual void visit(AstRealToBits* nodep, AstNUser* vup) { visit_Ou64_Lr(nodep,vup); }
|
virtual void visit(AstRealToBits* nodep, AstNUser* vup) { visit_Ou64_Lr(nodep,vup); }
|
||||||
|
|
||||||
// Widths: Constant, terminal
|
// Widths: Constant, terminal
|
||||||
virtual void visit(AstTime* nodep, AstNUser*) { nodep->dtypeChgUInt64(); }
|
virtual void visit(AstTime* nodep, AstNUser*) { nodep->dtypeSetUInt64(); }
|
||||||
virtual void visit(AstTimeD* nodep, AstNUser*) { nodep->dtypeChgDouble(); }
|
virtual void visit(AstTimeD* nodep, AstNUser*) { nodep->dtypeSetDouble(); }
|
||||||
virtual void visit(AstTestPlusArgs* nodep, AstNUser*) { nodep->dtypeChgSigned32(); }
|
virtual void visit(AstTestPlusArgs* nodep, AstNUser*) { nodep->dtypeSetSigned32(); }
|
||||||
virtual void visit(AstScopeName* nodep, AstNUser*) { nodep->dtypeChgUInt64(); } // A pointer, but not that it matters
|
virtual void visit(AstScopeName* nodep, AstNUser*) { nodep->dtypeSetUInt64(); } // A pointer, but not that it matters
|
||||||
|
|
||||||
// Special cases. So many....
|
// Special cases. So many....
|
||||||
virtual void visit(AstNodeCond* nodep, AstNUser* vup) {
|
virtual void visit(AstNodeCond* nodep, AstNUser* vup) {
|
||||||
@ -271,7 +271,7 @@ private:
|
|||||||
if (nodep->expr1p()->isDouble() || nodep->expr2p()->isDouble()) {
|
if (nodep->expr1p()->isDouble() || nodep->expr2p()->isDouble()) {
|
||||||
spliceCvtD(nodep->expr1p());
|
spliceCvtD(nodep->expr1p());
|
||||||
spliceCvtD(nodep->expr2p());
|
spliceCvtD(nodep->expr2p());
|
||||||
nodep->dtypeChgDouble();
|
nodep->dtypeSetDouble();
|
||||||
} else {
|
} else {
|
||||||
int width = max(vup->c()->width(), max(nodep->expr1p()->width(), nodep->expr2p()->width()));
|
int width = max(vup->c()->width(), max(nodep->expr1p()->width(), nodep->expr2p()->width()));
|
||||||
int mwidth = max(vup->c()->widthMin(), max(nodep->expr1p()->widthMin(), nodep->expr2p()->widthMin()));
|
int mwidth = max(vup->c()->widthMin(), max(nodep->expr1p()->widthMin(), nodep->expr2p()->widthMin()));
|
||||||
@ -382,7 +382,7 @@ private:
|
|||||||
AstConst* widthConstp = nodep->widthp()->castConst();
|
AstConst* widthConstp = nodep->widthp()->castConst();
|
||||||
if (!widthConstp) {
|
if (!widthConstp) {
|
||||||
nodep->v3error("Width of bit extract isn't a constant");
|
nodep->v3error("Width of bit extract isn't a constant");
|
||||||
nodep->dtypeChgLogicBool(); return;
|
nodep->dtypeSetLogicBool(); return;
|
||||||
}
|
}
|
||||||
int width = nodep->widthConst();
|
int width = nodep->widthConst();
|
||||||
nodep->width(width,width);
|
nodep->width(width,width);
|
||||||
@ -542,7 +542,7 @@ private:
|
|||||||
}
|
}
|
||||||
virtual void visit(AstRand* nodep, AstNUser* vup) {
|
virtual void visit(AstRand* nodep, AstNUser* vup) {
|
||||||
if (vup->c()->prelim()) {
|
if (vup->c()->prelim()) {
|
||||||
nodep->dtypeChgSigned32(); // Says the spec
|
nodep->dtypeSetSigned32(); // Says the spec
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
virtual void visit(AstUCFunc* nodep, AstNUser* vup) {
|
virtual void visit(AstUCFunc* nodep, AstNUser* vup) {
|
||||||
@ -562,7 +562,7 @@ private:
|
|||||||
if (vup->c()->prelim()) {
|
if (vup->c()->prelim()) {
|
||||||
nodep->lhsp()->iterateAndNext(*this,WidthVP(ANYSIZE,0,BOTH).p());
|
nodep->lhsp()->iterateAndNext(*this,WidthVP(ANYSIZE,0,BOTH).p());
|
||||||
checkCvtUS(nodep->lhsp());
|
checkCvtUS(nodep->lhsp());
|
||||||
nodep->dtypeChgSigned32();
|
nodep->dtypeSetSigned32();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
virtual void visit(AstPow* nodep, AstNUser* vup) {
|
virtual void visit(AstPow* nodep, AstNUser* vup) {
|
||||||
@ -710,8 +710,8 @@ private:
|
|||||||
// we want the init numbers to retain their width/minwidth until parameters are replaced.
|
// we want the init numbers to retain their width/minwidth until parameters are replaced.
|
||||||
// This prevents width warnings at the location the parameter is substituted in
|
// This prevents width warnings at the location the parameter is substituted in
|
||||||
if (nodep->valuep()->isDouble()) {
|
if (nodep->valuep()->isDouble()) {
|
||||||
nodep->dtypeChgDouble(); bdtypep=NULL;
|
nodep->dtypeSetDouble(); bdtypep=NULL;
|
||||||
nodep->dtypep()->dtypeChgDouble(); bdtypep=NULL;
|
nodep->dtypep()->dtypeSetDouble(); bdtypep=NULL;
|
||||||
nodep->valuep()->iterateAndNext(*this,WidthVP(width,0,FINAL).p());
|
nodep->valuep()->iterateAndNext(*this,WidthVP(width,0,FINAL).p());
|
||||||
} else {
|
} else {
|
||||||
nodep->valuep()->iterateAndNext(*this,WidthVP(width,0,FINAL).p());
|
nodep->valuep()->iterateAndNext(*this,WidthVP(width,0,FINAL).p());
|
||||||
@ -839,7 +839,7 @@ private:
|
|||||||
widthCheckReduce(nodep,"Disable",nodep->disablep(),1,1); // it's like an if() condition.
|
widthCheckReduce(nodep,"Disable",nodep->disablep(),1,1); // it's like an if() condition.
|
||||||
}
|
}
|
||||||
widthCheckReduce(nodep,"Property",nodep->propp(),1,1); // it's like an if() condition.
|
widthCheckReduce(nodep,"Property",nodep->propp(),1,1); // it's like an if() condition.
|
||||||
nodep->dtypeChgLogicBool();
|
nodep->dtypeSetLogicBool();
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------
|
//--------------------
|
||||||
@ -1014,7 +1014,7 @@ private:
|
|||||||
nodep->filep()->iterateAndNext(*this,WidthVP(32,32,BOTH).p());
|
nodep->filep()->iterateAndNext(*this,WidthVP(32,32,BOTH).p());
|
||||||
nodep->strgp()->iterateAndNext(*this,WidthVP(ANYSIZE,0,BOTH).p());
|
nodep->strgp()->iterateAndNext(*this,WidthVP(ANYSIZE,0,BOTH).p());
|
||||||
if (vup->c()->prelim()) {
|
if (vup->c()->prelim()) {
|
||||||
nodep->dtypeChgSigned32(); // Spec says integer return
|
nodep->dtypeSetSigned32(); // Spec says integer return
|
||||||
}
|
}
|
||||||
widthCheck(nodep,"file_descriptor",nodep->filep(),32,32);
|
widthCheck(nodep,"file_descriptor",nodep->filep(),32,32);
|
||||||
}
|
}
|
||||||
@ -1022,7 +1022,7 @@ private:
|
|||||||
nodep->filep()->iterateAndNext(*this,WidthVP(32,32,BOTH).p());
|
nodep->filep()->iterateAndNext(*this,WidthVP(32,32,BOTH).p());
|
||||||
nodep->exprsp()->iterateAndNext(*this,WidthVP(ANYSIZE,0,BOTH).p());
|
nodep->exprsp()->iterateAndNext(*this,WidthVP(ANYSIZE,0,BOTH).p());
|
||||||
if (vup->c()->prelim()) {
|
if (vup->c()->prelim()) {
|
||||||
nodep->dtypeChgSigned32(); // Spec says integer return
|
nodep->dtypeSetSigned32(); // Spec says integer return
|
||||||
}
|
}
|
||||||
widthCheck(nodep,"file_descriptor",nodep->filep(),32,32);
|
widthCheck(nodep,"file_descriptor",nodep->filep(),32,32);
|
||||||
}
|
}
|
||||||
@ -1030,7 +1030,7 @@ private:
|
|||||||
nodep->fromp()->iterateAndNext(*this,WidthVP(ANYSIZE,0,BOTH).p());
|
nodep->fromp()->iterateAndNext(*this,WidthVP(ANYSIZE,0,BOTH).p());
|
||||||
nodep->exprsp()->iterateAndNext(*this,WidthVP(ANYSIZE,0,BOTH).p());
|
nodep->exprsp()->iterateAndNext(*this,WidthVP(ANYSIZE,0,BOTH).p());
|
||||||
if (vup->c()->prelim()) {
|
if (vup->c()->prelim()) {
|
||||||
nodep->dtypeChgSigned32(); // Spec says integer return
|
nodep->dtypeSetSigned32(); // Spec says integer return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
virtual void visit(AstSysIgnore* nodep, AstNUser* vup) {
|
virtual void visit(AstSysIgnore* nodep, AstNUser* vup) {
|
||||||
@ -1038,7 +1038,7 @@ private:
|
|||||||
}
|
}
|
||||||
virtual void visit(AstSystemF* nodep, AstNUser*) {
|
virtual void visit(AstSystemF* nodep, AstNUser*) {
|
||||||
nodep->lhsp()->iterateAndNext(*this,WidthVP(ANYSIZE,0,BOTH).p());
|
nodep->lhsp()->iterateAndNext(*this,WidthVP(ANYSIZE,0,BOTH).p());
|
||||||
nodep->dtypeChgSigned32(); // Spec says integer return
|
nodep->dtypeSetSigned32(); // Spec says integer return
|
||||||
}
|
}
|
||||||
virtual void visit(AstSystemT* nodep, AstNUser*) {
|
virtual void visit(AstSystemT* nodep, AstNUser*) {
|
||||||
nodep->lhsp()->iterateAndNext(*this,WidthVP(ANYSIZE,0,BOTH).p());
|
nodep->lhsp()->iterateAndNext(*this,WidthVP(ANYSIZE,0,BOTH).p());
|
||||||
@ -1051,7 +1051,7 @@ private:
|
|||||||
}
|
}
|
||||||
virtual void visit(AstValuePlusArgs* nodep, AstNUser* vup) {
|
virtual void visit(AstValuePlusArgs* nodep, AstNUser* vup) {
|
||||||
nodep->exprsp()->iterateAndNext(*this,WidthVP(ANYSIZE,0,BOTH).p());
|
nodep->exprsp()->iterateAndNext(*this,WidthVP(ANYSIZE,0,BOTH).p());
|
||||||
nodep->dtypeChgSigned32(); // Spec says integer return
|
nodep->dtypeSetSigned32(); // Spec says integer return
|
||||||
}
|
}
|
||||||
virtual void visit(AstUCStmt* nodep, AstNUser*) {
|
virtual void visit(AstUCStmt* nodep, AstNUser*) {
|
||||||
// TOP LEVEL NODE
|
// TOP LEVEL NODE
|
||||||
@ -1160,7 +1160,7 @@ private:
|
|||||||
UINFO(5," FTASK "<<nodep<<endl);
|
UINFO(5," FTASK "<<nodep<<endl);
|
||||||
if (nodep->doingWidth()) {
|
if (nodep->doingWidth()) {
|
||||||
nodep->v3error("Unsupported: Recursive function or task call");
|
nodep->v3error("Unsupported: Recursive function or task call");
|
||||||
nodep->dtypeChgLogicBool();
|
nodep->dtypeSetLogicBool();
|
||||||
nodep->didWidth(true);
|
nodep->didWidth(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1295,7 +1295,7 @@ private:
|
|||||||
if (vup->c()->prelim()) { // First stage evaluation
|
if (vup->c()->prelim()) { // First stage evaluation
|
||||||
nodep->lhsp()->iterateAndNext(*this,WidthVP(ANYSIZE,0,BOTH).p());
|
nodep->lhsp()->iterateAndNext(*this,WidthVP(ANYSIZE,0,BOTH).p());
|
||||||
checkCvtUS(nodep->lhsp());
|
checkCvtUS(nodep->lhsp());
|
||||||
nodep->dtypeChgDouble();
|
nodep->dtypeSetDouble();
|
||||||
widthCheck(nodep,"LHS",nodep->lhsp(),64,64);
|
widthCheck(nodep,"LHS",nodep->lhsp(),64,64);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1305,7 +1305,7 @@ private:
|
|||||||
if (vup->c()->prelim()) { // First stage evaluation
|
if (vup->c()->prelim()) { // First stage evaluation
|
||||||
nodep->lhsp()->iterateAndNext(*this,WidthVP(ANYSIZE,0,BOTH).p());
|
nodep->lhsp()->iterateAndNext(*this,WidthVP(ANYSIZE,0,BOTH).p());
|
||||||
checkCvtUS(nodep->lhsp());
|
checkCvtUS(nodep->lhsp());
|
||||||
nodep->dtypeChgDouble();
|
nodep->dtypeSetDouble();
|
||||||
widthCheck(nodep,"LHS",nodep->lhsp(),32,32);
|
widthCheck(nodep,"LHS",nodep->lhsp(),32,32);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1315,7 +1315,7 @@ private:
|
|||||||
if (vup->c()->prelim()) { // First stage evaluation
|
if (vup->c()->prelim()) { // First stage evaluation
|
||||||
nodep->lhsp()->iterateAndNext(*this,WidthVP(ANYSIZE,0,BOTH).p());
|
nodep->lhsp()->iterateAndNext(*this,WidthVP(ANYSIZE,0,BOTH).p());
|
||||||
checkCvtD(nodep->lhsp());
|
checkCvtD(nodep->lhsp());
|
||||||
nodep->dtypeChgSigned32();
|
nodep->dtypeSetSigned32();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void visit_Ou64_Lr(AstNodeUniop* nodep, AstNUser* vup) {
|
void visit_Ou64_Lr(AstNodeUniop* nodep, AstNUser* vup) {
|
||||||
@ -1324,7 +1324,7 @@ private:
|
|||||||
if (vup->c()->prelim()) { // First stage evaluation
|
if (vup->c()->prelim()) { // First stage evaluation
|
||||||
nodep->lhsp()->iterateAndNext(*this,WidthVP(ANYSIZE,0,BOTH).p());
|
nodep->lhsp()->iterateAndNext(*this,WidthVP(ANYSIZE,0,BOTH).p());
|
||||||
checkCvtD(nodep->lhsp());
|
checkCvtD(nodep->lhsp());
|
||||||
nodep->dtypeChgUInt64();
|
nodep->dtypeSetUInt64();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1341,7 +1341,7 @@ private:
|
|||||||
nodep->op1p()->iterateAndNext(*this,WidthVP(1,0,BOTH).p());
|
nodep->op1p()->iterateAndNext(*this,WidthVP(1,0,BOTH).p());
|
||||||
spliceCvtCmpD0(nodep->op1p());
|
spliceCvtCmpD0(nodep->op1p());
|
||||||
}
|
}
|
||||||
nodep->dtypeChgLogicBool();
|
nodep->dtypeSetLogicBool();
|
||||||
if (vup->c()->final()) {
|
if (vup->c()->final()) {
|
||||||
widthCheckReduce(nodep,"LHS",nodep->op1p(),1,1);
|
widthCheckReduce(nodep,"LHS",nodep->op1p(),1,1);
|
||||||
}
|
}
|
||||||
@ -1355,7 +1355,7 @@ private:
|
|||||||
spliceCvtCmpD0(nodep->lhsp());
|
spliceCvtCmpD0(nodep->lhsp());
|
||||||
spliceCvtCmpD0(nodep->rhsp());
|
spliceCvtCmpD0(nodep->rhsp());
|
||||||
}
|
}
|
||||||
nodep->dtypeChgLogicBool();
|
nodep->dtypeSetLogicBool();
|
||||||
if (vup->c()->final()) {
|
if (vup->c()->final()) {
|
||||||
widthCheckReduce(nodep,"LHS",nodep->lhsp(),1,1);
|
widthCheckReduce(nodep,"LHS",nodep->lhsp(),1,1);
|
||||||
widthCheckReduce(nodep,"RHS",nodep->rhsp(),1,1);
|
widthCheckReduce(nodep,"RHS",nodep->rhsp(),1,1);
|
||||||
@ -1370,7 +1370,7 @@ private:
|
|||||||
nodep->lhsp()->iterateAndNext(*this,WidthVP(ANYSIZE,0,BOTH).p());
|
nodep->lhsp()->iterateAndNext(*this,WidthVP(ANYSIZE,0,BOTH).p());
|
||||||
}
|
}
|
||||||
if (!realok) checkCvtUS(nodep->lhsp());
|
if (!realok) checkCvtUS(nodep->lhsp());
|
||||||
nodep->dtypeChgLogicBool();
|
nodep->dtypeSetLogicBool();
|
||||||
}
|
}
|
||||||
void visit_cmp_O1_DSreplace(AstNodeBiop* nodep, AstNUser* vup) {
|
void visit_cmp_O1_DSreplace(AstNodeBiop* nodep, AstNUser* vup) {
|
||||||
// CALLER: AstEq, AstGt, ..., AstLtS
|
// CALLER: AstEq, AstGt, ..., AstLtS
|
||||||
@ -1396,7 +1396,7 @@ private:
|
|||||||
}
|
}
|
||||||
int width = max(nodep->lhsp()->width(), nodep->rhsp()->width());
|
int width = max(nodep->lhsp()->width(), nodep->rhsp()->width());
|
||||||
int ewidth = max(nodep->lhsp()->widthMin(), nodep->rhsp()->widthMin());
|
int ewidth = max(nodep->lhsp()->widthMin(), nodep->rhsp()->widthMin());
|
||||||
nodep->dtypeChgLogicBool();
|
nodep->dtypeSetLogicBool();
|
||||||
if (vup->c()->final()) {
|
if (vup->c()->final()) {
|
||||||
nodep->lhsp()->iterateAndNext(*this,WidthVP(width,ewidth,FINAL).p());
|
nodep->lhsp()->iterateAndNext(*this,WidthVP(width,ewidth,FINAL).p());
|
||||||
nodep->rhsp()->iterateAndNext(*this,WidthVP(width,ewidth,FINAL).p());
|
nodep->rhsp()->iterateAndNext(*this,WidthVP(width,ewidth,FINAL).p());
|
||||||
@ -1424,7 +1424,7 @@ private:
|
|||||||
}
|
}
|
||||||
int width = max(nodep->lhsp()->width(), nodep->rhsp()->width());
|
int width = max(nodep->lhsp()->width(), nodep->rhsp()->width());
|
||||||
int ewidth = max(nodep->lhsp()->widthMin(), nodep->rhsp()->widthMin());
|
int ewidth = max(nodep->lhsp()->widthMin(), nodep->rhsp()->widthMin());
|
||||||
nodep->dtypeChgLogicBool();
|
nodep->dtypeSetLogicBool();
|
||||||
if (vup->c()->final()) {
|
if (vup->c()->final()) {
|
||||||
nodep->lhsp()->iterateAndNext(*this,WidthVP(width,ewidth,FINAL).p());
|
nodep->lhsp()->iterateAndNext(*this,WidthVP(width,ewidth,FINAL).p());
|
||||||
nodep->rhsp()->iterateAndNext(*this,WidthVP(width,ewidth,FINAL).p());
|
nodep->rhsp()->iterateAndNext(*this,WidthVP(width,ewidth,FINAL).p());
|
||||||
@ -1620,7 +1620,7 @@ private:
|
|||||||
nodep->rhsp()->iterateAndNext(*this,WidthVP(ANYSIZE,0,BOTH).p());
|
nodep->rhsp()->iterateAndNext(*this,WidthVP(ANYSIZE,0,BOTH).p());
|
||||||
checkCvtD(nodep->lhsp());
|
checkCvtD(nodep->lhsp());
|
||||||
checkCvtD(nodep->rhsp());
|
checkCvtD(nodep->rhsp());
|
||||||
nodep->dtypeChgDouble();
|
nodep->dtypeSetDouble();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void visit_math_Or_Lr(AstNodeUniop* nodep, AstNUser* vup) {
|
void visit_math_Or_Lr(AstNodeUniop* nodep, AstNUser* vup) {
|
||||||
@ -1628,7 +1628,7 @@ private:
|
|||||||
if (vup->c()->prelim()) { // First stage evaluation
|
if (vup->c()->prelim()) { // First stage evaluation
|
||||||
nodep->lhsp()->iterateAndNext(*this,WidthVP(ANYSIZE,0,BOTH).p());
|
nodep->lhsp()->iterateAndNext(*this,WidthVP(ANYSIZE,0,BOTH).p());
|
||||||
checkCvtD(nodep->lhsp());
|
checkCvtD(nodep->lhsp());
|
||||||
nodep->dtypeChgDouble();
|
nodep->dtypeSetDouble();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user