Electronic – Do open source libraries exist for VHDL the way they do for C++ or python

code-designlibraryopen sourcevhdl

When I'm approaching a problem in C++ or python, there are many libraries that exist which do the heavy lifting of my code. I'm thinking about GNU GSL, BOOST, or FFTW for C++, and NumPy or SciPy for python. In many ways, the fact that these resources exist make coding in these respective languages worthwhile, as the libraries prevent you from having to rewrite all the low level things from scratch.

The IEEE standard libraries seem to cover only the very basics, such as data types (sort of akin to the C standard libs).

It seems like in VHDL, you can buy/find some "IP Cores" that will solve a problem, rather than using an open source library. In python, if I want to talk to a serial device, I just import serial and I'm basically done. In VHDL I would either be stuck writing a serial protocol from scratch, or I would have to google around on the various repositories until I found someone who had produced something that sort of works. I would then be patching bits of code into my project, rather than just including something and calling that. In a similar way, if I want to perform an FFT, I can find examples of FFTs in VHDL via google, but there is not something simple like FFTW that I can find.

Are there any comprehensive open source libraries available that I can import into my projects? Why does everyone seem to roll their own code for so many of the same things?

Best Answer

I'm a developer and maintainer at 'The PoC Library'. We try to provide such a library composed of packages (collection of new types and functions) and modules. It comes with common fifos, arithmetics, cross-clock components, low-speed-I/O components and a Ethernet/IP/UDP stack (next release).

As @crgrace described, it's quite complicated to design modules, which:

  • work on many platforms
  • support most vendor tool chains
  • add no/less overhead

Our library has an internal configuration mechanismn (PoC.config) to distinguish vendors, devices and even device subfamilies to choose the right code or an optimized implementation. It also distinguishes between synthesis and simulation code at some points.

For example PoC.fifo_cc_got is a FIFO with an 'common clock' (cc) interface and put/got signals to control the fifo. The fifo is configurable in widths, depths, fill-state bits and implementation type. It's possible to choose a LUT-based RAM or On-Chip-RAM (ocram) implementation type. If this fifo is synthesized with ocram option for Altera, it uses altsyncram; if Xilinx is chosen, it uses a generic BlockRAM description and implements the pointer arithmetic by explicit carrychain instantiation (Xilinx XST does not find the optimal solution, so it's done manually).

There are 2 other fifo types with 'dependent clock' (dc) and independent clock (ic) interface. So if it's required to switch from an normal fifo to a cross-clock fifo (PoC.fifo_ic_got), change the entity name and add a clock and reset for the second clock domain, that's all.

I think this proves, it's possible to write common modules, which work on multiple platforms and compile in different tools (Spartan->Virtex, Cyclone -> Stratix; ISE, Vivado, Quartus).

Besides PoC, there are other open source libraries:


The "Discover Free and Open Source Silicon" (FOSSi) projects on GitHub offers a browsable database of all GitHub projects that mainly use , , , or any other important hardware description language ().

See also: