From 32b115d8feb91222a72b17c7b64fe365335c3c71 Mon Sep 17 00:00:00 2001 From: Stephen Williams Date: Tue, 25 Mar 2008 21:30:41 -0700 Subject: [PATCH] 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. --- net_design.cc | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/net_design.cc b/net_design.cc index c3acc6524..37c1e398d 100644 --- a/net_design.cc +++ b/net_design.cc @@ -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;