Open FreeList Readme
The Open FreeList module is used to manage a set of variable sized packets inside a fixed memory block. The memory block is partitioned into fixed sized chunks and each packet uses one or more chunks. The module offers three possible actions:
Name | Description | Unit | Default Value |
---|---|---|---|
RAM_W | Memory block width | bits | 128 |
RAM_E | Memory block extra data | bits | 0 |
RAM_S | Memory block size | KBytes | 64 |
CHK_S | Chunk size | Bytes | 128 |
RAM_TYPE | Memory block type | string | "MRAM" |
FL_AEMPTY_LVL | FreeList almost empty level | # | 2 |
Name | Direction | Width | Description |
---|---|---|---|
global signals | |||
reset_n | input | 1 | async reset (active low) |
clk | input | 1 | clock |
write interface | |||
fl_q | output | clog(#_of_chunks) | first chunk number for a new packet. capture this value and use it to read/release the packet |
fl_aempty | output | 1 | indicates that the number of chunks reached the almost empty level |
fl_empty | output | 1 | no more chunks available. do not write any more |
wren | input | 1 | write pulse. writes the data on din into the memory block |
din | input | RAM_W+RAM_E | data to write into memory block |
eop | input | 1 | end-of-packet indication. assert on last write of packet |
read interface | |||
chunk_num | input | clog(#_of_chunks) | first chunk in a packet to be read or released |
load_req | input | 1 | request to read a packet starting at chunk number 'chunk_num' |
rel_req | input | 1 | request to release a packet starting at chunk number 'chunk_num'. also required after a packet is read |
load_rel_ack | output | 1 | acknowledge a read or release request |
rden | input | 1 | read request. data on 'dout' is valid one clock later |
dout | output | RAM_W+RAM_E | data read from memory block |
To write a packet, do the following:
To read a packet that was previously written, do the following:
Note that the 'eop' indication that is written in the write operation is not available on a read operation.
Important: after a read is complete, a release operation must be explicitly performed. There is no need to set the 'chunk_num' value after a read operation. The chunks are released when the packet is read, but the last chunk requires an explicit release operation.
A packet can be released under two circumstances:
Three memories are used in this module:
Code: Alex Manash - Crescendo Networks
Docs: Amit Fridman - Crescendo Networks