Changeset 9091

Show
Ignore:
Timestamp:
07/31/08 20:15:00
Author:
matt
Message:

more accurate full/empty counts, which leads to it being 1 bit wider

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • usrp2/trunk/fpga/control_lib/shortfifo.v

    r8717 r9091  
    1010     output reg full, 
    1111     output reg empty, 
    12      output [3:0] space, 
    13      output [3:0] occupied); 
     12     output [4:0] space, 
     13     output [4:0] occupied); 
    1414    
    1515   reg [3:0]      a; 
     
    5858   // NOTE will fail if you write into a full fifo or read from an empty one 
    5959 
    60    assign space = full ? 0 : empty ? 15 : 15-a; 
    61    assign occupied = empty ? 0 : full ? 15 : a+1; 
     60   assign space = full ? 0 : empty ? 16 : 15-a; 
     61   assign occupied = empty ? 0 : full ? 16 : a+1; 
    6262    
    6363endmodule // shortfifo