blob: 755ea5ed82ac666fef390d01d3c8a63465146076 (
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
-- Title : Testcase for unbounded records
-------------------------------------------------------------------------------
library ieee;
use ieee.std_logic_1164.all;
package test_pkg is
type test_rec is record
vec_bound : std_logic_vector(7 downto 0);
vec_unbound : std_logic_vector;
single_bit : std_logic;
end record test_rec;
end test_pkg;
------------------------------------------------------------------------------------------------------------------------------------------------------
-- Inner module
------------------------------------------------------------------------------------------------------------------------------------------------------
library ieee;
use ieee.std_logic_1164.all;
use work.test_pkg.all;
entity test_impl is
port (
clk : in std_logic;
rec_out : out test_rec
);
end entity test_impl;
architecture str of test_impl is
begin -- architecture str
end architecture str;
------------------------------------------------------------------------------------------------------------------------------------------------------
-- Outer Wrapper
------------------------------------------------------------------------------------------------------------------------------------------------------
library ieee;
use ieee.std_logic_1164.all;
use work.test_pkg.all;
entity test is
generic (
unbound_len : natural := 10
);
port (
clk : in std_logic;
rec_out : out test_rec(vec_unbound(unbound_len-1 downto 0)));
end entity test;
architecture str of test is
begin -- architecture str
test_impl_1: entity work.test_impl
port map (
clk => clk, -- [in std_logic]
rec_out => rec_out); -- [out test_rec]
end architecture str;
|