dgrnbrg / piplin

Compile Clojure to FPGAs
piplin.org
93 stars 10 forks source link

Use (eval ...) to compile sim fns #1

Closed dgrnbrg closed 12 years ago

dgrnbrg commented 12 years ago

Currently, sim fns use a map in a binding to do state argument lookup, and they call through many levels of fns. This could be made much faster by using eval to make a custom fn that does exactly what the expr needs at make-sim time.

dgrnbrg commented 12 years ago

One key usage of this is to make the mux2 and case branches lazily evaluated. When this is done, get-value for unions can throw exceptions during sims again (currently returns nil)

dgrnbrg commented 12 years ago

This will come later in a different form. Once the verilog generator is done, i'll use the same patterns to create a simulation code optimizer.