1
0
mirror of https://github.com/aolofsson/oh.git synced 2025-01-30 02:32:53 +08:00
oh/mio/hdl/mio.v

105 lines
2.9 KiB
Coq
Raw Normal View History

2016-02-26 22:51:35 -05:00
module mio (/*AUTOARG*/
2016-02-24 20:29:56 -05:00
// Outputs
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
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
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
// 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
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
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
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*/
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),
.tx_packet (tx_packet[N-1:0]),
2016-02-24 20:29:56 -05:00
// Inputs
.clk (clk),
.io_clk (io_clk),
.nreset (nreset),
.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));
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
.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),
.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),
.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