Configurable FIFO class.
More...
#include <fifo.h>
|
typedef | NVUINTW (BankSelWidth) BankIdx |
|
typedef | NVUINTW (AddrWidth) FifoIdx |
|
typedef | NVUINTW (AddrWidth+1) FifoIdxPlusOne |
|
FifoIdx | ModIncr (FifoIdx curr_idx) |
|
void | push (DataType wr_data, BankIdx bidx=0) |
|
DataType | pop (BankIdx bidx=0) |
|
void | incrHead (BankIdx bidx=0) |
|
DataType | peek (BankIdx bidx=0) |
|
bool | isEmpty (BankIdx bidx=0) |
|
bool | isFull (BankIdx bidx=0) |
|
FifoIdxPlusOne | NumFilled (BankIdx bidx=0) |
|
FifoIdxPlusOne | NumAvailable (BankIdx bidx=0) |
|
void | reset () |
|
FifoIdx | get_head (BankIdx bidx=0) |
|
FifoIdx | get_tail (BankIdx bidx=0) |
|
template<unsigned int Size> |
void | Marshall (Marshaller< Size > &m) |
|
|
FifoIdx | head [NumBanks] |
|
FifoIdx | tail [NumBanks] |
|
mem_array_sep< DataType, FifoLen *NumBanks, NumBanks > | fifo_body |
|
bool | last_action_was_push [NumBanks] |
|
|
static const int | BankSelWidth |
|
static const int | AddrWidth |
|
static const int | width = mem_array_sep<DataType, FifoLen * NumBanks, NumBanks>::width + 2 * NumBanks * AddrWidth + NumBanks |
|
template<typename DataType, unsigned int FifoLen, unsigned int NumBanks = 1>
class FIFO< DataType, FifoLen, NumBanks >
Configurable FIFO class.
- Template Parameters
-
DataType | DataType of entry in FIFO |
FifoLen | Length of FIFO |
NumBanks | Number of FIFO banks |
- A Simple Example
#include <fifo.h>
...
FIFO<DataType, LenInputBuffer, NumInputs> fifo_inst;
fifo_inst.reset();
...
if (!fifo_inst.isFull(bank_id)) {
fifo_inst.push(input_data, bank_id);
}
...
if (!fifo_inst.isEmpty(bank_id)) {
output_data = fifo_inst.pop(bank_id);
}
...
if (!fifo_inst.isEmpty(bank_id)) {
output_data = fifo_inst.peek(bank_id);
}
...
fifo_inst.incrHead(bank_id);
Definition at line 65 of file fifo.h.
◆ BankSelWidth
template<typename DataType , unsigned int FifoLen, unsigned int NumBanks = 1>
const int FIFO< DataType, FifoLen, NumBanks >::BankSelWidth |
|
static |
Initial value:=
Compute number of bits to represent a constant.
Definition at line 68 of file fifo.h.
◆ AddrWidth
template<typename DataType , unsigned int FifoLen, unsigned int NumBanks = 1>
const int FIFO< DataType, FifoLen, NumBanks >::AddrWidth |
|
static |
Initial value:
Definition at line 70 of file fifo.h.
The documentation for this class was generated from the following file: