axi_dac_interpolate: oversampling optimization

Optimize the oversampling mechanism.
The behavior of the axi_dac_interpolate was changing if a debug module was
added to the core.
The current code has a better utilization and reliability.
main
AndreiGrozav 2020-07-28 10:43:29 +03:00 committed by AndreiGrozav
parent d39ed3d4db
commit 4972e5c42d
1 changed files with 11 additions and 15 deletions

View File

@ -133,23 +133,19 @@ module axi_dac_interpolate_filter #(
// paths randomly ready, only when using data buffers
always @(posedge dac_clk) begin
if (interpolation_ratio == 0) begin
dac_int_ready <= dac_filt_int_valid;
end else begin
if (dac_filt_int_valid &
(!start_sync_channels & dma_valid |
(dma_valid & dma_valid_adjacent))) begin
if (interpolation_counter < interpolation_ratio) begin
interpolation_counter <= interpolation_counter + 1;
dac_int_ready <= 1'b0;
end else begin
interpolation_counter <= 0;
dac_int_ready <= 1'b1;
end
end else begin
dac_int_ready <= 1'b0;
if (dac_filt_int_valid &
(!start_sync_channels & dma_valid |
(dma_valid & dma_valid_adjacent))) begin
if (interpolation_counter == interpolation_ratio) begin
interpolation_counter <= 0;
dac_int_ready <= 1'b1;
end else begin
interpolation_counter <= interpolation_counter + 1;
dac_int_ready <= 1'b0;
end
end else begin
dac_int_ready <= 1'b0;
interpolation_counter <= 0;
end
end