iqcor- move i/q sel inside the module

main
Rejeesh Kutty 2015-07-23 15:55:27 -04:00
parent 289e73660b
commit cd5ce3349f
1 changed files with 15 additions and 8 deletions

View File

@ -44,8 +44,8 @@ module ad_iqcor (
clk,
valid,
data_i,
data_q,
data_in,
data_iq,
valid_out,
data_out,
@ -63,8 +63,8 @@ module ad_iqcor (
input clk;
input valid;
input [15:0] data_i;
input [15:0] data_q;
input [15:0] data_in;
input [15:0] data_iq;
output valid_out;
output [15:0] data_out;
@ -85,30 +85,37 @@ module ad_iqcor (
// internal signals
wire [15:0] data_i_s;
wire [15:0] data_q_s;
wire [33:0] p1_data_p_i_s;
wire p1_valid_s;
wire [15:0] p1_data_i_s;
wire [33:0] p1_data_p_q_s;
wire [15:0] p1_data_q_s;
// swap i & q
assign data_i_s = (IQSEL == 1) ? data_iq : data_in;
assign data_q_s = (IQSEL == 1) ? data_in : data_iq;
// scaling functions - i
ad_mul #(.DELAY_DATA_WIDTH(17)) i_mul_i (
.clk (clk),
.data_a ({data_i[15], data_i}),
.data_a ({data_i_s[15], data_i_s}),
.data_b ({iqcor_coeff_1[15], iqcor_coeff_1}),
.data_p (p1_data_p_i_s),
.ddata_in ({valid, data_i}),
.ddata_in ({valid, data_i_s}),
.ddata_out ({p1_valid_s, p1_data_i_s}));
// scaling functions - q
ad_mul #(.DELAY_DATA_WIDTH(16)) i_mul_q (
.clk (clk),
.data_a ({data_q[15], data_q}),
.data_a ({data_q_s[15], data_q_s}),
.data_b ({iqcor_coeff_2[15], iqcor_coeff_2}),
.data_p (p1_data_p_q_s),
.ddata_in (data_q),
.ddata_in (data_q_s),
.ddata_out (p1_data_q_s));
// sum