blob: 9c286cf87c69b0f55830f6aec9d99fb60cbdf770 (
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
|
package pkg_FileIO is
-------------------------------
-- Define some basic data types
-------------------------------
subtype t_BYTE is integer range 0 to 2**8 - 1;
---------------------------------------
-- And arrays of those basic data types
---------------------------------------
type arr_t_BYTE is array(natural range <>) of t_BYTE;
----------------------------
-- And a pointer to an array
----------------------------
type ptr_arr_t_BYTE is access arr_t_BYTE;
procedure Read_File(File_Name: in STRING; Data: inout ptr_arr_t_BYTE; Length: out integer);
end pkg_FileIO;
package body pkg_FileIO is
procedure Read_File(File_Name: in STRING; Data: inout ptr_arr_t_BYTE; Length: out integer) is
begin
Data := new arr_t_BYTE(0 to 10);
for i in 0 to 10 loop
Data(i) := 0; -- Comment this line out and GHDL is happy
end loop;
Length := 11;
end Read_File;
end pkg_FileIO;
|