Skip to content

Commit

Permalink
axi_adrv9009: Split DATAPATH parameter in multiple parameters. Map th…
Browse files Browse the repository at this point in the history
…e parameters in the CONFIG register
  • Loading branch information
acostina committed Jun 29, 2018
1 parent 41e717e commit 7601e38
Show file tree
Hide file tree
Showing 6 changed files with 120 additions and 40 deletions.
32 changes: 28 additions & 4 deletions library/axi_adrv9009/axi_adrv9009.v
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,17 @@
module axi_adrv9009 #(

parameter ID = 0,
parameter ADC_DATAPATH_DISABLE = 0,
parameter ADC_DATAFORMAT_DISABLE = 0,
parameter ADC_DCFILTER_DISABLE = 0,
parameter ADC_IQCORRECTION_DISABLE = 0,
parameter ADC_OS_DATAPATH_DISABLE = 0,
parameter ADC_OS_DATAFORMAT_DISABLE = 0,
parameter ADC_OS_DCFILTER_DISABLE = 0,
parameter ADC_OS_IQCORRECTION_DISABLE = 0,
parameter DAC_DATAPATH_DISABLE = 0,
parameter ADC_DATAPATH_DISABLE = 0) (
parameter DAC_DDS_DISABLE = 0,
parameter DAC_IQCORRECTION_DISABLE = 0) (

// receive

Expand Down Expand Up @@ -134,6 +143,16 @@ module axi_adrv9009 #(
output [ 1:0] s_axi_rresp,
input s_axi_rready);

// derived parameters

localparam ADC_DATAFORMAT_DISABLE_INT = (ADC_DATAPATH_DISABLE == 1) ? 1 : ADC_DATAFORMAT_DISABLE;
localparam ADC_DCFILTER_DISABLE_INT = (ADC_DATAPATH_DISABLE == 1) ? 1 : ADC_DCFILTER_DISABLE;
localparam ADC_IQCORRECTION_DISABLE_INT = (ADC_DATAPATH_DISABLE == 1) ? 1 : ADC_IQCORRECTION_DISABLE;
localparam ADC_OS_DATAFORMAT_DISABLE_INT = (ADC_OS_DATAPATH_DISABLE == 1) ? 1 : ADC_OS_DATAFORMAT_DISABLE;
localparam ADC_OS_DCFILTER_DISABLE_INT = (ADC_OS_DATAPATH_DISABLE == 1) ? 1 : ADC_OS_DCFILTER_DISABLE;
localparam ADC_OS_IQCORRECTION_DISABLE_INT = (ADC_OS_DATAPATH_DISABLE == 1) ? 1 : ADC_OS_IQCORRECTION_DISABLE;
localparam DAC_DDS_DISABLE_INT = (DAC_DATAPATH_DISABLE == 1) ? 1 : DAC_DDS_DISABLE;
localparam DAC_IQCORRECTION_DISABLE_INT = (DAC_DATAPATH_DISABLE == 1) ? 1 : DAC_IQCORRECTION_DISABLE;

// internal registers

Expand Down Expand Up @@ -207,7 +226,9 @@ module axi_adrv9009 #(

axi_adrv9009_rx #(
.ID (ID),
.DATAPATH_DISABLE (ADC_DATAPATH_DISABLE))
.DATAFORMAT_DISABLE (ADC_DATAFORMAT_DISABLE_INT),
.DCFILTER_DISABLE (ADC_DCFILTER_DISABLE_INT),
.IQCORRECTION_DISABLE (ADC_IQCORRECTION_DISABLE_INT))
i_rx (
.adc_rst (adc_rst),
.adc_clk (adc_clk),
Expand Down Expand Up @@ -240,7 +261,9 @@ module axi_adrv9009 #(

axi_adrv9009_rx_os #(
.ID (ID),
.DATAPATH_DISABLE (ADC_DATAPATH_DISABLE))
.DATAFORMAT_DISABLE (ADC_DATAFORMAT_DISABLE_INT),
.DCFILTER_DISABLE (ADC_DCFILTER_DISABLE_INT),
.IQCORRECTION_DISABLE (ADC_IQCORRECTION_DISABLE_INT))
i_rx_os (
.adc_os_rst (adc_os_rst),
.adc_os_clk (adc_os_clk),
Expand Down Expand Up @@ -275,7 +298,8 @@ module axi_adrv9009 #(

axi_adrv9009_tx #(
.ID (ID),
.DATAPATH_DISABLE (DAC_DATAPATH_DISABLE))
.DDS_DISABLE (DAC_DDS_DISABLE_INT),
.IQCORRECTION_DISABLE (DAC_IQCORRECTION_DISABLE_INT))
i_tx (
.dac_rst (dac_rst),
.dac_clk (dac_clk),
Expand Down
36 changes: 27 additions & 9 deletions library/axi_adrv9009/axi_adrv9009_rx.v
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,10 @@

module axi_adrv9009_rx #(

parameter DATAPATH_DISABLE = 0,
parameter ID = 0) (
parameter ID = 0,
parameter DATAFORMAT_DISABLE = 0,
parameter DCFILTER_DISABLE = 0,
parameter IQCORRECTION_DISABLE = 0) (

// adc interface

Expand Down Expand Up @@ -75,6 +77,11 @@ module axi_adrv9009_rx #(
output reg [ 31:0] up_rdata,
output reg up_rack);

