aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/issues/issue102
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/issues/issue102')
-rw-r--r--testsuite/issues/issue102/counters_8.vhdl25
-rwxr-xr-xtestsuite/issues/issue102/testsuite.sh9
2 files changed, 34 insertions, 0 deletions
diff --git a/testsuite/issues/issue102/counters_8.vhdl b/testsuite/issues/issue102/counters_8.vhdl
new file mode 100644
index 0000000..57ff057
--- /dev/null
+++ b/testsuite/issues/issue102/counters_8.vhdl
@@ -0,0 +1,25 @@
+library ieee;
+use ieee.std_logic_1164.all;
+use ieee.std_logic_arith.all;
+
+entity counters_8 is
+ generic (MAX : integer := 12);
+ port(C, CLR : in std_logic;
+ Q : out integer range 0 to MAX-1);
+end counters_8;
+
+architecture archi of counters_8 is
+ signal cnt : integer range 0 to MAX-1;
+begin
+ process (C, CLR)
+ begin
+ if (CLR='1') then
+ cnt <= 0;
+ elsif (rising_edge(C)) then
+ cnt <= (cnt + 1) mod MAX ;
+ end if;
+ end process;
+
+ Q <= cnt;
+
+end archi;
diff --git a/testsuite/issues/issue102/testsuite.sh b/testsuite/issues/issue102/testsuite.sh
new file mode 100755
index 0000000..8dd56b9
--- /dev/null
+++ b/testsuite/issues/issue102/testsuite.sh
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+topdir=../..
+. $topdir/testenv.sh
+
+synth_import -fsynopsys counters_8.vhdl -e
+
+clean
+echo OK