Part select of signals is always unsigned.
Part select of an entire signal returns just the NetESignal itself, but since part selects are always unsigned, even if the selected signal is signed, we need to cast the NetESignal to unsigned first.
This commit is contained in:
parent
392b162024
commit
a74f2827b2
|
|
@ -1567,9 +1567,11 @@ NetExpr* PEIdent::elaborate_expr_net_part_(Design*des, NetScope*scope,
|
|||
|
||||
// If the part select covers exactly the entire
|
||||
// vector, then do not bother with it. Return the
|
||||
// signal itself.
|
||||
if (sb_lsb == 0 && wid == net->vector_width())
|
||||
// signal itself, casting to unsigned if necessary.
|
||||
if (sb_lsb == 0 && wid == net->vector_width()) {
|
||||
net->cast_signed(false);
|
||||
return net;
|
||||
}
|
||||
|
||||
// If the part select covers NONE of the vector, then return a
|
||||
// constant X.
|
||||
|
|
|
|||
Loading…
Reference in New Issue