Tagged: compiling Toggle Comment Threads | Keyboard Shortcuts

  • CG 6:50 pm on October 13, 2010 Permalink | Reply
    Tags: , compiling, , linux,   

    Compiling assembly on Linux (Ubuntu on Virtual Box) 

    gcc -S logical.c

    gcc -O1 -S logical.c

    gcc -O2 -S logical.c

    objdump -d logical.o

  • CG 3:39 pm on October 12, 2010 Permalink | Reply
    Tags: , , compiling, , mac os x,   

    Compiling assembly on Snow Leopard 

    Comparing the compiling result with compiling assembly with Leopard (Mac OS X 10.5)

    code in c

    int logical(int x, int y){
       int t1 = x^y;
       int t2 = t1 >> 17;
       int mask = (1<<13)-7;
       int rval = t2 & mask;
       return rval;

    gcc -S logical.c

    gcc -O1 -S logical.c

    gcc -O2 -S logical.c

    dumping object file
    gcc -c logical.c
    otool -tv logical.o

  • CG 12:51 pm on May 4, 2010 Permalink | Reply
    Tags: compiling, , ,   

    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
      variable l : line;
      write (l, String'("Hello world!"));
      writeline (output, l);
      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


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

    • Nadav 2:31 am on May 5, 2010 Permalink | Reply

      When I write VHDL or Verilog I like to use automated tools. C-to-Verilog.com is a website which allows you to compiler your C code into hardware circuits. It has a great pipelining algorithm for superb performance.

    • vincent 6:15 pm on August 25, 2010 Permalink | Reply

      Thanks for this help on how to install and use ghdl in OS X unfortunately it does not work. Instructions seem not to cover what to do with the wine stuff. Could you please help?


    • Tinh 9:42 am on April 8, 2015 Permalink | Reply

      Hello! thanks for you instruction. However, wen i run a command line “wine ghdl.exe -a file.vhdl” it said that “-bash: wine: command not found”. so do i need to install wine? or just copy from the dmg that you provided? thanks!

      • CG 12:20 pm on April 8, 2015 Permalink | Reply

        yes you have to install wine! 🙂

Compose new post
Next post/Next comment
Previous post/Previous comment
Show/Hide comments
Go to top
Go to login
Show/Hide help
shift + esc