Co-simulation with multidimensional array fails because of wrong input data?
I'm implementing a function (a 2D DCT) in HLS. The function takes pointers to two structs as parameters (input, output), and the structs contain a little metadata as well as the data to be processed. The data itself is in a 3-dimensional array () containing 8x8 pixel tiles from three color components.
My test case fills the input array with values and compares the output against known good results.
When I run C/RTL cosimulation it fails, and after checking the waveform I realized it is the testbench that is supplying the wrong data. The first, second and third set of 64 values are all copies of the first three intended values (i.e. rather than 3x8x8 = 192 distinct values, the test bench only supplies three)
I frequently find C multidimensional arrays confusing myself, but if this is a case of insufficient caffeination on my part I simply can not find it.
I have a created a minimal HLS project that replicates the problem (attached).