5 input [WIDTH-1:0] datain,
6 output [WIDTH-1:0] dataout,
13 output [4:0] occupied);
19 for (i=0;i<WIDTH;i=i+1)
22 srl16e(.Q(dataout[i]),
23 .A0(a[0]),.A1(a[1]),.A2(a[2]),.A3(a[3]),
24 .CE(write),.CLK(clk),.D(datain[i]));
41 else if(read & ~write)
49 else if(write & ~read)
58 // NOTE will fail if you write into a full fifo or read from an empty one
60 assign space = full ? 0 : empty ? 16 : 15-a;
61 assign occupied = empty ? 0 : full ? 16 : a+1;
63 endmodule // shortfifo