aboutsummaryrefslogtreecommitdiffstats
path: root/src/vhdl
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2016-07-18 07:01:04 +0200
committerTristan Gingold <tgingold@free.fr>2016-07-18 07:01:04 +0200
commitafaf45e1da10e91cbab6856b1b97203b9f7c7e99 (patch)
tree8a1dcfd0b047ea55af91ed4e51c73c9cd4103212 /src/vhdl
parent2fd5fb225f89eb06e7b01f1fdbcee4be7241bd47 (diff)
downloadghdl-afaf45e1da10e91cbab6856b1b97203b9f7c7e99.tar.gz
ghdl-afaf45e1da10e91cbab6856b1b97203b9f7c7e99.tar.bz2
ghdl-afaf45e1da10e91cbab6856b1b97203b9f7c7e99.zip
Improve error message if synopsys package it not found.
Diffstat (limited to 'src/vhdl')
-rw-r--r--src/vhdl/sem_names.adb26
1 files changed, 23 insertions, 3 deletions
diff --git a/src/vhdl/sem_names.adb b/src/vhdl/sem_names.adb
index fdb6c4fbc..006390332 100644
--- a/src/vhdl/sem_names.adb
+++ b/src/vhdl/sem_names.adb
@@ -1887,6 +1887,28 @@ package body Sem_Names is
("no method " & Name_Table.Image (Suffix) & " in "
& Disp_Node (Prot_Type), Name);
end Error_Protected_Item;
+
+ -- Emit an error message if unit is not found in library LIB.
+ procedure Error_Unit_Not_Found (Lib : Iir)
+ is
+ use Std_Names;
+ begin
+ Error_Msg_Sem
+ ("unit """ & Name_Table.Image (Suffix)
+ & """ not found in " & Disp_Node (Lib), Name);
+
+ -- Give an advice for common synopsys packages.
+ if Get_Identifier (Lib) = Name_Ieee then
+ if Suffix = Name_Std_Logic_Arith
+ or else Suffix = Name_Std_Logic_Signed
+ or else Suffix = Name_Std_Logic_Unsigned
+ then
+ Error_Msg_Sem
+ (" (use --ieee=synopsys for non-standard synopsys packages)",
+ Name);
+ end if;
+ end if;
+ end Error_Unit_Not_Found;
begin
-- Analyze prefix.
Sem_Name (Prefix_Name);
@@ -1954,9 +1976,7 @@ package body Sem_Names is
-- GHDL: FIXME: error message more explicit
Res := Libraries.Load_Primary_Unit (Prefix, Suffix, Name);
if Res = Null_Iir then
- Error_Msg_Sem
- ("primary unit """ & Name_Table.Image (Suffix)
- & """ not found in " & Disp_Node (Prefix), Name);
+ Error_Unit_Not_Found (Prefix);
else
Sem.Add_Dependence (Res);
Res := Get_Library_Unit (Res);