diff options
author | Tristan Gingold <tgingold@free.fr> | 2019-05-28 06:54:10 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2019-05-28 06:54:10 +0200 |
commit | 3e817e1828a919a95d8e2efc9d73a38944d12778 (patch) | |
tree | 7f25c4a179121b8daafc34f8820390f8b88e1ca5 /src/vhdl/vhdl-sem_names.adb | |
parent | c24ef07771e91f11206f88d3c912941f942f4e4b (diff) | |
download | ghdl-3e817e1828a919a95d8e2efc9d73a38944d12778.tar.gz ghdl-3e817e1828a919a95d8e2efc9d73a38944d12778.tar.bz2 ghdl-3e817e1828a919a95d8e2efc9d73a38944d12778.zip |
vhdl-sem_names: check time resoultion for standalone units.
Diffstat (limited to 'src/vhdl/vhdl-sem_names.adb')
-rw-r--r-- | src/vhdl/vhdl-sem_names.adb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/vhdl/vhdl-sem_names.adb b/src/vhdl/vhdl-sem_names.adb index c8ec40285..cc731263e 100644 --- a/src/vhdl/vhdl-sem_names.adb +++ b/src/vhdl/vhdl-sem_names.adb @@ -4107,6 +4107,16 @@ package body Vhdl.Sem_Names is Set_Expr_Staticness (Res, Get_Expr_Staticness (Expr)); --Set_Name_Staticness (Name, Get_Name_Staticness (Expr)); --Set_Base_Name (Name, Get_Base_Name (Expr)); + + if Get_Type (Expr) = Time_Type_Definition + and then Get_Value (Get_Physical_Literal (Expr)) = 0 + then + -- See Sem_Physical_Literal. + Error_Msg_Sem + (+Res, + "physical unit %i is below the time resolution", +Expr); + end if; + return Res; end if; when Iir_Kind_Function_Call |