Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Review what happens when OUTBOX is full #26

Closed
adumont opened this issue Mar 12, 2019 · 3 comments
Closed

Review what happens when OUTBOX is full #26

adumont opened this issue Mar 12, 2019 · 3 comments

Comments

@adumont
Copy link
Owner

adumont commented Mar 12, 2019

When OUTBOX is full, FSM waits (#12).
Confirm that when we pop an item out (cpu_out_rd=1):

  • Outbox should clear the outbox full signal
  • FSM will resume activity
@adumont
Copy link
Owner Author

adumont commented Mar 20, 2019

try using w_full_n instead of o_err as FIFO full flag.
(note: w_full_n doesn't seem to be negative logic deespite the _n... It becomes 1 when the FIFO gets full, and 0 again when it gets freed).

@adumont
Copy link
Owner Author

adumont commented Mar 20, 2019

Also review ZipCPU/wbuart32#3 (comment) :

you are using the wrong signal to know if the FIFO is full or now. The err signal is set if you actually overflow the FIFO, and then cleared when you reset the FIFO to acknowledge the error--just as you noticed.

To know if the FIFO is actually full, you need to check the bottom bit of the status register, o_status. On a receive FIFO, where RXFIFO == 1'b1, this will be true if anything is within the FIFO that may then be read. For a transmit FIFO, where RXFIFO == 1'b0, this will be true if the FIFO is not full and so something may be written to the FIFO.

Alternatively, bits [11:2] contain the number of items in the FIFO. You can use those as well to check if the FIFO is full. In other words, when ((status & 0xffc) == 0xffc) you also know that the FIFO is full.

@adumont
Copy link
Owner Author

adumont commented Mar 21, 2019

df9ecc0 seems to fix the problem.

@adumont adumont closed this as completed Mar 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant