R
revkarol
Hi,
I'm trying to solve this issue with reading a fifo.
I've an FSM which decides whether to read the next item in the fifo. Let's make the assumption that the fifo is never empty.
I want to decide what to do with each element based on its contents. For now let's assume the elements are just 1 bit long. I have two input fifos (A and B ) and two output ports (X and Y).
Here's the proposed functionality:
If the element is '0', put it in X, if it's '1', put it in Y. With this logic, if both elements are the same I can only read one of them but if they're different I can read both.
I can explain the problem with just one fifo.
Let's say the A fifo is like this (and we read off the end):
A : 0 1 1 0
Here's the problem:
t | A | action
=========================
0 | 0 | set X <= A, set A_read
1 | 0 | X gets value of A, A_read goes high, unset A_read
2 | 1 | set Y <= A, A_read goes low, set A_read
3 | 1 | Y gets value of A, A_read goes high, unset A_read
At t=1 A_read is still low and the fifo doesn't move along. Only at t=2 does is it high. So I'm reading at half the speed I want to.
This smells like a classic problem, but I'm a bit of a noob.
Any help would be appreciated.
Regards,
Karol.
I'm trying to solve this issue with reading a fifo.
I've an FSM which decides whether to read the next item in the fifo. Let's make the assumption that the fifo is never empty.
I want to decide what to do with each element based on its contents. For now let's assume the elements are just 1 bit long. I have two input fifos (A and B ) and two output ports (X and Y).
Here's the proposed functionality:
If the element is '0', put it in X, if it's '1', put it in Y. With this logic, if both elements are the same I can only read one of them but if they're different I can read both.
I can explain the problem with just one fifo.
Let's say the A fifo is like this (and we read off the end):
A : 0 1 1 0
Here's the problem:
t | A | action
=========================
0 | 0 | set X <= A, set A_read
1 | 0 | X gets value of A, A_read goes high, unset A_read
2 | 1 | set Y <= A, A_read goes low, set A_read
3 | 1 | Y gets value of A, A_read goes high, unset A_read
At t=1 A_read is still low and the fifo doesn't move along. Only at t=2 does is it high. So I'm reading at half the speed I want to.
This smells like a classic problem, but I'm a bit of a noob.
Any help would be appreciated.
Regards,
Karol.