mirror of
https://github.com/verilator/verilator.git
synced 2026-10-06 01:54:01 +02:00
Always type '$clog2' as signed 32
This commit is contained in:
+3
-1
@@ -6139,7 +6139,9 @@ public:
|
||||
class AstCLog2 final : public AstNodeUniop {
|
||||
public:
|
||||
AstCLog2(FileLine* fl, AstNode* lhsp)
|
||||
: ASTGEN_SUPER_CLog2(fl, lhsp) {}
|
||||
: ASTGEN_SUPER_CLog2(fl, lhsp) {
|
||||
dtypeSetSigned32();
|
||||
}
|
||||
ASTNODE_NODE_FUNCS(CLog2)
|
||||
virtual void numberOperate(V3Number& out, const V3Number& lhs) override { out.opCLog2(lhs); }
|
||||
virtual string emitVerilog() override { return "%f$clog2(%l)"; }
|
||||
|
||||
+1
-4
@@ -1248,10 +1248,7 @@ private:
|
||||
}
|
||||
}
|
||||
virtual void visit(AstCLog2* nodep) override {
|
||||
if (m_vup->prelim()) {
|
||||
iterateCheckSizedSelf(nodep, "LHS", nodep->lhsp(), SELF, BOTH);
|
||||
nodep->dtypeSetSigned32();
|
||||
}
|
||||
if (m_vup->prelim()) { iterateCheckSizedSelf(nodep, "LHS", nodep->lhsp(), SELF, BOTH); }
|
||||
}
|
||||
virtual void visit(AstPow* nodep) override {
|
||||
// Pow is special, output sign only depends on LHS sign, but
|
||||
|
||||
Reference in New Issue
Block a user