From 3e817e1828a919a95d8e2efc9d73a38944d12778 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Tue, 28 May 2019 06:54:10 +0200 Subject: vhdl-sem_names: check time resoultion for standalone units. --- src/vhdl/vhdl-sem_names.adb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/vhdl') 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 -- cgit v1.2.3