From 93ce2c95f7e0c8a0e5d5d29fb86d4384e49ad1b3 Mon Sep 17 00:00:00 2001 From: AndreiGrozav Date: Thu, 24 Mar 2022 16:10:16 +0000 Subject: [PATCH] ad9361: Add support for config DDS phase resolution --- library/axi_ad9361/axi_ad9361.v | 2 ++ library/axi_ad9361/axi_ad9361_tx.v | 5 +++++ library/axi_ad9361/axi_ad9361_tx_channel.v | 12 +++++++----- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/library/axi_ad9361/axi_ad9361.v b/library/axi_ad9361/axi_ad9361.v index eaf06382ea..17ddf39d0f 100644 --- a/library/axi_ad9361/axi_ad9361.v +++ b/library/axi_ad9361/axi_ad9361.v @@ -60,6 +60,7 @@ module axi_ad9361 #( parameter DAC_DATAPATH_DISABLE = 0, parameter DAC_DDS_DISABLE = 0, parameter DAC_DDS_TYPE = 1, + parameter DAC_DDS_PHASE_DW = 16, parameter DAC_DDS_CORDIC_DW = 14, parameter DAC_DDS_CORDIC_PHASE_DW = 13, parameter DAC_USERPORTS_DISABLE = 0, @@ -667,6 +668,7 @@ module axi_ad9361 #( .PPS_RECEIVER_ENABLE (PPS_RECEIVER_ENABLE), .INIT_DELAY (DAC_INIT_DELAY), .DAC_DDS_DISABLE (DAC_DDS_DISABLE_INT), + .DAC_DDS_PHASE_DW (DAC_DDS_PHASE_DW), .DAC_DDS_TYPE (DAC_DDS_TYPE), .DAC_DDS_CORDIC_DW (DAC_DDS_CORDIC_DW), .DAC_DDS_CORDIC_PHASE_DW (DAC_DDS_CORDIC_PHASE_DW), diff --git a/library/axi_ad9361/axi_ad9361_tx.v b/library/axi_ad9361/axi_ad9361_tx.v index 6105f90017..783cee3492 100644 --- a/library/axi_ad9361/axi_ad9361_tx.v +++ b/library/axi_ad9361/axi_ad9361_tx.v @@ -51,6 +51,7 @@ module axi_ad9361_tx #( parameter INIT_DELAY = 0, parameter DAC_DDS_DISABLE = 0, parameter DAC_DDS_TYPE = 1, + parameter DAC_DDS_PHASE_DW = 16, parameter DAC_DDS_CORDIC_DW = 14, parameter DAC_DDS_CORDIC_PHASE_DW = 13, parameter USERPORTS_DISABLE = 0, @@ -224,6 +225,7 @@ module axi_ad9361_tx #( .DISABLE (0), .DAC_DDS_DISABLE (DAC_DDS_DISABLE), .DAC_DDS_TYPE (DAC_DDS_TYPE), + .DAC_DDS_PHASE_DW (DAC_DDS_PHASE_DW), .DAC_DDS_CORDIC_DW (DAC_DDS_CORDIC_DW), .DAC_DDS_CORDIC_PHASE_DW (DAC_DDS_CORDIC_PHASE_DW), .USERPORTS_DISABLE (USERPORTS_DISABLE), @@ -259,6 +261,7 @@ module axi_ad9361_tx #( .DISABLE (0), .DAC_DDS_DISABLE (DAC_DDS_DISABLE), .DAC_DDS_TYPE (DAC_DDS_TYPE), + .DAC_DDS_PHASE_DW (DAC_DDS_PHASE_DW), .DAC_DDS_CORDIC_DW (DAC_DDS_CORDIC_DW), .DAC_DDS_CORDIC_PHASE_DW (DAC_DDS_CORDIC_PHASE_DW), .USERPORTS_DISABLE (USERPORTS_DISABLE), @@ -294,6 +297,7 @@ module axi_ad9361_tx #( .DISABLE (MODE_1R1T), .DAC_DDS_DISABLE (DAC_DDS_DISABLE), .DAC_DDS_TYPE (DAC_DDS_TYPE), + .DAC_DDS_PHASE_DW (DAC_DDS_PHASE_DW), .DAC_DDS_CORDIC_DW (DAC_DDS_CORDIC_DW), .DAC_DDS_CORDIC_PHASE_DW (DAC_DDS_CORDIC_PHASE_DW), .USERPORTS_DISABLE (USERPORTS_DISABLE), @@ -329,6 +333,7 @@ module axi_ad9361_tx #( .DISABLE (MODE_1R1T), .DAC_DDS_DISABLE (DAC_DDS_DISABLE), .DAC_DDS_TYPE (DAC_DDS_TYPE), + .DAC_DDS_PHASE_DW (DAC_DDS_PHASE_DW), .DAC_DDS_CORDIC_DW (DAC_DDS_CORDIC_DW), .DAC_DDS_CORDIC_PHASE_DW (DAC_DDS_CORDIC_PHASE_DW), .USERPORTS_DISABLE (USERPORTS_DISABLE), diff --git a/library/axi_ad9361/axi_ad9361_tx_channel.v b/library/axi_ad9361/axi_ad9361_tx_channel.v index f85d7588ff..9e4c0444a5 100644 --- a/library/axi_ad9361/axi_ad9361_tx_channel.v +++ b/library/axi_ad9361/axi_ad9361_tx_channel.v @@ -44,6 +44,7 @@ module axi_ad9361_tx_channel #( parameter DISABLE = 0, parameter DAC_DDS_DISABLE = 0, parameter DAC_DDS_TYPE = 1, + parameter DAC_DDS_PHASE_DW = 16, parameter DAC_DDS_CORDIC_DW = 14, parameter DAC_DDS_CORDIC_PHASE_DW = 13, parameter USERPORTS_DISABLE = 0, @@ -103,11 +104,11 @@ module axi_ad9361_tx_channel #( wire [15:0] dac_iqcor_data_s; wire [11:0] dac_dds_data_s; wire [15:0] dac_dds_scale_1_s; - wire [15:0] dac_dds_init_1_s; - wire [15:0] dac_dds_incr_1_s; + wire [DAC_DDS_PHASE_DW-1:0] dac_dds_init_1_s; + wire [DAC_DDS_PHASE_DW-1:0] dac_dds_incr_1_s; wire [15:0] dac_dds_scale_2_s; - wire [15:0] dac_dds_init_2_s; - wire [15:0] dac_dds_incr_2_s; + wire [DAC_DDS_PHASE_DW-1:0] dac_dds_init_2_s; + wire [DAC_DDS_PHASE_DW-1:0] dac_dds_incr_2_s; wire [15:0] dac_pat_data_1_s; wire [15:0] dac_pat_data_2_s; wire [ 3:0] dac_data_sel_s; @@ -319,7 +320,7 @@ module axi_ad9361_tx_channel #( ad_dds #( .DISABLE (DAC_DDS_DISABLE), .DDS_DW (12), - .PHASE_DW (16), + .PHASE_DW (DAC_DDS_PHASE_DW), .DDS_TYPE (DAC_DDS_TYPE), .CORDIC_DW (DAC_DDS_CORDIC_DW), .CORDIC_PHASE_DW (DAC_DDS_CORDIC_PHASE_DW), @@ -347,6 +348,7 @@ module axi_ad9361_tx_channel #( .COMMON_ID (6'h11), .CHANNEL_ID (CHANNEL_ID), .DDS_DISABLE (DAC_DDS_DISABLE), + .DDS_PHASE_DW (DAC_DDS_PHASE_DW), .USERPORTS_DISABLE (USERPORTS_DISABLE), .IQCORRECTION_DISABLE (IQCORRECTION_DISABLE)) i_up_dac_channel (