2016-02-24 20:29:56 -05:00
|
|
|
//#######################################################
|
|
|
|
//# Target specific IO logic (fast, timing sensitive)
|
|
|
|
//#######################################################
|
2016-02-26 22:51:35 -05:00
|
|
|
module mrx_io (/*AUTOARG*/
|
2016-02-24 20:29:56 -05:00
|
|
|
// Outputs
|
|
|
|
io_access, io_packet,
|
|
|
|
// Inputs
|
|
|
|
nreset, clk, rx_packet, rx_access
|
|
|
|
);
|
|
|
|
|
|
|
|
//#####################################################################
|
|
|
|
//# INTERFACE
|
|
|
|
//#####################################################################
|
|
|
|
|
|
|
|
//parameters
|
2016-03-20 22:37:30 -04:00
|
|
|
parameter N = 16;
|
2016-02-24 20:29:56 -05:00
|
|
|
|
|
|
|
//RESET
|
2016-03-20 22:37:30 -04:00
|
|
|
input nreset; // async active low reset
|
|
|
|
input clk; // clock for IO
|
2016-02-24 20:29:56 -05:00
|
|
|
//IO interface
|
2016-03-20 22:37:30 -04:00
|
|
|
input [N-1:0] rx_packet; // data for IO
|
|
|
|
input rx_access; // access signal for IO
|
2016-02-24 20:29:56 -05:00
|
|
|
|
|
|
|
//FIFO interface (core side)
|
2016-03-20 22:37:30 -04:00
|
|
|
output io_access; // fifo packet valid
|
|
|
|
output [2*N-1:0] io_packet; // fifo packet
|
2016-02-24 20:29:56 -05:00
|
|
|
|
|
|
|
//regs
|
2016-03-20 22:37:30 -04:00
|
|
|
reg io_access;
|
2016-02-24 20:29:56 -05:00
|
|
|
|
|
|
|
//########################################
|
|
|
|
//# CLOCK, RESET
|
|
|
|
//########################################
|
|
|
|
|
|
|
|
//synchronize reset to rx_clk
|
|
|
|
oh_rsync oh_rsync(.nrst_out (io_nreset),
|
|
|
|
.clk (clk),
|
|
|
|
.nrst_in (nreset)
|
|
|
|
);
|
|
|
|
|
|
|
|
//########################################
|
|
|
|
//# ACCESS (SDR)
|
|
|
|
//########################################
|
2016-02-26 22:51:35 -05:00
|
|
|
|
2016-02-24 20:29:56 -05:00
|
|
|
always @ (posedge clk or negedge io_nreset)
|
|
|
|
if(!nreset)
|
|
|
|
io_access <= 1'b0;
|
|
|
|
else
|
|
|
|
io_access <= rx_access;
|
|
|
|
|
|
|
|
//########################################
|
|
|
|
//# DATA (DDR)
|
|
|
|
//########################################
|
|
|
|
|
2016-03-20 22:37:30 -04:00
|
|
|
oh_iddr #(.DW(N))
|
|
|
|
data_iddr(.q1 (io_packet[N-1:0]),
|
|
|
|
.q2 (io_packet[2*N-1:N]),
|
2016-02-24 20:29:56 -05:00
|
|
|
.clk (clk),
|
|
|
|
.ce (rx_access),
|
2016-03-20 22:37:30 -04:00
|
|
|
.din (rx_packet[N-1:0])
|
2016-02-24 20:29:56 -05:00
|
|
|
);
|
|
|
|
|
2016-02-26 22:51:35 -05:00
|
|
|
endmodule // mrx_io
|
2016-02-24 20:29:56 -05:00
|
|
|
|
|
|
|
// Local Variables:
|
|
|
|
// verilog-library-directories:("." "../../common/hdl")
|
|
|
|
// End:
|
|
|
|
|
|
|
|
|