jameshegarty / rigel

Rigel is a language for describing image processing hardware embedded in Lua. Rigel can compile to Verilog hardware designs for Xilinx FPGAs, and also can compile to fast x86 test code using Terra.
MIT License
56 stars 9 forks source link

Rigel HLL #35

Open jameshegarty opened 7 years ago

jameshegarty commented 7 years ago

Make a restriction: only support DAGs, only do typechecking forward. IE if we use a handshake module somewhere in the pipeline, require that the input to the pipeline is Handshake. This makes things a lot easier. This is the use case for almost all real pipelines anyway...

lambda(fn): fn should be a lua function that takes in a rigel value as input, and returns an output liftMath(fn): fn should be a lua function that takes in a fixed value as input, and returns an output

jameshegarty commented 7 years ago

Work on this is in progress with src/rigelhll.lua

jameshegarty commented 7 years ago

Rigel HLL will shove extra info in the IR to enable automatic generator value filling: "vectorized": is this value a vector? (can't tell this from the type... bc it could be an image etc) "imageSize": image size

The question is: is this sound? Is this well defined for all operators? How to deal with higher-order functions? (map etc). These will now need to operate on RigelHLL operators.

why is this different than a mid-level IR (#79)? That will still require explicit setting of parameters like image size. Rigel HLL will be built on top of mid-level IR.

jameshegarty commented 6 years ago

Why is "vectorized" necessary? There are ambiguous casting cases.

If we have A[2] going in to a line buffer, we don't know whether this is A vectorized to width 2, or a (x,y) coord pair (for example). Vectorized distinguishes these cases. This seems wrong. For one thing, 'vectorized' won't be propagated correctly through all operators without more annotations. Does this matter? Well, if the (x,y) coords are treated as a vector, stuff downstream won't end up with the correct types...