aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/synth/gen01/pkg04.vhdl
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2022-01-16 19:12:07 +0100
committerTristan Gingold <tgingold@free.fr>2022-01-16 19:12:07 +0100
commitaee3585afb2d5797d3cca5f13ae4a2c1a64b1267 (patch)
treeddb837d1ceadb11e93840c2d0cdba63e5f8ded38 /testsuite/synth/gen01/pkg04.vhdl
parent8503d1a87282fdd57e7cd85007799ad752ebf048 (diff)
downloadghdl-aee3585afb2d5797d3cca5f13ae4a2c1a64b1267.tar.gz
ghdl-aee3585afb2d5797d3cca5f13ae4a2c1a64b1267.tar.bz2
ghdl-aee3585afb2d5797d3cca5f13ae4a2c1a64b1267.zip
testsuite/synth: add more tests for generic packages
Diffstat (limited to 'testsuite/synth/gen01/pkg04.vhdl')
-rw-r--r--testsuite/synth/gen01/pkg04.vhdl27
1 files changed, 27 insertions, 0 deletions
diff --git a/testsuite/synth/gen01/pkg04.vhdl b/testsuite/synth/gen01/pkg04.vhdl
new file mode 100644
index 000000000..ccca9056e
--- /dev/null
+++ b/testsuite/synth/gen01/pkg04.vhdl
@@ -0,0 +1,27 @@
+package gen is
+ generic (val : integer);
+
+ constant c : integer := val;
+
+ function get_val (x : integer := c) return integer;
+end;
+
+package body gen is
+ function get_val (x : integer := c) return integer is
+ begin
+ return x + val;
+ end get_val;
+end;
+
+package inst1 is new work.gen generic map (val => 5);
+
+entity pkg04 is
+ port (i : in integer;
+ o : out integer);
+end pkg04;
+
+architecture behav of pkg04 is
+ use work.inst1.all;
+begin
+ o <= i + get_val;
+end behav;