Module ring_buffer
This document contains technical documentation for the ring_buffer
module.
To browse the source code, visit the repository on GitHub.
simple_ring_buffer_manager.vhd
Simple implementation of ring buffer, or circular buffer, logic. It is simple in the sense that all address segments provided are of the same length, which is defined at compile-time.
The buffer_start_address
, buffer_end_address
and buffer_read_address
must be set
by the user before enabling the entity with the enable
signal.
Initially, the buffer_read_address
should be set to the buffer_start_address
.
All these addresses need to be byte-aligned with the segment length.
Warning
Once the entity has been enabled, it does not support disabling, doing so would result in undefined behavior.
Once enabled, the entity will start providing segment addresses to the user on the
segment
interface.
This is an AXI-Stream-like handshaking interface.
Once a segment has been written, the segment_written
signal must be pulsed by the user.
The entity will then update the buffer_written_address
accordingly.
Note
In order to distinguish between the full and the empty states, this entity will never have
more than segment_length_bytes - 1
segments outstanding.
Warning
This entity will fail if buffer_last_address
is the very last address in the address space.
(e.g. 0xFFFFFFFF).
Resource utilization
This entity has netlist builds set up with automatic size checkers in module_ring_buffer.py. The following table lists the resource utilization for the entity, depending on generic configuration.
Generics |
Total LUTs |
FFs |
Maximum logic level |
---|---|---|---|
address_width = 29 segment_length_bytes = 64 |
94 |
52 |
12 |
simple_ring_buffer_manager_pkg.vhd
Package with types and constants for simple_ring_buffer_manager.vhd.