diff options
author | Tristan Gingold | 2015-05-14 06:53:26 +0200 |
---|---|---|
committer | Tristan Gingold | 2015-05-14 06:53:26 +0200 |
commit | e3921be1157d819a8c74bf17692f02d8d12a325c (patch) | |
tree | 8fe2431412b0c4aa019dec3b6e91e0bc5f604c4b /src | |
parent | eb074ccac4fdf54ff057e3c8da58f6318df10b52 (diff) | |
download | ghdl-e3921be1157d819a8c74bf17692f02d8d12a325c.tar.gz ghdl-e3921be1157d819a8c74bf17692f02d8d12a325c.tar.bz2 ghdl-e3921be1157d819a8c74bf17692f02d8d12a325c.zip |
vhdl 2008: allow to read out ports.
Diffstat (limited to 'src')
-rw-r--r-- | src/grt/grt-signals.adb | 12 | ||||
-rw-r--r-- | src/vhdl/sem_expr.adb | 26 |
2 files changed, 30 insertions, 8 deletions
diff --git a/src/grt/grt-signals.adb b/src/grt/grt-signals.adb index 7f8d3a0..38d33c8 100644 --- a/src/grt/grt-signals.adb +++ b/src/grt/grt-signals.adb @@ -1954,10 +1954,10 @@ package body Grt.Signals is begin case Sig.S.Mode_Sig is when Mode_Signal - | Mode_Buffer => - return True; - when Mode_Linkage + | Mode_Buffer | Mode_Out => + return True; + when Mode_Linkage => -- No effective value. return False; when Mode_Inout @@ -2150,11 +2150,11 @@ package body Grt.Signals is case Sig.S.Mode_Sig is when Mode_Signal - | Mode_Buffer => + | Mode_Buffer + | Mode_Out => -- Effective value is driving value. Sig.Flags.Propag := Propag_Done; - when Mode_Linkage - | Mode_Out => + when Mode_Linkage => -- No effective value. Sig.Flags.Propag := Propag_Done; when Mode_Inout diff --git a/src/vhdl/sem_expr.adb b/src/vhdl/sem_expr.adb index 703c554..46e75f3 100644 --- a/src/vhdl/sem_expr.adb +++ b/src/vhdl/sem_expr.adb @@ -3697,9 +3697,31 @@ package body Sem_Expr is when Iir_In_Mode | Iir_Inout_Mode | Iir_Buffer_Mode => + -- LRM08 6.5.3 Interface object declarations + -- - in. The value of the interface object is allowed + -- to be read, [...] + -- - inout or buffer. Reading and updating the value of + -- the interface object is allowed. [...] null; - when Iir_Out_Mode - | Iir_Linkage_Mode => + when Iir_Out_Mode => + -- LRM08 6.5.3 Interface object declarations + -- - out. The value of the interface object is allowed + -- [to be updated and,] provided it is not a signal + -- parameter, read. + if Vhdl_Std < Vhdl_08 + or else (Get_Kind (Get_Parent (Obj)) in + Iir_Kinds_Subprogram_Declaration) + then + Error_Msg_Sem + (Disp_Node (Obj) & " cannot be read", Expr); + end if; + when Iir_Linkage_Mode => + -- LRM08 6.5.3 Interface object declarations + -- - linkage. Reading and updating the value of the + -- interface object is allowed, but only by appearing + -- as an actual corresponding to an interface object + -- of mode LINKAGE. No other reading or updating is + -- permitted. Error_Msg_Sem (Disp_Node (Obj) & " cannot be read", Expr); when Iir_Unknown_Mode => raise Internal_Error; |