Skip to content
Snippets Groups Projects
Commit 17fdd3c3 authored by Wesley W. Terpstra's avatar Wesley W. Terpstra
Browse files

altera fifos: remove unused warnings

There were many constructs like this:
  gen_with_empty : if(g_with_empty) generate
    empty_o <= empty;
  end generate gen_with_empty;

If g_with_empty is true, then there are no warnings.
If g_with_empty is false, then empty_o is unset and empty is unused.

There is no improvement in performance/resource utilization to explicitly
cutting these signals. The optimizer will happily discard unused logic.

The alternative of adding
  gen_without_empty : if(not g_with_empty) generate
    empty_o <= 'X';
  end generate gen_without_empty;
will remove the empty_o unset warning, but not the empty unused warning.

This patch does make it possible for designs to  use empty_o without
setting g_with_empty; an error. On the other hand, those designs had
undefined behaviour before anyway, so they might have worked unreliably.
parent 417152ef
Branches
Tags
No related merge requests found
......@@ -170,44 +170,15 @@ begin -- syn
wrusedw => wrusedw,
rdusedw => rdusedw);
gen_with_wr_count : if(g_with_wr_count) generate
wr_count_o <= wrusedw;
end generate gen_with_wr_count;
gen_with_rd_count : if(g_with_rd_count) generate
rd_count_o <= rdusedw;
end generate gen_with_rd_count;
gen_with_wr_empty : if(g_with_wr_empty) generate
wr_empty_o <= wrempty;
end generate gen_with_wr_empty;
gen_with_rd_empty : if(g_with_rd_empty) generate
rd_empty_o <= rdempty;
end generate gen_with_rd_empty;
gen_with_wr_full : if(g_with_wr_full) generate
wr_full_o <= wrfull;
end generate gen_with_wr_full;
gen_with_rd_full : if(g_with_rd_full) generate
rd_full_o <= rdfull;
end generate gen_with_rd_full;
gen_with_wr_almost_empty : if(g_with_wr_almost_empty) generate
wr_almost_empty_o <= '1' when unsigned(wrusedw) < to_unsigned(g_almost_empty_threshold, wrusedw'length) else '0';
end generate gen_with_wr_almost_empty;
gen_with_rd_almost_empty : if(g_with_rd_almost_empty) generate
rd_almost_empty_o <= '1' when unsigned(rdusedw) < to_unsigned(g_almost_empty_threshold, rdusedw'length) else '0';
end generate gen_with_rd_almost_empty;
gen_with_wr_almost_full : if(g_with_wr_almost_full) generate
wr_almost_full_o <= '1' when unsigned(wrusedw) > to_unsigned(g_almost_full_threshold, wrusedw'length) else '0';
end generate gen_with_wr_almost_full;
gen_with_rd_almost_full : if(g_with_rd_almost_full) generate
rd_almost_full_o <= '1' when unsigned(rdusedw) > to_unsigned(g_almost_full_threshold,rdusedw'length) else '0';
end generate gen_with_rd_almost_full;
wr_count_o <= wrusedw;
rd_count_o <= rdusedw;
wr_empty_o <= wrempty;
rd_empty_o <= rdempty;
wr_full_o <= wrfull;
rd_full_o <= rdfull;
wr_almost_empty_o <= '1' when unsigned(wrusedw) < to_unsigned(g_almost_empty_threshold, wrusedw'length) else '0';
rd_almost_empty_o <= '1' when unsigned(rdusedw) < to_unsigned(g_almost_empty_threshold, rdusedw'length) else '0';
wr_almost_full_o <= '1' when unsigned(wrusedw) > to_unsigned(g_almost_full_threshold, wrusedw'length) else '0';
rd_almost_full_o <= '1' when unsigned(rdusedw) > to_unsigned(g_almost_full_threshold,rdusedw'length) else '0';
end syn;
......@@ -144,27 +144,10 @@ begin -- syn
data => d_i,
rdreq => rd_i);
gen_with_count : if(g_with_count) generate
count_o <= usedw;
end generate gen_with_count;
gen_with_empty : if(g_with_empty) generate
empty_o <= empty;
end generate gen_with_empty;
gen_with_full : if(g_with_full) generate
full_o <= full;
end generate gen_with_full;
gen_with_almost_empty : if(g_with_almost_empty) generate
almost_empty_o <= almost_empty;
end generate gen_with_almost_empty;
gen_with_almost_full : if(g_with_almost_full) generate
almost_full_o <= almost_full;
end generate gen_with_almost_full;
count_o <= usedw;
empty_o <= empty;
full_o <= full;
almost_empty_o <= almost_empty;
almost_full_o <= almost_full;
end syn;
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment