293 lines
8.6 KiB
Verilog
293 lines
8.6 KiB
Verilog
module P_NCO(
|
|
clk,
|
|
rstn,
|
|
clr,
|
|
clr_acc,
|
|
pha,
|
|
|
|
s1,
|
|
s2,
|
|
s3,
|
|
|
|
s1_o,
|
|
s2_o,
|
|
s3_o,
|
|
|
|
fcw1,
|
|
fcw2,
|
|
fcw3,
|
|
fcw4,
|
|
fcw5,
|
|
fcw6,
|
|
fcw7,
|
|
fcw8,
|
|
fcw9,
|
|
fcw10,
|
|
fcw11,
|
|
fcw12,
|
|
fcw13,
|
|
fcw14,
|
|
fcw15,
|
|
fcw16,
|
|
|
|
cos_0,
|
|
cos_1,
|
|
cos_2,
|
|
cos_3,
|
|
cos_4,
|
|
cos_5,
|
|
cos_6,
|
|
cos_7,
|
|
cos_8,
|
|
cos_9,
|
|
cos_10,
|
|
cos_11,
|
|
cos_12,
|
|
cos_13,
|
|
cos_14,
|
|
cos_15,
|
|
|
|
sin_0,
|
|
sin_1,
|
|
sin_2,
|
|
sin_3,
|
|
sin_4,
|
|
sin_5,
|
|
sin_6,
|
|
sin_7,
|
|
sin_8,
|
|
sin_9,
|
|
sin_10,
|
|
sin_11,
|
|
sin_12,
|
|
sin_13,
|
|
sin_14,
|
|
sin_15
|
|
);
|
|
|
|
input clk;
|
|
input rstn;
|
|
input clr;
|
|
input clr_acc;
|
|
input [15:0] pha;
|
|
|
|
input [15:0] s1;
|
|
input [15:0] s2;
|
|
input [15:0] s3;
|
|
|
|
output [15:0] s1_o;
|
|
output [15:0] s2_o;
|
|
output [15:0] s3_o;
|
|
|
|
output [15:0] cos_0;
|
|
output [15:0] cos_1;
|
|
output [15:0] cos_2;
|
|
output [15:0] cos_3;
|
|
output [15:0] cos_4;
|
|
output [15:0] cos_5;
|
|
output [15:0] cos_6;
|
|
output [15:0] cos_7;
|
|
output [15:0] cos_8;
|
|
output [15:0] cos_9;
|
|
output [15:0] cos_10;
|
|
output [15:0] cos_11;
|
|
output [15:0] cos_12;
|
|
output [15:0] cos_13;
|
|
output [15:0] cos_14;
|
|
output [15:0] cos_15;
|
|
|
|
|
|
output [15:0] sin_0;
|
|
output [15:0] sin_1;
|
|
output [15:0] sin_2;
|
|
output [15:0] sin_3;
|
|
output [15:0] sin_4;
|
|
output [15:0] sin_5;
|
|
output [15:0] sin_6;
|
|
output [15:0] sin_7;
|
|
output [15:0] sin_8;
|
|
output [15:0] sin_9;
|
|
output [15:0] sin_10;
|
|
output [15:0] sin_11;
|
|
output [15:0] sin_12;
|
|
output [15:0] sin_13;
|
|
output [15:0] sin_14;
|
|
output [15:0] sin_15;
|
|
|
|
|
|
input [47:0] fcw1;
|
|
input [47:0] fcw2;
|
|
input [47:0] fcw3;
|
|
input [47:0] fcw4;
|
|
input [47:0] fcw5;
|
|
input [47:0] fcw6;
|
|
input [47:0] fcw7;
|
|
input [47:0] fcw8;
|
|
input [47:0] fcw9;
|
|
input [47:0] fcw10;
|
|
input [47:0] fcw11;
|
|
input [47:0] fcw12;
|
|
input [47:0] fcw13;
|
|
input [47:0] fcw14;
|
|
input [47:0] fcw15;
|
|
input [47:0] fcw16;
|
|
|
|
|
|
reg [15:0] pha_r;
|
|
always@(posedge clk or negedge rstn)
|
|
if(!rstn)
|
|
pha_r <= 16'd0;
|
|
else
|
|
pha_r <= pha;
|
|
|
|
wire [18:0] pha0;
|
|
wire [18:0] pha1;
|
|
wire [18:0] pha2;
|
|
wire [18:0] pha3;
|
|
wire [18:0] pha4;
|
|
wire [18:0] pha5;
|
|
wire [18:0] pha6;
|
|
wire [18:0] pha7;
|
|
wire [18:0] pha8;
|
|
wire [18:0] pha9;
|
|
wire [18:0] pha10;
|
|
wire [18:0] pha11;
|
|
wire [18:0] pha12;
|
|
wire [18:0] pha13;
|
|
wire [18:0] pha14;
|
|
wire [18:0] pha15;
|
|
|
|
PIPE3_ADD_48BIT inst_pipe_0(.clk(clk),.rstn(rstn),.in(fcw1),.clr(clr),.ptw(pha_r),.s1(s1),.s2(s2),.s3(s3),.out(pha0));
|
|
PIPE3_ADD_48BIT inst_pipe_1(.clk(clk),.rstn(rstn),.in(fcw2),.clr(clr),.ptw(pha_r),.s1(s1),.s2(s2),.s3(s3),.out(pha1));
|
|
PIPE3_ADD_48BIT inst_pipe_2(.clk(clk),.rstn(rstn),.in(fcw3),.clr(clr),.ptw(pha_r),.s1(s1),.s2(s2),.s3(s3),.out(pha2));
|
|
PIPE3_ADD_48BIT inst_pipe_3(.clk(clk),.rstn(rstn),.in(fcw4),.clr(clr),.ptw(pha_r),.s1(s1),.s2(s2),.s3(s3),.out(pha3));
|
|
PIPE3_ADD_48BIT inst_pipe_4(.clk(clk),.rstn(rstn),.in(fcw5),.clr(clr),.ptw(pha_r),.s1(s1),.s2(s2),.s3(s3),.out(pha4));
|
|
PIPE3_ADD_48BIT inst_pipe_5(.clk(clk),.rstn(rstn),.in(fcw6),.clr(clr),.ptw(pha_r),.s1(s1),.s2(s2),.s3(s3),.out(pha5));
|
|
PIPE3_ADD_48BIT inst_pipe_6(.clk(clk),.rstn(rstn),.in(fcw7),.clr(clr),.ptw(pha_r),.s1(s1),.s2(s2),.s3(s3),.out(pha6));
|
|
PIPE3_ADD_48BIT inst_pipe_7(.clk(clk),.rstn(rstn),.in(fcw8),.clr(clr),.ptw(pha_r),.s1(s1),.s2(s2),.s3(s3),.out(pha7));
|
|
PIPE3_ADD_48BIT inst_pipe_8(.clk(clk),.rstn(rstn),.in(fcw9),.clr(clr),.ptw(pha_r),.s1(s1),.s2(s2),.s3(s3),.out(pha8));
|
|
PIPE3_ADD_48BIT inst_pipe_9(.clk(clk),.rstn(rstn),.in(fcw10),.clr(clr),.ptw(pha_r),.s1(s1),.s2(s2),.s3(s3),.out(pha9));
|
|
PIPE3_ADD_48BIT inst_pipe_10(.clk(clk),.rstn(rstn),.in(fcw11),.clr(clr),.ptw(pha_r),.s1(s1),.s2(s2),.s3(s3),.out(pha10));
|
|
PIPE3_ADD_48BIT inst_pipe_11(.clk(clk),.rstn(rstn),.in(fcw12),.clr(clr),.ptw(pha_r),.s1(s1),.s2(s2),.s3(s3),.out(pha11));
|
|
PIPE3_ADD_48BIT inst_pipe_12(.clk(clk),.rstn(rstn),.in(fcw13),.clr(clr),.ptw(pha_r),.s1(s1),.s2(s2),.s3(s3),.out(pha12));
|
|
PIPE3_ADD_48BIT inst_pipe_13(.clk(clk),.rstn(rstn),.in(fcw14),.clr(clr),.ptw(pha_r),.s1(s1),.s2(s2),.s3(s3),.out(pha13));
|
|
PIPE3_ADD_48BIT inst_pipe_14(.clk(clk),.rstn(rstn),.in(fcw15),.clr(clr),.ptw(pha_r),.s1(s1),.s2(s2),.s3(s3),.out(pha14));
|
|
PIPE3_ACC_48BIT inst_pipe_15(.clk(clk),.rstn(rstn),.in(fcw16),.clr(clr_acc),.ptw(pha),.s_o_1(s1_o),.s_o_2(s2_o),.s_o_3(s3_o),.s_i_1(s1),.s_i_2(s2),.s_i_3(s3),.out(pha15));
|
|
|
|
PH2AMP inst_ph2amp_0(
|
|
.clk(clk) ,
|
|
.rstn(rstn) ,
|
|
.pha_map(pha0) ,
|
|
.sin_o(sin_0) ,
|
|
.cos_o(cos_0)
|
|
);
|
|
PH2AMP inst_ph2amp_1(
|
|
.clk(clk) ,
|
|
.rstn(rstn) ,
|
|
.pha_map(pha1) ,
|
|
.sin_o(sin_1) ,
|
|
.cos_o(cos_1)
|
|
);
|
|
PH2AMP inst_ph2amp_2(
|
|
.clk(clk) ,
|
|
.rstn(rstn) ,
|
|
.pha_map(pha2) ,
|
|
.sin_o(sin_2) ,
|
|
.cos_o(cos_2)
|
|
);
|
|
PH2AMP inst_ph2amp_3(
|
|
.clk(clk) ,
|
|
.rstn(rstn) ,
|
|
.pha_map(pha3) ,
|
|
.sin_o(sin_3) ,
|
|
.cos_o(cos_3)
|
|
);
|
|
PH2AMP inst_ph2amp_4(
|
|
.clk(clk) ,
|
|
.rstn(rstn) ,
|
|
.pha_map(pha4) ,
|
|
.sin_o(sin_4) ,
|
|
.cos_o(cos_4)
|
|
);
|
|
PH2AMP inst_ph2amp_5(
|
|
.clk(clk) ,
|
|
.rstn(rstn) ,
|
|
.pha_map(pha5) ,
|
|
.sin_o(sin_5) ,
|
|
.cos_o(cos_5)
|
|
);
|
|
PH2AMP inst_ph2amp_6(
|
|
.clk(clk) ,
|
|
.rstn(rstn) ,
|
|
.pha_map(pha6) ,
|
|
.sin_o(sin_6) ,
|
|
.cos_o(cos_6)
|
|
);
|
|
PH2AMP inst_ph2amp_7(
|
|
.clk(clk) ,
|
|
.rstn(rstn) ,
|
|
.pha_map(pha7) ,
|
|
.sin_o(sin_7) ,
|
|
.cos_o(cos_7)
|
|
);
|
|
|
|
PH2AMP inst_ph2amp_8(
|
|
.clk(clk) ,
|
|
.rstn(rstn) ,
|
|
.pha_map(pha8) ,
|
|
.sin_o(sin_8) ,
|
|
.cos_o(cos_8)
|
|
);
|
|
PH2AMP inst_ph2amp_9(
|
|
.clk(clk) ,
|
|
.rstn(rstn) ,
|
|
.pha_map(pha9) ,
|
|
.sin_o(sin_9) ,
|
|
.cos_o(cos_9)
|
|
);
|
|
PH2AMP inst_ph2amp_10(
|
|
.clk(clk) ,
|
|
.rstn(rstn) ,
|
|
.pha_map(pha10) ,
|
|
.sin_o(sin_10) ,
|
|
.cos_o(cos_10)
|
|
);
|
|
PH2AMP inst_ph2amp_11(
|
|
.clk(clk) ,
|
|
.rstn(rstn) ,
|
|
.pha_map(pha11) ,
|
|
.sin_o(sin_11) ,
|
|
.cos_o(cos_11)
|
|
);
|
|
PH2AMP inst_ph2amp_12(
|
|
.clk(clk) ,
|
|
.rstn(rstn) ,
|
|
.pha_map(pha12) ,
|
|
.sin_o(sin_12) ,
|
|
.cos_o(cos_12)
|
|
);
|
|
PH2AMP inst_ph2amp_13(
|
|
.clk(clk) ,
|
|
.rstn(rstn) ,
|
|
.pha_map(pha13) ,
|
|
.sin_o(sin_13) ,
|
|
.cos_o(cos_13)
|
|
);
|
|
PH2AMP inst_ph2amp_14(
|
|
.clk(clk) ,
|
|
.rstn(rstn) ,
|
|
.pha_map(pha14) ,
|
|
.sin_o(sin_14) ,
|
|
.cos_o(cos_14)
|
|
);
|
|
PH2AMP inst_ph2amp_15(
|
|
.clk(clk) ,
|
|
.rstn(rstn) ,
|
|
.pha_map(pha15) ,
|
|
.sin_o(sin_15) ,
|
|
.cos_o(cos_15)
|
|
);
|
|
|
|
|
|
endmodule
|