diff options
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/gna/bug18280/alias_bug.txt | 33 | ||||
-rw-r--r-- | testsuite/gna/bug18280/alias_bug.vhd | 41 | ||||
-rw-r--r-- | testsuite/gna/bug18280/ghdc.bat | 2 | ||||
-rwxr-xr-x | testsuite/gna/bug18280/testsuite.sh | 10 |
4 files changed, 86 insertions, 0 deletions
diff --git a/testsuite/gna/bug18280/alias_bug.txt b/testsuite/gna/bug18280/alias_bug.txt new file mode 100644 index 0000000..b86e47d --- /dev/null +++ b/testsuite/gna/bug18280/alias_bug.txt @@ -0,0 +1,33 @@ +
+ The Windows 0.29.1 GHDL build errors at compile time when
+an attribute is placed on a signal for which an alias has
+previously been created.
+
+--------
+
+Code snippet from attached <alias_bug.vhd> example:
+
+ signal processor_address : std_logic_vector(15 downto 0);
+
+ alias address_ms : std_logic_vector(3 downto 0) is processor_address(15 downto 12);
+
+ attribute keep : boolean;
+ attribute keep of processor_address: signal is TRUE;
+
+Resulting error message:
+
+ .\alias_bug.vhd:35:13: alias "address_ms" does not denote the entire object
+
+--------
+
+Workaround:
+
+ Moving the alias _after_ the attribute causes the error to go away.
+
+--------
+
+alias_bug.zip contents :
+
+ alias_bug.txt this file
+ alias_bug.vhd test program to demonstrate alias bug
+ ghdc.bat batch file to invoke compiler
diff --git a/testsuite/gna/bug18280/alias_bug.vhd b/testsuite/gna/bug18280/alias_bug.vhd new file mode 100644 index 0000000..c9e5caa --- /dev/null +++ b/testsuite/gna/bug18280/alias_bug.vhd @@ -0,0 +1,41 @@ +--
+-- <alias_bug.vhd>
+--
+-- Illustrates GHDL 0.29.1 WinXP problem with attributes and aliases
+--
+-- Problem:
+-- A signal attribute, placed after an alias on the signal, causes errors like this:
+--
+-- .\alias_bug.vhd:35:13: alias "address_ms" does not denote the entire object
+--
+--
+-- Workaround: move the attribute before the alias
+--
+
+library ieee;
+ use ieee.std_logic_1164.all;
+ use ieee.numeric_std.all;
+
+entity alias_bug is
+end alias_bug;
+
+architecture test of alias_bug is
+
+ signal processor_address : std_logic_vector(15 downto 0);
+
+ --
+ -- if alias is _NOT_ declared, error goes away
+ --
+ alias address_ms : std_logic_vector(3 downto 0) is processor_address(15 downto 12);
+
+ --
+ -- if the keep attribute is placed _BEFORE_ the alias, no error occurs
+ --
+ attribute keep : boolean;
+ attribute keep of processor_address: signal is TRUE;
+
+ begin
+
+ processor_address <= X"1234";
+
+ end test;
diff --git a/testsuite/gna/bug18280/ghdc.bat b/testsuite/gna/bug18280/ghdc.bat new file mode 100644 index 0000000..aca169b --- /dev/null +++ b/testsuite/gna/bug18280/ghdc.bat @@ -0,0 +1,2 @@ +ghdl -a alias_bug.vhd
+ghdl -r alias_bug.vhd
\ No newline at end of file diff --git a/testsuite/gna/bug18280/testsuite.sh b/testsuite/gna/bug18280/testsuite.sh new file mode 100755 index 0000000..8856ba5 --- /dev/null +++ b/testsuite/gna/bug18280/testsuite.sh @@ -0,0 +1,10 @@ +#! /bin/sh + +. ../../testenv.sh + +analyze alias_bug.vhd +elab_simulate alias_bug + +clean + +echo "Test successful" |