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
569 stars 46 forks source link

Allow user static stateful functions to have IO regs turned when used in pipelines #195

Closed JulianKemmerer closed 3 months ago

JulianKemmerer commented 3 months ago

ex.

Image a pipeline of static func stages only - no room for pipelining in comb. logic as is.

Instead of dropping pipeline regs attempted to added into static funcs, turn on either input or output regs... like multipliers, allow multiple sets of input and output regs turned on too

JulianKemmerer commented 3 months ago
#pragma PART "xc7a35ticsg324-1l" 
#include "uintN_t.h"
uint32_t accum(uint32_t x){
  static uint32_t sum;
  sum += x;
  return sum;
}
#pragma MAIN_MHZ main 200.0
uint32_t main(uint32_t x)
{
  uint32_t i;
  for (i = 0; i < 10; i+=1)
  {
    x = accum(x);
  }
  return x;
}

should be able to make each accum() a single stage via auto pipelining