Detect proper support for missing else_ without latches (synthesis)
This commit is contained in:
parent
463407572f
commit
f43080fbcb
28
synth2.cc
28
synth2.cc
|
|
@ -366,10 +366,17 @@ bool NetCondit::synth_async(Design*des, NetScope*scope,
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (else_ == 0) {
|
if (else_ == 0) {
|
||||||
cerr << get_fileline() << ": warning: Asynchronous if statement"
|
bool latch_flag = false;
|
||||||
<< " is missing the else clause, and I" << endl;
|
for (unsigned idx = 0 ; idx < nex_out.pin_count() ; idx += 1) {
|
||||||
cerr << get_fileline() << ": : don't know how to check"
|
if (! accumulated_nex_out.pin(idx).is_linked())
|
||||||
<< " for latches yet." << endl;
|
latch_flag = true;
|
||||||
|
}
|
||||||
|
if (latch_flag) {
|
||||||
|
cerr << get_fileline() << ": error: Asynchronous if statement"
|
||||||
|
<< " cannot synthesize missing \"else\""
|
||||||
|
<< " without generating latches." << endl;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ivl_assert(*this, if_ != 0);
|
ivl_assert(*this, if_ != 0);
|
||||||
|
|
@ -389,16 +396,17 @@ bool NetCondit::synth_async(Design*des, NetScope*scope,
|
||||||
|
|
||||||
NetBus btmp(scope, nex_out.pin_count());
|
NetBus btmp(scope, nex_out.pin_count());
|
||||||
NetBus bsig(scope, nex_out.pin_count());
|
NetBus bsig(scope, nex_out.pin_count());
|
||||||
if (else_) {
|
|
||||||
flag = else_->synth_async(des, scope, nex_map, bsig, btmp);
|
if (else_==0) {
|
||||||
if (!flag) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
for (unsigned idx = 0 ; idx < nex_out.pin_count() ; idx += 1) {
|
for (unsigned idx = 0 ; idx < nex_out.pin_count() ; idx += 1) {
|
||||||
connect(bsig.pin(idx), accumulated_nex_out.pin(idx));
|
connect(bsig.pin(idx), accumulated_nex_out.pin(idx));
|
||||||
accumulated_nex_out.pin(idx).unlink();
|
accumulated_nex_out.pin(idx).unlink();
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
flag = else_->synth_async(des, scope, nex_map, bsig, btmp);
|
||||||
|
if (!flag) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ivl_assert(*this, nex_out.pin_count()==asig.pin_count());
|
ivl_assert(*this, nex_out.pin_count()==asig.pin_count());
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue