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.

81 lines
2.4 KiB

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, level])` checks if boolean x = false
  8. * `assert_false(x[, str, level])` checks if boolean x = false
  9. * `assert_equal(x, y[, str, level])` checks if x = y
  10. * `assert_unequal(x, y[, str, level])` checks if x /= y
  11. All of the assert_* procedures have following optional parameters:
  12. * `str` print string str to console instead implemented one
  13. * `level` severity level (note, warning, error, failure)
  14. ##### SimP
  15. Package with various components general useful for simulation
  16. * `wait_cycles(x, n)` waits for n rising edges on std_logic signal x
  17. * `spi_master()` configurable master for SPI protocol, supports all cpol/cpha modes
  18. * `spi_slave()` configurable slave for SPI protocol, supports all cpol/cpha modes
  19. ##### StringP
  20. Package with various functions to convert to string
  21. * `to_char(x)` returns string with binary value of std_logic x
  22. * `to_string(x)` returns string with binary value of std_logic_vector x
  23. ##### QueueP
  24. Package with various implementations of queue types:
  25. * `t_simple_queue` simple array based FIFO queue
  26. * `t_list_queue` linked list FIFO queue using access types
  27. ## syn
  28. Synthesizable components for implementing in FPGA
  29. ##### SpiSlaveE
  30. Configurable SPI slave with support modes 0-3 and simple VAI local backend.
  31. Implementation results:
  32. * 49 logic elements utilization, 397 MHz clock frequency on Microsemi SmartFusion2, speed grade STD
  33. * 24 slices utilization, 649 MHz clock frequency on Xilinx Kintex7, speed grade -3
  34. ##test
  35. Unit tests for each component
  36. ##### QueueT
  37. Unit tests for components of QueueP package
  38. ##### SimT
  39. Unit tests for components of SimP package
  40. ##### SpiT
  41. Unit tests for SpiSlave component
  42. ##### StringT
  43. Unit tests for components of SimP package
  44. ## Dependencies
  45. 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/).
  46. ## Building
  47. Type `make` and you should see the successfully running tests
  48. ```
  49. $ make
  50. ghdl -a --std=02 ../sim/QueueP.vhd QueueT.vhd
  51. ghdl -e --std=02 QueueT
  52. ghdl -r --std=02 QueueT
  53. QueueT.vhd:52:5:@0ms:(report note): INFO: t_simple_queue test finished successfully
  54. QueueT.vhd:87:5:@0ms:(report note): INFO: t_list_queue test finished successfully
  55. ```