From dcf9335a06eb78c5d977945f713f326e6288ae9a Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Sat, 10 Jan 2015 16:06:11 +0100 Subject: File bug23165. --- testsuite/gna/bug23165/mwe_working/counter.vhd | 33 ++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 testsuite/gna/bug23165/mwe_working/counter.vhd (limited to 'testsuite/gna/bug23165/mwe_working/counter.vhd') diff --git a/testsuite/gna/bug23165/mwe_working/counter.vhd b/testsuite/gna/bug23165/mwe_working/counter.vhd new file mode 100644 index 0000000..9982f1d --- /dev/null +++ b/testsuite/gna/bug23165/mwe_working/counter.vhd @@ -0,0 +1,33 @@ +-- counter +-- clk: clock input +-- en: enable input +-- rst: reset input +-- dir: direction pin (1 = up, 0 = down) +-- q: output + +library ieee; +use ieee.std_logic_1164.all; +use ieee.numeric_std.all; + +entity counter is + generic ( + width : positive := 16 + ); + + port ( + clk : in std_logic; + q : out std_logic_vector(width-1 downto 0) + ); +end counter; + +architecture behav of counter is +signal cnt : unsigned(width-1 downto 0) := to_unsigned(0, width); +begin + process + begin + wait until rising_edge(clk); + cnt <= cnt + to_unsigned(1, cnt'length); + end process; + q <= std_logic_vector(cnt); +end behav; + -- cgit