aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/gna/bug18280/alias_bug.vhd
blob: c9e5caab6ab6efd826e064e08ea886e3a702c037 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
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;