aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/gna/issue44/dffregister.vhdl
blob: b976412eeb4066db6912b5ac7f1503346e829637 (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
-- dffregister.vhd
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;

entity dffregister is
  generic (word_size: integer);
	port(clk, reset: in std_logic;
  d:in signed(word_size-1 downto 0);
  reset_word: in signed(word_size-1 downto 0);
  q:out signed(word_size-1 downto 0));
end dffregister;

architecture dffregister_arch of dffregister is
  signal arr:signed(word_size -1 downto 0);

begin
  q <= arr;
  process(reset, clk)
  begin
    if reset = '1' then
      arr <= reset_word;
  elsif rising_edge(clk) then
      arr <= d;
    end if;

  end process;

end dffregister_arch;