2016-02-26 22:51:35 -05:00
|
|
|
module mio (/*AUTOARG*/
|
2016-02-24 20:29:56 -05:00
|
|
|
// Outputs
|
2016-03-20 22:39:22 -04:00
|
|
|
tx_full, tx_prog_full, tx_empty, rx_full, rx_prog_full, rx_empty,
|
2016-02-26 22:51:35 -05:00
|
|
|
tx_access, tx_packet, rx_wait, wait_out, access_out, packet_out,
|
2016-02-24 20:29:56 -05:00
|
|
|
// Inputs
|
2016-03-20 22:39:22 -04:00
|
|
|
clk, io_clk, nreset, datasize, ddr_mode, lsbfirst, tx_en, rx_en,
|
|
|
|
tx_wait, rx_clk, rx_access, rx_packet, access_in, packet_in,
|
|
|
|
wait_in
|
2016-02-24 20:29:56 -05:00
|
|
|
);
|
|
|
|
|
|
|
|
//#####################################################################
|
|
|
|
//# INTERFACE
|
|
|
|
//#####################################################################
|
|
|
|
|
|
|
|
//parameters
|
2016-03-20 22:39:22 -04:00
|
|
|
parameter PW = 104; // data width (core)
|
|
|
|
parameter N = 8; // Mini IO width
|
|
|
|
localparam CW = $clog2(2*PW/N);// transfer count width
|
2016-02-24 20:29:56 -05:00
|
|
|
|
2016-03-20 22:39:22 -04:00
|
|
|
// reset, clk, config
|
|
|
|
input clk; // main core clock
|
|
|
|
input io_clk; // clock for TX
|
|
|
|
input nreset; // async active low reset
|
|
|
|
input [7:0] datasize; // size of data transmitted
|
|
|
|
input ddr_mode; // dual data rate mode
|
|
|
|
input lsbfirst; // send data lsbfirst
|
|
|
|
input tx_en; // enable transmit
|
|
|
|
input rx_en; // enable receive
|
|
|
|
|
|
|
|
// status
|
|
|
|
output tx_full;
|
|
|
|
output tx_prog_full;
|
|
|
|
output tx_empty;
|
|
|
|
output rx_full;
|
|
|
|
output rx_prog_full;
|
|
|
|
output rx_empty;
|
|
|
|
|
2016-02-24 20:29:56 -05:00
|
|
|
// tx interface
|
2016-03-20 22:39:22 -04:00
|
|
|
output tx_access; // access signal for IO
|
|
|
|
output [N-1:0] tx_packet; // packet for IO
|
|
|
|
input tx_wait; // pushback from IO
|
|
|
|
|
2016-02-24 20:29:56 -05:00
|
|
|
// rx interface
|
2016-03-20 22:39:22 -04:00
|
|
|
input rx_clk; // rx clock
|
|
|
|
input rx_access; // rx access
|
|
|
|
input [N-1:0] rx_packet; // rx packet
|
|
|
|
output rx_wait; // pushback from IO
|
2016-02-24 20:29:56 -05:00
|
|
|
|
2016-02-26 22:51:35 -05:00
|
|
|
// core interface
|
2016-03-20 22:39:22 -04:00
|
|
|
input access_in; // fifo data valid
|
|
|
|
input [PW-1:0] packet_in; // fifo packet
|
|
|
|
output wait_out; // wait pushback for fifo
|
|
|
|
|
|
|
|
output access_out; // fifo data valid
|
|
|
|
output [PW-1:0] packet_out; // fifo packet
|
|
|
|
input wait_in; // wait pushback for fifo
|
2016-02-24 20:29:56 -05:00
|
|
|
|
|
|
|
/*AUTOOUTPUT*/
|
|
|
|
/*AUTOINPUT*/
|
|
|
|
/*AUTOWIRE*/
|
|
|
|
|
2016-03-20 22:39:22 -04:00
|
|
|
mtx #(.N(N),
|
2016-02-24 20:29:56 -05:00
|
|
|
.PW(PW))
|
2016-02-26 22:51:35 -05:00
|
|
|
mtx (/*AUTOINST*/
|
2016-02-24 20:29:56 -05:00
|
|
|
// Outputs
|
|
|
|
.wait_out (wait_out),
|
|
|
|
.tx_access (tx_access),
|
2016-03-20 22:39:22 -04:00
|
|
|
.tx_packet (tx_packet[N-1:0]),
|
2016-02-24 20:29:56 -05:00
|
|
|
// Inputs
|
|
|
|
.clk (clk),
|
|
|
|
.io_clk (io_clk),
|
|
|
|
.nreset (nreset),
|
2016-03-20 22:39:22 -04:00
|
|
|
.tx_en (tx_en),
|
|
|
|
.datasize (datasize[7:0]),
|
|
|
|
.ddr_mode (ddr_mode),
|
|
|
|
.lsbfirst (lsbfirst),
|
2016-02-24 20:29:56 -05:00
|
|
|
.access_in (access_in),
|
|
|
|
.packet_in (packet_in[PW-1:0]),
|
|
|
|
.tx_wait (tx_wait));
|
|
|
|
|
2016-03-20 22:39:22 -04:00
|
|
|
mrx #(.N(N),
|
2016-02-24 20:29:56 -05:00
|
|
|
.PW(PW))
|
2016-02-26 22:51:35 -05:00
|
|
|
mrx (/*AUTOINST*/
|
2016-02-24 20:29:56 -05:00
|
|
|
// Outputs
|
2016-03-20 22:39:22 -04:00
|
|
|
.rx_empty (rx_empty),
|
|
|
|
.rx_full (rx_full),
|
|
|
|
.rx_prog_full (rx_prog_full),
|
2016-02-24 20:29:56 -05:00
|
|
|
.rx_wait (rx_wait),
|
|
|
|
.access_out (access_out),
|
|
|
|
.packet_out (packet_out[PW-1:0]),
|
|
|
|
// Inputs
|
|
|
|
.clk (clk),
|
|
|
|
.nreset (nreset),
|
2016-03-20 22:39:22 -04:00
|
|
|
.datasize (datasize[7:0]),
|
|
|
|
.ddr_mode (ddr_mode),
|
|
|
|
.lsbfirst (lsbfirst),
|
2016-02-24 20:29:56 -05:00
|
|
|
.rx_clk (rx_clk),
|
|
|
|
.rx_access (rx_access),
|
2016-03-20 22:39:22 -04:00
|
|
|
.rx_packet (rx_packet[N-1:0]),
|
2016-02-24 20:29:56 -05:00
|
|
|
.wait_in (wait_in));
|
|
|
|
|
2016-02-26 22:51:35 -05:00
|
|
|
endmodule // mio
|
|
|
|
|
|
|
|
|