aboutsummaryrefslogtreecommitdiffstats
path: root/src/vhdl
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2021-03-20 07:44:36 +0100
committerTristan Gingold <tgingold@free.fr>2021-03-20 07:44:36 +0100
commit51100708e8a9a825bca006aadbe1e86250dd4a60 (patch)
tree96c252d37bb7ce002bf70a7204bacf07870fe828 /src/vhdl
parent2bd2787adfea419435d001cf95f556eb9b120512 (diff)
downloadghdl-51100708e8a9a825bca006aadbe1e86250dd4a60.tar.gz
ghdl-51100708e8a9a825bca006aadbe1e86250dd4a60.tar.bz2
ghdl-51100708e8a9a825bca006aadbe1e86250dd4a60.zip
vhdl: make standard.now impure for vhdl 2008. Fix #1691
Diffstat (limited to 'src/vhdl')
-rw-r--r--src/vhdl/vhdl-std_package.adb16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/vhdl/vhdl-std_package.adb b/src/vhdl/vhdl-std_package.adb
index b06d06fbe..3c6852c23 100644
--- a/src/vhdl/vhdl-std_package.adb
+++ b/src/vhdl/vhdl-std_package.adb
@@ -1045,6 +1045,7 @@ package body Vhdl.Std_Package is
-- impure function NOW return DELAY_LENGTH.
declare
Function_Now : Iir_Function_Declaration;
+ Pure : Boolean;
begin
Function_Now := Create_Std_Decl (Iir_Kind_Function_Declaration);
Set_Std_Identifier (Function_Now, Std_Names.Name_Now);
@@ -1053,11 +1054,16 @@ package body Vhdl.Std_Package is
else
Set_Return_Type (Function_Now, Delay_Length_Subtype_Definition);
end if;
- if Vhdl_Std = Vhdl_02 then
- Set_Pure_Flag (Function_Now, True);
- else
- Set_Pure_Flag (Function_Now, False);
- end if;
+ case Vhdl_Std is
+ when Vhdl_87
+ | Vhdl_02 =>
+ Pure := True;
+ when Vhdl_93
+ | Vhdl_00
+ | Vhdl_08 =>
+ Pure := False;
+ end case;
+ Set_Pure_Flag (Function_Now, Pure);
Set_Implicit_Definition (Function_Now, Iir_Predefined_Now_Function);
Vhdl.Sem_Utils.Compute_Subprogram_Hash (Function_Now);
Add_Decl (Function_Now);