From d98d41a7fcc178a5cedb155cabb7cde85b014f64 Mon Sep 17 00:00:00 2001 From: gingold Date: Sun, 16 Oct 2005 07:56:34 +0000 Subject: updated for ghdl-0.20 --- bug.adb | 16 +++++++++-- bug.ads | 4 +++ doc/ghdl.texi | 2 +- ortho/gcc/Makefile | 2 +- parse.adb | 2 +- translate/gcc/dist.sh | 20 ++++++++++++++ translate/ghdldrv/ghdl_gcc.adb | 2 +- translate/ghdldrv/ghdl_mcode.adb | 2 +- translate/ghdldrv/ghdldrv.adb | 14 +++++----- translate/ghdldrv/ghdlmain.adb | 14 ++++++---- translate/grt/Makefile.inc | 35 +++++++----------------- translate/grt/grt-vcd.adb | 57 ++++++++++++++++++++++++---------------- translate/grt/grt-vcdz.adb | 2 +- version.ads | 2 +- 14 files changed, 105 insertions(+), 69 deletions(-) diff --git a/bug.adb b/bug.adb index 770114ea8..57f977391 100644 --- a/bug.adb +++ b/bug.adb @@ -25,9 +25,21 @@ package body Bug is -- Note: since the string is exported with C convension, there is no way -- to know the length (gnat1 crashes if the string is unconstrained). -- Hopefully, the format of the string seems to be fixed. - GNAT_Version : constant String (1 .. 31); + -- We don't use GNAT.Compiler_Version because it doesn't exist + -- in gnat 3.15p + GNAT_Version : constant String (1 .. 31 + 15); pragma Import (C, GNAT_Version, "__gnat_version"); + function Get_Gnat_Version return String is + begin + for I in GNAT_Version'Range loop + if GNAT_Version (I) = ')' then + return GNAT_Version (1 .. I); + end if; + end loop; + return GNAT_Version; + end Get_Gnat_Version; + procedure Disp_Bug_Box (Except : Exception_Occurrence) is Id : Exception_Id; @@ -40,7 +52,7 @@ package body Bug is (Standard_Error, "Please, report this bug to ghdl@free.fr, with all the output."); Put_Line (Standard_Error, "GHDL version: " & Ghdl_Version); - Put_Line (Standard_Error, "Compiled with " & GNAT_Version); + Put_Line (Standard_Error, "Compiled with " & Get_Gnat_Version); Put_Line (Standard_Error, "In directory: " & GNAT.Directory_Operations.Get_Current_Dir); --Put_Line diff --git a/bug.ads b/bug.ads index ce57a35a7..5e35ffca0 100644 --- a/bug.ads +++ b/bug.ads @@ -18,5 +18,9 @@ with Ada.Exceptions; use Ada.Exceptions; package Bug is + -- Display a bug box for EXCEPT. procedure Disp_Bug_Box (Except : Exception_Occurrence); + + -- Get the gnat version used to bind the unit. + function Get_Gnat_Version return String; end Bug; diff --git a/doc/ghdl.texi b/doc/ghdl.texi index 41785e505..7b0ce1d85 100644 --- a/doc/ghdl.texi +++ b/doc/ghdl.texi @@ -7,7 +7,7 @@ @titlepage @title GHDL guide @subtitle GHDL, a VHDL compiler -@subtitle For GHDL version 0.19 (Sokcho edition) +@subtitle For GHDL version 0.20 (Sokcho edition) @author Tristan Gingold @c The following two commands start the copyright page. @page diff --git a/ortho/gcc/Makefile b/ortho/gcc/Makefile index 69c99969d..f1f0c0b42 100644 --- a/ortho/gcc/Makefile +++ b/ortho/gcc/Makefile @@ -2,7 +2,7 @@ ortho_srcdir=.. orthobe_srcdir=$(ortho_srcdir)/gcc agcc_objdir=. agcc_srcdir=$(ortho_srcdir)/gcc -AGCC_GCCSRC_DIR:=$(HOME)/dist/gcc-4.0.1 +AGCC_GCCSRC_DIR:=$(HOME)/dist/gcc-4.0.2 AGCC_GCCOBJ_DIR:=$(AGCC_GCCSRC_DIR)-objs SED=sed diff --git a/parse.adb b/parse.adb index 68fcae508..a0e388e1c 100644 --- a/parse.adb +++ b/parse.adb @@ -968,7 +968,7 @@ package body Parse is Scan.Scan; exit when Current_Token = Tok_Colon; - Expect (Tok_Comma, "',' or ':' after an identifier"); + Expect (Tok_Comma, "',' or ':' expected after identifier"); Scan.Scan; Inter := Create_Iir (Get_Kind (Inter)); end loop; diff --git a/translate/gcc/dist.sh b/translate/gcc/dist.sh index c2cd8f16f..ace5e8265 100755 --- a/translate/gcc/dist.sh +++ b/translate/gcc/dist.sh @@ -47,6 +47,10 @@ tarfile=$distdir.tar GCCVERSION=4.0.2 DISTDIR=/home/gingold/dist +GTKWAVE_VERSION=1.3.72 + +GTKWAVE_BASE=$HOME/devel/gtkwave-$GTKWAVE_VERSION + GCCDIST=$DISTDIR/gcc-$GCCVERSION GCCDISTOBJ=$GCCDIST-objs PREFIX=/usr/local @@ -530,6 +534,20 @@ do_dist_phase2 () echo "dist_phase2 success" } +# Create gtkwave patch +do_gtkwave_patch () +{ +# rm -rf gtkwave-patch + mkdir gtkwave-patch + diff -rc -x Makefile.in $GTKWAVE_BASE.orig $GTKWAVE_BASE | \ + sed -e "/^Only in/d" \ + > gtkwave-patch/gtkwave-$GTKWAVE_VERSION.diffs + cp ../grt/ghwlib.c ../grt/ghwlib.h $GTKWAVE_BASE/src/ghw.c gtkwave-patch + sed -e "s/VERSION/$GTKWAVE_VERSION/g" < README.gtkwave > gtkwave-patch/README + tar zcvf ../../website/gtkwave-patch.tgz gtkwave-patch + rm -rf gtkwave-patch +} + # Update the index.html # Update the doc do_website () @@ -633,6 +651,8 @@ else do_dist_phase1;; dist_phase2) do_dist_phase2;; + gtkwave_patch) + do_gtkwave_patch;; *) echo "usage: $0 clean|Makefile|files|all" exit 1 ;; diff --git a/translate/ghdldrv/ghdl_gcc.adb b/translate/ghdldrv/ghdl_gcc.adb index 5edb6bf38..a93579ba6 100644 --- a/translate/ghdldrv/ghdl_gcc.adb +++ b/translate/ghdldrv/ghdl_gcc.adb @@ -24,7 +24,7 @@ procedure Ghdl_Gcc is begin -- Manual elaboration so that the order is known (because it is the order -- used to display help). - Ghdlmain.Version_String := new String'("(Use the GCC back-end.)"); + Ghdlmain.Version_String := new String'("GCC back-end code generator"); Ghdldrv.Register_Commands; Ghdllocal.Register_Commands; Ghdlprint.Register_Commands; diff --git a/translate/ghdldrv/ghdl_mcode.adb b/translate/ghdldrv/ghdl_mcode.adb index 3506856ce..56b23420c 100644 --- a/translate/ghdldrv/ghdl_mcode.adb +++ b/translate/ghdldrv/ghdl_mcode.adb @@ -24,7 +24,7 @@ procedure Ghdl_Mcode is begin -- Manual elaboration so that the order is known (because it is the order -- used to display help). - Ghdlmain.Version_String := new String'("(Use the mcode code generator.)"); + Ghdlmain.Version_String := new String'("mcode code generator"); Ghdlrun.Register_Commands; Ghdllocal.Register_Commands; Ghdlprint.Register_Commands; diff --git a/translate/ghdldrv/ghdldrv.adb b/translate/ghdldrv/ghdldrv.adb index d863f6189..6612fb3fe 100644 --- a/translate/ghdldrv/ghdldrv.adb +++ b/translate/ghdldrv/ghdldrv.adb @@ -637,12 +637,6 @@ package body Ghdldrv is Add_Argument (Compiler_Args, Str); Add_Argument (Linker_Args, Str); Res := Option_Ok; - elsif Option'Length >= 2 - and then (Option (2) = 'O' or Option (2) = 'f') - then - -- Optimization option. - Add_Argument (Compiler_Args, new String'(Option)); - Res := Option_Ok; elsif Option = "-Q" then Flag_Not_Quiet := True; Res := Option_Ok; @@ -653,6 +647,14 @@ package body Ghdldrv is elsif Flags.Parse_Option (Option) then Add_Argument (Compiler_Args, new String'(Option)); Res := Option_Ok; + elsif Option'Length >= 2 + and then (Option (2) = 'O' or Option (2) = 'f') + then + -- Optimization option. + -- This is put after Flags.Parse_Option, since it may catch -fxxx + -- options. + Add_Argument (Compiler_Args, new String'(Option)); + Res := Option_Ok; else Decode_Option (Command_Lib (Cmd), Option, Arg, Res); end if; diff --git a/translate/ghdldrv/ghdlmain.adb b/translate/ghdldrv/ghdlmain.adb index bd2462ff8..717e4fc4b 100644 --- a/translate/ghdldrv/ghdlmain.adb +++ b/translate/ghdldrv/ghdlmain.adb @@ -216,16 +216,20 @@ package body Ghdlmain is use Ada.Text_IO; begin Put_Line (Version.Ghdl_Version); + Put_Line (" Compiled with " & Bug.Get_Gnat_Version); if Version_String /= null then - Put_Line (Version_String.all); + Put (" "); + Put (Version_String.all); end if; + New_Line; Put_Line ("Written by Tristan Gingold."); New_Line; + -- Display copyright. Assume 80 cols terminal. Put_Line ("Copyright (C) 2003, 2004, 2005 Tristan Gingold."); - Put_Line ("This is free software; see the source for copying conditions." - & " There is NO"); - Put_Line ("warranty; not even for MERCHANTABILITY or FITNESS FOR A " - & "PARTICULAR PURPOSE."); + Put_Line ("GHDL is free software, covered by the " + & "GNU General Public License. There is NO"); + Put_Line ("warranty; not even for MERCHANTABILITY or" + & " FITNESS FOR A PARTICULAR PURPOSE."); if Args'Length /= 0 then Error ("warning: command '--version' does not accept any argument"); end if; diff --git a/translate/grt/Makefile.inc b/translate/grt/Makefile.inc index 9300770a8..55a45e977 100644 --- a/translate/grt/Makefile.inc +++ b/translate/grt/Makefile.inc @@ -53,34 +53,14 @@ ifndef GRT_TARGET_OBJS GRT_EXTRA_LIB=-lpthread endif +# Additionnal object files (C or asm files). GRT_ADD_OBJS=$(GRT_TARGET_OBJS) grt-cbinding.o grt-cvpi.o +# Configuration pragmas. GRT_PRAGMA_FLAG=-gnatec$(GRTSRCDIR)/grt.adc -GRT_OBJS_FILES=\ -grt.o \ -grt-disp.o \ -grt-main.o \ -grt-stacks.o \ -grt-errors.o \ -grt-options.o \ -grt-stdio.o \ -grt-files.o \ -grt-processes.o \ -grt-typedesc.o \ -grt-hierarchy.o \ -grt-shadow_ieee.o \ -grt-types.o \ -grt-images.o \ -grt-signals.o \ -grt-vcd.o \ -grt-vpi.o \ -grt-lib.o \ -grt-sdf.o \ -grt-stack2.o \ -grt-names.o - -GRT_ADACOMPILE=$(ADAC) -c $(GRT_FLAGS) -o $@ $< +# Rule to compile an Ada file. +GRT_ADACOMPILE=$(ADAC) -c $(GRT_FLAGS) $(GRT_PRAGMA_FLAG) -o $@ $< grt-all: libgrt.a grt.lst @@ -137,9 +117,12 @@ grt-files: run-bind.adb # Remove local files (they are now in the libgrt library). # Also, remove the -shared option, in order not to build a shared library -# instead of an executable. +# instead of an executable. +# Also remove -lgnat and its associated -L flags. This appears to be required +# with GNAT GPL 2005. grt-files.in: grt-files - sed -e "\!^./!d" -e "/-shared/d" < $< > $@ + sed -e "\!^./!d" -e "/-shared/d" -e "/-static/d" -e "/-lgnat/d" \ + -e "\X-L/Xd" < $< > $@ grt.lst: grt-files.in echo "@/libgrt.a" > $@ diff --git a/translate/grt/grt-vcd.adb b/translate/grt/grt-vcd.adb index f9fd174d2..e2419cd2e 100644 --- a/translate/grt/grt-vcd.adb +++ b/translate/grt/grt-vcd.adb @@ -33,6 +33,10 @@ with Grt.Rtis_Types; use Grt.Rtis_Types; with Grt.Vstrings; package body Grt.Vcd is + -- If TRUE, put $date in vcd file. + -- Can be set to FALSE to make vcd comparaison easier. + Flag_Vcd_Date : Boolean := True; + type Vcd_IO_Simple is new Vcd_IO_Handler with record Stream : FILEs; end record; @@ -79,6 +83,10 @@ package body Grt.Vcd is if Opt'Length < 5 or else Opt (F .. F + 4) /= "--vcd" then return False; end if; + if Opt'Length = 12 and then Opt (F + 5 .. F + 11) = "-nodate" then + Flag_Vcd_Date := False; + return True; + end if; if Opt'Length > 6 and then Opt (F + 5) = '=' then if H /= null then Error ("--vcd: file already set"); @@ -112,6 +120,7 @@ package body Grt.Vcd is procedure Vcd_Help is begin Put_Line (" --vcd=FILENAME dump signal values into a VCD file"); + Put_Line (" --vcd-nodate do not write date in VCD file"); end Vcd_Help; procedure Vcd_Put (Str : String) is @@ -194,29 +203,31 @@ package body Grt.Vcd is if H = null then return; end if; - Vcd_Putline ("$date"); - Vcd_Put (" "); - declare - type time_t is new Interfaces.Integer_64; - Cur_Time : time_t; - - function time (Addr : Address) return time_t; - pragma Import (C, time); - - function ctime (Timep: Address) return Ghdl_C_String; - pragma Import (C, ctime); - - Ct : Ghdl_C_String; - begin - Cur_Time := time (Null_Address); - Ct := ctime (Cur_Time'Address); - for I in Positive loop - exit when Ct (I) = NUL; - Vcd_Putc (Ct (I)); - end loop; - -- Note: ctime already append a LF. - end; - Vcd_Put_End; + if Flag_Vcd_Date then + Vcd_Putline ("$date"); + Vcd_Put (" "); + declare + type time_t is new Interfaces.Integer_64; + Cur_Time : time_t; + + function time (Addr : Address) return time_t; + pragma Import (C, time); + + function ctime (Timep: Address) return Ghdl_C_String; + pragma Import (C, ctime); + + Ct : Ghdl_C_String; + begin + Cur_Time := time (Null_Address); + Ct := ctime (Cur_Time'Address); + for I in Positive loop + exit when Ct (I) = NUL; + Vcd_Putc (Ct (I)); + end loop; + -- Note: ctime already append a LF. + end; + Vcd_Put_End; + end if; Vcd_Putline ("$version"); Vcd_Putline (" GHDL v0"); Vcd_Put_End; diff --git a/translate/grt/grt-vcdz.adb b/translate/grt/grt-vcdz.adb index 7b5144ee2..a6ba718e3 100644 --- a/translate/grt/grt-vcdz.adb +++ b/translate/grt/grt-vcdz.adb @@ -68,7 +68,7 @@ package body Grt.Vcdz is end if; if Opt'Length > 7 and then Opt (F + 7) = '=' then if H /= null then - Error ("--vcdz: file already set"); + Error ("--vcdgz: file already set"); return True; end if; diff --git a/version.ads b/version.ads index e459f8e8d..e387c7de4 100644 --- a/version.ads +++ b/version.ads @@ -1,4 +1,4 @@ package Version is Ghdl_Version : constant String := - "GHDL 0.20dev (20050926) [Sokcho edition]"; + "GHDL 0.20 (20051015) [Sokcho edition]"; end Version; -- cgit v1.2.3