util_fir_int: Force 1/8 filter input data rate

main
AndreiGrozav 2017-05-16 19:32:49 +03:00
parent 3f5d930cde
commit 857ad45d57
1 changed files with 7 additions and 3 deletions

View File

@ -52,25 +52,29 @@ module util_fir_int (
input dac_read); input dac_read);
wire [31:0] m_axis_data_tdata_s; wire [31:0] m_axis_data_tdata_s;
wire s_axis_data_tvalid_s;
reg s_axis_data_tready_r; reg s_axis_data_tready_r;
reg s_axis_data_tvalid_r;
reg [2:0] ready_counter; reg [2:0] ready_counter;
always @(posedge aclk) begin always @(posedge aclk) begin
ready_counter <= ready_counter + 1; ready_counter <= ready_counter + 1;
s_axis_data_tready_r <= s_axis_data_tvalid_r;
if (ready_counter == 0) begin if (ready_counter == 0) begin
s_axis_data_tready_r <= 1'b1; s_axis_data_tvalid_r <= 1'b1;
end else begin end else begin
s_axis_data_tready_r <= 1'b0; s_axis_data_tvalid_r <= 1'b1;
end end
end end
assign {channel_1, channel_0} = (interpolate == 1'b1) ? {m_axis_data_tdata_s[30:16],1'b0,m_axis_data_tdata_s[14:0], 1'b0} : s_axis_data_tdata; assign {channel_1, channel_0} = (interpolate == 1'b1) ? {m_axis_data_tdata_s[30:16],1'b0,m_axis_data_tdata_s[14:0], 1'b0} : s_axis_data_tdata;
assign s_axis_data_tready = (interpolate == 1'b1) ? s_axis_data_tready_r : dac_read; assign s_axis_data_tready = (interpolate == 1'b1) ? s_axis_data_tready_r : dac_read;
assign s_axis_data_tvalid_s = (interpolate == 1'b1) ? s_axis_data_tvalid_r : s_axis_data_tvalid;
fir_interp interpolator ( fir_interp interpolator (
.aclk(aclk), .aclk(aclk),
.s_axis_data_tvalid(s_axis_data_tvalid), .s_axis_data_tvalid(s_axis_data_tvalid_s),
.s_axis_data_tready(), .s_axis_data_tready(),
.s_axis_data_tdata(s_axis_data_tdata), .s_axis_data_tdata(s_axis_data_tdata),
.m_axis_data_tvalid(m_axis_data_tvalid), .m_axis_data_tvalid(m_axis_data_tvalid),