aboutsummaryrefslogtreecommitdiffstats
path: root/src/ghdldrv/ghdlxml.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2017-11-06 20:20:52 +0100
committerTristan Gingold <tgingold@free.fr>2017-11-06 20:20:52 +0100
commit1984d2adb083153f03eb7775d956445772ca484f (patch)
tree92939d572fd44940755e30d3963101c0a797f9e7 /src/ghdldrv/ghdlxml.adb
parentf9dd14670a2b17575bc879f82030faaaabdbbea6 (diff)
downloadghdl-1984d2adb083153f03eb7775d956445772ca484f.tar.gz
ghdl-1984d2adb083153f03eb7775d956445772ca484f.tar.bz2
ghdl-1984d2adb083153f03eb7775d956445772ca484f.zip
Use Flist for array indexes.
Diffstat (limited to 'src/ghdldrv/ghdlxml.adb')
-rw-r--r--src/ghdldrv/ghdlxml.adb66
1 files changed, 66 insertions, 0 deletions
diff --git a/src/ghdldrv/ghdlxml.adb b/src/ghdldrv/ghdlxml.adb
index 5ce64b299..cc7a5c9f4 100644
--- a/src/ghdldrv/ghdlxml.adb
+++ b/src/ghdldrv/ghdlxml.adb
@@ -197,6 +197,17 @@ package body Ghdlxml is
Put_Empty_Stag_End;
end Disp_Iir_List_Ref;
+ procedure Disp_Iir_Flist_Ref (Id : String; L : Iir_Flist) is
+ begin
+ if L = Null_Iir_Flist then
+ return;
+ end if;
+
+ Put_Stag (Id);
+ Put_Attribute ("flist-ref", Strip (Iir_Flist'Image (L)));
+ Put_Empty_Stag_End;
+ end Disp_Iir_Flist_Ref;
+
procedure Disp_Iir_Chain_Elements (Chain : Iir)
is
El : Iir;
@@ -256,6 +267,41 @@ package body Ghdlxml is
Put_Etag (Id);
end Disp_Iir_List;
+ procedure Disp_Iir_Flist (Id : String; L : Iir_Flist; Ref : Boolean)
+ is
+ El : Iir;
+ begin
+ if L = Null_Iir_Flist then
+ return;
+ end if;
+
+ Put_Stag (Id);
+ case L is
+ when Iir_Flist_All =>
+ Put_Attribute ("flist-id", "all");
+ Put_Empty_Stag_End;
+ return;
+ when Iir_Flist_Others =>
+ Put_Attribute ("flist-id", "others");
+ Put_Empty_Stag_End;
+ return;
+ when others =>
+ Put_Attribute ("flist-id", Strip (Iir_Flist'Image (L)));
+ Put_Stag_End;
+ end case;
+
+ for I in Flist_First .. Flist_Last (L) loop
+ El := Get_Nth_Element (L, I);
+ if Ref then
+ Disp_Iir_Ref ("el", El);
+ else
+ Disp_Iir ("el", El);
+ end if;
+ end loop;
+
+ Put_Etag (Id);
+ end Disp_Iir_Flist;
+
procedure Disp_Iir (Id : String; N : Iir) is
begin
if N = Null_Iir then
@@ -293,6 +339,8 @@ package body Ghdlxml is
null;
when Type_Iir_List =>
null;
+ when Type_Iir_Flist =>
+ null;
when Type_String8_Id =>
null;
when Type_PSL_NFA =>
@@ -415,6 +463,24 @@ package body Ghdlxml is
raise Internal_Error;
end case;
end;
+ when Type_Iir_Flist =>
+ declare
+ L : constant Iir_Flist := Get_Iir_Flist (N, F);
+ Img : constant String := Get_Field_Image (F);
+ begin
+ case Get_Field_Attribute (F) is
+ when Attr_None =>
+ Disp_Iir_Flist (Img, L, False);
+ when Attr_Of_Ref =>
+ Disp_Iir_Flist (Img, L, True);
+ when Attr_Of_Maybe_Ref =>
+ Disp_Iir_Flist (Img, L, Get_Is_Ref (N));
+ when Attr_Ref =>
+ Disp_Iir_Flist_Ref (Img, L);
+ when others =>
+ raise Internal_Error;
+ end case;
+ end;
when Type_String8_Id =>
-- Special handling for strings
declare