M
Markus Jochim
Guest
Hello everybody,
I just started with VHDL and I have three (probably simple) questions:
Using Alteras Quartus 2 Tool I want to do some VHDL simulation:
A simple example:
ARCHITECTURE TEST OF TEST IS
BEGIN
x <= i after 20 ns;
END TEST;
Using the simulator that is integrated in Quartus 2 I generated a simple
waveform where:
i = ' 0 ' form 0 ns to 10 ns
i = ' 1 ' for time > 10 ns
When I switch to "Functional Simulation" timing is ignored (as
expected). When I switch to "Timing Simulation" I get:
x = '1' for time > 23 ns
which obviously reflects the timing of the FPGA for which the design was
synthesised by Quartus II.
Now my questions are as follows:
Question 1: How can I just perform a VHDL simulation that reflects the
timing expressed by the statement "... after 20 ns"?
Question 2: How can I instruct Quartus II to accept all valid VHDL-code
and not only code that actually can be synthesised? I just want to
simulate a VHDL model!
Question 3: How can run simple test benches written in VHDL (like in the
example attached below) and watch the resulting waveforms using Quartus II.
Any help is highly appreciated!
Best regards
Markus
-- Test Bench:
LIBRARY IEEE;
USE IEEE.std_logic_1164.ALL;
ENTITY TEST IS
PORT (
i1, i2: IN std_logic;
o: OUT std_logic
);
END TEST;
ARCHITECTURE TEST OF TEST IS
BEGIN
o <= i1 and i2;
END TEST;
LIBRARY IEEE;
USE IEEE.std_logic_1164.ALL;
ENTITY TB_TEST IS
END TB_TEST;
ARCHITECTURE TB_TEST of TB_TEST is
COMPONENT TEST IS
PORT (
i1, i2: IN std_logic;
o: OUT std_logic
);
END COMPONENT;
SIGNAL w_i1, w_i2: std_logic;
BEGIN
DUT:
TEST PORT MAP( i1 => w_i1,
i2 => w_i2);
STIMULI:
PROCESS
BEGIN
w_i1 <= '1';
WAIT FOR 50 ns;
w_i2 <= '1';
WAIT FOR 50 ns;
w_i1 <= '0';
WAIT FOR 50 ns;
END PROCESS STIMULI;
END TB_TEST;
I just started with VHDL and I have three (probably simple) questions:
Using Alteras Quartus 2 Tool I want to do some VHDL simulation:
A simple example:
ARCHITECTURE TEST OF TEST IS
BEGIN
x <= i after 20 ns;
END TEST;
Using the simulator that is integrated in Quartus 2 I generated a simple
waveform where:
i = ' 0 ' form 0 ns to 10 ns
i = ' 1 ' for time > 10 ns
When I switch to "Functional Simulation" timing is ignored (as
expected). When I switch to "Timing Simulation" I get:
x = '1' for time > 23 ns
which obviously reflects the timing of the FPGA for which the design was
synthesised by Quartus II.
Now my questions are as follows:
Question 1: How can I just perform a VHDL simulation that reflects the
timing expressed by the statement "... after 20 ns"?
Question 2: How can I instruct Quartus II to accept all valid VHDL-code
and not only code that actually can be synthesised? I just want to
simulate a VHDL model!
Question 3: How can run simple test benches written in VHDL (like in the
example attached below) and watch the resulting waveforms using Quartus II.
Any help is highly appreciated!
Best regards
Markus
-- Test Bench:
LIBRARY IEEE;
USE IEEE.std_logic_1164.ALL;
ENTITY TEST IS
PORT (
i1, i2: IN std_logic;
o: OUT std_logic
);
END TEST;
ARCHITECTURE TEST OF TEST IS
BEGIN
o <= i1 and i2;
END TEST;
LIBRARY IEEE;
USE IEEE.std_logic_1164.ALL;
ENTITY TB_TEST IS
END TB_TEST;
ARCHITECTURE TB_TEST of TB_TEST is
COMPONENT TEST IS
PORT (
i1, i2: IN std_logic;
o: OUT std_logic
);
END COMPONENT;
SIGNAL w_i1, w_i2: std_logic;
BEGIN
DUT:
TEST PORT MAP( i1 => w_i1,
i2 => w_i2);
STIMULI:
PROCESS
BEGIN
w_i1 <= '1';
WAIT FOR 50 ns;
w_i2 <= '1';
WAIT FOR 50 ns;
w_i1 <= '0';
WAIT FOR 50 ns;
END PROCESS STIMULI;
END TB_TEST;