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

entity revrng01 is
  port (a : std_logic_vector (7 downto 0);
        o : out std_logic_vector (7 downto 0));
end revrng01;

architecture behav of revrng01 is
  function rev (v : std_logic_vector) return std_logic_vector
  is
    variable temp : std_logic_vector(v'reverse_range);
  begin
    for i in v'range loop
      temp (i) := v (i);
    end loop;
    return temp;
  end rev;
begin
  o <= rev (a);
end behav;