On 4/04/11 12:54 PM, David G. Koontz wrote:
> On 3/04/11 7:51 PM, Tristan Gingold wrote:
>> > Thank you for the investigation. I will try to understand why revision
>> > 143 doesn't work.
>> >
>
> I'll trade you and test my fix to Mr. Landaker's rol/ror bug, submit it as a
> bug and a patch.
While looking at Mr. Landaker's bug I found it crashed with some mods I had
done (bit_vector_rol_ror_bug1.vhdl) while ran and reported the errors with
his original code (bit_vector_rol_ror_bug.vhdl).
Under Revision 142 on a Mac, ghdl_mcode version:
Macbook: ghdl -a bit_vector_rol_ror_bug.vhdl
ghdl -r bit_vector_rol_ror_bug
bit_vector_rol_ror_bug.vhdl:20:3:@0ms:(assertion warning): ror 5 is broken
bit_vector_rol_ror_bug.vhdl:28:3:@0ms:(assertion warning): rol -5 is broken
Macbook: ghdl -a bit_vector_rol_ror_bug1.vhdl
Macbook: ghdl -r bit_vector_rol_ror_bug (bit_vector_rol_ror_bug1.vhdl)
******************** GHDL Bug occured ****************************
Please report this bug on http://gna.org/projects/ghdl
GHDL release: GHDL 0.29 (20100109) [Sokcho edition]
Compiled with GNAT Version: 4.4.0 20080314 (experimental)
In directory: /Users/david_koontz/Desktop/ghdl rorate error/ghdl_rotate_error/
Command line:
ghdl -r bit_vector_rol_ror_bug
Exception CONSTRAINT_ERROR raised
Exception information:
Exception name: CONSTRAINT_ERROR
Message: ortho_code-consts.adb:89 index check failed
Call stack traceback locations:
0x76b55 0xa659a 0xa6764 0xa6889 0xa7078 0x890f9 0xaa354 0x1bb3b4 0x189936
0x194c0d 0x195417 0x18ac4a 0x18b2e2 0x195793 0x18d183 0x1955d8 0x18d148
0x1955d8 0x195417 0x1a52c7 0x1a552f 0x1ae9f9 0x1aeb22 0x1b0de9 0x1b4ead
0x1503e0 0x1ddcf1 0x1d70af 0x1e787e 0x1ee45e 0x1ed0bc 0xc2370 0x2f6f 0x2483
******************************************************************
Under ghdl-0.29 (revision 143 on Linux ghdl mcode version):
%VBox: ghdl -a bit_vector_rol_ror_bug1.vhdl
%VBox: ghdl -r bit_vector_rol_ror_bug
******************** GHDL Bug occured ****************************
Please report this bug on http://gna.org/projects/ghdl
GHDL release: GHDL 0.29 (20100109) [Sokcho edition]
Compiled with GNAT Version: 4.4.5 20100909 (prerelease)
In directory: /mnt/share/ghdl rorate error/ghdl_rotate_error/
Command line:
ghdl -r bit_vector_rol_ror_bug
Exception CONSTRAINT_ERROR raised
Exception information:
Exception name: CONSTRAINT_ERROR
Message: ortho_code-types.adb:115 index check failed
Call stack traceback locations:
0x80bc2d3 0x80d2fbe 0x80d30e2 0x80d31fa 0x80d393e 0x80ba00a 0x80d64db
0x81bf301 0x8194414 0x819d7ec 0x819de79 0x8195400 0x8195952 0x819e1b3
0x819747b 0x819e01c 0x8197440 0x819e01c 0x819de79 0x81ac1fc 0x81ac426
0x81b464c 0x81b4767 0x81b66c1 0x81b9cf6 0x816281f 0x81dc854 0x81d6894
0x81e4ee2 0x81ea295 0x81e95f3 0x80ea2b1 0x804d3e8 0x54ece5
******************************************************************
Under ghdl-0.29 (revision 136 as released, Linux ghdl front end version):
%VBox: ghdl -a bit_vector_rol_ror_bug1.vhdl
%VBox: ghdl -e bit_vector_rol_ror_bug
%VBox: ghdl -e bit_vector_rol_ror_bug
bit_vector_rol_ror_bug1.vhdl:41:3:@0ms:(assertion warning): ror 5 is broken
11100 produces 00000!
bit_vector_rol_ror_bug1.vhdl:49:3:@0ms:(assertion warning): rol -5 is broken
11100 produces 00000!
Under ghdl-0.28 (revision 136 as released, Mac OS X ghdl mcode version):
ghdl -a bit_vector_rol_ror_bug1.vhdl
Macbook: ghdl -r bit_vector_rol_ror_bug
******************** GHDL Bug occured ****************************
Please report this bug on http://gna.org/projects/ghdl
GHDL release: GHDL 0.29 (20100109) [Sokcho edition]
Compiled with GNAT Version: 4.4.0 20080314 (experimental)
In directory: /Users/david_koontz/Desktop/ghdl rorate error/ghdl_rotate_error/
Command line:
ghdl -r bit_vector_rol_ror_bug
Exception CONSTRAINT_ERROR raised
Exception information:
Exception name: CONSTRAINT_ERROR
Message: ortho_code-consts.adb:76 index check failed
Call stack traceback locations:
0x76d29 0xa6662 0xa682c 0xa6951 0xa7140 0x892ad 0xaa41c 0x1bb3dc 0x18995e
0x194c35 0x19543f 0x18ac72 0x18b30a 0x1957bb 0x18d1ab 0x195600 0x18d170
0x195600 0x19543f 0x1a52ef 0x1a5557 0x1aea21 0x1aeb4a 0x1b0e11 0x1b4ed5
0x150408 0x1ddd19 0x1d70d7 0x1e78a6 0x1ee486 0x1ed0e4 0xc243c 0x315a 0x2663
******************************************************************
Under ghdl-0.27 (revision 108 as released, Mac OS X ghdl mcode version):
Macbook: ghdl -a bit_vector_rol_ror_bug1.vhdl
david_koontz@Macbook: ghdl -r bit
bit_vector_rol_ror_bug* bit_vector_rol_ror_bug1.o
bit_vector_rol_ror_bug.vhdl* bit_vector_rol_ror_bug1.vhdl
david_koontz@Macbook: ghdl -r bit_vector_rol_ror_bug
Segmentation violation
(I checked the right Stack_Boundary value was represented for all mcode
versions, in particular after finding a Segmentation violation.)
This seems to say there is a fundamental difference between the mcode and
front end versions. This Linux front end version is a deb file from ubuntu.
I no longer have the ghdl-0.28 Linux front end version on kubuntu 0.28 I ran
the bit_vector_rol_ror_bug1.vhdl generated bit_vector_rol_ror bug elaborated
mode on originally. It ran too.
The modification was to demonstrate the index was out of range and did not
simply demonstrate a modulo error.
report "rol -5 is broken " & TO_STRING(bit_vector'("11100"))&" produces "&
TO_STRING(bit_vector'(("11100") ror 5)) &"!"
And output:
bit_vector_rol_ror_bug1.vhdl:49:3:@0ms:(assertion warning): rol -5 is broken
11100 produces 00000!
The value following the key word report required to be a string.
Oh, and I checked in at least one revision that the extraneous
library ieee;
and
use ieee.std_logic_1164.all;
had no effect.
I happen to have been able to recover the make output from building the
Linux revision 143 mcode version of ghdl if that would be of interest. I
turned my konsole (and iterm2) history to unlimited in both Mac OS X and the
Virtual Box kubuntu 10.10, and have been halting the Linux machine by saving
and restoring.
entity bit_vector_rol_ror_bug is
end entity;
architecture ghdl_bug of bit_vector_rol_ror_bug is
begin
assert ((bit_vector'("11100") ror -8) = "00111") report "ror -8 is broken"
severity warning;
assert ((bit_vector'("11100") ror -7) = "10011") report "ror -7 is broken"
severity warning;
assert ((bit_vector'("11100") ror -6) = "11001") report "ror -6 is broken"
severity warning;
assert ((bit_vector'("11100") ror -5) = "11100") report "ror -5 is broken"
severity warning;
assert ((bit_vector'("11100") ror -4) = "01110") report "ror -4 is broken"
severity warning;
assert ((bit_vector'("11100") ror -3) = "00111") report "ror -3 is broken"
severity warning;
assert ((bit_vector'("11100") ror -2) = "10011") report "ror -2 is broken"
severity warning;
assert ((bit_vector'("11100") ror -1) = "11001") report "ror -1 is broken"
severity warning;
assert ((bit_vector'("11100") ror 0) = "11100") report "ror 0 is broken"
severity warning;
assert ((bit_vector'("11100") ror 1) = "01110") report "ror 1 is broken"
severity warning;
assert ((bit_vector'("11100") ror 2) = "00111") report "ror 2 is broken"
severity warning;
assert ((bit_vector'("11100") ror 3) = "10011") report "ror 3 is broken"
severity warning;
assert ((bit_vector'("11100") ror 4) = "11001") report "ror 4 is broken"
severity warning;
assert ((bit_vector'("11100") ror 5) = "11100") report "ror 5 is broken"
severity warning;
assert ((bit_vector'("11100") ror 6) = "01110") report "ror 6 is broken"
severity warning;
assert ((bit_vector'("11100") ror 7) = "00111") report "ror 7 is broken"
severity warning;
assert ((bit_vector'("11100") ror 8) = "10011") report "ror 8 is broken"
severity warning;
assert ((bit_vector'("11100") rol -8) = "10011") report "rol -8 is broken"
severity warning;
assert ((bit_vector'("11100") rol -7) = "00111") report "rol -7 is broken"
severity warning;
assert ((bit_vector'("11100") rol -6) = "01110") report "rol -6 is broken"
severity warning;
assert ((bit_vector'("11100") rol -5) = "11100") report "rol -5 is broken"
severity warning;
assert ((bit_vector'("11100") rol -4) = "11001") report "rol -4 is broken"
severity warning;
assert ((bit_vector'("11100") rol -3) = "10011") report "rol -3 is broken"
severity warning;
assert ((bit_vector'("11100") rol -2) = "00111") report "rol -2 is broken"
severity warning;
assert ((bit_vector'("11100") rol -1) = "01110") report "rol -1 is broken"
severity warning;
assert ((bit_vector'("11100") rol 0) = "11100") report "rol 0 is broken"
severity warning;
assert ((bit_vector'("11100") rol 1) = "11001") report "rol 1 is broken"
severity warning;
assert ((bit_vector'("11100") rol 2) = "10011") report "rol 2 is broken"
severity warning;
assert ((bit_vector'("11100") rol 3) = "00111") report "rol 3 is broken"
severity warning;
assert ((bit_vector'("11100") rol 4) = "01110") report "rol 4 is broken"
severity warning;
assert ((bit_vector'("11100") rol 5) = "11100") report "rol 5 is broken"
severity warning;
assert ((bit_vector'("11100") rol 6) = "11001") report "rol 6 is broken"
severity warning;
assert ((bit_vector'("11100") rol 7) = "10011") report "rol 7 is broken"
severity warning;
assert ((bit_vector'("11100") rol 8) = "00111") report "rol 8 is broken"
severity warning;
end architecture;library ieee;
use ieee.std_logic_1164.all;
entity bit_vector_rol_ror_bug is
end entity;
architecture ghdl_bug of bit_vector_rol_ror_bug is
function TO_STRING (VALUE : BIT_VECTOR) return STRING is
alias ivalue : BIT_VECTOR(1 to value'length) is value;
variable result : STRING(1 to value'length);
begin
if value'length < 1 then
return "";
else
for i in ivalue'range loop
if iValue(i) = '0' then
result(i) := '0';
else
result(i) := '1';
end if;
end loop;
return result;
end if;
end function to_string;
begin
assert ((bit_vector'("11100") ror -8) = "00111") report "ror -8 is broken"
severity warning;
assert ((bit_vector'("11100") ror -7) = "10011") report "ror -7 is broken"
severity warning;
assert ((bit_vector'("11100") ror -6) = "11001") report "ror -6 is broken"
severity warning;
assert ((bit_vector'("11100") ror -5) = "11100") report "ror -5 is broken"
severity warning;
assert ((bit_vector'("11100") ror -4) = "01110") report "ror -4 is broken"
severity warning;
assert ((bit_vector'("11100") ror -3) = "00111") report "ror -3 is broken"
severity warning;
assert ((bit_vector'("11100") ror -2) = "10011") report "ror -2 is broken"
severity warning;
assert ((bit_vector'("11100") ror -1) = "11001") report "ror -1 is broken"
severity warning;
assert ((bit_vector'("11100") ror 0) = "11100") report "ror 0 is broken"
severity warning;
assert ((bit_vector'("11100") ror 1) = "01110") report "ror 1 is broken"
severity warning;
assert ((bit_vector'("11100") ror 2) = "00111") report "ror 2 is broken"
severity warning;
assert ((bit_vector'("11100") ror 3) = "10011") report "ror 3 is broken"
severity warning;
assert ((bit_vector'("11100") ror 4) = "11001") report "ror 4 is broken"
severity warning;
assert ((bit_vector'("11100") ror 5) = "11100") report string'("ror 5 is
broken " & TO_STRING(bit_vector'("11100"))&" produces "&
TO_STRING(bit_vector'(("11100") ror 5)) &"!") severity warning;
assert ((bit_vector'("11100") ror 6) = "01110") report "ror 6 is broken"
severity warning;
assert ((bit_vector'("11100") ror 7) = "00111") report "ror 7 is broken"
severity warning;
assert ((bit_vector'("11100") ror 8) = "10011") report "ror 8 is broken"
severity warning;
assert ((bit_vector'("11100") rol -8) = "10011") report "rol -8 is broken"
severity warning;
assert ((bit_vector'("11100") rol -7) = "00111") report "rol -7 is broken"
severity warning;
assert ((bit_vector'("11100") rol -6) = "01110") report "rol -6 is broken"
severity warning;
assert ((bit_vector'("11100") rol -5) = "11100") report string'("rol -5 is
broken " & TO_STRING(bit_vector'("11100"))&" produces "&
TO_STRING(bit_vector'(("11100") rol 5)) &"!") severity warning;
assert ((bit_vector'("11100") rol -4) = "11001") report "rol -4 is broken"
severity warning;
assert ((bit_vector'("11100") rol -3) = "10011") report "rol -3 is broken"
severity warning;
assert ((bit_vector'("11100") rol -2) = "00111") report "rol -2 is broken"
severity warning;
assert ((bit_vector'("11100") rol -1) = "01110") report "rol -1 is broken"
severity warning;
assert ((bit_vector'("11100") rol 0) = "11100") report "rol 0 is broken"
severity warning;
assert ((bit_vector'("11100") rol 1) = "11001") report "rol 1 is broken"
severity warning;
assert ((bit_vector'("11100") rol 2) = "10011") report "rol 2 is broken"
severity warning;
assert ((bit_vector'("11100") rol 3) = "00111") report "rol 3 is broken"
severity warning;
assert ((bit_vector'("11100") rol 4) = "01110") report "rol 4 is broken"
severity warning;
assert ((bit_vector'("11100") rol 5) = "11100") report "rol 5 is broken"
severity warning;
assert ((bit_vector'("11100") rol 6) = "11001") report "rol 6 is broken"
severity warning;
assert ((bit_vector'("11100") rol 7) = "10011") report "rol 7 is broken"
severity warning;
assert ((bit_vector'("11100") rol 8) = "00111") report "rol 8 is broken"
severity warning;
end architecture;_______________________________________________
Ghdl-discuss mailing list
[email protected]
https://mail.gna.org/listinfo/ghdl-discuss