JulianKemmerer / PipelineC

A C-like hardware description language (HDL) adding high level synthesis(HLS)-like automatic pipelining as a language construct/compiler feature.
https://github.com/JulianKemmerer/PipelineC/wiki
GNU General Public License v3.0
606 stars 50 forks source link

Support full C syntax for invoking derived FSMs #180

Open JulianKemmerer opened 1 year ago

JulianKemmerer commented 1 year ago

Ex. consider a derived FSM function uint32_t add1(uint32_t) invoked three times sequentially:

uint32_t add1(uint32_t x)
{
  uint32_t rv = x + 1;
  __clk();
  return rv;
}

uint32_t test1(uint32_t x)
{
  uint32_t rv = add1(add1(add1(x)));
  return rv;
}

The add1(add1(add1(x nesting syntax is not yet supported (requires logic to follow chain of ~almost recursive looking use of a function and allocate registers as needed).

Will get an error like: Exception: TODO unsupported control flow in func call argument: or similar...

Work around is to declare the intermediate variables yourself:

a = add1(x)
b = add1(a);
c = add1(b);
//etc