-
-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix crash with array of record subtypes. Issue #615
- Loading branch information
Showing
5 changed files
with
103 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
(32768,0) | ||
(32138,6393) | ||
(30274,12540) | ||
(27246,18205) | ||
(23170,23170) | ||
(18205,27246) | ||
(12540,30274) | ||
(6393,32138) | ||
(0,32768) | ||
(-6393,32138) | ||
(-12540,30274) | ||
(-18205,27246) | ||
(-23170,23170) | ||
(-27246,18205) | ||
(-30274,12540) | ||
(-32138,6393) | ||
(-32768,0) | ||
(-32138,-6393) | ||
(-30274,-12540) | ||
(-27246,-18205) | ||
(-23170,-23170) | ||
(-18205,-27246) | ||
(-12540,-30274) | ||
(-6393,-32138) | ||
(0,-32768) | ||
(6393,-32138) | ||
(12540,-30274) | ||
(18205,-27246) | ||
(23170,-23170) | ||
(27246,-18205) | ||
(30274,-12540) | ||
(32138,-6393) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
-- Test case from Brian Padalino | ||
library ieee ; | ||
use ieee.std_logic_1164.all ; | ||
use ieee.numeric_std.all ; | ||
use ieee.math_real.all ; | ||
|
||
use std.textio.all ; | ||
|
||
entity issue615 is | ||
end entity ; | ||
|
||
architecture arch of issue615 is | ||
|
||
constant LUT_DEPTH : positive := 32 ; | ||
|
||
type cx_t is record | ||
re : signed ; | ||
im : signed ; | ||
end record ; | ||
|
||
function to_string(x : cx_t) return string is | ||
begin | ||
return "(" & | ||
to_string(to_integer(x.re)) & | ||
"," & | ||
to_string(to_integer(x.im)) & | ||
")" ; | ||
end function ; | ||
|
||
subtype c18_t is cx_t( re(17 downto 0), im(17 downto 0) ); | ||
|
||
type c18s_t is array(natural range <>) of c18_t ; | ||
|
||
function sincos(n : positive) return c18s_t is | ||
variable rv : c18s_t(0 to n-1) ; | ||
begin | ||
for idx in 0 to n-1 loop | ||
rv(idx).re := to_signed(integer(round(32768.0*cos(2.0*MATH_PI*real(idx)/real(n)))), 18) ; | ||
rv(idX).im := to_signed(integer(round(32768.0*sin(2.0*MATH_PI*real(idx)/real(n)))), 18) ; | ||
end loop ; | ||
return rv ; | ||
end function ; | ||
|
||
constant sincos_lut : c18s_t(0 to LUT_DEPTH-1) := sincos(LUT_DEPTH) ; | ||
|
||
begin | ||
|
||
tb : process | ||
variable l : line ; | ||
begin | ||
for idx in sincos_lut'range loop | ||
write(l, to_string(sincos_lut(idx))) ; | ||
writeline(output, l) ; | ||
end loop ; | ||
std.env.stop ; | ||
end process ; | ||
|
||
end architecture ; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -713,3 +713,4 @@ cmdline5 shell | |
issue603 normal | ||
issue609 normal | ||
issue618 normal,gA='1',gB='0' | ||
issue615 normal,gold,2008 |