summaryrefslogtreecommitdiff
path: root/src/vhdl/sem_expr.adb
diff options
context:
space:
mode:
authorTristan Gingold2015-05-14 06:53:26 +0200
committerTristan Gingold2015-05-14 06:53:26 +0200
commite3921be1157d819a8c74bf17692f02d8d12a325c (patch)
tree8fe2431412b0c4aa019dec3b6e91e0bc5f604c4b /src/vhdl/sem_expr.adb
parenteb074ccac4fdf54ff057e3c8da58f6318df10b52 (diff)
downloadghdl-e3921be1157d819a8c74bf17692f02d8d12a325c.tar.gz
ghdl-e3921be1157d819a8c74bf17692f02d8d12a325c.tar.bz2
ghdl-e3921be1157d819a8c74bf17692f02d8d12a325c.zip
vhdl 2008: allow to read out ports.
Diffstat (limited to 'src/vhdl/sem_expr.adb')
-rw-r--r--src/vhdl/sem_expr.adb26
1 files changed, 24 insertions, 2 deletions
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;