ad_dds: Update for CORDIC algorithm integration

Add parameters:
  - to select the sine generator (polynomial/CORDIC)
  - to select the CORDIC data width(default 16)
Suppress the warnings generated when the DDS is disabled.
main
AndreiGrozav 2018-02-07 13:48:03 +02:00 committed by AndreiGrozav
parent 4c32b47f6a
commit 4362c35125
1 changed files with 40 additions and 25 deletions

View File

@ -39,8 +39,9 @@ module ad_dds #(
// data path disable // data path disable
parameter DISABLE = 0) ( parameter DISABLE = 0,
parameter DDS_TYPE = 1,
parameter CORDIC_DW = 14) (
// interface // interface
input clk, input clk,
@ -65,7 +66,12 @@ module ad_dds #(
// disable // disable
assign dds_data = (DISABLE == 1) ? 16'd0 : dds_data_out; generate
if (DISABLE == 1) begin
assign dds_data = 16'd0;
end else begin
assign dds_data = dds_data_out;
// dds channel output // dds channel output
@ -79,9 +85,13 @@ module ad_dds #(
dds_scale_0_d <= dds_scale_0; dds_scale_0_d <= dds_scale_0;
dds_scale_1_d <= dds_scale_1; dds_scale_1_d <= dds_scale_1;
end end
// dds-1 // dds-1
ad_dds_1 i_dds_1_0 ( ad_dds_1 #(
.CORDIC_DW(CORDIC_DW),
.DDS_TYPE(DDS_TYPE))
i_dds_1_0 (
.clk (clk), .clk (clk),
.angle (dds_phase_0), .angle (dds_phase_0),
.scale (dds_scale_0_d), .scale (dds_scale_0_d),
@ -89,11 +99,16 @@ module ad_dds #(
// dds-2 // dds-2
ad_dds_1 i_dds_1_1 ( ad_dds_1 #(
.CORDIC_DW(CORDIC_DW),
.DDS_TYPE(DDS_TYPE))
i_dds_1_1 (
.clk (clk), .clk (clk),
.angle (dds_phase_1), .angle (dds_phase_1),
.scale (dds_scale_1_d), .scale (dds_scale_1_d),
.dds_data (dds_data_1_s)); .dds_data (dds_data_1_s));
end
endgenerate
endmodule endmodule