-
-
Notifications
You must be signed in to change notification settings - Fork 80
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
Showing
6 changed files
with
182 additions
and
9 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
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
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
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
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,39 @@ | ||
entity reflect5 is | ||
end entity; | ||
|
||
use std.reflection.all; | ||
use std.textio.all; | ||
|
||
architecture test of reflect5 is | ||
function basename(path : string) return string is | ||
begin | ||
for i in path'reverse_range loop | ||
if path(i) = '\' or path(i) = '/' then | ||
return path(i + 1 to path'length); | ||
end if; | ||
end loop; | ||
return path; | ||
end function; | ||
begin | ||
|
||
p1: process is | ||
variable stm : subtype_mirror; | ||
variable fstm : file_subtype_mirror; | ||
variable fvm : file_value_mirror; | ||
file f : text; | ||
begin | ||
stm := text'reflect; | ||
assert stm.get_type_class = CLASS_FILE; | ||
fstm := stm.to_file; | ||
assert fstm.designated_subtype.simple_name = "STRING"; | ||
|
||
file_open(f, "temp.txt", WRITE_MODE); | ||
|
||
fvm := f'reflect.to_file; | ||
assert fvm.get_file_open_kind = WRITE_MODE; | ||
assert basename(fvm.get_file_logical_name) = "temp.txt"; | ||
|
||
wait; | ||
end process; | ||
|
||
end architecture; |
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 |
---|---|---|
|
@@ -830,3 +830,4 @@ predef4 normal,2008 | |
protected11 fail,gold,2002 | ||
issue744 normal,vhpi | ||
reflect4 normal,2019 | ||
reflect5 normal,2019 |