aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2019-11-17 16:14:45 +0100
committerTristan Gingold <tgingold@free.fr>2019-11-17 16:14:45 +0100
commit99d3462a523a13ca044eec51b11bcff97265b5f6 (patch)
tree3de71de70e35d4a9c6757649006cd5a96008542e
parent9abf9c243068a9ea308c70e2cf09ac721221158e (diff)
downloadghdl-99d3462a523a13ca044eec51b11bcff97265b5f6.tar.gz
ghdl-99d3462a523a13ca044eec51b11bcff97265b5f6.tar.bz2
ghdl-99d3462a523a13ca044eec51b11bcff97265b5f6.zip
synth: handle dereference.
-rw-r--r--src/synth/synth-expr.adb12
-rw-r--r--src/synth/synth-stmts.adb6
2 files changed, 16 insertions, 2 deletions
diff --git a/src/synth/synth-expr.adb b/src/synth/synth-expr.adb
index 7f701edde..d24370c25 100644
--- a/src/synth/synth-expr.adb
+++ b/src/synth/synth-expr.adb
@@ -885,6 +885,18 @@ package body Synth.Expr is
return Create_Value_Discrete
(Int64 (Get_Enum_Pos (Name)),
Get_Value_Type (Syn_Inst, Get_Type (Name)));
+ when Iir_Kind_Unit_Declaration =>
+ return Create_Value_Discrete
+ (Vhdl.Evaluation.Get_Physical_Value (Name),
+ Get_Value_Type (Syn_Inst, Get_Type (Name)));
+ when Iir_Kind_Implicit_Dereference
+ | Iir_Kind_Dereference =>
+ declare
+ Val : Value_Acc;
+ begin
+ Val := Synth_Expression (Syn_Inst, Get_Prefix (Name));
+ return Heap.Synth_Dereference (Val.Acc);
+ end;
when others =>
Error_Kind ("synth_name", Name);
end case;
diff --git a/src/synth/synth-stmts.adb b/src/synth/synth-stmts.adb
index 95f5e48f6..d7ee4d471 100644
--- a/src/synth/synth-stmts.adb
+++ b/src/synth/synth-stmts.adb
@@ -320,7 +320,8 @@ package body Synth.Stmts is
end if;
end;
- when Iir_Kind_Implicit_Dereference =>
+ when Iir_Kind_Implicit_Dereference
+ | Iir_Kind_Dereference =>
Synth_Assignment_Prefix
(Syn_Inst, Get_Prefix (Pfx),
Dest_Obj, Dest_Off, Dest_Voff, Dest_Rdwd, Dest_Type);
@@ -397,7 +398,8 @@ package body Synth.Stmts is
| Iir_Kind_Signal_Declaration
| Iir_Kind_Anonymous_Signal_Declaration
| Iir_Kind_Indexed_Name
- | Iir_Kind_Slice_Name =>
+ | Iir_Kind_Slice_Name
+ | Iir_Kind_Dereference =>
declare
Obj : Value_Acc;
Off : Uns32;