From ebe81f70590c1f28b0cd515aa2457d86e5115a1a Mon Sep 17 00:00:00 2001 From: Martin Whitaker Date: Thu, 26 Jul 2012 18:33:04 +0100 Subject: [PATCH] Eliminate duplicate error messages for indexed part selects. This patch stops the compiler generating duplicate error messages when an indexed part select has an illegal width. --- elab_expr.cc | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/elab_expr.cc b/elab_expr.cc index e4c835ac3..f323e8351 100644 --- a/elab_expr.cc +++ b/elab_expr.cc @@ -2750,8 +2750,8 @@ NetExpr* PEIdent::elaborate_expr_param_idx_up_(Design*des, NetScope*scope, NetExpr*base = calculate_up_do_base_(des, scope, need_const); if (base == 0) return 0; - unsigned long wid = 0; - calculate_up_do_width_(des, scope, wid); + // Use the part select width already calculated by test_width(). + unsigned long wid = min_width_; if (debug_elaborate) cerr << get_fileline() << ": debug: Calculate part select " @@ -2836,8 +2836,8 @@ NetExpr* PEIdent::elaborate_expr_param_idx_do_(Design*des, NetScope*scope, NetExpr*base = calculate_up_do_base_(des, scope, need_const); if (base == 0) return 0; - unsigned long wid = 0; - calculate_up_do_width_(des, scope, wid); + // Use the part select width already calculated by test_width(). + unsigned long wid = min_width_; if (debug_elaborate) cerr << get_fileline() << ": debug: Calculate part select " @@ -3369,9 +3369,8 @@ NetExpr* PEIdent::elaborate_expr_net_idx_up_(Design*des, NetScope*scope, NetExpr*base = calculate_up_do_base_(des, scope, need_const); - unsigned long wid = 0; - calculate_up_do_width_(des, scope, wid); - + // Use the part select width already calculated by test_width(). + unsigned long wid = min_width_; // Handle the special case that the base is constant as // well. In this case it can be converted to a conventional @@ -3472,8 +3471,8 @@ NetExpr* PEIdent::elaborate_expr_net_idx_do_(Design*des, NetScope*scope, NetExpr*base = calculate_up_do_base_(des, scope, need_const); - unsigned long wid = 0; - calculate_up_do_width_(des, scope, wid); + // Use the part select width already calculated by test_width(). + unsigned long wid = min_width_; // Handle the special case that the base is constant as // well. In this case it can be converted to a conventional