aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/gna/issue531/repro1.vhdl
blob: 7cf8e3c65a9b12fe864c62cce5435652b90734b8 (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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
library ieee;
   use ieee.std_logic_1164.all;
   use ieee.numeric_std.all;

entity submodule is
port (
   clk    : in  std_logic;
   arg : in  std_logic_vector(7 downto 0);
   res : out std_logic_vector(7 downto 0)
);
end submodule;

architecture rtl of submodule is
begin
  sub_proc : process(clk)
    variable last : std_logic_vector(7 downto 0);
   begin
      if rising_edge(clk) then
         res <= arg XOR last;
         last := arg;
      end if;
   end process sub_proc;

    monitor : process(clk)
   begin
      if rising_edge(clk) then
        report "arg: " & integer'image(to_integer(unsigned(arg)));
      end if;
   end process;
end rtl;


library ieee;
   use ieee.std_logic_1164.all;

entity sliced_ex is
port (
   arg_a : in  std_logic_vector(3 downto 0);
   arg_b : in  std_logic_vector(3 downto 0)
);
end sliced_ex;

architecture rtl of sliced_ex is
  signal clk   :  std_logic;
begin
   process
   begin
     clk <= '0';
     for i in 1 to 5 * 2 loop
       wait for 10 ns;
       clk <= not clk;
     end loop;
     wait;
   end process;

   sub_module : entity work.submodule
   port map (
      clk => clk,

      -- This one fails
      arg(3 downto 0) => arg_a(3 downto 0),
      arg(7 downto 4) => arg_b(3 downto 0),

      res => OPEN
   );

end rtl;