synth2 NetForLoop synthesis works a lot like begin/end blocks.

Using the synth_async_block_substatement_ makes the for-loop
synthesis properly handle the chance that there are default
inputs.
This commit is contained in:
Stephen Williams 2014-05-17 16:58:36 -07:00
parent 020e280a98
commit f16c67d45a
1 changed files with 9 additions and 1 deletions

View File

@ -611,7 +611,11 @@ bool NetForLoop::synth_async(Design*des, NetScope*scope,
// value and use it during its own synthesis.
ivl_assert(*this, scope->loop_index_tmp.empty());
scope->loop_index_tmp = index_args;
rc = statement_->synth_async(des, scope, nex_map, nex_out, accumulated_nex_out);
rc = synth_async_block_substatement_(des, scope, nex_map,
accumulated_nex_out,
statement_);
scope->loop_index_tmp.clear();
// Evaluate the step_expr to generate the next index value.
@ -645,6 +649,10 @@ bool NetForLoop::synth_async(Design*des, NetScope*scope,
delete index_var.value;
// The output from the block is now the accumulated outputs.
for (unsigned idx = 0 ; idx < nex_out.pin_count() ; idx += 1)
connect(nex_out.pin(idx), accumulated_nex_out.pin(idx));
return true;
}