summaryrefslogtreecommitdiff
path: root/testsuite/gna/bug18280/alias_bug.vhd
diff options
context:
space:
mode:
authorTristan Gingold2014-01-01 07:18:58 +0100
committerTristan Gingold2014-01-01 07:18:58 +0100
commit237fd4c864c50a8b0ab99daf198ad60790cb6d0f (patch)
tree315bb7ed4bde66b1f0dea79a5fce454b0adce2f1 /testsuite/gna/bug18280/alias_bug.vhd
parent8f92f5f35a740182637d137b934b539a7a469014 (diff)
downloadghdl-237fd4c864c50a8b0ab99daf198ad60790cb6d0f.tar.gz
ghdl-237fd4c864c50a8b0ab99daf198ad60790cb6d0f.tar.bz2
ghdl-237fd4c864c50a8b0ab99daf198ad60790cb6d0f.zip
Fix bug18280, and add it.
Diffstat (limited to 'testsuite/gna/bug18280/alias_bug.vhd')
-rw-r--r--testsuite/gna/bug18280/alias_bug.vhd41
1 files changed, 41 insertions, 0 deletions
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;