aboutsummaryrefslogtreecommitdiffstats
path: root/translate/ghdldrv
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2014-09-02 21:17:16 +0200
committerTristan Gingold <tgingold@free.fr>2014-09-02 21:17:16 +0200
commite6ffb98cb5ad3f07bcaf79323d8ab8411688c494 (patch)
tree46a91868b6e4aeb5354249c74507b3e92e85f01f /translate/ghdldrv
parente393e8b7babd9d2dbe5e6bb7816b82036b857a1f (diff)
downloadghdl-e6ffb98cb5ad3f07bcaf79323d8ab8411688c494.tar.gz
ghdl-e6ffb98cb5ad3f07bcaf79323d8ab8411688c494.tar.bz2
ghdl-e6ffb98cb5ad3f07bcaf79323d8ab8411688c494.zip
Keep names in the tree.
This is a large change to improve error locations and allow pretty printing.
Diffstat (limited to 'translate/ghdldrv')
-rw-r--r--translate/ghdldrv/Makefile6
-rw-r--r--translate/ghdldrv/ghdlprint.adb16
-rw-r--r--translate/ghdldrv/ghdlsimul.adb3
3 files changed, 21 insertions, 4 deletions
diff --git a/translate/ghdldrv/Makefile b/translate/ghdldrv/Makefile
index fe859f273..9dd86b64f 100644
--- a/translate/ghdldrv/Makefile
+++ b/translate/ghdldrv/Makefile
@@ -153,10 +153,12 @@ grt.links:
cd ../lib; ln -sf $(GRTSRCDIR)/grt.lst .; ln -sf $(GRTSRCDIR)/libgrt.a .; ln -sf $(GRTSRCDIR)/grt.ver .
install.all: install.v87 install.v93 install.standard
-install.mcode: install.v87 install.v93 install.v08
+
+install.mcode:
+ $(MAKE) GHDL=ghdl_mcode install.v87 install.v93 # install.v08
install.simul:
- $(MAKE) GHDL=ghdl_simul install.v87 install.v93
+ $(MAKE) GHDL=ghdl_simul install.v87 install.v93 install.v08
install.llvm:
$(MAKE) GHDL=ghdl_llvm GHDL1=../ghdl1-llvm install.all
diff --git a/translate/ghdldrv/ghdlprint.adb b/translate/ghdldrv/ghdlprint.adb
index 3af75f864..73d5ba7ad 100644
--- a/translate/ghdldrv/ghdlprint.adb
+++ b/translate/ghdldrv/ghdlprint.adb
@@ -78,6 +78,9 @@ package body Ghdlprint is
type Filexref_Info_Arr_Acc is access Filexref_Info_Arr;
Filexref_Info : Filexref_Info_Arr_Acc := null;
+ -- If True, at least one xref is missing.
+ Missing_Xref : Boolean := False;
+
procedure PP_Html_File (File : Source_File_Entry)
is
use Flags;
@@ -238,6 +241,7 @@ package body Ghdlprint is
if Ref = Bad_Xref then
Disp_Text;
Warning_Msg_Sem ("cannot find xref", Loc);
+ Missing_Xref := True;
return;
end if;
else
@@ -989,7 +993,7 @@ package body Ghdlprint is
Unit := Get_First_Design_Unit (Design_File);
while Unit /= Null_Iir loop
- -- Sem, canon, annotate a design unit.
+ -- Analyze the design unit.
Back_End.Finish_Compilation (Unit, True);
Next_Unit := Get_Chain (Unit);
@@ -1204,6 +1208,7 @@ package body Ghdlprint is
-- Command --xref-html.
type Command_Xref_Html is new Command_Html with record
Output_Dir : String_Access := null;
+ Check_Missing : Boolean := False;
end record;
function Decode_Command (Cmd : Command_Xref_Html; Name : String)
@@ -1246,6 +1251,9 @@ package body Ghdlprint is
Cmd.Output_Dir := new String'(Arg);
Res := Option_Arg;
end if;
+ elsif Option = "--check-missing" then
+ Cmd.Check_Missing := True;
+ Res := Option_Ok;
else
Decode_Option (Command_Html (Cmd), Option, Arg, Res);
end if;
@@ -1255,6 +1263,7 @@ package body Ghdlprint is
begin
Disp_Long_Help (Command_Html (Cmd));
Put_Line ("-o DIR Put generated files into DIR (def: html/)");
+ Put_Line ("--check-missing Fail if a reference is missing");
New_Line;
Put_Line ("When format is css, the CSS file 'ghdl.css' "
& "is never overwritten.");
@@ -1493,6 +1502,11 @@ package body Ghdlprint is
end if;
end;
end if;
+
+ if Missing_Xref and Cmd.Check_Missing then
+ Error ("missing xrefs");
+ raise Compile_Error;
+ end if;
exception
when Compilation_Error =>
Error ("xrefs has failed due to compilation error");
diff --git a/translate/ghdldrv/ghdlsimul.adb b/translate/ghdldrv/ghdlsimul.adb
index 27b1ce62c..17cece726 100644
--- a/translate/ghdldrv/ghdlsimul.adb
+++ b/translate/ghdldrv/ghdlsimul.adb
@@ -32,6 +32,7 @@ with Std_Package;
with Libraries;
with Canon;
with Configuration;
+with Iirs_Utils;
with Annotations;
with Elaboration;
with Sim_Be;
@@ -109,7 +110,7 @@ package body Ghdlsimul is
Conf_Unit : constant Iir := Get_Library_Unit (Top_Conf);
Arch : constant Iir :=
Get_Block_Specification (Get_Block_Configuration (Conf_Unit));
- Entity : constant Iir := Get_Entity (Arch);
+ Entity : constant Iir := Iirs_Utils.Get_Entity (Arch);
begin
Configuration.Check_Entity_Declaration_Top (Entity);
if Nbr_Errors > 0 then