Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dp_queue: change buf calculation size and cosmetic changes
buf calculation size has been changed to be always 2xmax(IBS,OBS) to allow free read/write in various data chunk sizes and execution periods (of course in/out data rates must be same) example: Consumer reads 3bytes each 3 cycles (IBS = 3) producer writes 5bytes every 5 cycles (OBS = 5) * - cycle0 produce 3 bytes (buf occupation = 3) * - cycle3 produce 3 bytes (buf occupation = 6) * - cycle5 consume 5 bytes (buf occupation = 1) * - cycle6 produce 3 bytes (buf occupation = 4) * - cycle9 produce 3 bytes (buf occupation = 7) * - cycle10 consume 5 bytes (buf occupation = 2) * - cycle12 produce 3 bytes (buf occupation = 5) * - cycle15 (producer goes first) produce 3 bytes (buf occupation = 8) consume 5 bytes (buf occupation = 3) at this point the situation is identical as in cycle 0 ===> max buf occupation = 8 even in case of IBS=OBS and equal periods of consumer/producer the buffer must be 2*MAX(IBS,OBS) as we do not know who goes first - consumer or producer, especially when both are located on separate cores and EDF scheduling is used example: Consumer reads 5 bytes every cycle (IBS = 5) producer writes 5 bytes every cycle (OBS = 5) * - cycle0 consumer goes first - must wait (buf occupation = 0) * producer produce 5 bytes (buf occupation = 5) * - cycle1 producer goes first - produce 5 bytes (buf occupation = 10) * consumer consumes 5 bytes (buf occupation = 5) ===> max buf occupation = 10 Signed-off-by: Marcin Szkudlinski <[email protected]>
- Loading branch information