Attention

This documentation is a work in progress. Expect to see errors and unfinished things.

iq_deinterleaver_multichannel Source File

 1`timescale 1ns / 1ns
 2
 3/** IQ_DEINTERLEAVER_MULTICHANNEL **
 4    Convenience wrapper that instantiates a generic number of iq_deinterleaver
 5    Inputs are flattened vectors of the individual channels.
 6
 7*/
 8
 9module iq_deinterleaver_multichannel #(
10   parameter NCHAN     = 2,
11   parameter SCALE_WI  = 18,
12   parameter DWI       = 16,
13   parameter DAVR      = 4
14) (
15   input                         clk,
16   input  signed [SCALE_WI-1:0]  scale_in,
17   input  signed [NCHAN*DWI-1:0] iq_data_in,
18   input                         iq_sel,
19   output                        valid_out,
20   output [NCHAN*(DWI+DAVR)-1:0] i_data_out,
21   output [NCHAN*(DWI+DAVR)-1:0] q_data_out
22);
23   wire [NCHAN-1:0] valids_out;
24
25   genvar ch_id;
26   generate for (ch_id=0; ch_id < NCHAN; ch_id=ch_id+1) begin : g_iq_deinterleaver
27
28      iq_deinterleaver #(
29         .scale_wi  (SCALE_WI),
30         .dwi       (DWI),
31         .davr      (DAVR)
32      )
33      i_iq_deinterleaver
34      (
35         .clk        (clk),
36         .scale_in   (scale_in),
37         .iq_data_in (iq_data_in[(ch_id+1)*DWI-1:ch_id*DWI]),
38         .iq_sel     (iq_sel),
39         .valid_out  (valids_out[ch_id]),
40         .i_data_out (i_data_out[(ch_id+1)*(DWI+DAVR)-1:ch_id*(DWI+DAVR)]),
41         .q_data_out (q_data_out[(ch_id+1)*(DWI+DAVR)-1:ch_id*(DWI+DAVR)])
42      );
43
44   end endgenerate
45
46   assign valid_out = valids_out[0];
47endmodule