This package provides a fixed-size FIFO queue in Livt for small byte-oriented buffering needs.
This repository is intentionally small, so the core design rationale is captured directly in this README rather than a separate design note.
The current package is organized around one main component:
Queuestores up to 32 entries oflogic[8]using circular-buffer indexing to preserve FIFO ordering across wrap-around.
The queue is currently fixed to:
- 32 elements of storage
- 8-bit
logic[8]queue entries
The public API is intentionally small and centered on predictable FIFO behavior:
Enqueue()appends when space is available.Dequeue()removes the oldest queued element.Peek()reads the oldest queued element without removing it.IsEmpty(),IsFull(), andGetSize()expose queue state.Clear()resets the queue to an empty state.
.
├── src/
│ └── Queue.lvt
├── tests/
│ └── QueueTest.lvt
├── LICENSE
├── README.md
└── livt.toml
Build the package with:
livt buildThe package configuration is defined in livt.toml. The current project
name there is Queue.
Run the full test suite with:
livt testConfigured test components:
QueueTest
Small fixed-size FIFO queue in the Livt.Collections namespace.
Features:
- circular-buffer storage
- FIFO dequeue order
- explicit empty and full state checks
- defined empty-queue return value for
Peek()andDequeue()
Public methods:
Enqueue(element: logic[8])Dequeue() logic[8]Peek() logic[8]IsEmpty() boolIsFull() boolGetSize() intClear()
Enqueue() is ignored when the queue is full. Dequeue() and Peek() return
0b0000_0000 when the queue is empty.
using Livt.Collections
component Example
{
queue: Queue
new()
{
this.queue = new Queue()
}
public fn PushAndPop(value: logic[8]) logic[8]
{
this.queue.Enqueue(value)
return this.queue.Dequeue()
}
}
This package does not currently expose configurable width or depth parameters.
To change the queue shape today, update the fixed constants and storage type in:
If the queue contract changes, the expected behavior should also be updated in:
- The package is intentionally minimal and focused on predictable FIFO behavior.
- The queue implementation uses circular-buffer indexing rather than shifting data.
- The empty-queue fallback value is currently fixed to
0b0000_0000.
Contributions are welcome. Areas that would be natural extensions for this package include:
- configurable queue depth
- configurable entry width
- explicit overflow reporting for rejected
Enqueue()calls - alternative empty-read behavior beyond returning
0b0000_0000 - convenience wrappers for common buffering patterns
This project is licensed under the MIT License. See LICENSE.