From f23ab72129041777bcd3357a1f4e37b29e62dd86 Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Mon, 22 Nov 2021 12:09:16 +0100 Subject: fpga: x300: OR ATR signals going into db_control Before this change, only the channel 0 ATR state was sent to the db_control module. For TwinRX, this had the disadvantage that when only Channel 1 was used, the FP- and LED-GPIOs could not track the radio's ATR state (e.g., no LED would light up in this case). Note that unlike UHD 3, there is only one db_control module per slot. There are therefore no options to map GPIOs to track the ATR state of an individual channel. --- fpga/usrp3/top/x300/x300_core.v | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'fpga/usrp3/top') diff --git a/fpga/usrp3/top/x300/x300_core.v b/fpga/usrp3/top/x300/x300_core.v index f4349b90a..32f0f5b5d 100644 --- a/fpga/usrp3/top/x300/x300_core.v +++ b/fpga/usrp3/top/x300/x300_core.v @@ -555,6 +555,13 @@ module x300_core #( //------------------------------------ // Daughterboard Control // ----------------------------------- + // Note: We have one db_control per slot, even though we can have up to 2 + // channels. In practice, this only affects TwinRX (and maybe some of the + // Basic- and LF-boards, depending how they're used). + // The main disadvantage in these cases is that individual channels cannot + // individually trigger GPIOs based on ATR state (i.e., we cannot tell if + // channel 0 or 1 are in a TX/RX state, we can only say that one of them is + // in such a state). localparam [7:0] SR_DB_BASE = 8'd160; localparam [7:0] RB_DB_BASE = 8'd16; @@ -570,7 +577,9 @@ module x300_core #( .clk(radio_clk), .reset(radio_rst), .set_stb(db_fe_set_stb[i]), .set_addr(db_fe_set_addr[i]), .set_data(db_fe_set_data[i]), .rb_stb(db_fe_rb_stb[i]), .rb_addr(db_fe_rb_addr[i]), .rb_data(db_fe_rb_data[i]), - .run_rx(rx_running[i*2]), .run_tx(tx_running[i*2]), + // We OR the ATR indicators from both channels + .run_rx(|{rx_running[i*2], rx_running[i*2+1]}), + .run_tx(|{tx_running[i*2], tx_running[i*2+1]}), .misc_ins(misc_ins[i]), .misc_outs(misc_outs[i]), .fp_gpio_in(fp_gpio_r_in[i]), .fp_gpio_out(fp_gpio_r_out[i]), .fp_gpio_ddr(fp_gpio_r_ddr[i]), .fp_gpio_fab(), .db_gpio_in(db_gpio_in[i]), .db_gpio_out(db_gpio_out[i]), .db_gpio_ddr(db_gpio_ddr[i]), .db_gpio_fab(), -- cgit v1.2.3