aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/gna/issue560/reproducer.vhdl
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/gna/issue560/reproducer.vhdl')
-rw-r--r--testsuite/gna/issue560/reproducer.vhdl58
1 files changed, 58 insertions, 0 deletions
diff --git a/testsuite/gna/issue560/reproducer.vhdl b/testsuite/gna/issue560/reproducer.vhdl
new file mode 100644
index 000000000..0a7fe319c
--- /dev/null
+++ b/testsuite/gna/issue560/reproducer.vhdl
@@ -0,0 +1,58 @@
+library ieee;
+ use ieee.std_logic_1164.all;
+ use ieee.numeric_std.all;
+
+package reproducer_pkg is
+
+ -- Functions
+ function MIN(LEFT, RIGHT: unsigned) return unsigned;
+ function MIN(LEFT, RIGHT: integer) return integer;
+
+end reproducer_pkg;
+
+package body reproducer_pkg is
+
+ function MIN(LEFT, RIGHT: unsigned) return unsigned is
+ begin
+ if LEFT < RIGHT then
+ return LEFT;
+ else
+ return RIGHT;
+ end if;
+ end;
+
+ function MIN(LEFT, RIGHT: integer) return integer is
+ begin
+ if LEFT < RIGHT then
+ return LEFT;
+ else
+ return RIGHT;
+ end if;
+ end;
+
+end reproducer_pkg;
+library ieee;
+ use ieee.std_logic_1164.all;
+ use ieee.numeric_std.all;
+
+library work;
+ use work.reproducer_pkg.all;
+
+entity reproducer is
+ port(
+ inputA : in unsigned(7 downto 0);
+ inputB : in unsigned(7 downto 0);
+ inputC : in integer;
+ inputD : in integer;
+ OutputA : out unsigned(7 downto 0);
+ OutputB : out integer
+ );
+end reproducer;
+
+architecture rtl of reproducer is
+begin
+
+ OutputA <= min(inputA, inputB);
+ OutputB <= min(inputC, inputD);
+
+end rtl;