Parameters get their types (signedness) from expressions.
Parameters get their signedness from the expression that is assigned to them unless the type is explicitly expressed where the parameter is declared.
This commit is contained in:
parent
14e3a886bd
commit
32b115d8fe
|
|
@ -377,10 +377,6 @@ void NetScope::evaluate_parameters(Design*des)
|
|||
assert(nexpr);
|
||||
delete expr;
|
||||
(*cur).second.expr = nexpr;
|
||||
|
||||
// Set the signedness flag.
|
||||
(*cur).second.expr
|
||||
->cast_signed( (*cur).second.signed_flag );
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
@ -393,7 +389,9 @@ void NetScope::evaluate_parameters(Design*des)
|
|||
}
|
||||
|
||||
/* If the parameter has range information, then make
|
||||
sure the value is set right. */
|
||||
sure the value is set right. Note that if the
|
||||
parameter doesn't have an explicit range, then it
|
||||
will get the signedness from the expression itself. */
|
||||
if (range_flag) {
|
||||
unsigned long wid = (msb >= lsb)? msb - lsb : lsb - msb;
|
||||
wid += 1;
|
||||
|
|
|
|||
Loading…
Reference in New Issue