Skip to content
This repository
Browse code

Evaluate nonblocking assign r-values.

  • Loading branch information...
commit 3fca25181ad065f6b9cbe4d81343cde59cf09ce5 1 parent cbca315
authored August 28, 2002

Showing 1 changed file with 19 additions and 5 deletions. Show diff stats Hide diff stats

  1. 24  elaborate.cc
24  elaborate.cc
@@ -17,7 +17,7 @@
17 17
  *    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
18 18
  */
19 19
 #ifdef HAVE_CVS_IDENT
20  
-#ident "$Id: elaborate.cc,v 1.262 2002/08/15 02:11:54 steve Exp $"
  20
+#ident "$Id: elaborate.cc,v 1.263 2002/08/28 18:54:36 steve Exp $"
21 21
 #endif
22 22
 
23 23
 # include "config.h"
@@ -1107,11 +1107,22 @@ NetProc* PAssignNB::elaborate(Design*des, NetScope*scope) const
1107 1107
 
1108 1108
       assert(rval());
1109 1109
 
1110  
-	/* Elaborate the r-value expression. This generates a
1111  
-	   procedural expression that I attach to the assignment. */
1112  
-      NetExpr*rv = rval()->elaborate_expr(des, scope);
1113  
-      if (rv == 0)
  1110
+      NetExpr*rv;
  1111
+
  1112
+	/* Evaluate the rval expression if possible, otherwise just
  1113
+	   elaborate it. */
  1114
+      if (verinum*val = rval()->eval_const(des, scope)) {
  1115
+	    rv = new NetEConst(*val);
  1116
+	    delete val;
  1117
+
  1118
+      } else if (rv = rval()->elaborate_expr(des, scope)) {
  1119
+
  1120
+	      /* OK, go on. */
  1121
+
  1122
+      } else {
  1123
+	      /* Unable to elaborate expression. Retreat. */
1114 1124
 	    return 0;
  1125
+      }
1115 1126
 
1116 1127
       assert(rv);
1117 1128
 
@@ -2511,6 +2522,9 @@ Design* elaborate(list<const char*>roots)
2511 2522
 
2512 2523
 /*
2513 2524
  * $Log: elaborate.cc,v $
  2525
+ * Revision 1.263  2002/08/28 18:54:36  steve
  2526
+ *  Evaluate nonblocking assign r-values.
  2527
+ *
2514 2528
  * Revision 1.262  2002/08/15 02:11:54  steve
2515 2529
  *  Handle special case of empty system task argument list.
2516 2530
  *

0 notes on commit 3fca251

Please sign in to comment.
Something went wrong with that request. Please try again.