Library of reusable VHDL components
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

62 lines
1.9 KiB

10 years ago
10 years ago
  1. # libvhdl
  2. A LGPLv3 licensed library of reusable components for VHDL designs and testbenches
  3. ##sim
  4. (Non) synthesible components for testbenches
  5. ##### AssertP
  6. Package with various assertion procedures
  7. * `assert_true(x[, str])` checks if boolean x = false, prints string str to console str when given
  8. * `assert_false(x[, str])` checks if boolean x = false, prints string str to console str when given
  9. * `assert_equal(x, y[, str])` checks if x = y, prints string str to console str when given
  10. * `assert_unequal(x, y[, str])` checks if x /= y, prints string str to console str when given
  11. ##### SimP
  12. Package with various components general useful for simulation
  13. * `wait_cycles(x, n)` waits for n rising edges on std_logic signal x
  14. * `spi_master()` configurable master for SPI protocol
  15. * `spi_slave()` configurable slave for SPI protocol
  16. ##### StringP
  17. Package with various functions to convert to string
  18. * `to_char(x)` returns string with binary value of std_logic x
  19. * `to_string(x)` returns string with binary value of std_logic_vector x
  20. ##### QueueP
  21. Package with various implementations of queue types:
  22. * `t_simple_queue` simple array based FIFO queue
  23. * `t_list_queue` linked list FIFO queue using access types
  24. ##test
  25. Unit tests for each component
  26. ##### QueueT
  27. Units tests for components of QueueP package
  28. ##### SimT
  29. Units tests for components of SimP package
  30. ##### StringT
  31. Units tests for components of SimP package
  32. ## Dependencies
  33. To run the tests, you have to install GHDL. You can get it from [http://sourceforge.net/projects/ghdl-updates/](http://sourceforge.net/projects/ghdl-updates/).
  34. ## Building
  35. Type `make` and you should see the successfully running tests
  36. ```
  37. $ make
  38. ghdl -a --std=02 ../sim/QueueP.vhd QueueT.vhd
  39. ghdl -e --std=02 QueueT
  40. ghdl -r --std=02 QueueT
  41. QueueT.vhd:52:5:@0ms:(report note): INFO: t_simple_queue test finished successfully
  42. QueueT.vhd:87:5:@0ms:(report note): INFO: t_list_queue test finished successfully
  43. ```