//+FHDR-------------------------------------------------------------------------------------------------------- // Company: //----------------------------------------------------------------------------------------------------------------- // File Name : Z_dsp.v // Department : // Author : thfu // Author's Tel : //----------------------------------------------------------------------------------------------------------------- // Relese History // Version Date Author Description // 0.2 2024-10-09 thfu to fit the addition of 8 interpolation //----------------------------------------------------------------------------------------------------------------- // Keywords : // //----------------------------------------------------------------------------------------------------------------- // Parameter // //----------------------------------------------------------------------------------------------------------------- // Purpose : // //----------------------------------------------------------------------------------------------------------------- // Target Device: // Tool versions: //----------------------------------------------------------------------------------------------------------------- // Reuse Issues // Reset Strategy: // Clock Domains: // Critical Timing: // Asynchronous I/F: // Synthesizable (y/n): // Other: //-FHDR-------------------------------------------------------------------------------------------------------- module z_dsp ( input rstn ,input clk ,input en ,input tc_bypass ,input vldi ,input [1:0] intp_mode ,input [1:0] dac_mode_sel ,input signed [15:0] din ,input signed [31:0] a0_re ,input signed [31:0] a0_im ,input signed [31:0] ab0_re ,input signed [31:0] ab0_im ,input signed [31:0] bb0_re ,input signed [31:0] bb0_im ,input signed [31:0] a1_re ,input signed [31:0] a1_im ,input signed [31:0] ab1_re ,input signed [31:0] ab1_im ,input signed [31:0] bb1_re ,input signed [31:0] bb1_im ,input signed [31:0] a2_re ,input signed [31:0] a2_im ,input signed [31:0] ab2_re ,input signed [31:0] ab2_im ,input signed [31:0] bb2_re ,input signed [31:0] bb2_im ,input signed [31:0] a3_re ,input signed [31:0] a3_im ,input signed [31:0] ab3_re ,input signed [31:0] ab3_im ,input signed [31:0] bb3_re ,input signed [31:0] bb3_im ,input signed [31:0] a4_re ,input signed [31:0] a4_im ,input signed [31:0] ab4_re ,input signed [31:0] ab4_im ,input signed [31:0] bb4_re ,input signed [31:0] bb4_im ,input signed [31:0] a5_re ,input signed [31:0] a5_im ,input signed [31:0] ab5_re ,input signed [31:0] ab5_im ,input signed [31:0] bb5_re ,input signed [31:0] bb5_im ,output signed [15:0] dout0 ,output signed [15:0] dout1 ,output signed [15:0] dout2 ,output signed [15:0] dout3 ,output vldo ); parameter Delay = 11-1; wire signed [15:0] IIR_out; reg [Delay:0] vldo_r; always@(posedge clk or negedge rstn) if(!rstn) begin vldo_r <= 11'b0; end else if(en) begin vldo_r <= {vldo_r[Delay:0], vldi};//Delay with 9 clk end else begin vldo_r <= vldo_r; end assign vldo = vldo_r[Delay]; TailCorr_top inst_TailCorr_top ( .clk (clk ), .rstn (rstn ), .en (en ), .vldi (vldi ), .tc_bypass (tc_bypass ), .din (din ), .a0_re (a0_re ), .a0_im (a0_im ), .ab0_re (ab0_re ), .ab0_im (ab0_im ), .bb0_re (bb0_re ), .bb0_im (bb0_im ), .a1_re (a1_re ), .a1_im (a1_im ), .ab1_re (ab1_re ), .ab1_im (ab1_im ), .bb1_re (bb1_re ), .bb1_im (bb1_im ), .a2_re (a2_re ), .a2_im (a2_im ), .ab2_re (ab2_re ), .ab2_im (ab2_im ), .bb2_re (bb2_re ), .bb2_im (bb2_im ), .a3_re (a3_re ), .a3_im (a3_im ), .ab3_re (ab3_re ), .ab3_im (ab3_im ), .bb3_re (bb3_re ), .bb3_im (bb3_im ), .a4_re (a4_re ), .a4_im (a4_im ), .ab4_re (ab4_re ), .ab4_im (ab4_im ), .bb4_re (bb4_re ), .bb4_im (bb4_im ), .a5_re (a5_re ), .a5_im (a5_im ), .ab5_re (ab5_re ), .ab5_im (ab5_im ), .bb5_re (bb5_re ), .bb5_im (bb5_im ), .dout (IIR_out ) ); wire signed [15:0] dout_0; wire signed [15:0] dout_1; wire signed [15:0] dout_2; wire signed [15:0] dout_3; wire signed [15:0] dout_4; wire signed [15:0] dout_5; wire signed [15:0] dout_6; wire signed [15:0] dout_7; MeanIntp_8 inst_MeanIntp_8 ( .clk (clk ), .rstn (rstn ), .en (en ), .intp_mode (intp_mode ), .din (IIR_out ), .dout_0 (dout_0 ), .dout_1 (dout_1 ), .dout_2 (dout_2 ), .dout_3 (dout_3 ), .dout_4 (dout_4 ), .dout_5 (dout_5 ), .dout_6 (dout_6 ), .dout_7 (dout_7 ) ); reg signed [15:0] doutf_0; reg signed [15:0] doutf_1; reg signed [15:0] doutf_2; reg signed [15:0] doutf_3; always@(posedge clk or negedge rstn) if(!rstn) begin doutf_0 <= 0; doutf_1 <= 0; doutf_2 <= 0; doutf_3 <= 0; end else if(en) begin doutf_0 <= dout_0; doutf_1 <= dout_1; doutf_2 <= dout_2; doutf_3 <= dout_3; end else begin doutf_0 <= dout_4; doutf_1 <= dout_5; doutf_2 <= dout_6; doutf_3 <= dout_7; end assign dout0 = doutf_0; assign dout1 = doutf_1; assign dout2 = doutf_2; assign dout3 = doutf_3; endmodule