From e92c4638edbacf544a2985c411e4d7fa68d7de5a Mon Sep 17 00:00:00 2001 From: Cary R Date: Tue, 13 Oct 2009 16:38:53 -0700 Subject: [PATCH] $clog2() should return an integer value. The constant $clog2() was returning a value that had an integer width, but it did not have the sign bit set. This could result in incorrect math expressions. This patch sets the sign bit for the constant $clog2() result. (cherry picked from commit bc60536eb970237f61e6e377daa42456d222b409) --- eval_tree.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/eval_tree.cc b/eval_tree.cc index deb313f34..3f278f842 100644 --- a/eval_tree.cc +++ b/eval_tree.cc @@ -1703,6 +1703,7 @@ NetExpr* evaluate_clog2(NetExpr*&arg_) res = integer_width; verinum tmp (res, integer_width); + tmp.has_sign(true); NetEConst*rtn = new NetEConst(tmp); return rtn; }