util_axis_resize: Add support for non power-of-two ratios

Update the axi_repack core so it can handle non power-of-two ratios between
the input and output stream width. The ratio still needs to be a integer
though.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
main
Lars-Peter Clausen 2015-04-01 12:48:51 +02:00
parent b6458f9aab
commit f1eb1c6064
1 changed files with 12 additions and 4 deletions

View File

@ -77,10 +77,14 @@ begin
else if (m_ready == 1'b1)
valid <= 1'b0;
if (s_ready == 1'b1 && s_valid == 1'b1)
if (s_ready == 1'b1 && s_valid == 1'b1) begin
if (count == 'h00)
count <= RATIO - 1;
else
count <= count - 1'b1;
end
end
end
always @(posedge clk)
begin
@ -111,10 +115,14 @@ begin
else if (count == 'h0 && m_ready == 1'b1 && m_valid == 1'b1)
valid <= 1'b0;
if (m_ready == 1'b1 && m_valid == 1'b1)
if (m_ready == 1'b1 && m_valid == 1'b1) begin
if (count == 'h00)
count <= RATIO - 1;
else
count <= count - 1'b1;
end
end
end
always @(posedge clk)
begin