From 5d4c8d616ab5ae5b9289d2f3c9b4e843d361a5bd Mon Sep 17 00:00:00 2001 From: Cary R Date: Tue, 25 Aug 2009 10:41:07 -0700 Subject: [PATCH] Propagate sign in synthesize for math operators. The sign of the expression needs to be propagated for the math operators when they are synthesized. (cherry picked from commit a49463e728827fafaa31d89760a28f460fd5ba86) --- expr_synth.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/expr_synth.cc b/expr_synth.cc index 70b5dff76..6e4a7f842 100644 --- a/expr_synth.cc +++ b/expr_synth.cc @@ -122,6 +122,7 @@ NetNet* NetEBAdd::synthesize(Design*des, NetScope*scope, NetExpr*root) NetNet*osig = new NetNet(lsig->scope(), path, NetNet::IMPLICIT, width); osig->local_flag(true); osig->data_type(expr_type()); + osig->set_signed(has_sign()); perm_string oname = osig->scope()->local_symbol(); NetAddSub *adder = new NetAddSub(lsig->scope(), oname, width); @@ -390,6 +391,7 @@ NetNet* NetEBPow::synthesize(Design*des, NetScope*scope, NetExpr*root) NetNet::IMPLICIT, width); osig->set_line(*this); osig->data_type(expr_type()); + osig->set_signed(has_sign()); osig->local_flag(true); connect(powr->pin_Result(), osig->pin(0)); @@ -426,6 +428,7 @@ NetNet* NetEBMult::synthesize(Design*des, NetScope*scope, NetExpr*root) NetNet::IMPLICIT, width); osig->set_line(*this); osig->data_type(expr_type()); + osig->set_signed(has_sign()); osig->local_flag(true); connect(mult->pin_Result(), osig->pin(0));