VHDL linked list protected type
This VHDL package contains an object-oriented linked list of protected type that implements a dynamic length FIFO for use in testbenches.
The linked list is a dynamic data structure that’s useful when the total number of elements is not known in advance. It grows and shrinks relative to the number of items it contains.
The package is only for simulation because the linked list is not synthesizable. Study the testbench included in the downloadable to see an example use case.
Package declarative region
package DataStructures is type LinkedList is protected -- Add an element to the list procedure Push(constant Data : in integer); -- Remove the oldest element from the list and return it impure function Pop return integer; impure function IsEmpty return boolean; end protected; end package DataStructures;
Click here to read more about how I created this package:
How to create a Linked List in VHDL
Download request form
Copyright (c) 2023 Jonas Julian Jensen
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.