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

Almost full flag in fifos #10

Open
GMellar opened this issue Jun 14, 2022 · 0 comments
Open

Almost full flag in fifos #10

GMellar opened this issue Jun 14, 2022 · 0 comments

Comments

@GMellar
Copy link

GMellar commented Jun 14, 2022

The almost full flag in all FIFO should be 1 when there are less elements left than the threshold. That is what the documentation states. There is this check for head and tail:

      if head_v /= tail_v then
        if head_v > tail_v then
          if Almost_full_thresh >= MEM_SIZE - (head_v - tail_v) then
            Almost_full <= '1';
          end if;
          if Almost_empty_thresh >= head_v - tail_v then
            Almost_empty <= '1';
          end if;
        else
          if Almost_full_thresh >= tail_v - head_v then
            Almost_full <= '1';
          end if;
          if Almost_empty_thresh >= MEM_SIZE - (tail_v - head_v) then
            Almost_empty <= '1';
          end if;
        end if;
      end if;

As I understand that in a FIFO with a size of 16 and 8 bytes where the almost full threshold is 8 the almost full flag would be 1 after the write sequence of 8 elements which conflicts the documentation. Is there anything I miss here?

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