Compiling VHDL with GHDL on Mac OS

  1. Download GHDL for Mac OS download here
  2. Put the whole directory in the home directory
  3. Type a simple .vhdl code from here

    -- 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
    write (l, String'("Hello world!"));
    writeline (output, l);
    wait;
    end process;
    end behaviour;

  4. Compile the file:  wine ghdl.exe -a hello_world.vhdl
  5. Build an executable file:  wine ghdl.exe -e hello_world
  6. Run the code:  wine ghdl.exe -r hello_world or wine ./hello_world

Notes:

the working directory is : /Users/chika/.wine/drive_c/Program Files/Ghdl/bin

Advertisements