aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/synth/synth108/mwe.vhdl
blob: af286bc9ed7c9c03a970d270c70ee0176ca75193 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;

entity MWE is

  port (
    a   : in std_logic_vector(0 to 3);
    b   : in std_logic_vector(0 to 3);
    sel : in std_logic_vector(0 to 1);
    o   : out std_logic_vector(0 to 1)
  );
end MWE;

architecture behavioral of MWE is
  signal cnt : integer range 0 to 1;
begin
  cnt <= to_integer(unsigned(sel));
  o <= a(cnt*o'length to (cnt + 1)*o'length - 1) xor b(cnt*o'length to (cnt + 1)*o'length - 1);
end architecture behavioral;