Call probe_expr_width() before elab_and_eval() when evaluating a path.

You need to probe the expression width before trying to elaborate and
evaluate an expression. The eval_path_component() routine was missing
this and was causing an assert.
This commit is contained in:
Cary R 2010-06-04 09:59:56 -07:00 committed by Stephen Williams
parent b7264d21d5
commit c7afb4f51a
1 changed files with 2 additions and 1 deletions

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2001-2009 Stephen Williams (steve@icarus.com) * Copyright (c) 2001-2010 Stephen Williams (steve@icarus.com)
* *
* This source code is free software; you can redistribute it * This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU * and/or modify it in source code form under the terms of the GNU
@ -364,6 +364,7 @@ hname_t eval_path_component(Design*des, NetScope*scope,
assert(index.sel == index_component_t::SEL_BIT); assert(index.sel == index_component_t::SEL_BIT);
// Evaluate the bit select to get a number. // Evaluate the bit select to get a number.
probe_expr_width(des, scope, index.msb);
NetExpr*tmp = elab_and_eval(des, scope, index.msb, -1); NetExpr*tmp = elab_and_eval(des, scope, index.msb, -1);
ivl_assert(*index.msb, tmp); ivl_assert(*index.msb, tmp);