diff --git a/elab_expr.cc b/elab_expr.cc index 1f5ac0f33..544bd55f7 100644 --- a/elab_expr.cc +++ b/elab_expr.cc @@ -224,8 +224,8 @@ unsigned PEBinary::test_width(Design*des, NetScope*scope, width_mode_t&mode) break; case 'l': // << Should be handled by PEBShift - case 'r': // << Should be handled by PEBShift - case 'R': // << Should be handled by PEBShift + case 'r': // >> Should be handled by PEBShift + case 'R': // >>> Should be handled by PEBShift case '<': // < Should be handled by PEBComp case '>': // > Should be handled by PEBComp case 'e': // == Should be handled by PEBComp diff --git a/expr_synth.cc b/expr_synth.cc index 6a69d256e..c6de2ea8f 100644 --- a/expr_synth.cc +++ b/expr_synth.cc @@ -615,7 +615,8 @@ NetNet* NetEBShift::synthesize(Design*des, NetScope*scope, NetExpr*root) // to the amount left by the shift. NetPartSelect*psel = new NetPartSelect(lsig, shift<0? ushift : 0, part_width, - NetPartSelect::VP); + NetPartSelect::VP, + signed_flag && right_flag); psel->set_line(*this); des->add_node(psel); diff --git a/netlist.cc b/netlist.cc index 43cbb0760..4c8898123 100644 --- a/netlist.cc +++ b/netlist.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998-2012 Stephen Williams (steve@icarus.com) + * Copyright (c) 1998-2013 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -977,9 +977,10 @@ const NetDelaySrc* NetNet::delay_path(unsigned idx) const } NetPartSelect::NetPartSelect(NetNet*sig, unsigned off, unsigned wid, - NetPartSelect::dir_t dir__) + NetPartSelect::dir_t dir__, + bool signed_flag__) : NetNode(sig->scope(), sig->scope()->local_symbol(), 2), - off_(off), wid_(wid), dir_(dir__), signed_flag_(false) + off_(off), wid_(wid), dir_(dir__), signed_flag_(signed_flag__) { set_line(*sig); diff --git a/netlist.h b/netlist.h index 39543e1e3..4884933fd 100644 --- a/netlist.h +++ b/netlist.h @@ -2027,7 +2027,8 @@ class NetPartSelect : public NetNode { enum dir_t { VP, PV}; explicit NetPartSelect(NetNet*sig, - unsigned off, unsigned wid, dir_t dir); + unsigned off, unsigned wid, dir_t dir, + bool signed_flag__ = false); explicit NetPartSelect(NetNet*sig, NetNet*sel, unsigned wid, bool signed_flag__ = false); ~NetPartSelect();