Search code examples
compilationmakefilevhdlghdl

how can one compile .vhd under ghdl?


My first question : I wonder how you compile your vhdl file under ghdl ?

In c/c++, we use

  • -Werror
  • -Wunused-variable
  • -Wunused-value
  • -Wunused-function
  • -Wfloat-equal -Wall

.My second question : are there a way one can use ghdl with those things ?


Solution

  • The user manual for GHDL would be a good starting point, specifically sections 3.1 (building) and 3.4 (warnings).

    It is difficult to compare a set of C/C++ compiler flags to that of a VHDL compiler, but there may be some similar functionality between them, such as warnings become errors and alerting the user to unused design components. For example (from the documentation):

    --warn-unused
       Emit a warning when a subprogram is never used. 
    --warn-error
       When this option is set, warnings are considered as errors.