2014-12-14 17:18:53 -05:00
|
|
|
module erx (/*AUTOARG*/
|
|
|
|
// Outputs
|
2015-04-13 23:35:21 -04:00
|
|
|
ecfg_rx_debug, ecfg_rx_datain, mi_dout, emwr_access, emwr_write,
|
|
|
|
emwr_datamode, emwr_ctrlmode, emwr_dstaddr, emwr_data,
|
|
|
|
emwr_srcaddr, emrq_access, emrq_write, emrq_datamode,
|
|
|
|
emrq_ctrlmode, emrq_dstaddr, emrq_data, emrq_srcaddr, emrr_access,
|
|
|
|
emrr_data, rxo_wr_wait_p, rxo_wr_wait_n, rxo_rd_wait_p,
|
|
|
|
rxo_rd_wait_n,
|
2014-12-14 17:18:53 -05:00
|
|
|
// Inputs
|
2015-04-11 00:04:18 -04:00
|
|
|
reset, s_axi_aclk, m_axi_aclk, ecfg_rx_enable, ecfg_rx_mmu_enable,
|
|
|
|
ecfg_rx_gpio_enable, ecfg_dataout, mi_clk, mi_en, mi_we, mi_addr,
|
2015-04-13 23:35:21 -04:00
|
|
|
mi_din, emwr_rd_en, emrq_rd_en, emrr_rd_en, rxi_lclk_p, rxi_lclk_n,
|
|
|
|
rxi_frame_p, rxi_frame_n, rxi_data_p, rxi_data_n
|
2014-12-14 17:18:53 -05:00
|
|
|
);
|
|
|
|
|
2014-12-14 22:24:16 -05:00
|
|
|
parameter AW = 32;
|
|
|
|
parameter DW = 32;
|
2015-03-24 20:44:03 -04:00
|
|
|
parameter RFAW = 13;
|
|
|
|
parameter MW = 44; //width of MMU lookup table
|
|
|
|
|
2014-12-14 17:18:53 -05:00
|
|
|
|
|
|
|
//Clocks and reset
|
|
|
|
input reset;
|
2015-03-25 19:25:12 -04:00
|
|
|
input s_axi_aclk; //clock for host read response fifo
|
|
|
|
input m_axi_aclk; //clock for read request and write fifo
|
2014-12-14 17:18:53 -05:00
|
|
|
|
2015-03-25 19:25:12 -04:00
|
|
|
//Configuration signals
|
2015-04-11 00:04:18 -04:00
|
|
|
input ecfg_rx_enable; //receiver enable
|
|
|
|
input ecfg_rx_mmu_enable; //enable mmu
|
|
|
|
output [15:0] ecfg_rx_debug; //various debug signals
|
|
|
|
input ecfg_rx_gpio_enable;//mode for sampling elink pins directly
|
|
|
|
input [1:0] ecfg_dataout; //data for pins in direct mode
|
|
|
|
output [8:0] ecfg_rx_datain; //samples elink pins
|
2014-12-14 17:18:53 -05:00
|
|
|
|
2015-03-25 19:25:12 -04:00
|
|
|
//MMU table configuration interface
|
2015-04-13 23:35:21 -04:00
|
|
|
input mi_clk; //source synchronous clock
|
|
|
|
input mi_en; //memory access
|
|
|
|
input mi_we; //byte wise write enable
|
|
|
|
input [15:0] mi_addr; //table address
|
|
|
|
input [31:0] mi_din; //input data
|
|
|
|
output [31:0] mi_dout; //read back data
|
2015-03-25 19:25:12 -04:00
|
|
|
|
2014-12-14 17:18:53 -05:00
|
|
|
//Writes (to axi master)
|
2015-04-13 23:35:21 -04:00
|
|
|
output emwr_access;
|
|
|
|
output emwr_write;
|
|
|
|
output [1:0] emwr_datamode;
|
|
|
|
output [3:0] emwr_ctrlmode;
|
|
|
|
output [31:0] emwr_dstaddr;
|
|
|
|
output [31:0] emwr_data;
|
|
|
|
output [31:0] emwr_srcaddr;
|
|
|
|
input emwr_rd_en;
|
2014-12-14 17:18:53 -05:00
|
|
|
|
|
|
|
//Read requests (to axi master)
|
2015-04-13 23:35:21 -04:00
|
|
|
output emrq_access;
|
|
|
|
output emrq_write;
|
|
|
|
output [1:0] emrq_datamode;
|
|
|
|
output [3:0] emrq_ctrlmode;
|
|
|
|
output [31:0] emrq_dstaddr;
|
|
|
|
output [31:0] emrq_data;
|
|
|
|
output [31:0] emrq_srcaddr;
|
|
|
|
input emrq_rd_en;
|
2014-12-14 17:18:53 -05:00
|
|
|
|
2015-04-13 23:35:21 -04:00
|
|
|
//Read responses (to slave, only 32bit data needed)
|
|
|
|
output emrr_access;
|
|
|
|
output [31:0] emrr_data;
|
|
|
|
input emrr_rd_en;
|
|
|
|
|
2015-03-25 19:25:12 -04:00
|
|
|
//IO Pins
|
2015-04-13 23:35:21 -04:00
|
|
|
input rxi_lclk_p, rxi_lclk_n; //link rx clock input
|
|
|
|
input rxi_frame_p, rxi_frame_n; //link rx frame signal
|
|
|
|
input [7:0] rxi_data_p, rxi_data_n; //link rx data
|
|
|
|
output rxo_wr_wait_p,rxo_wr_wait_n; //link rx write pushback output
|
|
|
|
output rxo_rd_wait_p,rxo_rd_wait_n; //link rx read pushback output
|
2014-12-14 17:18:53 -05:00
|
|
|
|
2015-04-13 23:35:21 -04: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)
|
|
|
|
wire emesh_rx_access; // From erx_protocol of erx_protocol.v
|
|
|
|
wire [3:0] emesh_rx_ctrlmode; // From erx_protocol of erx_protocol.v
|
|
|
|
wire [31:0] emesh_rx_data; // From erx_protocol of erx_protocol.v
|
|
|
|
wire [1:0] emesh_rx_datamode; // From erx_protocol of erx_protocol.v
|
2015-03-25 19:25:12 -04:00
|
|
|
wire [31:0] emesh_rx_dstaddr; // From erx_protocol of erx_protocol.v
|
2014-12-14 17:18:53 -05:00
|
|
|
wire emesh_rx_rd_wait; // From erx_disty of erx_disty.v
|
|
|
|
wire [31:0] emesh_rx_srcaddr; // From erx_protocol of erx_protocol.v
|
|
|
|
wire emesh_rx_wr_wait; // From erx_disty of erx_disty.v
|
|
|
|
wire emesh_rx_write; // From erx_protocol of erx_protocol.v
|
2015-03-25 19:25:12 -04:00
|
|
|
wire emmu_access; // From emmu of emmu.v
|
|
|
|
wire [3:0] emmu_ctrlmode; // From emmu of emmu.v
|
|
|
|
wire [DW-1:0] emmu_data; // From emmu of emmu.v
|
|
|
|
wire [1:0] emmu_datamode; // From emmu of emmu.v
|
|
|
|
wire [63:0] emmu_dstaddr; // From emmu of emmu.v
|
|
|
|
wire [AW-1:0] emmu_srcaddr; // From emmu of emmu.v
|
|
|
|
wire emmu_write; // From emmu of emmu.v
|
2015-04-13 23:35:21 -04:00
|
|
|
wire emrq_full; // From m_rq_fifo of fifo_async_emesh.v
|
|
|
|
wire emrq_progfull; // From m_rq_fifo of fifo_async_emesh.v
|
2014-12-14 17:18:53 -05:00
|
|
|
wire emrq_wr_en; // From erx_disty of erx_disty.v
|
2015-04-13 23:35:21 -04:00
|
|
|
wire emrr_full; // From s_rr_fifo of fifo_async_emesh.v
|
|
|
|
wire emrr_progfull; // From s_rr_fifo of fifo_async_emesh.v
|
2014-12-14 17:18:53 -05:00
|
|
|
wire emrr_wr_en; // From erx_disty of erx_disty.v
|
2015-04-13 23:35:21 -04:00
|
|
|
wire emwr_full; // From m_wr_fifo of fifo_async_emesh.v
|
|
|
|
wire emwr_progfull; // From m_wr_fifo of fifo_async_emesh.v
|
2014-12-14 17:18:53 -05:00
|
|
|
wire emwr_wr_en; // From erx_disty of erx_disty.v
|
2015-04-13 23:35:21 -04:00
|
|
|
wire [3:0] erx_ctrlmode; // From erx_disty of erx_disty.v
|
|
|
|
wire [31:0] erx_data; // From erx_disty of erx_disty.v
|
|
|
|
wire [1:0] erx_datamode; // From erx_disty of erx_disty.v
|
|
|
|
wire [31:0] erx_dstaddr; // From erx_disty of erx_disty.v
|
|
|
|
wire [31:0] erx_srcaddr; // From erx_disty of erx_disty.v
|
|
|
|
wire erx_write; // From erx_disty of erx_disty.v
|
2015-03-24 20:44:03 -04:00
|
|
|
wire [63:0] rx_data_par; // From erx_io of erx_io.v
|
|
|
|
wire [7:0] rx_frame_par; // From erx_io of erx_io.v
|
|
|
|
wire rx_lclk_div4; // From erx_io of erx_io.v
|
2014-12-14 17:18:53 -05:00
|
|
|
wire rx_rd_wait; // From erx_protocol of erx_protocol.v
|
|
|
|
wire rx_wr_wait; // From erx_protocol of erx_protocol.v
|
|
|
|
// End of automatics
|
2014-12-14 22:24:16 -05:00
|
|
|
|
|
|
|
//regs
|
2015-03-25 19:25:12 -04:00
|
|
|
reg [15:0] ecfg_rx_debug;
|
2015-04-13 23:35:21 -04:00
|
|
|
|
2014-12-14 17:18:53 -05:00
|
|
|
/************************************************************/
|
|
|
|
/*FIFOs */
|
2015-03-25 19:25:12 -04:00
|
|
|
/*(for AXI 1. read request, 2. write, and 3. read response) */
|
2014-12-14 17:18:53 -05:00
|
|
|
/************************************************************/
|
2015-03-25 19:25:12 -04:00
|
|
|
|
2015-04-13 23:35:21 -04:00
|
|
|
/*fifo_async_emesh AUTO_TEMPLATE (
|
|
|
|
//outputs
|
|
|
|
.emesh_\(.*\)_out (em@"(substring vl-cell-name 2 4)"_\1[]),
|
|
|
|
|
|
|
|
.fifo_\(.*\) (em@"(substring vl-cell-name 2 4)"_\1),
|
|
|
|
//inputs
|
|
|
|
.rd_clk (@"(substring vl-cell-name 0 1)"_axi_aclk),
|
|
|
|
.wr_clk (rx_lclk_div4),
|
|
|
|
.emesh_\(.*\)_in (erx_\1[]),
|
|
|
|
.emesh_access_in (em@"(substring vl-cell-name 2 4)"_wr_en),
|
|
|
|
.fifo_read (em@"(substring vl-cell-name 2 4)"_rd_en),
|
2014-12-14 17:18:53 -05:00
|
|
|
);
|
|
|
|
*/
|
|
|
|
|
2015-03-25 19:25:12 -04:00
|
|
|
//Read request fifo (from Epiphany)
|
2015-04-13 23:35:21 -04:00
|
|
|
fifo_async_emesh m_rq_fifo(/*AUTOINST*/
|
|
|
|
// Outputs
|
|
|
|
.emesh_access_out (emrq_access), // Templated
|
|
|
|
.emesh_write_out (emrq_write), // Templated
|
|
|
|
.emesh_datamode_out(emrq_datamode[1:0]), // Templated
|
|
|
|
.emesh_ctrlmode_out(emrq_ctrlmode[3:0]), // Templated
|
|
|
|
.emesh_dstaddr_out(emrq_dstaddr[31:0]), // Templated
|
|
|
|
.emesh_data_out (emrq_data[31:0]), // Templated
|
|
|
|
.emesh_srcaddr_out(emrq_srcaddr[31:0]), // Templated
|
|
|
|
.fifo_full (emrq_full), // Templated
|
|
|
|
.fifo_progfull (emrq_progfull), // Templated
|
|
|
|
// Inputs
|
|
|
|
.rd_clk (m_axi_aclk), // Templated
|
|
|
|
.wr_clk (rx_lclk_div4), // Templated
|
|
|
|
.reset (reset),
|
|
|
|
.emesh_access_in (emrq_wr_en), // Templated
|
|
|
|
.emesh_write_in (erx_write), // Templated
|
|
|
|
.emesh_datamode_in(erx_datamode[1:0]), // Templated
|
|
|
|
.emesh_ctrlmode_in(erx_ctrlmode[3:0]), // Templated
|
|
|
|
.emesh_dstaddr_in (erx_dstaddr[31:0]), // Templated
|
|
|
|
.emesh_data_in (erx_data[31:0]), // Templated
|
|
|
|
.emesh_srcaddr_in (erx_srcaddr[31:0]), // Templated
|
|
|
|
.fifo_read (emrq_rd_en)); // Templated
|
2014-12-14 17:18:53 -05:00
|
|
|
|
2015-03-25 19:25:12 -04:00
|
|
|
//Write fifo (from Epiphany)
|
2015-04-13 23:35:21 -04:00
|
|
|
fifo_async_emesh m_wr_fifo(/*AUTOINST*/
|
|
|
|
// Outputs
|
|
|
|
.emesh_access_out (emwr_access), // Templated
|
|
|
|
.emesh_write_out (emwr_write), // Templated
|
|
|
|
.emesh_datamode_out(emwr_datamode[1:0]), // Templated
|
|
|
|
.emesh_ctrlmode_out(emwr_ctrlmode[3:0]), // Templated
|
|
|
|
.emesh_dstaddr_out(emwr_dstaddr[31:0]), // Templated
|
|
|
|
.emesh_data_out (emwr_data[31:0]), // Templated
|
|
|
|
.emesh_srcaddr_out(emwr_srcaddr[31:0]), // Templated
|
|
|
|
.fifo_full (emwr_full), // Templated
|
|
|
|
.fifo_progfull (emwr_progfull), // Templated
|
|
|
|
// Inputs
|
|
|
|
.rd_clk (m_axi_aclk), // Templated
|
|
|
|
.wr_clk (rx_lclk_div4), // Templated
|
|
|
|
.reset (reset),
|
|
|
|
.emesh_access_in (emwr_wr_en), // Templated
|
|
|
|
.emesh_write_in (erx_write), // Templated
|
|
|
|
.emesh_datamode_in(erx_datamode[1:0]), // Templated
|
|
|
|
.emesh_ctrlmode_in(erx_ctrlmode[3:0]), // Templated
|
|
|
|
.emesh_dstaddr_in (erx_dstaddr[31:0]), // Templated
|
|
|
|
.emesh_data_in (erx_data[31:0]), // Templated
|
|
|
|
.emesh_srcaddr_in (erx_srcaddr[31:0]), // Templated
|
|
|
|
.fifo_read (emwr_rd_en)); // Templated
|
2014-12-14 17:18:53 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
2015-03-25 19:25:12 -04:00
|
|
|
//Read response fifo (for host)
|
2015-04-13 23:35:21 -04:00
|
|
|
fifo_async_emesh s_rr_fifo(
|
|
|
|
.emesh_access_out (),
|
|
|
|
.emesh_write_out (),
|
|
|
|
.emesh_datamode_out(),
|
|
|
|
.emesh_ctrlmode_out(),
|
|
|
|
.emesh_dstaddr_out(),
|
|
|
|
.emesh_srcaddr_out(),
|
|
|
|
/*AUTOINST*/
|
|
|
|
// Outputs
|
|
|
|
.emesh_data_out (emrr_data[31:0]), // Templated
|
|
|
|
.fifo_full (emrr_full), // Templated
|
|
|
|
.fifo_progfull (emrr_progfull), // Templated
|
|
|
|
// Inputs
|
|
|
|
.rd_clk (s_axi_aclk), // Templated
|
|
|
|
.wr_clk (rx_lclk_div4), // Templated
|
|
|
|
.reset (reset),
|
|
|
|
.emesh_access_in (emrr_wr_en), // Templated
|
|
|
|
.emesh_write_in (erx_write), // Templated
|
|
|
|
.emesh_datamode_in(erx_datamode[1:0]), // Templated
|
|
|
|
.emesh_ctrlmode_in(erx_ctrlmode[3:0]), // Templated
|
|
|
|
.emesh_dstaddr_in (erx_dstaddr[31:0]), // Templated
|
|
|
|
.emesh_data_in (erx_data[31:0]), // Templated
|
|
|
|
.emesh_srcaddr_in (erx_srcaddr[31:0]), // Templated
|
|
|
|
.fifo_read (emrr_rd_en)); // Templated
|
2014-12-14 17:18:53 -05:00
|
|
|
|
|
|
|
|
|
|
|
/************************************************************/
|
|
|
|
/*ELINK RECEIVE DISTRIBUTOR ("DEMUX") */
|
2015-03-25 19:25:12 -04:00
|
|
|
/*(figures out who RX transaction belongs to) */
|
2014-12-14 17:18:53 -05:00
|
|
|
/********************1***************************************/
|
|
|
|
/*erx_disty AUTO_TEMPLATE (
|
|
|
|
//Inputs
|
|
|
|
.emesh_rd_wait (emesh_rx_rd_wait),
|
|
|
|
.emesh_wr_wait (emesh_rx_wr_wait),
|
2015-04-11 00:04:18 -04:00
|
|
|
.mmu_en (ecfg_rx_mmu_enable),
|
2015-03-24 20:44:03 -04:00
|
|
|
.clk (rx_lclk_div4),
|
2015-04-13 23:35:21 -04:00
|
|
|
);
|
2014-12-14 17:18:53 -05:00
|
|
|
*/
|
2015-04-13 23:35:21 -04:00
|
|
|
|
2014-12-14 17:18:53 -05:00
|
|
|
erx_disty erx_disty (
|
2015-03-24 20:44:03 -04:00
|
|
|
/*AUTOINST*/
|
2014-12-14 17:18:53 -05:00
|
|
|
// Outputs
|
|
|
|
.emesh_rd_wait (emesh_rx_rd_wait), // Templated
|
|
|
|
.emesh_wr_wait (emesh_rx_wr_wait), // Templated
|
|
|
|
.emwr_wr_en (emwr_wr_en),
|
|
|
|
.emrq_wr_en (emrq_wr_en),
|
|
|
|
.emrr_wr_en (emrr_wr_en),
|
2015-04-13 23:35:21 -04:00
|
|
|
.erx_write (erx_write),
|
|
|
|
.erx_datamode (erx_datamode[1:0]),
|
|
|
|
.erx_ctrlmode (erx_ctrlmode[3:0]),
|
|
|
|
.erx_dstaddr (erx_dstaddr[31:0]),
|
|
|
|
.erx_srcaddr (erx_srcaddr[31:0]),
|
|
|
|
.erx_data (erx_data[31:0]),
|
2014-12-14 17:18:53 -05:00
|
|
|
// Inputs
|
2015-03-24 20:44:03 -04:00
|
|
|
.clk (rx_lclk_div4), // Templated
|
2015-04-11 00:04:18 -04:00
|
|
|
.mmu_en (ecfg_rx_mmu_enable), // Templated
|
2015-03-25 19:25:12 -04:00
|
|
|
.emmu_access (emmu_access),
|
|
|
|
.emmu_write (emmu_write),
|
|
|
|
.emmu_datamode (emmu_datamode[1:0]),
|
|
|
|
.emmu_ctrlmode (emmu_ctrlmode[3:0]),
|
|
|
|
.emmu_dstaddr (emmu_dstaddr[31:0]),
|
|
|
|
.emmu_srcaddr (emmu_srcaddr[31:0]),
|
|
|
|
.emmu_data (emmu_data[31:0]),
|
2014-12-14 17:18:53 -05:00
|
|
|
.emwr_full (emwr_full),
|
2015-03-25 19:25:12 -04:00
|
|
|
.emwr_progfull (emwr_progfull),
|
2014-12-14 17:18:53 -05:00
|
|
|
.emrq_full (emrq_full),
|
2015-03-25 19:25:12 -04:00
|
|
|
.emrq_progfull (emrq_progfull),
|
2014-12-14 17:18:53 -05:00
|
|
|
.emrr_full (emrr_full),
|
2015-03-25 19:25:12 -04:00
|
|
|
.emrr_progfull (emrr_progfull),
|
2014-12-14 17:18:53 -05:00
|
|
|
.ecfg_rx_enable (ecfg_rx_enable));
|
|
|
|
|
2015-03-24 20:44:03 -04:00
|
|
|
|
2014-12-14 17:18:53 -05:00
|
|
|
/************************************************************/
|
|
|
|
/*ELINK MEMORY MANAGEMENT UNIT */
|
2015-03-25 19:25:12 -04:00
|
|
|
/*(uses lookup table to translate destination address) */
|
2014-12-14 17:18:53 -05:00
|
|
|
/************************************************************/
|
|
|
|
/*emmu AUTO_TEMPLATE (
|
2015-03-25 19:25:12 -04:00
|
|
|
.emmu_\(.*\)_out (emmu_\1[]),
|
|
|
|
//Inputs
|
2014-12-14 17:18:53 -05:00
|
|
|
.emesh_\(.*\)_in (emesh_rx_\1[]),
|
2015-04-11 00:04:18 -04:00
|
|
|
.mmu_en (ecfg_rx_mmu_enable),
|
2015-03-24 20:44:03 -04:00
|
|
|
.clk (rx_lclk_div4),
|
2014-12-14 17:18:53 -05:00
|
|
|
);
|
|
|
|
*/
|
|
|
|
|
2015-03-24 20:44:03 -04:00
|
|
|
emmu emmu (
|
2015-03-25 19:25:12 -04:00
|
|
|
/*AUTOINST*/
|
2014-12-14 17:18:53 -05:00
|
|
|
// Outputs
|
2015-04-11 00:04:18 -04:00
|
|
|
.mi_dout (mi_dout[DW-1:0]),
|
2015-03-25 19:25:12 -04:00
|
|
|
.emmu_access_out (emmu_access), // Templated
|
|
|
|
.emmu_write_out (emmu_write), // Templated
|
|
|
|
.emmu_datamode_out (emmu_datamode[1:0]), // Templated
|
|
|
|
.emmu_ctrlmode_out (emmu_ctrlmode[3:0]), // Templated
|
|
|
|
.emmu_dstaddr_out (emmu_dstaddr[63:0]), // Templated
|
|
|
|
.emmu_srcaddr_out (emmu_srcaddr[AW-1:0]), // Templated
|
|
|
|
.emmu_data_out (emmu_data[DW-1:0]), // Templated
|
2014-12-14 17:18:53 -05:00
|
|
|
// Inputs
|
2015-03-24 20:44:03 -04:00
|
|
|
.clk (rx_lclk_div4), // Templated
|
2015-04-17 10:08:17 -04:00
|
|
|
.reset (reset),
|
2015-04-11 00:04:18 -04:00
|
|
|
.mmu_en (ecfg_rx_mmu_enable), // Templated
|
2015-03-25 19:25:12 -04:00
|
|
|
.mi_clk (mi_clk),
|
|
|
|
.mi_en (mi_en),
|
2015-04-11 00:04:18 -04:00
|
|
|
.mi_we (mi_we),
|
2015-04-14 14:00:23 -04:00
|
|
|
.mi_addr (mi_addr[15:0]),
|
2015-04-11 00:04:18 -04:00
|
|
|
.mi_din (mi_din[DW-1:0]),
|
2014-12-14 17:18:53 -05:00
|
|
|
.emesh_access_in (emesh_rx_access), // Templated
|
|
|
|
.emesh_write_in (emesh_rx_write), // Templated
|
|
|
|
.emesh_datamode_in (emesh_rx_datamode[1:0]), // Templated
|
|
|
|
.emesh_ctrlmode_in (emesh_rx_ctrlmode[3:0]), // Templated
|
|
|
|
.emesh_dstaddr_in (emesh_rx_dstaddr[AW-1:0]), // Templated
|
|
|
|
.emesh_srcaddr_in (emesh_rx_srcaddr[AW-1:0]), // Templated
|
2015-03-25 19:25:12 -04:00
|
|
|
.emesh_data_in (emesh_rx_data[DW-1:0])); // Templated
|
2014-12-14 17:18:53 -05:00
|
|
|
|
|
|
|
|
2015-03-25 19:25:12 -04:00
|
|
|
/**************************************************************/
|
|
|
|
/*ELINK PROTOCOL LOGIC */
|
|
|
|
/*-translates a slowed down elink packet an emesh transaction */
|
|
|
|
/**************************************************************/
|
2014-12-14 17:18:53 -05:00
|
|
|
|
|
|
|
erx_protocol erx_protocol (/*AUTOINST*/
|
|
|
|
// Outputs
|
|
|
|
.rx_rd_wait (rx_rd_wait),
|
|
|
|
.rx_wr_wait (rx_wr_wait),
|
|
|
|
.emesh_rx_access (emesh_rx_access),
|
|
|
|
.emesh_rx_write (emesh_rx_write),
|
|
|
|
.emesh_rx_datamode(emesh_rx_datamode[1:0]),
|
|
|
|
.emesh_rx_ctrlmode(emesh_rx_ctrlmode[3:0]),
|
|
|
|
.emesh_rx_dstaddr (emesh_rx_dstaddr[31:0]),
|
|
|
|
.emesh_rx_srcaddr (emesh_rx_srcaddr[31:0]),
|
|
|
|
.emesh_rx_data (emesh_rx_data[31:0]),
|
|
|
|
// Inputs
|
|
|
|
.reset (reset),
|
2015-03-24 20:44:03 -04:00
|
|
|
.rx_lclk_div4 (rx_lclk_div4),
|
|
|
|
.rx_frame_par (rx_frame_par[7:0]),
|
|
|
|
.rx_data_par (rx_data_par[63:0]),
|
2014-12-14 17:18:53 -05:00
|
|
|
.emesh_rx_rd_wait (emesh_rx_rd_wait),
|
|
|
|
.emesh_rx_wr_wait (emesh_rx_wr_wait));
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************/
|
|
|
|
/*ELINK TRANSMIT I/O LOGIC */
|
|
|
|
/*-parallel data and frame as input */
|
|
|
|
/*-serializes data for I/O */
|
|
|
|
/***********************************************************/
|
|
|
|
|
2015-04-08 13:20:25 -04:00
|
|
|
erx_io erx_io (
|
2014-12-14 17:18:53 -05:00
|
|
|
/*AUTOINST*/
|
|
|
|
// Outputs
|
2015-04-13 23:35:21 -04:00
|
|
|
.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),
|
2015-03-24 20:44:03 -04:00
|
|
|
.rx_lclk_div4 (rx_lclk_div4),
|
|
|
|
.rx_frame_par (rx_frame_par[7:0]),
|
|
|
|
.rx_data_par (rx_data_par[63:0]),
|
2015-04-11 00:04:18 -04:00
|
|
|
.ecfg_rx_datain (ecfg_rx_datain[8:0]),
|
2014-12-14 17:18:53 -05:00
|
|
|
// Inputs
|
2015-04-08 13:20:25 -04:00
|
|
|
.reset (reset),
|
2015-04-13 23:35:21 -04:00
|
|
|
.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]),
|
2014-12-14 17:18:53 -05:00
|
|
|
.rx_wr_wait (rx_wr_wait),
|
|
|
|
.rx_rd_wait (rx_rd_wait),
|
|
|
|
.ecfg_rx_enable (ecfg_rx_enable),
|
2015-04-11 00:04:18 -04:00
|
|
|
.ecfg_rx_gpio_enable (ecfg_rx_gpio_enable),
|
2015-04-08 13:20:25 -04:00
|
|
|
.ecfg_dataout (ecfg_dataout[1:0]));
|
2014-12-14 17:18:53 -05:00
|
|
|
|
|
|
|
/************************************************************/
|
|
|
|
/*Debug signals */
|
|
|
|
/************************************************************/
|
2015-03-24 20:44:03 -04:00
|
|
|
always @ (posedge rx_lclk_div4)
|
2014-12-14 17:18:53 -05:00
|
|
|
begin
|
2015-03-25 19:25:12 -04:00
|
|
|
ecfg_rx_debug[15:0] <= {2'b0, //15:14
|
|
|
|
emesh_rx_rd_wait, //13
|
|
|
|
emesh_rx_wr_wait, //12
|
2015-04-13 23:35:21 -04:00
|
|
|
emrr_rd_en, //11
|
2015-04-11 00:04:18 -04:00
|
|
|
emrr_progfull, //10
|
|
|
|
emrr_wr_en, //9
|
2015-04-13 23:35:21 -04:00
|
|
|
emrq_rd_en, //8
|
2015-04-11 00:04:18 -04:00
|
|
|
emrq_progfull, //7
|
|
|
|
emrq_wr_en, //6
|
2015-04-13 23:35:21 -04:00
|
|
|
emwr_rd_en, //5
|
2015-04-11 00:04:18 -04:00
|
|
|
emwr_progfull, //4
|
|
|
|
emwr_wr_en, //3
|
|
|
|
emrr_full, //2
|
|
|
|
emrq_full, //1
|
|
|
|
emwr_full //0
|
2015-03-25 19:25:12 -04:00
|
|
|
};
|
2014-12-14 17:18:53 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
|
2015-03-25 19:25:12 -04:00
|
|
|
endmodule // erx
|
2014-12-14 17:18:53 -05:00
|
|
|
// Local Variables:
|
2015-04-13 23:35:21 -04:00
|
|
|
// verilog-library-directories:("." "../../emmu/hdl" "../../stubs/hdl" "../../memory/hdl")
|
2014-12-14 17:18:53 -05:00
|
|
|
// End:
|
|
|
|
|
2015-04-11 00:04:18 -04:00
|
|
|
/*
|
|
|
|
Copyright (C) 2014 Adapteva, Inc.
|
|
|
|
|
|
|
|
Contributed by Andreas Olofsson <andreas@adapteva.com>
|
|
|
|
|
|
|
|
This program is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.This program is distributed in the hope
|
|
|
|
that it will be useful,but WITHOUT ANY WARRANTY; without even the implied
|
|
|
|
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details. You should have received a copy
|
|
|
|
of the GNU General Public License along with this program (see the file
|
|
|
|
COPYING). If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
2014-12-14 17:18:53 -05:00
|
|
|
|