aboutsummaryrefslogtreecommitdiffstats
path: root/src/vhdl/vhdl-annotations.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2019-11-08 07:47:00 +0100
committerTristan Gingold <tgingold@free.fr>2019-11-11 20:24:46 +0100
commit507e691dd68da7f8e2aa093b4caa565c044cdead (patch)
treebf485e78963483cb204cf28c41cd7950735c3dd8 /src/vhdl/vhdl-annotations.adb
parent7f23209c22450787fc428aecbc434d93c2cd0c69 (diff)
downloadghdl-507e691dd68da7f8e2aa093b4caa565c044cdead.tar.gz
ghdl-507e691dd68da7f8e2aa093b4caa565c044cdead.tar.bz2
ghdl-507e691dd68da7f8e2aa093b4caa565c044cdead.zip
synth: initial support for file types. For #1004
Diffstat (limited to 'src/vhdl/vhdl-annotations.adb')
-rw-r--r--src/vhdl/vhdl-annotations.adb60
1 files changed, 33 insertions, 27 deletions
diff --git a/src/vhdl/vhdl-annotations.adb b/src/vhdl/vhdl-annotations.adb
index 8e2973356..a349a8a07 100644
--- a/src/vhdl/vhdl-annotations.adb
+++ b/src/vhdl/vhdl-annotations.adb
@@ -445,33 +445,39 @@ package body Vhdl.Annotations is
null;
when Iir_Kind_File_Type_Definition =>
- declare
- Type_Name : constant Iir := Get_Type (Get_File_Type_Mark (Def));
- Res : String_Acc;
- begin
- if Get_Text_File_Flag (Def)
- or else
- (Get_Kind (Type_Name)
- in Iir_Kinds_Scalar_Type_And_Subtype_Definition)
- then
- Res := null;
- else
- declare
- Sig : String
- (1 .. Get_File_Signature_Length (Type_Name) + 2);
- Off : Natural := Sig'First;
- begin
- Get_File_Signature (Type_Name, Sig, Off);
- Sig (Off + 0) := '.';
- Sig (Off + 1) := ASCII.NUL;
- Res := new String'(Sig);
- end;
- end if;
- Set_Info (Def,
- new Sim_Info_Type'(Kind => Kind_File_Type,
- Ref => Def,
- File_Signature => Res));
- end;
+ if Flag_Synthesis then
+ -- For the File type.
+ Create_Object_Info (Block_Info, Def, Kind_Type);
+ else
+ declare
+ Type_Name : constant Iir :=
+ Get_Type (Get_File_Type_Mark (Def));
+ Res : String_Acc;
+ begin
+ if Get_Text_File_Flag (Def)
+ or else
+ (Get_Kind (Type_Name)
+ in Iir_Kinds_Scalar_Type_And_Subtype_Definition)
+ then
+ Res := null;
+ else
+ declare
+ Sig : String
+ (1 .. Get_File_Signature_Length (Type_Name) + 2);
+ Off : Natural := Sig'First;
+ begin
+ Get_File_Signature (Type_Name, Sig, Off);
+ Sig (Off + 0) := '.';
+ Sig (Off + 1) := ASCII.NUL;
+ Res := new String'(Sig);
+ end;
+ end if;
+ Set_Info (Def,
+ new Sim_Info_Type'(Kind => Kind_File_Type,
+ Ref => Def,
+ File_Signature => Res));
+ end;
+ end if;
when Iir_Kind_Protected_Type_Declaration =>
Annotate_Protected_Type_Declaration (Block_Info, Def);