From a170b9b42345794429486dd4f3316e84ea2cc871 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Fri, 22 Jan 2010 11:46:58 -0800 Subject: Moved usrp1 fpga files into usrp1 subdir. --- usrp1/models/fifo_1c_1k.v | 81 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 usrp1/models/fifo_1c_1k.v (limited to 'usrp1/models/fifo_1c_1k.v') diff --git a/usrp1/models/fifo_1c_1k.v b/usrp1/models/fifo_1c_1k.v new file mode 100644 index 000000000..d11040b54 --- /dev/null +++ b/usrp1/models/fifo_1c_1k.v @@ -0,0 +1,81 @@ +// Model of FIFO in Altera + +module fifo_1c_1k ( data, wrreq, rdreq, rdclk, wrclk, aclr, q, + rdfull, rdempty, rdusedw, wrfull, wrempty, wrusedw); + + parameter width = 32; + parameter depth = 1024; + //`define rd_req 0; // Set this to 0 for rd_ack, 1 for rd_req + + input [31:0] data; + input wrreq; + input rdreq; + input rdclk; + input wrclk; + input aclr; + output [31:0] q; + output rdfull; + output rdempty; + output [9:0] rdusedw; + output wrfull; + output wrempty; + output [9:0] wrusedw; + + reg [width-1:0] mem [0:depth-1]; + reg [7:0] rdptr; + reg [7:0] wrptr; + +`ifdef rd_req + reg [width-1:0] q; +`else + wire [width-1:0] q; +`endif + + reg [9:0] rdusedw; + reg [9:0] wrusedw; + + integer i; + + always @( aclr) + begin + wrptr <= #1 0; + rdptr <= #1 0; + for(i=0;i