Eliminate spurious error message for array word lval in always @* block.
This commit is contained in:
parent
36c91491cc
commit
bb39d09d5e
|
|
@ -38,38 +38,43 @@ void NetProc::nex_output(NexusSet&)
|
||||||
|
|
||||||
void NetAssign_::nex_output(NexusSet&out)
|
void NetAssign_::nex_output(NexusSet&out)
|
||||||
{
|
{
|
||||||
if (sig_ && !word_) {
|
assert(sig_);
|
||||||
Nexus*nex = sig_->pin(0).nexus();
|
unsigned use_word = 0;
|
||||||
unsigned use_base = 0;
|
unsigned use_base = 0;
|
||||||
unsigned use_wid = lwidth();
|
unsigned use_wid = lwidth();
|
||||||
if (base_) {
|
if (word_) {
|
||||||
long tmp = 0;
|
long tmp = 0;
|
||||||
bool flag = eval_as_long(tmp, base_);
|
if (eval_as_long(tmp, word_)) {
|
||||||
if (!flag) {
|
// A constant word select, so add the selected word.
|
||||||
// Unable to evaluate the bit/part select of
|
use_word = tmp;
|
||||||
// the l-value, so this is a mux. Pretty
|
} else {
|
||||||
// sure I don't know how to handle this yet
|
// A variable word select. The obvious thing to do
|
||||||
// in synthesis, so punt for now.
|
// is to add the whole array, but this could cause
|
||||||
use_base = 0;
|
// NetBlock::nex_input() to overprune the input set.
|
||||||
use_wid = nex->vector_width();
|
// As array access is not yet handled in synthesis,
|
||||||
|
// I'll leave this as TBD - the output set is not
|
||||||
} else {
|
// otherwise used when elaborating an always @*
|
||||||
use_base = tmp;
|
// 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);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue