Hello,
I have an issue when reading and writing to DDR memory via XRT.
For the buffer to be syncronized, buffer.synq_to_device()
and buffer.synq_from_device()
functions must be used. This is clear, although I don’t know why exactly!!! but this to some level doesn’t apply if I wanna use the DDR memroy as a virtual FIFO.
My IP has the following structure:
void top(float* A, int iter) {
read_data(float* A, stream_in, iter); // reads buffer "iter" times (including recently written results from write_data below)
calculate(stream_in, stream_out, iter); // accumulate over read data with new calculations
write_data(stream_out, float* A, iter); // writes data to buffer "iter" times
}
The reseaon behind this is that the buffer is too large to be saved in memory, and multiple accumulations is needed for my calculate function (some tiling/partitioning approach). So I read the intermediate data, do the accumulation, write the data, and then do it again until it is completed after ‘iter’ times.
The issue occurs exactly when I write the data to the buffer, I need to use the synq.from.device() so when it is read again, it will update. But this does not apply because I use the call function accel.call(BufferA, iter)
from the DefaultIP class.
Is there a work around that allow me automatically sync the buffers without the need to call the sync functions? Any suggestions would be much appreciated.
EDIT: one possible fix is to change the IP in such a way, that I use the call function “iter” times, and use the sync functions between each call. But this might results in an overhead due to missed pipelining over the “iter” loop.