// configuration settings

localparam CONFIG = (DATAFORMAT_DISABLE * 4) +
(DCFILTER_DISABLE * 2) +
(IQCORRECTION_DISABLE * 1);

// internal registers

Expand Down Expand Up @@ -127,8 +134,10 @@ module axi_adrv9009_rx #(
axi_adrv9009_rx_channel #(
.Q_OR_I_N (0),
.COMMON_ID ('h01),
.CHANNEL_ID (0),
.DATAPATH_DISABLE (DATAPATH_DISABLE),
.DISABLE (0),
.DATAFORMAT_DISABLE (DATAFORMAT_DISABLE),
.DCFILTER_DISABLE (DCFILTER_DISABLE),
.IQCORRECTION_DISABLE (IQCORRECTION_DISABLE),
.DATA_WIDTH (16))
i_rx_channel_0 (
.adc_clk (adc_clk),
Expand Down Expand Up @@ -160,7 +169,10 @@ module axi_adrv9009_rx #(
.Q_OR_I_N (1),
.COMMON_ID ('h01),
.CHANNEL_ID (1),
.DATAPATH_DISABLE (DATAPATH_DISABLE),
.DISABLE (0),
.DATAFORMAT_DISABLE (DATAFORMAT_DISABLE),
.DCFILTER_DISABLE (DCFILTER_DISABLE),
.IQCORRECTION_DISABLE (IQCORRECTION_DISABLE),
.DATA_WIDTH (16))
i_rx_channel_1 (
.adc_clk (adc_clk),
Expand Down Expand Up @@ -192,7 +204,10 @@ module axi_adrv9009_rx #(
.Q_OR_I_N (0),
.COMMON_ID ('h01),
.CHANNEL_ID (2),
.DATAPATH_DISABLE (DATAPATH_DISABLE),
.DISABLE (0),
.DATAFORMAT_DISABLE (DATAFORMAT_DISABLE),
.DCFILTER_DISABLE (DCFILTER_DISABLE),
.IQCORRECTION_DISABLE (IQCORRECTION_DISABLE),
.DATA_WIDTH (16))
i_rx_channel_2 (
.adc_clk (adc_clk),
Expand Down Expand Up @@ -224,7 +239,10 @@ module axi_adrv9009_rx #(
.Q_OR_I_N (1),
.COMMON_ID ('h01),
.CHANNEL_ID (3),
.DATAPATH_DISABLE (DATAPATH_DISABLE),
.DISABLE (0),
.DATAFORMAT_DISABLE (DATAFORMAT_DISABLE),
.DCFILTER_DISABLE (DCFILTER_DISABLE),
.IQCORRECTION_DISABLE (IQCORRECTION_DISABLE),
.DATA_WIDTH (16))
i_rx_channel_3 (
.adc_clk (adc_clk),
Expand Down Expand Up @@ -253,9 +271,9 @@ module axi_adrv9009_rx #(
// common processor control

up_adc_common #(
.COMMON_ID (6'h00),
.ID (ID),
.CONFIG(0),
.COMMON_ID (6'h00),
.CONFIG(CONFIG),
.DRP_DISABLE(1),
.USERPORTS_DISABLE(1),
.GPIO_DISABLE(1),
Expand Down
17 changes: 10 additions & 7 deletions library/axi_adrv9009/axi_adrv9009_rx_channel.v
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ module axi_adrv9009_rx_channel #(
parameter Q_OR_I_N = 0,
parameter COMMON_ID = 0,
parameter CHANNEL_ID = 0,
parameter DATAPATH_DISABLE = 0,
parameter DISABLE = 0,
parameter DATAFORMAT_DISABLE = 0,
parameter DCFILTER_DISABLE = 0,
parameter IQCORRECTION_DISABLE = 0,
parameter DATA_WIDTH = 32) (

// adc interface
Expand Down Expand Up @@ -107,7 +110,7 @@ module axi_adrv9009_rx_channel #(

generate
for (n = 0; n < NUM_OF_SAMPLES; n = n + 1) begin: g_datafmt
if (DATAPATH_DISABLE == 1) begin
if (DISABLE == 1 || DATAFORMAT_DISABLE == 1) begin
assign adc_dfmt_valid_s[n] = adc_valid_in;
assign adc_dfmt_data_s[((16*n)+15):(16*n)] = adc_data_in[((16*n)+15):(16*n)];
end else begin
Expand All @@ -126,7 +129,7 @@ module axi_adrv9009_rx_channel #(

generate
for (n = 0; n < NUM_OF_SAMPLES; n = n + 1) begin: g_dcfilter
if (DATAPATH_DISABLE == 1) begin
if (DISABLE == 1 || DCFILTER_DISABLE == 1) begin
assign adc_dcfilter_valid_s[n] = adc_dfmt_valid_s[n];
assign adc_dcfilter_data_s[((16*n)+15):(16*n)] = adc_dfmt_data_s[((16*n)+15):(16*n)];
end else begin
Expand All @@ -148,7 +151,7 @@ module axi_adrv9009_rx_channel #(

generate
for (n = 0; n < NUM_OF_SAMPLES; n = n + 1) begin: g_iqcor
if (DATAPATH_DISABLE == 1) begin
if (DISABLE == 1 || IQCORRECTION_DISABLE == 1) begin
assign adc_valid_out_s[n] = adc_dcfilter_valid_s[n];
assign adc_data_out[((16*n)+15):(16*n)] = adc_dcfilter_data_s[((16*n)+15):(16*n)];
end else begin
Expand All @@ -170,9 +173,9 @@ module axi_adrv9009_rx_channel #(
.COMMON_ID (COMMON_ID),
.CHANNEL_ID (CHANNEL_ID),
.USERPORTS_DISABLE(1),
.DATAFORMAT_DISABLE(DATAPATH_DISABLE),
.DCFILTER_DISABLE(DATAPATH_DISABLE),
.IQCORRECTION_DISABLE(DATAPATH_DISABLE))
.DATAFORMAT_DISABLE(DATAFORMAT_DISABLE),
.DCFILTER_DISABLE(DCFILTER_DISABLE),
.IQCORRECTION_DISABLE(IQCORRECTION_DISABLE))
i_up_adc_channel (
.adc_clk (adc_clk),
.adc_rst (adc_rst),
Expand Down
36 changes: 29 additions & 7 deletions library/axi_adrv9009/axi_adrv9009_rx_os.v
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,10 @@

module axi_adrv9009_rx_os #(

parameter DATAPATH_DISABLE = 0,
parameter ID = 0) (
parameter ID = 0,
parameter DATAFORMAT_DISABLE = 0,
parameter DCFILTER_DISABLE = 0,
parameter IQCORRECTION_DISABLE = 0) (

// adc interface

Expand Down Expand Up @@ -77,6 +79,9 @@ module axi_adrv9009_rx_os #(
output reg [ 31:0] up_rdata,
output reg up_rack);

localparam CONFIG = (DATAFORMAT_DISABLE * 4) +
(DCFILTER_DISABLE * 2) +
(IQCORRECTION_DISABLE * 1);

// internal registers

Expand Down Expand Up @@ -123,7 +128,10 @@ module axi_adrv9009_rx_os #(
.Q_OR_I_N (0),
.COMMON_ID ('h21),
.CHANNEL_ID (0),
.DATAPATH_DISABLE (DATAPATH_DISABLE),
.DISABLE (0),
.DATAFORMAT_DISABLE (DATAFORMAT_DISABLE),
.DCFILTER_DISABLE (DCFILTER_DISABLE),
.IQCORRECTION_DISABLE (IQCORRECTION_DISABLE),
.DATA_WIDTH (32))
i_rx_os_channel_0 (
.adc_clk (adc_os_clk),
Expand Down Expand Up @@ -155,7 +163,10 @@ module axi_adrv9009_rx_os #(
.Q_OR_I_N (1),
.COMMON_ID ('h21),
.CHANNEL_ID (1),
.DATAPATH_DISABLE (DATAPATH_DISABLE),
.DISABLE (0),
.DATAFORMAT_DISABLE (DATAFORMAT_DISABLE),
.DCFILTER_DISABLE (DCFILTER_DISABLE),
.IQCORRECTION_DISABLE (IQCORRECTION_DISABLE),
.DATA_WIDTH (32))
i_rx_os_channel_1 (
.adc_clk (adc_os_clk),
Expand Down Expand Up @@ -185,7 +196,10 @@ module axi_adrv9009_rx_os #(
.Q_OR_I_N (2),
.COMMON_ID ('h21),
.CHANNEL_ID (2),
.DATAPATH_DISABLE (DATAPATH_DISABLE),
.DISABLE (0),
.DATAFORMAT_DISABLE (DATAFORMAT_DISABLE),
.DCFILTER_DISABLE (DCFILTER_DISABLE),
.IQCORRECTION_DISABLE (IQCORRECTION_DISABLE),
.DATA_WIDTH (32))
i_rx_os_channel_2 (
.adc_clk (adc_os_clk),
Expand Down Expand Up @@ -215,7 +229,10 @@ module axi_adrv9009_rx_os #(
.Q_OR_I_N (3),
.COMMON_ID ('h21),
.CHANNEL_ID (3),
.DATAPATH_DISABLE (DATAPATH_DISABLE),
.DISABLE (0),
.DATAFORMAT_DISABLE (DATAFORMAT_DISABLE),
.DCFILTER_DISABLE (DCFILTER_DISABLE),
.IQCORRECTION_DISABLE (IQCORRECTION_DISABLE),
.DATA_WIDTH (32))
i_rx_os_channel_3 (
.adc_clk (adc_os_clk),
Expand Down Expand Up @@ -244,8 +261,13 @@ module axi_adrv9009_rx_os #(
// common processor control

up_adc_common #(
.ID (ID),
.COMMON_ID ('h20),
.ID (ID))
.CONFIG (CONFIG),
.DRP_DISABLE (1),
.USERPORTS_DISABLE (1),
.GPIO_DISABLE (1),
.START_CODE_DISABLE (1))
i_up_adc_common (
.mmcm_rst (),
.adc_clk (adc_os_clk),
Expand Down
27 changes: 19 additions & 8 deletions library/axi_adrv9009/axi_adrv9009_tx.v
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@

module axi_adrv9009_tx #(

parameter DATAPATH_DISABLE = 0,
parameter ID = 0) (
parameter ID = 0,
parameter DDS_DISABLE = 0,
parameter IQCORRECTION_DISABLE = 0) (

// dac interface

Expand Down Expand Up @@ -80,8 +81,10 @@ module axi_adrv9009_tx #(
output reg [ 31:0] up_rdata,
output reg up_rack);

// configuration settings


localparam CONFIG = (DDS_DISABLE * 64) +
(IQCORRECTION_DISABLE * 1);

// internal registers

Expand Down Expand Up @@ -129,7 +132,9 @@ module axi_adrv9009_tx #(
axi_adrv9009_tx_channel #(
.CHANNEL_ID (0),
.Q_OR_I_N (0),
.DATAPATH_DISABLE (DATAPATH_DISABLE))
.DISABLE (0),
.DDS_DISABLE (DDS_DISABLE),
.IQCORRECTION_DISABLE (IQCORRECTION_DISABLE))
i_tx_channel_0 (
.dac_clk (dac_clk),
.dac_rst (dac_rst),
Expand Down Expand Up @@ -158,7 +163,9 @@ module axi_adrv9009_tx #(
axi_adrv9009_tx_channel #(
.CHANNEL_ID (1),
.Q_OR_I_N (1),
.DATAPATH_DISABLE (DATAPATH_DISABLE))
.DISABLE (0),
.DDS_DISABLE (DDS_DISABLE),
.IQCORRECTION_DISABLE (IQCORRECTION_DISABLE))
i_tx_channel_1 (
.dac_clk (dac_clk),
.dac_rst (dac_rst),
Expand Down Expand Up @@ -187,7 +194,9 @@ module axi_adrv9009_tx #(
axi_adrv9009_tx_channel #(
.CHANNEL_ID (2),
.Q_OR_I_N (0),
.DATAPATH_DISABLE (DATAPATH_DISABLE))
.DISABLE (0),
.DDS_DISABLE (DDS_DISABLE),
.IQCORRECTION_DISABLE (IQCORRECTION_DISABLE))
i_tx_channel_2 (
.dac_clk (dac_clk),
.dac_rst (dac_rst),
Expand Down Expand Up @@ -216,7 +225,9 @@ module axi_adrv9009_tx #(
axi_adrv9009_tx_channel #(
.CHANNEL_ID (3),
.Q_OR_I_N (1),
.DATAPATH_DISABLE (DATAPATH_DISABLE))
.DISABLE (0),
.DDS_DISABLE (DDS_DISABLE),
.IQCORRECTION_DISABLE (IQCORRECTION_DISABLE))
i_tx_channel_3 (
.dac_clk (dac_clk),
.dac_rst (dac_rst),
Expand All @@ -242,7 +253,7 @@ module axi_adrv9009_tx #(

up_dac_common #(
.ID (ID),
.CONFIG(0),
.CONFIG(CONFIG),
.CLK_EDGE_SEL(0),
.COMMON_ID(6'h10),
.DRP_DISABLE(1),
Expand Down
Loading

0 comments on commit 7601e38

Please sign in to comment.