diff options
author | jcorgan <jcorgan@221aa14e-8319-0410-a670-987f0aec2ac5> | 2008-09-08 01:00:12 +0000 |
---|---|---|
committer | jcorgan <jcorgan@221aa14e-8319-0410-a670-987f0aec2ac5> | 2008-09-08 01:00:12 +0000 |
commit | 61f2f0214c5999ea42a368a4fc99f03d8eb28d1e (patch) | |
tree | e7e24a9adc05ff1422fe3ada9926a51634741b47 /control_lib/medfifo.v | |
download | uhd-61f2f0214c5999ea42a368a4fc99f03d8eb28d1e.tar.gz uhd-61f2f0214c5999ea42a368a4fc99f03d8eb28d1e.tar.bz2 uhd-61f2f0214c5999ea42a368a4fc99f03d8eb28d1e.zip |
Merged r9433:9527 from features/gr-usrp2 into trunk. Adds usrp2 and gr-usrp2 top-level components. Trunk passes distcheck with mb-gcc installed, but currently not without them. The key issue is that when mb-gcc is not installed, the build system skips over the usrp2/firmware directory, and the firmware include files don't get put into the dist tarball. But we can't do the usual DIST_SUBDIRS method as the firmware is a subpackage.
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@9528 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'control_lib/medfifo.v')
-rw-r--r-- | control_lib/medfifo.v | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/control_lib/medfifo.v b/control_lib/medfifo.v new file mode 100644 index 000000000..5a77e8c16 --- /dev/null +++ b/control_lib/medfifo.v @@ -0,0 +1,49 @@ + +module medfifo + #(parameter WIDTH=32, + parameter DEPTH=1) + (input clk, input rst, + input [WIDTH-1:0] datain, + output [WIDTH-1:0] dataout, + input read, + input write, + input clear, + output full, + output empty, + output [7:0] space, + output [7:0] occupied); + + localparam NUM_FIFOS = (1<<DEPTH); + + wire [WIDTH-1:0] dout [0:NUM_FIFOS-1]; + wire [0:NUM_FIFOS-1] full_x; + wire [0:NUM_FIFOS-1] empty_x; + + shortfifo #(.WIDTH(WIDTH)) + head (.clk(clk),.rst(rst), + .datain(datain),.write(write),.full(full), + .dataout(dout[0]),.read(~empty_x[0] & ~full_x[1]),.empty(empty_x[0]), + .clear(clear),.space(space[4:0]),.occupied() ); + + shortfifo #(.WIDTH(WIDTH)) + tail (.clk(clk),.rst(rst), + .datain(dout[NUM_FIFOS-2]),.write(~empty_x[NUM_FIFOS-2] & ~full_x[NUM_FIFOS-1]),.full(full_x[NUM_FIFOS-1]), + .dataout(dataout),.read(read),.empty(empty), + .clear(clear),.space(),.occupied(occupied[4:0]) ); + + genvar i; + generate + for(i = 1; i < NUM_FIFOS-1 ; i = i + 1) + begin : gen_depth + shortfifo #(.WIDTH(WIDTH)) + shortfifo (.clk(clk),.rst(rst), + .datain(dout[i-1]),.write(~full_x[i] & ~empty_x[i-1]),.full(full_x[i]), + .dataout(dout[i]),.read(~full_x[i+1] & ~empty_x[i]),.empty(empty_x[i]), + .clear(clear),.space(),.occupied() ); + end + endgenerate + + assign space[7:5] = 0; + assign occupied[7:5] = 0; + +endmodule // medfifo |