How do I compile and run a VHDL program on Mac with ghdl?

前端 未结 4 709
执笔经年
执笔经年 2021-02-02 01:52

i just wrote a simple VHDL program. I saved the file as a .vhd file. Then I compiled it with

ghdl -a test.vhd

and then built and executable fi

4条回答
  •  抹茶落季
    2021-02-02 02:19

    I don't know if this is exactly relevant to this discussion. However, I am excited that I managed to install GHDL on my Mac, El Capitan today. I downloaded the latest GHDL version from ghdl.free.fr for mac and everything installed okay. I did get a message saying that the object files were a newer format or something along those lines. Still, my vhdl code compiled.

    I did have an issue trying to compile a test bench for said vhdl code. When I compiled them separately I got error messages. When I compiled them together, that is

    ghdl -a code.vhdl code_tb.vhdl
    

    everything worked as you would expect it to.

    ghdl -e code_tb 
    

    worked and so did

    ghdl -r code_tb --vcd=code.vcd 
    

    So maybe there was an issue with how the vhdl was compiled. In my case, unlike in Ubuntu, I had to analyze code.vhdl and code_tb.vhdl together. Perhaps this may be useful to future readers.

提交回复
热议问题