-
Notifications
You must be signed in to change notification settings - Fork 349
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
39a3405
commit ef5d600
Showing
3 changed files
with
71 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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: out ptr_arr_t_BYTE; Length: out integer); | ||
end pkg_FileIO; | ||
|
||
package body pkg_FileIO is | ||
procedure Read_File(File_Name: in STRING; Data: out 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; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#! /bin/sh | ||
|
||
. ../../testenv.sh | ||
|
||
analyze_failure junk1.vhd | ||
analyze --std=08 junk1.vhd | ||
analyze junk1ok.vhd | ||
clean | ||
clean --std=08 | ||
|
||
echo "Test successful" |