[Open-graphics] Center for High-Performance Reconfigurable Computing

Timothy Miller theosib at gmail.com
Sun Oct 15 14:28:52 EDT 2006


On 10/15/06, Benjamin Schroeder <benschroeder at acm.org> wrote:
>
> On Oct 15, 2006, at 1:13 PM, Timothy Miller wrote:
>
> > One idea I had was to define stylistic requirements on C functions
> > where a function takes a single struct as input and returns a single
> > struct as a result.  The structs can contain any primitive data items.
> > This would be relatively easy to parse and convert to Verilog, which
> > we would synthesize for the FPGA.
>
> By primitive data items, do you mean non-pointers?

Yeah, but we might allow arrays of fixed size.

> Of course, taking a single struct as input is equivalent to taking an
> arbitrary number of structs (because you could just cat them
> together). It's also OK to take a struct like
>
>      struct Foo
>      {
>          int x;
>          struct Bar b;
>          int y;
>      };
>
> because its memory layout is the same as some longer struct where b
> (however struct Bar is defined) is inlined.

Sure.  All this does is make the parser slightly more complex.  After
conversion, all array members have to be seen as explicit, separate
data items.

The main point is that the C code cannot refer to anything non-local
or not in the input or output structs.

And there are various things you can code that affect the performance
of the resulting logic.  For instance, a variable-length loop will
have to convert to a pipeline stage that takes multiple cycles.


More information about the Open-graphics mailing list