From 3f8f81568aaed467a660cf01e2a958cbb7a1d0e3 Mon Sep 17 00:00:00 2001 From: Cary R Date: Mon, 7 Sep 2009 10:55:44 -0700 Subject: [PATCH] Add file/line information to named events and better expr. error. This patch adds file and line number information to named events. It also modifies the draw_eval_expr_wid() routine to fail with an appropriate message for named events. This checking needs to be pushed into the elaboration stage, but this will give a better message than we had before. (cherry picked from commit dff6a1ebff8bc33a80626f778659bf89d7823c6a) --- t-dll-expr.cc | 1 + tgt-vvp/eval_expr.c | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/t-dll-expr.cc b/t-dll-expr.cc index e4dcbf289..e67caca11 100644 --- a/t-dll-expr.cc +++ b/t-dll-expr.cc @@ -308,6 +308,7 @@ void dll_target::expr_event(const NetEEvent*net) assert(expr_); expr_->type_ = IVL_EX_EVENT; + FILE_NAME(expr_, net); expr_->value_= IVL_VT_VOID; /* Locate the event by name. Save the ivl_event_t in the diff --git a/tgt-vvp/eval_expr.c b/tgt-vvp/eval_expr.c index a41ba97f9..ebe9bb03f 100644 --- a/tgt-vvp/eval_expr.c +++ b/tgt-vvp/eval_expr.c @@ -2983,6 +2983,12 @@ struct vector_info draw_eval_expr_wid(ivl_expr_t exp, unsigned wid, res.base = 0; res.wid = 0; break; + case IVL_EX_EVENT: + fprintf(stderr, "%s:%u: vvp-tgt error: A named event is not " + "handled in this context (expression).\n", + ivl_expr_file(exp), ivl_expr_lineno(exp)); + exit(1); + break; case IVL_EX_STRING: res = draw_string_expr(exp, wid);