Node:The hello word program, Next:A full adder, Previous:Starting with GHDL, Up:Starting with GHDL
To illustrate the large purpose of VHDL, here is a commented VHDL "Hello world" program.
		
--  Hello world program.
use std.textio.all; --  Imports the standard textio package.
--  Defines a design entity, without any ports.
entity hello_world is
end hello_world;
architecture behaviour of hello_world is
begin
   process
      variable l : line;
   begin
      l := new String'("Hello world!");
      writeline (output, l);
      wait;
   end process;
end behaviour;
		Suppose this program is contained in the file hello.vhdl. First, you have to compile the file; this is called analysis of a design file in VHDL terms.
		
$ ghdl -a hello.vhdlThis command generates a file
hello.o, which is the object file corresponding to your VHDL program. This command also creates or updates a file work-obj93.cf, which describes the library work.
		Then, you have to build an executable file.
		
$ ghdl -e hello_worldThe
-e option means elaborate. With this option, GHDL creates code in order to elaborate a design, with the hello entity at the top of the hierarchy.
		The result is an executable program called hello which can be run:
		
$ ./hello_world
and which should display:
		
Hello world!