ASIC/FPGA Design and Verification Out Source Services
One clock domain register (made by Flip-Flop
devices) FIFO
- The I/O interface is quite the same as any other FIFO design: clock, reset, data, and flags:
- input ck, rs; //clock and reset
- input [`WIDTH-1 : 0] wr_d; //write data
- input wr_en; //write enable
- output full; //full
- output hfull; //half full
- output [`WIDTH-1 : 0] rd_d; //read data
- input rd_en; //read enable
- output empty; //empty
- The flags are implemented with a set condition and keep set condition.
- empty <= ( empty & ~wr_en) |
- (~empty & ~(|rd_ptr) & rd_en & ~wr_en);
- full <=
- (~full & (rd_ptr == (DEPTH-2) && wr_en && ~rd_en)) |
- (full & ~rd_en);
- hfull <= (rd_ptr >= (DEPTH/2));
|