update fifo per PanRe review
This commit is contained in:
@@ -54,7 +54,7 @@ extern "C" {
|
||||
|
||||
/* Write/Read index is always in the range of:
|
||||
* 0 .. 2*depth-1
|
||||
* The extra window allow us to determine the fifo state of empty or full with only 2 indexes
|
||||
* The extra window allow us to determine the fifo state of empty or full with only 2 indices
|
||||
* Following are examples with depth = 3
|
||||
*
|
||||
* - empty: W = R
|
||||
@@ -86,7 +86,8 @@ extern "C" {
|
||||
* -------------------------
|
||||
* | R | 1 | 2 | 3 | W | 5 |
|
||||
*
|
||||
* - Double Overflowed: write(3), write(1), write(2)
|
||||
* - Double Overflowed i.e index is out of allowed range [0,2*depth) e.g:
|
||||
* write(3), write(1), write(2)
|
||||
* Continue to write after overflowed to 2nd overflowed.
|
||||
* We must prevent 2nd overflowed since it will cause incorrect computed of count, in above example
|
||||
* if not handled the fifo will be empty instead of continue-to-be full. Since we must not modify
|
||||
@@ -94,7 +95,7 @@ extern "C" {
|
||||
* after data is written it is a full fifo i.e W = depth - R
|
||||
*
|
||||
* re-position W = 1 before write(2)
|
||||
* Note: we should also move data from mem[4] to read index as well, but deliberately skipped here
|
||||
* Note: we should also move data from mem[3] to read index as well, but deliberately skipped here
|
||||
* since it is an expensive operation !!!
|
||||
* |
|
||||
* -------------------------
|
||||
|
||||
Reference in New Issue
Block a user