// Implements GPIO pins from the PS/EMIO // Works with 7010 (24 pins) or 7020 (48 pins) and // either single-ended or differential IO module pgpio(/*AUTOARG*/ // Outputs ps_gpio_i, // Inouts gpio_p, gpio_n, // Inputs ps_gpio_o, ps_gpio_t ); parameter NGPIO = 24; // 12 or 24 parameter NPS = 64; // signals for PS parameter DIFF = 0; // 0= single ended // 1= differential inout [NGPIO-1:0] gpio_p; inout [NGPIO-1:0] gpio_n; output [NPS-1:0] ps_gpio_i; input [NPS-1:0] ps_gpio_o; input [NPS-1:0] ps_gpio_t; genvar m; generate if( DIFF == 1 ) begin: gpio_diff IOBUFDS #( .DIFF_TERM("TRUE"), .IBUF_LOW_PWR("TRUE"), .IOSTANDARD("LVDS_25"), .SLEW("FAST") ) i_iodiff [NGPIO-1:0] ( .O(ps_gpio_i), // Buffer output .IO(gpio_p), // Diff_p inout (connect directly to top-level port) .IOB(gpio_n), // Diff_n inout (connect directly to top-level port) .I(ps_gpio_o), // Buffer input .T(ps_gpio_t) // 3-state enable input, high=input, low=output ); end else begin: gpio_cmos // single-ended wire [NGPIO-1:0] gpio_i_n, gpio_i_p; wire [NGPIO-1:0] gpio_o_n, gpio_o_p; wire [NGPIO-1:0] gpio_t_n, gpio_t_p; // Map P/N pins to single-ended signals for(m=0; m