PipelineC icon indicating copy to clipboard operation
PipelineC copied to clipboard

Convert sync integer ratio clock crossing c code gen to define struct instead of using fixed size array types

Open JulianKemmerer opened this issue 1 year ago • 0 comments

...so that the new clock_crossing.h header macros can be used.

Current code gen looks like:

#define fast_to_slow_RATIO 4
#include "uint64_s_array_N_t.h"
#define fast_to_slow_write_t uint64_s_array_1_t
#define fast_to_slow_read_t uint64_s_array_4_t

// Clock cross write
void fast_to_slow_WRITE(uint64_s_array_1_t in_data)
{
  // TODO
}

// Clock cross read
uint64_s_array_4_t fast_to_slow_READ()
{
  // TODO
}

Already do #define fast_to_slow_read_t uint64_s_array_4_t making it look like a type.

Get rid of #include "uint64_s_array_N_t.h" by actually generating fast_to_slow_read_t struct which has field that is an fixed size array.

Macro for sync crossing will need user to specify clock ratio (instead of being detected in auto generated header gen process) but macros are easier to work with than #include's...

JulianKemmerer avatar Jul 04 '23 19:07 JulianKemmerer