pzsdr2/ccfmc- add rf input protection

main
Rejeesh Kutty 2017-03-06 16:19:55 -05:00
parent 3fa9a30f0e
commit fc8af6903f
2 changed files with 42 additions and 9 deletions

View File

@ -4,3 +4,6 @@ source ../common/ccfmc_bd.tcl
cfg_ad9361_interface LVDS
create_bd_port -dir O sys_cpu_clk_out
ad_connect sys_cpu_clk sys_cpu_clk_out

View File

@ -141,9 +141,9 @@ module system_top (
inout gpio_rf0,
inout gpio_rf1,
inout gpio_rf2,
output gpio_rf2,
inout gpio_rf3,
inout gpio_rf4,
input gpio_rf4,
inout gpio_rfpwr_enable,
inout gpio_clksel,
inout gpio_resetb,
@ -157,12 +157,20 @@ module system_top (
output spi_mosi,
input spi_miso);
// internal registers
reg rf_peak_det_n_d = 'd0;
reg rf_peak_det_enb_d = 'd0;
reg rf_peak_rst_enb = 'd0;
reg rf_peak_rst = 'd0;
// internal signals
wire [ 1:0] spi_csn_s;
wire spi_clk_s;
wire spi_mosi_s;
wire spi_miso_s;
wire sys_cpu_clk;
wire clk_0;
wire clk_1;
wire gt_ref_clk_1;
@ -175,6 +183,10 @@ module system_top (
wire tdd_sync_i;
wire tdd_sync_o;
wire tdd_sync_t;
wire rf_peak_det_n;
wire rf_peak_det_enb;
wire rf_peak_rst_1;
wire rf_peak_rst_0;
// assignments
@ -236,23 +248,40 @@ module system_top (
.dio_o (gpio_i[20:0]),
.dio_p (gpio_bd));
// ad9361 input protection
assign gpio_rf2 = rf_peak_rst;
assign rf_peak_det_n = gpio_rf4;
assign rf_peak_det_enb = ~(rf_peak_det_n_d & rf_peak_det_n);
assign rf_peak_rst_1 = ~rf_peak_det_enb_d & rf_peak_det_enb;
assign rf_peak_rst_0 = rf_peak_det_enb_d & ~rf_peak_det_enb;
always @(posedge sys_cpu_clk) begin
rf_peak_det_n_d <= rf_peak_det_n;
rf_peak_det_enb_d <= rf_peak_det_enb;
if (rf_peak_rst_1 == 1'b1) begin
rf_peak_rst_enb <= 1'b1;
end else if (rf_peak_rst_0 == 1'b1) begin
rf_peak_rst_enb <= 1'b0;
end
rf_peak_rst = ~rf_peak_rst & rf_peak_rst_enb;
end
// ad9361 gpio - 63-32
assign gpio_i[63:62] = gpio_o[63:62];
assign gpio_i[50:47] = gpio_o[50:47];
ad_iobuf #(.DATA_WIDTH(26)) i_iobuf (
.dio_t ({gpio_t[61:51], gpio_t[46:32]}),
.dio_i ({gpio_o[61:51], gpio_o[46:32]}),
.dio_o ({gpio_i[61:51], gpio_i[46:32]}),
.dio_p ({ gpio_rf4, // 61:61
ad9517_pdn, // 60:60
ad_iobuf #(.DATA_WIDTH(24)) i_iobuf (
.dio_t ({gpio_t[60:55], gpio_t[53:51], gpio_t[46:32]}),
.dio_i ({gpio_o[60:55], gpio_o[53:51], gpio_o[46:32]}),
.dio_o ({gpio_i[60:55], gpio_i[53:51], gpio_i[46:32]}),
.dio_p ({ ad9517_pdn, // 60:60
ad9517_ref_sel, // 59:59
ad9517_ld, // 58:58
ad9517_status, // 57:57
gpio_rf0, // 56:56
gpio_rf1, // 55:55
gpio_rf2, // 54:54
gpio_rf3, // 53:53
gpio_rfpwr_enable, // 52:52
gpio_clksel, // 51:51
@ -361,6 +390,7 @@ module system_top (
.spi1_sdi_i (1'b0),
.spi1_sdo_i (1'b0),
.spi1_sdo_o (),
.sys_cpu_clk_out (sys_cpu_clk),
.tdd_sync_i (tdd_sync_i),
.tdd_sync_o (tdd_sync_o),
.tdd_sync_t (tdd_sync_t),