Eliminate spurious error message for array word lval in always @* block.

This commit is contained in:
Martin Whitaker 2013-10-26 23:05:21 +01:00
parent 36c91491cc
commit bb39d09d5e
1 changed files with 35 additions and 30 deletions

View File

@ -38,38 +38,43 @@ void NetProc::nex_output(NexusSet&)
void NetAssign_::nex_output(NexusSet&out)
{
if (sig_ && !word_) {
Nexus*nex = sig_->pin(0).nexus();
unsigned use_base = 0;
unsigned use_wid = lwidth();
if (base_) {
long tmp = 0;
bool flag = eval_as_long(tmp, base_);
if (!flag) {
// Unable to evaluate the bit/part select of
// the l-value, so this is a mux. Pretty
// sure I don't know how to handle this yet
// in synthesis, so punt for now.
use_base = 0;
use_wid = nex->vector_width();
} else {
use_base = tmp;
}
assert(sig_);
unsigned use_word = 0;
unsigned use_base = 0;
unsigned use_wid = lwidth();
if (word_) {
long tmp = 0;
if (eval_as_long(tmp, word_)) {
// A constant word select, so add the selected word.
use_word = tmp;
} else {
// A variable word select. The obvious thing to do
// is to add the whole array, but this could cause
// NetBlock::nex_input() to overprune the input set.
// As array access is not yet handled in synthesis,
// I'll leave this as TBD - the output set is not
// otherwise used when elaborating an always @*
// block.
return;
}
out.add(nex, use_base, use_wid);
} else {
/* Quoting from netlist.h comments for class NetMemory:
* "This is not a node because memory objects can only be
* accessed by behavioral code."
*/
cerr << "?:?" << ": internal error: "
<< "NetAssignBase::nex_output on unsupported lval ";
dump_lval(cerr);
cerr << endl;
}
Nexus*nex = sig_->pin(use_word).nexus();
if (base_) {
long tmp = 0;
bool flag = eval_as_long(tmp, base_);
if (!flag) {
// Unable to evaluate the bit/part select of
// the l-value, so this is a mux. Pretty
// sure I don't know how to handle this yet
// in synthesis, so punt for now.
use_base = 0;
use_wid = nex->vector_width();
} else {
use_base = tmp;
}
}
out.add(nex, use_base, use_wid);
}
/*