From fff46da881ead454ec1c35ea2786e6a11776c905 Mon Sep 17 00:00:00 2001 From: Cary R Date: Wed, 23 Nov 2011 17:30:42 -0800 Subject: [PATCH] v0.9: Treat an empty @* as something that will never trigger. An @* with no sensitivities should be treated as something that will never trigger vs something that will run continuously. This patch makes this change and adds a warning when an @* has no sensitivities since this is almost certainly a coding bug. --- elaborate.cc | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/elaborate.cc b/elaborate.cc index c681c63d92..d77b9274ff 100644 --- a/elaborate.cc +++ b/elaborate.cc @@ -3146,10 +3146,20 @@ NetProc* PEventStatement::elaborate_st(Design*des, NetScope*scope, } if (nset->count() == 0) { - cerr << get_fileline() << ": error: No inputs to statement." - << " The @* cannot execute." << endl; - des->errors += 1; - return enet; + cerr << get_fileline() << ": warning: @* found no " + "sensitivities so it will never trigger." + << endl; + /* Add the currently unreferenced event to the scope. */ + scope->add_event(ev); + /* Delete the current wait, create a new one with no + * statement and add the event to it. This creates a + * perpetual wait since nothing will ever trigger the + * unreferenced event. */ + delete wa; + wa = new NetEvWait(0); + wa->set_line(*this); + wa->add_event(ev); + return wa; } NetEvProbe*pr = new NetEvProbe(scope, scope->local_symbol(),