axi_adxcvr: Correctly report the transceiver type in the register map

The util_adxcvr supports GTX2, GTH3 and GTH4. The transceiver is selected
using the XCVR_TYPE parameter.

The axi_adxcvr on the other hand only has a configuration parameter to
indicate whether a GTX or GTH transceiver is used (GTH_OR_GTX_N). Since
there are some minor differences between GTH3 and GTH4 that software needs
to know about rename the GTH_OR_GTX_N to XCVR_TYPE and match use the same
semantics as util_adxcvr.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
main
Lars-Peter Clausen 2017-11-10 17:05:05 +01:00
parent caac2ce588
commit 631f9253b2
3 changed files with 16 additions and 16 deletions

View File

@ -42,7 +42,7 @@ module axi_adxcvr #(
parameter integer ID = 0,
parameter integer NUM_OF_LANES = 8,
parameter integer GTH_OR_GTX_N = 0,
parameter integer XCVR_TYPE = 0,
parameter integer TX_OR_RX_N = 0,
parameter integer QPLL_ENABLE = 1,
parameter LPM_OR_DFE_N = 1,
@ -1671,7 +1671,7 @@ module axi_adxcvr #(
.up_ready_out (up_ch_ready_15_s));
axi_adxcvr_es #(
.GTH_OR_GTX_N (GTH_OR_GTX_N),
.XCVR_TYPE (XCVR_TYPE),
.TX_OR_RX_N (TX_OR_RX_N))
i_es (
.up_rstn (up_rstn),
@ -1718,7 +1718,7 @@ module axi_adxcvr #(
axi_adxcvr_up #(
.ID (ID),
.NUM_OF_LANES (NUM_OF_LANES),
.GTH_OR_GTX_N (GTH_OR_GTX_N),
.XCVR_TYPE (XCVR_TYPE),
.TX_OR_RX_N (TX_OR_RX_N),
.QPLL_ENABLE (QPLL_ENABLE),
.LPM_OR_DFE_N (LPM_OR_DFE_N),

View File

@ -85,17 +85,17 @@ module axi_adxcvr_es (
// parameters
parameter integer GTH_OR_GTX_N = 0;
parameter integer XCVR_TYPE = 0;
parameter integer TX_OR_RX_N = 0;
// addresses
localparam [11:0] ES_DRP_CTRL_ADDR = (GTH_OR_GTX_N == 1) ? 12'h03c : 12'h03d; // GTH-7 12'h03d
localparam [11:0] ES_DRP_HOFFSET_ADDR = (GTH_OR_GTX_N == 1) ? 12'h04f : 12'h03c; // GTH-7 12'h03c
localparam [11:0] ES_DRP_VOFFSET_ADDR = (GTH_OR_GTX_N == 1) ? 12'h097 : 12'h03b; // GTH-7 12'h03b
localparam [11:0] ES_DRP_STATUS_ADDR = (GTH_OR_GTX_N == 1) ? 12'h153 : 12'h151; // GTH-7 12'h153
localparam [11:0] ES_DRP_SCNT_ADDR = (GTH_OR_GTX_N == 1) ? 12'h152 : 12'h150; // GTH-7 12'h152
localparam [11:0] ES_DRP_ECNT_ADDR = (GTH_OR_GTX_N == 1) ? 12'h151 : 12'h14f; // GTH-7 12'h151
localparam [11:0] ES_DRP_CTRL_ADDR = (XCVR_TYPE != 0) ? 12'h03c : 12'h03d; // GTH-7 12'h03d
localparam [11:0] ES_DRP_HOFFSET_ADDR = (XCVR_TYPE != 0) ? 12'h04f : 12'h03c; // GTH-7 12'h03c
localparam [11:0] ES_DRP_VOFFSET_ADDR = (XCVR_TYPE != 0) ? 12'h097 : 12'h03b; // GTH-7 12'h03b
localparam [11:0] ES_DRP_STATUS_ADDR = (XCVR_TYPE != 0) ? 12'h153 : 12'h151; // GTH-7 12'h153
localparam [11:0] ES_DRP_SCNT_ADDR = (XCVR_TYPE != 0) ? 12'h152 : 12'h150; // GTH-7 12'h152
localparam [11:0] ES_DRP_ECNT_ADDR = (XCVR_TYPE != 0) ? 12'h151 : 12'h14f; // GTH-7 12'h151
// fsm-states
@ -483,7 +483,7 @@ module axi_adxcvr_es (
up_enb <= 1'b1;
up_addr <= ES_DRP_HOFFSET_ADDR;
up_wr <= 1'b1;
if (GTH_OR_GTX_N == 1) begin
if (XCVR_TYPE != 0) begin
up_data <= {up_hindex, up_hdata[3:0]};
end else begin
up_data <= {up_hdata[15:12], up_hindex};
@ -499,7 +499,7 @@ module axi_adxcvr_es (
up_enb <= 1'b1;
up_addr <= ES_DRP_VOFFSET_ADDR;
up_wr <= 1'b1;
if (GTH_OR_GTX_N == 1) begin
if (XCVR_TYPE != 0) begin
up_data <= {up_vdata[15:11], up_vindex_s[7], up_ut_s, up_vindex_s[6:0], up_es_vrange};
end else begin
up_data <= {up_es_pscale, up_vdata[10:9], up_ut_s, up_vindex_s};
@ -515,7 +515,7 @@ module axi_adxcvr_es (
up_enb <= 1'b1;
up_addr <= ES_DRP_CTRL_ADDR;
up_wr <= 1'b1;
if (GTH_OR_GTX_N == 1) begin
if (XCVR_TYPE != 0) begin
up_data <= {6'd1, 2'b11, up_cdata[7:5], up_es_pscale};
end else begin
up_data <= {up_cdata[15:10], 2'b11, up_cdata[7:6], 6'd1};
@ -531,7 +531,7 @@ module axi_adxcvr_es (
up_enb <= 1'b1;
up_addr <= ES_DRP_CTRL_ADDR;
up_wr <= 1'b1;
if (GTH_OR_GTX_N == 1) begin
if (XCVR_TYPE != 0) begin
up_data <= {6'd0, 2'b11, up_cdata[7:5], up_es_pscale};
end else begin
up_data <= {up_cdata[15:10], 2'b11, up_cdata[7:6], 6'd0};

View File

@ -41,7 +41,7 @@ module axi_adxcvr_up #(
parameter integer ID = 0,
parameter integer NUM_OF_LANES = 8,
parameter integer GTH_OR_GTX_N = 0,
parameter integer XCVR_TYPE = 0,
parameter integer TX_OR_RX_N = 0,
parameter integer QPLL_ENABLE = 1,
parameter LPM_OR_DFE_N = 1,
@ -450,7 +450,7 @@ module axi_adxcvr_up #(
assign up_rparam_s[23:21] = 3'd0;
assign up_rparam_s[20:20] = (QPLL_ENABLE == 0) ? 1'b0 : 1'b1;
assign up_rparam_s[19:16] = (GTH_OR_GTX_N == 0) ? 1'b0 : 1'b1;
assign up_rparam_s[19:16] = XCVR_TYPE[3:0];
// generic