@chintan_joshi : maybe it's time to rethink how the buffers are being filled? Some things to try:
(1) Could the buffer be filled in the background by another cog while the main cog is doing other work? This may mean you'd have to double buffer, but would let you hide the time for the fill.
(2) Could you pack multiple values into a long and write them all at once? It looks like the present solution writes 1 byte at a time, but writing a long word is just as fast as writing a byte, so there's a 4x speed improvement available by packing into longs first and then writing the data. You seem to have 3 sets of values, so doing this might require changing the memory layout, or else writing 12 values (3 long words) at a time.
(3) Does the data have to be interleaved in the precise way you're doing? You may be able to improve performance with a different layout, particularly if it makes it easier to write multiple values at a time (see above).
Comments
@Wuerfel_21 yes with 320 MHZ its decreased 1 ms from total
with 256 MHZ
And with 320 MHZ
still need to optimize it, because this filling of data slowing down my printing speed.
@chintan_joshi : maybe it's time to rethink how the buffers are being filled? Some things to try:
(1) Could the buffer be filled in the background by another cog while the main cog is doing other work? This may mean you'd have to double buffer, but would let you hide the time for the fill.
(2) Could you pack multiple values into a long and write them all at once? It looks like the present solution writes 1 byte at a time, but writing a long word is just as fast as writing a byte, so there's a 4x speed improvement available by packing into longs first and then writing the data. You seem to have 3 sets of values, so doing this might require changing the memory layout, or else writing 12 values (3 long words) at a time.
(3) Does the data have to be interleaved in the precise way you're doing? You may be able to improve performance with a different layout, particularly if it makes it easier to write multiple values at a time (see above).