Thu Aug 23 10:09:27 EDT 2018

Update: behavioral

(I shouldn't do this stuff right before bed...)

So I think the main idea is that the behavioral approach can make
control decisions based on signal values, and unrolls this into a
circuit.  At first glance, this seems to need target HDL support, but
because of the result being a static circuit, it should be able to be
expressed as a macro.  Just maybe not an imperative one.


The key to the gray counter example is the "found" variable.  It
appears to make a structural decision.  However, unrolled, the only
thing that happens is that the ith iteration of the loop has a
different input.  So this is a chain of combinatorial circuits.

This means that "for" can be a macro, and variables can just be

Generalize this to fold.

This is an important insight.

Maybe the one-legged if can also be implemented this way: a fold?