How to simulate VHDL

Discussion in 'General Electronics Chat' started by El3, Nov 16, 2014.

  1. El3

    Thread Starter Member

    Sep 13, 2014
    I want to try writing some VHDL code and simulating it. I don't want to connect it to any hardware at the moment, I just want to simulate it on computer to start with.

    I found a plugin for Eclipse called Sigasi where you can write VHDL code. It seems to work well. So for example I added this mux:

    Code (Text):
    1. --MUX2_1
    2. --2001-07-27 Lars-H Hemert
    4. library IEEE;
    5. use IEEE.std_logic_1164.all;
    7. entity MUX2_1 is
    8.   port(d_in0, d_in1, adress: in std_logic;
    9.   d_ut: out std_logic);
    10. end entity MUX2_1;
    12. architecture beteende of MUX2_1 is
    13. begin
    14.   d_ut <= (not adress and d_in0) or (adress and d_in1);
    15. end architecture beteende;
    Now how do I simulate it? I want now to add some values for inputs and see what the output becomes when simulating it. How do I do that?
  2. Veracohr

    Well-Known Member

    Jan 3, 2011
    Did you search the internet for "VHDL simulator"?
  3. El3

    Thread Starter Member

    Sep 13, 2014
    Yes, did you miss that I wrote this?
    So in this program, I can write the code and it "simulates" it (checks if it's correct syntax etc). The question is rather, how do I check that the code actually works the way I intend? I mean how can I test the code?
  4. Veracohr

    Well-Known Member

    Jan 3, 2011
    Oh, yeah I guess I did miss that. I've only used the Xilinx ISE suite. If I recall, checking the syntax and simulating for functionality are (in ISE) separate actions. I don't know about what you have, but surely there's some documentation on it.
  5. kubeek

    AAC Fanatic!

    Sep 20, 2005
    You missed the basic fact that code editor does not equal simulator. You need to get either some IDE like Xilinx ISE or from Altera, or you need to download some standalone simulator like Modelsim (but that one is a really clumsy piece of software..)

    So I suggest you get either one of those IDEs and start using it as a simulator. Later you can use it to program the chips as well.
  6. tshuck

    Well-Known Member

    Oct 18, 2012
    Here is a list of HDL simulators, most are usable.

    Note: this list includes strictly Verilog simulators as well.

    You will probably have to write a testbench (good thing to do, regardless of whether your simulator can generate one for you, or not) to exercise your model.

    I don't see it....
    absf likes this.
  7. Brownout

    Well-Known Member

    Jan 10, 2012
    I use a free version of Modelsim. It has an easy user interface, and you can find tutorials online.
    El3 and ConnieKeefe like this.