summaryrefslogtreecommitdiff
path: root/translate/grt
diff options
context:
space:
mode:
authorgingold2005-10-16 07:56:34 +0000
committergingold2005-10-16 07:56:34 +0000
commitd98d41a7fcc178a5cedb155cabb7cde85b014f64 (patch)
tree36c03bb6cf2f6dc838a31f6f94d6b00b77c7c5f7 /translate/grt
parent70cc586c068c297bdd1fbb0285473246f8812655 (diff)
downloadghdl-d98d41a7fcc178a5cedb155cabb7cde85b014f64.tar.gz
ghdl-d98d41a7fcc178a5cedb155cabb7cde85b014f64.tar.bz2
ghdl-d98d41a7fcc178a5cedb155cabb7cde85b014f64.zip
updated for ghdl-0.20
Diffstat (limited to 'translate/grt')
-rw-r--r--translate/grt/Makefile.inc35
-rw-r--r--translate/grt/grt-vcd.adb57
-rw-r--r--translate/grt/grt-vcdz.adb2
3 files changed, 44 insertions, 50 deletions
diff --git a/translate/grt/Makefile.inc b/translate/grt/Makefile.inc
index 9300770..55a45e9 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 f9fd174..e2419cd 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 7b5144e..a6ba718 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;