A follow-up to my earlier post [1] about trying to get a
known working testbench simulating with GHDL 0.29.1 on WinXP.
I have managed to work through some minor problems ( with
absolute paths, aliases, and attributes ) but have gotten
stuck on what seems to be a fundamental problem with tristates.
Any invocation of the std_logic_vector resolution functions
crashes GHDL with an "invalid memory access" error.
Attached below is an example simulation run [2a] and the
source [3], which is simply the GHDL "hello world" example
with a tristate bus assignment and monitor added.
Removing all but one of the tristate assignments, the example
runs without any crash [2b]
Brian
simulator version info:
GHDL 0.29.1 (20100301) [Sokcho edition]
Compiled with GNAT Version: GPL 2009 (20090519)
mcode code generator
[1] https://mail.gna.org/public/ghdl-discuss/2011-01/msg00007.html
[2a] Simulation run with all three tristate assignments in place:
C:\ghdl_test\tristate_bug>ghdl -a tristate_bug.vhd
C:\ghdl_test\tristate_bug>ghdl -e tristate_bug
C:\ghdl_test\tristate_bug>ghdl -r tristate_bug
Hello world!
C:\Program Files\Ghdl\Bin\ghdl.exe:error: invalid memory access
(dangling accesses or stack size too small)
C:\Program Files\Ghdl\Bin\ghdl.exe:error: simulation failed
[2b] Simulation run with first two assignments commented out:
C:\brian\jobs\ghdl_test\tristate_bug>ghdl -a tristate_bug.vhd
C:\brian\jobs\ghdl_test\tristate_bug>ghdl -e tristate_bug
C:\brian\jobs\ghdl_test\tristate_bug>ghdl -r tristate_bug
Hello world!
0
0
10
[3] Test Program:
--
-- <tristate_bug.vhd>
--
-- illustrates GHDL 0.29.1 WinXP crash problem with tristates
--
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
library std;
use std.textio.all;
entity tristate_bug is
end tristate_bug;
architecture crashes of tristate_bug is
signal tristate_data : std_logic_vector( 3 downto 0 );
begin
--
-- say hello before crashing
--
process
variable l : line;
begin
write (l, String'("Hello world!"));
writeline (output, l);
wait;
end process;
--
-- monitor tristate bus
--
process(tristate_data)
variable l : line;
begin
write (l, to_integer(to_01(unsigned(tristate_data))));
writeline (output, l);
end process;
--
-- tristate assignments, more than one assignment here will crash
GHDL
--
tristate_data <= X"0", ( others => 'Z' ) after 100 ns;
tristate_data <= (others => 'Z'), X"5" after 200 ns, (others =>
'Z') after 400 ns ;
tristate_data <= (others => 'Z'), X"A" after 800 ns;
end crashes;
_______________________________________________
Ghdl-discuss mailing list
[email protected]
https://mail.gna.org/listinfo/ghdl-discuss