Forrest logo
back to the ghdl tool


ghdl: Check the syntax of a VHDL source file.
$ ghdl -s ${filename-vhdl}
try on your machine

The command "ghdl -s ${filename-vhdl}" is used to analyze and compile a VHDL (Very High Speed Integrated Circuit Hardware Description Language) file using the GHDL (GNU Hardware Description Language) compiler.

Here's the breakdown of the command:

  • "ghdl": It is the command to run the GHDL compiler.

  • "-s": It is a command-line option that stands for "analyze and compile." When used with GHDL, it instructs the compiler to analyze the design hierarchy and compile the VHDL code without performing any simulation.

  • "${filename-vhdl}": It is a placeholder that represents the VHDL file's name and extension. The actual filename needs to be provided here. The "-vhdl" is an optional suffix that may be appended to the filename, indicating that it is a VHDL file.

When you run this command with the desired VHDL file, GHDL will analyze the VHDL code, check for any syntax errors, and compile it into an intermediate representation known as "work". This allows subsequent commands, such as elaboration and execution, to be performed.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the ghdl tool