2015-10-07 19:21:04 -04:00
|
|
|
//`include "../../elink/hdl/elink_constants.v"
|
2015-04-14 23:56:00 -04:00
|
|
|
module fifo_async
|
|
|
|
(/*AUTOARG*/
|
2015-03-24 20:44:03 -04:00
|
|
|
// Outputs
|
2015-04-27 11:15:06 -04:00
|
|
|
full, prog_full, dout, empty, valid,
|
2015-03-24 20:44:03 -04:00
|
|
|
// Inputs
|
2015-05-07 23:50:34 -04:00
|
|
|
wr_rst, rd_rst, wr_clk, rd_clk, wr_en, din, rd_en
|
2015-03-24 20:44:03 -04:00
|
|
|
);
|
2015-04-14 23:56:00 -04:00
|
|
|
|
2015-07-02 16:59:38 -04:00
|
|
|
parameter DW = 104; //FIFO width
|
2015-10-07 19:21:04 -04:00
|
|
|
parameter DEPTH = 32; //FIFO depth
|
2015-05-07 23:50:34 -04:00
|
|
|
|
2015-04-14 23:56:00 -04:00
|
|
|
//##########
|
2015-04-23 17:53:22 -04:00
|
|
|
//# RESET/CLOCK
|
2015-04-14 23:56:00 -04:00
|
|
|
//##########
|
2015-05-07 23:50:34 -04:00
|
|
|
input wr_rst; //write reset
|
|
|
|
input rd_rst; //read reset
|
2015-04-14 23:56:00 -04:00
|
|
|
input wr_clk; //write clock
|
2015-04-23 17:53:22 -04:00
|
|
|
input rd_clk; //read clock
|
|
|
|
|
|
|
|
//##########
|
|
|
|
//# FIFO WRITE
|
|
|
|
//##########
|
2015-05-07 23:50:34 -04:00
|
|
|
input wr_en;
|
2015-10-07 19:21:04 -04:00
|
|
|
input [DW-1:0] din;
|
2015-05-07 23:50:34 -04:00
|
|
|
output full;
|
|
|
|
output prog_full;
|
2015-04-14 23:56:00 -04:00
|
|
|
|
|
|
|
//###########
|
2015-04-23 17:53:22 -04:00
|
|
|
//# FIFO READ
|
2015-04-14 23:56:00 -04:00
|
|
|
//###########
|
2015-05-07 23:50:34 -04:00
|
|
|
input rd_en;
|
2015-07-02 16:59:38 -04:00
|
|
|
output [DW-1:0] dout;
|
2015-05-07 23:50:34 -04:00
|
|
|
output empty;
|
|
|
|
output valid;
|
2015-03-24 20:44:03 -04:00
|
|
|
|
2015-05-07 23:50:34 -04:00
|
|
|
|
2015-07-02 16:59:38 -04:00
|
|
|
`ifdef TARGET_CLEAN
|
2015-04-27 11:15:06 -04:00
|
|
|
|
2015-07-02 16:59:38 -04:00
|
|
|
fifo_async_model fifo_model (.full (),
|
|
|
|
.prog_full (prog_full),
|
|
|
|
.almost_full (full),
|
|
|
|
/*AUTOINST*/
|
|
|
|
// Outputs
|
|
|
|
.dout (dout[DW-1:0]),
|
|
|
|
.empty (empty),
|
|
|
|
.valid (valid),
|
|
|
|
// Inputs
|
|
|
|
.wr_rst (wr_rst),
|
|
|
|
.rd_rst (rd_rst),
|
|
|
|
.wr_clk (wr_clk),
|
|
|
|
.rd_clk (rd_clk),
|
|
|
|
.wr_en (wr_en),
|
|
|
|
.din (din[DW-1:0]),
|
|
|
|
.rd_en (rd_en));
|
2015-03-24 20:44:03 -04:00
|
|
|
|
2015-07-02 16:59:38 -04:00
|
|
|
`elsif TARGET_XILINX
|
|
|
|
generate
|
2015-10-07 19:21:04 -04:00
|
|
|
if((DW==104) & (DEPTH==32))
|
2015-07-02 16:59:38 -04:00
|
|
|
begin
|
|
|
|
fifo_async_104x32 fifo_async_104x32 (.full (),
|
|
|
|
.prog_full (prog_full),
|
|
|
|
.almost_full (full),
|
|
|
|
/*AUTOINST*/
|
|
|
|
// Outputs
|
|
|
|
.dout (dout[DW-1:0]),
|
|
|
|
.empty (empty),
|
|
|
|
.valid (valid),
|
|
|
|
// Inputs
|
|
|
|
.wr_rst (wr_rst),
|
|
|
|
.rd_rst (rd_rst),
|
|
|
|
.wr_clk (wr_clk),
|
|
|
|
.rd_clk (rd_clk),
|
|
|
|
.wr_en (wr_en),
|
|
|
|
.din (din[DW-1:0]),
|
|
|
|
.rd_en (rd_en));
|
|
|
|
|
2015-10-07 19:21:04 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
|
2015-07-02 16:59:38 -04:00
|
|
|
|
2015-05-07 23:50:34 -04:00
|
|
|
endgenerate
|
|
|
|
|
|
|
|
|
|
|
|
`endif // !`elsif TARGET_XILINX
|
2015-04-23 18:56:49 -04:00
|
|
|
|
2015-04-23 17:53:22 -04:00
|
|
|
|
2015-03-24 20:44:03 -04:00
|
|
|
endmodule // fifo_async
|
2015-04-14 23:56:00 -04:00
|
|
|
// Local Variables:
|
2015-07-02 16:59:38 -04:00
|
|
|
// verilog-library-directories:("." "../../xilibs/hdl")
|
2015-04-14 23:56:00 -04:00
|
|
|
// End:
|
2015-03-24 20:44:03 -04:00
|
|
|
|
2015-04-14 23:56:00 -04:00
|
|
|
/*
|
|
|
|
Copyright (C) 2013 Adapteva, Inc.
|
|
|
|
Contributed by Andreas Olofsson, Roman Trogan <support@adapteva.com>
|
2015-03-24 20:44:03 -04:00
|
|
|
|
2015-04-14 23:56:00 -04:00
|
|
|
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.
|
2015-03-24 20:44:03 -04:00
|
|
|
|
2015-04-14 23:56:00 -04:00
|
|
|
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.
|
2015-03-24 20:44:03 -04:00
|
|
|
|
2015-04-14 23:56:00 -04:00
|
|
|
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/>.
|
|
|
|
*/
|