From bbe037bf9f0bf0c0bee432c38f2462c042e3a39d Mon Sep 17 00:00:00 2001 From: Cary R Date: Fri, 19 Jun 2009 10:11:57 -0700 Subject: [PATCH] Print a warning for an implicit sensitivity list that has selects. An implicit sensitivity list that has selects (bit, part, indexed part or array) will include more than the user expects so print a warning to let them know what will happen. Other simulators have the same behavior, but I believe this is incorrect and needs to be fixed to only include the appropriate parts. The warnings can go when we fix this functionality, but we need them now to warn the user that they may not be getting what they expect. One other simulator warns for array selects. This patch also adds the array index to the sensitivity list. --- net_nex_input.cc | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/net_nex_input.cc b/net_nex_input.cc index aeddc73eb..a1f81829c 100644 --- a/net_nex_input.cc +++ b/net_nex_input.cc @@ -114,6 +114,11 @@ NexusSet* NetESelect::nex_input(bool rem_out) } result->add(*tmp); delete tmp; + /* See the comment for NetESignal below. */ + if (base_) { + cerr << get_fileline() << ": warning: @* is sensitive to all " + "bits in '" << *expr_ << "'." << endl; + } return result; } @@ -133,7 +138,23 @@ NexusSet* NetESFunc::nex_input(bool rem_out) NexusSet* NetESignal::nex_input(bool rem_out) { + /* + * This is not what I would expect for the various selects (bit, + * part, index, array). This code adds all the bits/array words + * instead of building the appropriate select and then using it + * as the trigger. Other simulators also add everything. + */ NexusSet*result = new NexusSet; + /* If we have an array index add it to the sensitivity list. */ + if (word_) { + NexusSet*tmp; + tmp = word_->nex_input(rem_out); + result->add(*tmp); + delete tmp; + cerr << get_fileline() << ": warning: @* is sensitive to all " + << net_->array_count() << " words in array '" + << name() << "'." << endl; + } for (unsigned idx = 0 ; idx < net_->pin_count() ; idx += 1) result->add(net_->pin(idx).nexus());