aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcderrien <65495526+cderrien@users.noreply.github.com>2022-11-08 08:02:39 +0100
committerGitHub <noreply@github.com>2022-11-08 08:02:39 +0100
commit33b400ad884ee8f9a9c01c3d47968eea7dcd3db2 (patch)
tree234d519d805d8cedc005df757b9b925301a47876
parent640e4c13fc8bd1fd7a0bfddddf7c851b2b171135 (diff)
downloadghdl-33b400ad884ee8f9a9c01c3d47968eea7dcd3db2.tar.gz
ghdl-33b400ad884ee8f9a9c01c3d47968eea7dcd3db2.tar.bz2
ghdl-33b400ad884ee8f9a9c01c3d47968eea7dcd3db2.zip
Added id to warnings related to attributes. (#2242)
-rw-r--r--src/errorout.ads5
-rw-r--r--src/synth/synth-errors.adb8
-rw-r--r--src/synth/synth-errors.ads4
-rw-r--r--src/synth/synth-vhdl_decls.adb4
-rw-r--r--src/synth/synth-vhdl_stmts.adb6
5 files changed, 25 insertions, 2 deletions
diff --git a/src/errorout.ads b/src/errorout.ads
index b4207be4c..d0cd5b9e1 100644
--- a/src/errorout.ads
+++ b/src/errorout.ads
@@ -131,6 +131,10 @@ package Errorout is
-- Lexical conformance
Warnid_Conformance,
+
+ -- Attributes in the netlist is not kept during synthesis
+ Warnid_Unkept_Attribute,
+ Warnid_Unhandled_Attribute,
-- Violation of staticness rules
Warnid_Static,
@@ -330,6 +334,7 @@ private
| Warnid_Nowrite
| Warnid_No_Wait | Warnid_Useless
| Warnid_Conformance
+ | Warnid_Unkept_Attribute | Warnid_Unhandled_Attribute
| Msgid_Warning => (Enabled => True, Error => False),
Warnid_Delta_Cycle | Warnid_Body | Warnid_Static | Warnid_Nested_Comment
| Warnid_Universal | Warnid_Port_Bounds
diff --git a/src/synth/synth-errors.adb b/src/synth/synth-errors.adb
index 795c0e1c4..dfccaf158 100644
--- a/src/synth/synth-errors.adb
+++ b/src/synth/synth-errors.adb
@@ -61,6 +61,14 @@ package body Synth.Errors is
begin
Report_Msg (Warnid, Errorout.Elaboration, +Loc, Msg, (1 => Arg1));
end Warning_Msg_Synth;
+
+ procedure Warning_Msg_Synth (Warnid : Msgid_Warnings;
+ Loc : Location_Type;
+ Msg : String;
+ Args : Earg_Arr := No_Eargs) is
+ begin
+ Report_Msg (Warnid, Errorout.Elaboration, +Loc, Msg, Args);
+ end Warning_Msg_Synth;
procedure Warning_Msg_Synth (Loc : Location_Type;
Msg : String;
diff --git a/src/synth/synth-errors.ads b/src/synth/synth-errors.ads
index c238d7575..8b505587d 100644
--- a/src/synth/synth-errors.ads
+++ b/src/synth/synth-errors.ads
@@ -43,6 +43,10 @@ package Synth.Errors is
Loc : Location_Type;
Msg : String;
Arg1 : Earg_Type);
+ procedure Warning_Msg_Synth (Warnid : Msgid_Warnings;
+ Loc : Location_Type;
+ Msg : String;
+ Args : Earg_Arr := No_Eargs);
procedure Warning_Msg_Synth (Loc : Location_Type;
Msg : String;
Args : Earg_Arr := No_Eargs);
diff --git a/src/synth/synth-vhdl_decls.adb b/src/synth/synth-vhdl_decls.adb
index 7732e47ec..de10c01b6 100644
--- a/src/synth/synth-vhdl_decls.adb
+++ b/src/synth/synth-vhdl_decls.adb
@@ -257,7 +257,9 @@ package body Synth.Vhdl_Decls is
-- TODO: components ?
-- TODO: Interface_Signal ? But no instance for them.
Warning_Msg_Synth
- (+Attr_Value, "attribute %i for %n is not kept in the netlist",
+ (Warnid_Unkept_Attribute,
+ +Attr_Value,
+ "attribute %i for %n is not kept in the netlist",
(+Attr_Decl, +Obj));
return;
end case;
diff --git a/src/synth/synth-vhdl_stmts.adb b/src/synth/synth-vhdl_stmts.adb
index 54936e140..18525a4b6 100644
--- a/src/synth/synth-vhdl_stmts.adb
+++ b/src/synth/synth-vhdl_stmts.adb
@@ -4616,7 +4616,11 @@ package body Synth.Vhdl_Stmts is
-- Applies to nets/ports.
null;
when others =>
- Warning_Msg_Synth (+Spec, "unhandled attribute %i", (1 => +Id));
+ Warning_Msg_Synth
+ (Warnid_Unhandled_Attribute,
+ +Spec,
+ "unhandled attribute %i",
+ (1 => +Id));
end case;
Val := Get_Value_Chain (Val);
end loop;