2014-12-14 17:18:53 -05:00
|
|
|
module erx (/*AUTOARG*/
|
|
|
|
// Outputs
|
2015-11-02 16:10:05 -05:00
|
|
|
rx_active, rxo_wr_wait_p, rxo_wr_wait_n, rxo_rd_wait_p,
|
|
|
|
rxo_rd_wait_n, rxwr_access, rxwr_packet, rxrd_access, rxrd_packet,
|
2015-11-06 16:51:57 -05:00
|
|
|
rxrr_access, rxrr_packet, erx_cfg_wait, rx_lclk_div4, erx_nreset,
|
2015-11-29 12:20:17 -05:00
|
|
|
mailbox_irq,
|
2014-12-14 17:18:53 -05:00
|
|
|
// Inputs
|
2015-11-06 16:51:57 -05:00
|
|
|
soft_reset, sys_nreset, sys_clk, tx_active, rxi_lclk_p, rxi_lclk_n,
|
2015-10-07 19:12:57 -04:00
|
|
|
rxi_frame_p, rxi_frame_n, rxi_data_p, rxi_data_n, rxwr_wait,
|
|
|
|
rxrd_wait, rxrr_wait, erx_cfg_access, erx_cfg_packet
|
2014-12-14 17:18:53 -05:00
|
|
|
);
|
|
|
|
|
2015-09-14 22:03:22 -04:00
|
|
|
parameter AW = 32;
|
|
|
|
parameter DW = 32;
|
|
|
|
parameter PW = 104;
|
|
|
|
parameter RFAW = 6;
|
|
|
|
parameter ID = 12'h800;
|
|
|
|
parameter IOSTD_ELINK = "LVDS_25";
|
2016-08-17 15:30:38 +01:00
|
|
|
parameter ETYPE = 1;
|
|
|
|
parameter TARGET = "GENERIC";
|
2015-05-01 17:58:16 -04:00
|
|
|
|
2015-10-07 19:12:57 -04:00
|
|
|
//Synched resets, clock
|
2015-10-08 10:34:59 -04:00
|
|
|
input soft_reset; // sw driven reset
|
2015-11-06 16:51:57 -05:00
|
|
|
input sys_nreset; // async reset
|
2015-10-08 10:34:59 -04:00
|
|
|
input sys_clk; // system clock for fifo/clocks
|
|
|
|
input tx_active; // holds rx in check until tx has booted
|
2015-11-02 16:10:05 -05:00
|
|
|
output rx_active; // indicates RX and TX are active
|
2015-05-10 23:38:08 -04:00
|
|
|
|
2015-04-23 18:04:39 -04:00
|
|
|
//FROM IO Pins
|
2015-05-13 23:29:18 -04:00
|
|
|
input rxi_lclk_p, rxi_lclk_n; // rx clock input
|
|
|
|
input rxi_frame_p, rxi_frame_n; // rx frame signal
|
|
|
|
input [7:0] rxi_data_p, rxi_data_n; // rx data
|
|
|
|
output rxo_wr_wait_p,rxo_wr_wait_n; // rx write pushback output
|
|
|
|
output rxo_rd_wait_p,rxo_rd_wait_n; // rx read pushback output
|
2014-12-14 17:18:53 -05:00
|
|
|
|
2015-04-23 18:04:39 -04:00
|
|
|
//Master write
|
|
|
|
output rxwr_access;
|
|
|
|
output [PW-1:0] rxwr_packet;
|
|
|
|
input rxwr_wait;
|
|
|
|
|
|
|
|
//Master read request
|
|
|
|
output rxrd_access;
|
|
|
|
output [PW-1:0] rxrd_packet;
|
|
|
|
input rxrd_wait;
|
|
|
|
|
|
|
|
//Slave read response
|
|
|
|
output rxrr_access;
|
|
|
|
output [PW-1:0] rxrr_packet;
|
|
|
|
input rxrr_wait;
|
2015-04-13 23:35:21 -04:00
|
|
|
|
2015-05-01 17:58:16 -04:00
|
|
|
//Configuration Interface (from ETX)
|
|
|
|
input erx_cfg_access;
|
|
|
|
input [PW-1:0] erx_cfg_packet;
|
|
|
|
output erx_cfg_wait;
|
2015-10-08 10:34:59 -04:00
|
|
|
output rx_lclk_div4;
|
2015-11-06 16:51:57 -05:00
|
|
|
output erx_nreset;
|
2015-11-02 16:10:05 -05:00
|
|
|
|
2015-04-29 11:55:01 -04:00
|
|
|
|
2015-11-29 12:20:17 -05:00
|
|
|
//Mailbox interrupt
|
|
|
|
output mailbox_irq;
|
2015-11-09 13:23:40 -05:00
|
|
|
|
2014-12-14 17:18:53 -05:00
|
|
|
/*AUTOOUTPUT*/
|
|
|
|
/*AUTOINPUT*/
|
2015-04-13 23:35:21 -04:00
|
|
|
|
2014-12-14 17:18:53 -05:00
|
|
|
/*AUTOWIRE*/
|
|
|
|
// Beginning of automatic wires (for undeclared instantiated-module outputs)
|
2015-11-06 16:51:57 -05:00
|
|
|
wire erx_io_nreset; // From erx_clocks of erx_clocks.v
|
2015-10-07 20:37:49 -04:00
|
|
|
wire [44:0] idelay_value; // From erx_core of erx_core.v
|
2015-10-07 19:12:57 -04:00
|
|
|
wire load_taps; // From erx_core of erx_core.v
|
2015-05-13 23:29:18 -04:00
|
|
|
wire rx_access; // From erx_io of erx_io.v
|
|
|
|
wire rx_burst; // From erx_io of erx_io.v
|
2015-10-07 19:12:57 -04:00
|
|
|
wire rx_clkin; // From erx_io of erx_io.v
|
|
|
|
wire rx_lclk; // From erx_clocks of erx_clocks.v
|
2015-05-13 23:29:18 -04:00
|
|
|
wire [PW-1:0] rx_packet; // From erx_io of erx_io.v
|
2015-05-10 23:38:08 -04:00
|
|
|
wire rx_rd_wait; // From erx_core of erx_core.v
|
|
|
|
wire rx_wr_wait; // From erx_core of erx_core.v
|
|
|
|
wire rxrd_fifo_access; // From erx_core of erx_core.v
|
|
|
|
wire [PW-1:0] rxrd_fifo_packet; // From erx_core of erx_core.v
|
|
|
|
wire rxrd_fifo_wait; // From erx_fifo of erx_fifo.v
|
|
|
|
wire rxrr_fifo_access; // From erx_core of erx_core.v
|
|
|
|
wire [PW-1:0] rxrr_fifo_packet; // From erx_core of erx_core.v
|
|
|
|
wire rxrr_fifo_wait; // From erx_fifo of erx_fifo.v
|
|
|
|
wire rxwr_fifo_access; // From erx_core of erx_core.v
|
|
|
|
wire [PW-1:0] rxwr_fifo_packet; // From erx_core of erx_core.v
|
|
|
|
wire rxwr_fifo_wait; // From erx_fifo of erx_fifo.v
|
2014-12-14 17:18:53 -05:00
|
|
|
// End of automatics
|
2014-12-14 22:24:16 -05:00
|
|
|
|
2015-10-07 19:12:57 -04:00
|
|
|
/***********************************************************/
|
|
|
|
/*CLOCK/RESET */
|
|
|
|
/***********************************************************/
|
|
|
|
erx_clocks erx_clocks(/*AUTOINST*/
|
|
|
|
// Outputs
|
|
|
|
.rx_lclk (rx_lclk),
|
|
|
|
.rx_lclk_div4 (rx_lclk_div4),
|
2015-11-02 16:10:05 -05:00
|
|
|
.rx_active (rx_active),
|
2015-11-06 16:51:57 -05:00
|
|
|
.erx_nreset (erx_nreset),
|
|
|
|
.erx_io_nreset (erx_io_nreset),
|
2015-10-07 19:12:57 -04:00
|
|
|
// Inputs
|
2015-11-06 16:51:57 -05:00
|
|
|
.sys_nreset (sys_nreset),
|
2015-10-07 19:12:57 -04:00
|
|
|
.soft_reset (soft_reset),
|
2015-10-08 10:34:59 -04:00
|
|
|
.tx_active (tx_active),
|
2015-10-07 19:12:57 -04:00
|
|
|
.sys_clk (sys_clk),
|
|
|
|
.rx_clkin (rx_clkin));
|
|
|
|
|
2015-05-01 17:58:16 -04:00
|
|
|
/***********************************************************/
|
|
|
|
/*RECEIVER I/O LOGIC */
|
|
|
|
/***********************************************************/
|
2015-11-06 22:51:09 -05:00
|
|
|
erx_io #(.ETYPE(ETYPE))
|
|
|
|
erx_io (
|
2015-05-14 22:31:42 -04:00
|
|
|
/*AUTOINST*/
|
2015-11-06 22:51:09 -05:00
|
|
|
// Outputs
|
|
|
|
.rx_clkin (rx_clkin),
|
|
|
|
.rxo_wr_wait_p (rxo_wr_wait_p),
|
|
|
|
.rxo_wr_wait_n (rxo_wr_wait_n),
|
|
|
|
.rxo_rd_wait_p (rxo_rd_wait_p),
|
|
|
|
.rxo_rd_wait_n (rxo_rd_wait_n),
|
|
|
|
.rx_access (rx_access),
|
|
|
|
.rx_burst (rx_burst),
|
|
|
|
.rx_packet (rx_packet[PW-1:0]),
|
|
|
|
// Inputs
|
|
|
|
.erx_io_nreset (erx_io_nreset),
|
|
|
|
.rx_lclk (rx_lclk),
|
|
|
|
.rx_lclk_div4 (rx_lclk_div4),
|
|
|
|
.idelay_value (idelay_value[44:0]),
|
|
|
|
.load_taps (load_taps),
|
|
|
|
.rxi_lclk_p (rxi_lclk_p),
|
|
|
|
.rxi_lclk_n (rxi_lclk_n),
|
|
|
|
.rxi_frame_p (rxi_frame_p),
|
|
|
|
.rxi_frame_n (rxi_frame_n),
|
|
|
|
.rxi_data_p (rxi_data_p[7:0]),
|
|
|
|
.rxi_data_n (rxi_data_n[7:0]),
|
|
|
|
.rx_wr_wait (rx_wr_wait),
|
|
|
|
.rx_rd_wait (rx_rd_wait));
|
2015-05-13 23:29:18 -04:00
|
|
|
|
2015-05-01 17:58:16 -04:00
|
|
|
/**************************************************************/
|
2015-05-10 23:38:08 -04:00
|
|
|
/*ELINK CORE LOGIC */
|
2015-05-01 17:58:16 -04:00
|
|
|
/**************************************************************/
|
2015-05-13 23:29:18 -04:00
|
|
|
/*erx_core AUTO_TEMPLATE ( .rx_packet (rx_packet[PW-1:0]),
|
|
|
|
.rx_access (rx_access),
|
2015-05-10 23:38:08 -04:00
|
|
|
.erx_cfg_access (erx_cfg_access),
|
|
|
|
.erx_cfg_packet (erx_cfg_packet[PW-1:0]),
|
|
|
|
.erx_cfg_wait (erx_cfg_wait),
|
|
|
|
.rx_rd_wait (rx_rd_wait),
|
|
|
|
.rx_wr_wait (rx_wr_wait),
|
|
|
|
.\(.*\)_packet (\1_fifo_packet[PW-1:0]),
|
|
|
|
.\(.*\)_access (\1_fifo_access),
|
|
|
|
.\(.*\)_wait (\1_fifo_wait),
|
2015-05-01 17:58:16 -04:00
|
|
|
);
|
|
|
|
*/
|
2016-08-17 15:30:38 +01:00
|
|
|
|
|
|
|
erx_core #(.TARGET(TARGET), .ID(ID))
|
|
|
|
erx_core ( .clk (rx_lclk_div4),
|
2015-11-06 16:51:57 -05:00
|
|
|
.nreset (erx_nreset),
|
2015-05-13 23:29:18 -04:00
|
|
|
/*AUTOINST*/
|
2015-05-03 23:29:32 -04:00
|
|
|
// Outputs
|
2015-05-10 23:38:08 -04:00
|
|
|
.rx_rd_wait (rx_rd_wait), // Templated
|
|
|
|
.rx_wr_wait (rx_wr_wait), // Templated
|
2015-10-07 20:37:49 -04:00
|
|
|
.idelay_value (idelay_value[44:0]),
|
2015-10-07 19:12:57 -04:00
|
|
|
.load_taps (load_taps),
|
2015-05-10 23:38:08 -04:00
|
|
|
.rxrd_access (rxrd_fifo_access), // Templated
|
|
|
|
.rxrd_packet (rxrd_fifo_packet[PW-1:0]), // Templated
|
|
|
|
.rxrr_access (rxrr_fifo_access), // Templated
|
|
|
|
.rxrr_packet (rxrr_fifo_packet[PW-1:0]), // Templated
|
|
|
|
.rxwr_access (rxwr_fifo_access), // Templated
|
|
|
|
.rxwr_packet (rxwr_fifo_packet[PW-1:0]), // Templated
|
|
|
|
.erx_cfg_wait (erx_cfg_wait), // Templated
|
2015-11-29 12:20:17 -05:00
|
|
|
.mailbox_irq (mailbox_irq),
|
2015-05-03 23:29:32 -04:00
|
|
|
// Inputs
|
2015-05-13 23:29:18 -04:00
|
|
|
.rx_packet (rx_packet[PW-1:0]), // Templated
|
|
|
|
.rx_access (rx_access), // Templated
|
|
|
|
.rx_burst (rx_burst),
|
2015-05-10 23:38:08 -04:00
|
|
|
.rxrd_wait (rxrd_fifo_wait), // Templated
|
|
|
|
.rxrr_wait (rxrr_fifo_wait), // Templated
|
|
|
|
.rxwr_wait (rxwr_fifo_wait), // Templated
|
|
|
|
.erx_cfg_access (erx_cfg_access), // Templated
|
|
|
|
.erx_cfg_packet (erx_cfg_packet[PW-1:0])); // Templated
|
2015-05-01 17:58:16 -04:00
|
|
|
|
|
|
|
/************************************************************/
|
2015-05-10 23:38:08 -04:00
|
|
|
/*FIFOs */
|
|
|
|
/************************************************************/
|
2016-08-17 15:30:38 +01:00
|
|
|
erx_fifo #(.TARGET(TARGET))
|
|
|
|
erx_fifo (
|
2015-05-10 23:38:08 -04:00
|
|
|
/*AUTOINST*/
|
2015-05-01 17:58:16 -04:00
|
|
|
// Outputs
|
2015-05-10 23:38:08 -04:00
|
|
|
.rxwr_access (rxwr_access),
|
|
|
|
.rxwr_packet (rxwr_packet[PW-1:0]),
|
|
|
|
.rxrd_access (rxrd_access),
|
|
|
|
.rxrd_packet (rxrd_packet[PW-1:0]),
|
|
|
|
.rxrr_access (rxrr_access),
|
|
|
|
.rxrr_packet (rxrr_packet[PW-1:0]),
|
|
|
|
.rxrd_fifo_wait (rxrd_fifo_wait),
|
|
|
|
.rxrr_fifo_wait (rxrr_fifo_wait),
|
|
|
|
.rxwr_fifo_wait (rxwr_fifo_wait),
|
|
|
|
// Inputs
|
|
|
|
.sys_clk (sys_clk),
|
2015-11-09 13:23:40 -05:00
|
|
|
.rx_lclk_div4 (rx_lclk_div4),
|
2015-11-13 16:28:40 -05:00
|
|
|
.erx_nreset (erx_nreset),
|
2015-05-10 23:38:08 -04:00
|
|
|
.rxwr_wait (rxwr_wait),
|
|
|
|
.rxrd_wait (rxrd_wait),
|
|
|
|
.rxrr_wait (rxrr_wait),
|
2015-05-01 17:58:16 -04:00
|
|
|
.rxrd_fifo_access(rxrd_fifo_access),
|
|
|
|
.rxrd_fifo_packet(rxrd_fifo_packet[PW-1:0]),
|
|
|
|
.rxrr_fifo_access(rxrr_fifo_access),
|
|
|
|
.rxrr_fifo_packet(rxrr_fifo_packet[PW-1:0]),
|
2015-05-10 23:38:08 -04:00
|
|
|
.rxwr_fifo_access(rxwr_fifo_access),
|
|
|
|
.rxwr_fifo_packet(rxwr_fifo_packet[PW-1:0]));
|
2014-12-14 17:18:53 -05:00
|
|
|
|
2015-03-25 19:25:12 -04:00
|
|
|
endmodule // erx
|
2014-12-14 17:18:53 -05:00
|
|
|
// Local Variables:
|
2015-05-14 22:31:42 -04:00
|
|
|
// verilog-library-directories:(".")
|
2014-12-14 17:18:53 -05:00
|
|
|
// End:
|
|
|
|
|
2015-04-11 00:04:18 -04:00
|
|
|
|
2014-12-14 17:18:53 -05:00
|
|
|
|