diff options
author | Tristan Gingold <tgingold@free.fr> | 2021-03-08 22:27:05 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2021-03-08 22:27:05 +0100 |
commit | 86e924834a11200167f0a38a3193cbdaa4f2dbe1 (patch) | |
tree | 96038105278ac6c4954867d63e5481111d0eba0c /src | |
parent | 2036d713a73a91a8014d0d63201d795807e0c924 (diff) | |
download | ghdl-86e924834a11200167f0a38a3193cbdaa4f2dbe1.tar.gz ghdl-86e924834a11200167f0a38a3193cbdaa4f2dbe1.tar.bz2 ghdl-86e924834a11200167f0a38a3193cbdaa4f2dbe1.zip |
Add a warning for processes without a wait statement. Fix #1677
Diffstat (limited to 'src')
-rw-r--r-- | src/errorout.ads | 4 | ||||
-rw-r--r-- | src/vhdl/vhdl-sem_stmts.adb | 20 |
2 files changed, 17 insertions, 7 deletions
diff --git a/src/errorout.ads b/src/errorout.ads index f8af414a3..4fa3b3a95 100644 --- a/src/errorout.ads +++ b/src/errorout.ads @@ -93,6 +93,9 @@ package Errorout is -- Signal assignment creates a delta cycle in a postponed process. Warnid_Delta_Cycle, + -- No wait statement in a non-sensitized process. + Warnid_No_Wait, + -- Declaration of a shared variable with a non-protected type. Warnid_Shared, @@ -308,6 +311,7 @@ private | Warnid_Runtime_Error | Warnid_Pure | Warnid_Specs | Warnid_Hide | Warnid_Pragma | Warnid_Analyze_Assert | Warnid_Attribute | Warnid_Deprecated_Option | Warnid_Unexpected_Option + | Warnid_No_Wait | Msgid_Warning => (Enabled => True, Error => False), Warnid_Delta_Cycle | Warnid_Body | Warnid_Static | Warnid_Nested_Comment | Warnid_Universal | Warnid_Port_Bounds diff --git a/src/vhdl/vhdl-sem_stmts.adb b/src/vhdl/vhdl-sem_stmts.adb index c7f734404..b0b0447da 100644 --- a/src/vhdl/vhdl-sem_stmts.adb +++ b/src/vhdl/vhdl-sem_stmts.adb @@ -2240,13 +2240,19 @@ package body Vhdl.Sem_Stmts is Set_Is_Within_Flag (Proc, False); - if Get_Kind (Proc) = Iir_Kind_Sensitized_Process_Statement - and then Get_Callees_List (Proc) /= Null_Iir_List - then - -- Check there is no wait statement in subprograms called. - -- Also in the case of all-sensitized process, check that package - -- subprograms don't read signals. - Sem.Add_Analysis_Checks_List (Proc); + if Get_Kind (Proc) = Iir_Kind_Sensitized_Process_Statement then + if Get_Callees_List (Proc) /= Null_Iir_List then + -- Check there is no wait statement in subprograms called. + -- Also in the case of all-sensitized process, check that package + -- subprograms don't read signals. + Sem.Add_Analysis_Checks_List (Proc); + end if; + else + if not Get_Suspend_Flag (Proc) then + Warning_Msg_Sem + (Warnid_No_Wait, +Proc, + "infinite loop for this process without a wait statement"); + end if; end if; end Sem_Process_Statement; |