summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--disp_vhdl.adb2
-rw-r--r--libraries/Makefile.inc4
-rw-r--r--ortho/gcc/Makefile2
-rw-r--r--ortho/gcc/ortho_gcc-main.adb2
-rw-r--r--scan-scan_literal.adb16
-rw-r--r--translate/gcc/Make-lang.in7
-rwxr-xr-xtranslate/gcc/dist.sh13
-rw-r--r--translate/gcc/lang-specs.h6
-rwxr-xr-xtranslate/mcode/dist.sh4
-rw-r--r--translate/mcode/windows/ghdl.nsi60
-rw-r--r--translate/translation.adb47
-rw-r--r--version.ads2
12 files changed, 132 insertions, 33 deletions
diff --git a/disp_vhdl.adb b/disp_vhdl.adb
index 982977f..9620563 100644
--- a/disp_vhdl.adb
+++ b/disp_vhdl.adb
@@ -680,6 +680,8 @@ package body Disp_Vhdl is
Put ("variable ");
when Iir_Kind_Constant_Interface_Declaration =>
Put ("constant ");
+ when Iir_Kind_File_Interface_Declaration =>
+ Put ("file ");
when others =>
Error_Kind ("disp_interface_declaration", Inter);
end case;
diff --git a/libraries/Makefile.inc b/libraries/Makefile.inc
index e32da22..2830b23 100644
--- a/libraries/Makefile.inc
+++ b/libraries/Makefile.inc
@@ -112,7 +112,7 @@ synopsys.v93: $(LIB93_DIR) $(SYNOPSYS_SRCS) force
prev=`pwd`; cd $(SYN93_DIR); \
$(CP) ../ieee/ieee-obj93.cf .; \
test x$(VHDLLIBS_COPY_OBJS) = "xno" || \
- for i in $(IEEE_SRCS) $(VITAL2000_SRCS); do \
+ for i in $(IEEE_SRCS) $(MATH_SRCS) $(VITAL2000_SRCS); do \
b=`basename $$i .vhdl`; $(LN) ../ieee/$$b.o $$b.o || exit 1; \
done; \
for i in $(SYNOPSYS93_BSRCS); do \
@@ -127,7 +127,7 @@ mentor.v93: $(LIB93_DIR) $(MENTOR93_SRCS) force
prev=`pwd`; cd $(MENTOR93_DIR); \
$(CP) ../ieee/ieee-obj93.cf . ;\
test x$(VHDLLIBS_COPY_OBJS) = "xno" || \
- for i in $(IEEE_SRCS) $(VITAL2000_SRCS); do \
+ for i in $(IEEE_SRCS) $(MATH_SRCS) $(VITAL2000_SRCS); do \
b=`basename $$i .vhdl`; $(LN) ../ieee/$$b.o $$b.o || exit 1; \
done ; \
for i in $(MENTOR93_BSRCS); do \
diff --git a/ortho/gcc/Makefile b/ortho/gcc/Makefile
index 845caca..1fe3a53 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.1.0
+AGCC_GCCSRC_DIR:=$(HOME)/dist/gcc-4.1.1
AGCC_GCCOBJ_DIR:=$(AGCC_GCCSRC_DIR)-objs
SED=sed
diff --git a/ortho/gcc/ortho_gcc-main.adb b/ortho/gcc/ortho_gcc-main.adb
index 5a71aac..96b89e6 100644
--- a/ortho/gcc/ortho_gcc-main.adb
+++ b/ortho/gcc/ortho_gcc-main.adb
@@ -6,11 +6,9 @@ procedure Ortho_Gcc.Main
is
gnat_argc : Integer;
gnat_argv : System.Address;
- gnat_envp : System.Address;
pragma Import (C, gnat_argc);
pragma Import (C, gnat_argv);
- pragma Import (C, gnat_envp);
function Toplev_Main (Argc : Integer; Argv : System.Address)
return Integer;
diff --git a/scan-scan_literal.adb b/scan-scan_literal.adb
index 21c54fb..6b2e7a6 100644
--- a/scan-scan_literal.adb
+++ b/scan-scan_literal.adb
@@ -228,6 +228,8 @@ procedure Scan_Literal is
Dividend : Uint16_Array (0 .. Nbr_Digits);
A_F : constant Sint16 := First_Digit (A);
B_F : constant Sint16 := First_Digit (B);
+
+ -- Digit corresponding to the first digit of B.
Doff : constant Sint16 := Dividend'Last - B_F;
Q : Uint16;
C, N_C : Uint16;
@@ -238,6 +240,9 @@ procedure Scan_Literal is
end if;
-- Copy and shift dividend.
+ -- Bit 15 of the most significant digit of A becomes bit 0 of the
+ -- most significant digit of DIVIDEND. Therefore we are sure
+ -- DIVIDEND < B (after realignment).
C := 0;
for K in 0 .. A_F loop
N_C := Shift_Right (A.S (K), 15);
@@ -249,6 +254,7 @@ procedure Scan_Literal is
Dividend (0 .. Dividend'last - 2 - A_F) := (others => 0);
-- Algorithm is the same as division by hand.
+ C := 0;
for I in reverse Digit_Range loop
Q := 0;
for J in 0 .. 15 loop
@@ -271,7 +277,13 @@ procedure Scan_Literal is
Tmp (K) := Dividend (Doff + K) - V16;
end loop;
+ -- If the last shift creates a carry, we are sure Dividend > B
+ if C /= 0 then
+ Borrow := 0;
+ end if;
+
Q := Q * 2;
+ -- Begin of : Dividend = Dividend * 2
C := 0;
for K in 0 .. Doff - 1 loop
N_C := Shift_Right (Dividend (K), 15);
@@ -280,13 +292,17 @@ procedure Scan_Literal is
end loop;
if Borrow = 0 then
+ -- Dividend > B
Q := Q + 1;
+ -- Dividend = Tmp * 2
+ -- = (Dividend - B) * 2
for K in Doff .. Nbr_Digits loop
N_C := Shift_Right (Tmp (K - Doff), 15);
Dividend (K) := Shift_Left (Tmp (K - Doff), 1) or C;
C := N_C;
end loop;
else
+ -- Dividend = Dividend * 2
for K in Doff .. Nbr_Digits loop
N_C := Shift_Right (Dividend (K), 15);
Dividend (K) := Shift_Left (Dividend (K), 1) or C;
diff --git a/translate/gcc/Make-lang.in b/translate/gcc/Make-lang.in
index cb7335c..0c2cc0f 100644
--- a/translate/gcc/Make-lang.in
+++ b/translate/gcc/Make-lang.in
@@ -139,7 +139,12 @@ vhdl.install-info: ghdl.info
install-ghdllib:
$(MAKE) -f vhdl/Makefile $(FLAGS_TO_PASS) $(VHDL_FLAGS_TO_PASS) install-ghdllib
-vhdl.install-man:
+vhdl.install-man: $(DESTDIR)$(man1dir)/ghdl$(man1ext)
+
+$(DESTDIR)$(man1dir)/ghdl$(man1ext): $(srcdir)/vhdl/ghdl.1
+ -rm -f $@
+ -$(INSTALL_DATA) $< $@
+ -chmod a-x $@
vhdl.uninstall:
-$(RM) $(DESTDIR)$(bindir)/ghdl$(exeext)
diff --git a/translate/gcc/dist.sh b/translate/gcc/dist.sh
index e03e686..4b0554b 100755
--- a/translate/gcc/dist.sh
+++ b/translate/gcc/dist.sh
@@ -39,7 +39,7 @@
set -e
# GCC version
-GCCVERSION=4.1.0
+GCCVERSION=4.1.1
# Machine name used by GCC
MACHINE=i686-pc-linux-gnu
# Directory where GCC sources (and objects) stay.
@@ -105,7 +105,7 @@ for i in $lfiles; do ln -sf $CWD/$i $VHDLDIR/$i; done
for i in $cfiles; do ln -sf $CWD/../../$i $VHDLDIR/$i; done
-ln -sf $CWD/../../doc/ghdl.texi $VHDLDIR/ghdl.texi
+for i in ghdl.texi ghdl.1; do ln -sf $CWD/../../doc/$i $VHDLDIR/$i; done
for i in $tfiles; do ln -sf $CWD/../$i $VHDLDIR/$i; done
@@ -212,7 +212,7 @@ do_compile2 ()
do_tar_install ()
{
tar -C $DESTDIR -jcvf $TARINSTALL \
- ./$PREFIX/bin/ghdl ./$PREFIX/info/ghdl.info \
+ ./$PREFIX/bin/ghdl ./$PREFIX/info/ghdl.info ./$PREFIX/man/man1/ghdl.1 \
./$GCCLIBDIR/vhdl \
./$GCCLIBEXECDIR/ghdl1
}
@@ -248,9 +248,12 @@ do_distclean_gcc ()
rm -f ${DESTDIR}${PREFIX}/info/gcc.info*
rm -f ${DESTDIR}${PREFIX}/info/gccinstall.info*
rm -f ${DESTDIR}${PREFIX}/info/gccint.info*
- rm -f ${DESTDIR}${PREFIX}/lib/*.a ${DESTDIR}${PREFIX}/lib/*.so*
+ rm -f ${DESTDIR}${PREFIX}/lib/*.a
+ rm -f ${DESTDIR}${PREFIX}/lib/*.so*
+ rm -f ${DESTDIR}${PREFIX}/lib/*.la
rm -rf ${DESTDIR}${PREFIX}/share
- rm -rf ${DESTDIR}${PREFIX}/man
+ rm -rf ${DESTDIR}${PREFIX}/man/man7
+ rm -rf ${DESTDIR}${PREFIX}/man/man1/{cpp,gcc,gcov}.1
rm -rf ${DESTDIR}${PREFIX}/include
rm -f ${DESTDIR}${GCCLIBEXECDIR}/cc1 ${DESTDIR}${GCCLIBEXECDIR}/collect2
rm -f ${DESTDIR}${GCCLIBEXECDIR}/cpp0 ${DESTDIR}${GCCLIBEXECDIR}/tradcpp0
diff --git a/translate/gcc/lang-specs.h b/translate/gcc/lang-specs.h
index e8e79a2..0504435 100644
--- a/translate/gcc/lang-specs.h
+++ b/translate/gcc/lang-specs.h
@@ -22,7 +22,7 @@ Boston, MA 02111-1307, USA. */
/* This is the contribution to the `default_compilers' array in gcc.c for
GHDL. */
- {".vhd", "@vhdl", 0},
- {".vhdl", "@vhdl", 0},
+ {".vhd", "@vhdl", 0, 0, 0},
+ {".vhdl", "@vhdl", 0, 0, 0},
{"@vhdl",
- "ghdl1 %i %(cc1_options) %{!fsyntax-only:%(invoke_as)}", 0},
+ "ghdl1 %i %(cc1_options) %{!fsyntax-only:%(invoke_as)}", 0, 0, 0},
diff --git a/translate/mcode/dist.sh b/translate/mcode/dist.sh
index e28bec6..132ba0b 100755
--- a/translate/mcode/dist.sh
+++ b/translate/mcode/dist.sh
@@ -192,6 +192,8 @@ done
for i in $windows_files; do
ln -sf $CWD/windows/$i $distdir/windows/$i
done
+ echo "!define VERSION \"$VERSION\"" > $distdir/windows/version.nsi
+
ln -sf $CWD/winbuild.bat $distdir/winbuild.bat
@@ -439,7 +441,7 @@ EOF
}
if [ $# -eq 0 ]; then
- do_Makefile;
+ do_zip;
else
for i ; do
case $i in
diff --git a/translate/mcode/windows/ghdl.nsi b/translate/mcode/windows/ghdl.nsi
index ec186ef..4aeab9c 100644
--- a/translate/mcode/windows/ghdl.nsi
+++ b/translate/mcode/windows/ghdl.nsi
@@ -5,19 +5,20 @@
; Check if administrator
; uninstall support
; TODO:
-; * Add in PATH
; * Add version
; * Check if GHDL is already installed (and uninstall before)
-; * Check Windows version
+; * Doc
; * Allow user install
;--------------------------------
+!include version.nsi
+;--------------------------------
; The name of the installer
Name "Ghdl"
; The file to write
-OutFile "ghdl-install.exe"
+OutFile "ghdl-installer-${VERSION}.exe"
SetDateSave on
@@ -34,6 +35,7 @@ LicenseData ..\COPYING
;--------------------------------
; Pages
+
Page license
Page components
Page directory
@@ -58,6 +60,48 @@ nt_ok:
Quit
Admin:
+
+ ;;; Check if already installed.
+ ReadRegStr $0 HKLM "Software\Ghdl" "Install_Dir"
+ IfErrors not_installed
+ ReadRegStr $0 HKLM "Software\Ghdl" "Version"
+ IfErrors unknown_prev_version
+ Goto known_version
+unknown_prev_version:
+ StrCpy $0 "(unknown)"
+known_version:
+ MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION "You already have GHDL version $0 installed. Deinstall ?" IDCANCEL install_abort IDOK deinstall
+install_abort:
+ Abort "Installation aborted"
+deinstall:
+ ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Ghdl" "UninstallString"
+ IfErrors deinstall_failed
+
+ ; First version of the GHDL installer adds quotes
+ StrCpy $1 $0 1
+ StrCmp $1 '"' 0 str_ok
+ StrCpy $1 $0 "" 1
+ StrCpy $0 $1 -1
+str_ok:
+
+ ; Read install dir
+ ReadRegStr $1 HKLM "Software\Ghdl" "Install_Dir"
+ IfErrors deinstall_failed
+
+; MessageBox MB_OK 'copy $0 to $TEMP'
+
+ ClearErrors
+; MessageBox MB_OK 'copy $0 to $TEMP'
+ CopyFiles $0 $TEMP
+ IfErrors deinstall_failed
+ ExecWait '"$TEMP\uninst-ghdl.exe" /S _?=$1'
+ IfErrors deinstall_failed
+ Delete "$TEMP\uninst-ghdl.exe"
+ Return
+deinstall_failed:
+ Delete $TEMP\uninst-ghdl.exe
+ MessageBox MB_YESNO|MB_ICONSTOP "Can't deinstall GHDL: de-installer not found or failed. Continue installation ?" IDNO install_abort
+not_installed:
Return
FunctionEnd
@@ -76,11 +120,13 @@ Section "Ghdl Compiler (required)"
File /oname=COPYING.txt ..\COPYING
; Write the installation path into the registry
- WriteRegStr HKLM "Software\Ghdl" "Install_Dir" "$INSTDIR"
+ WriteRegStr HKLM "Software\Ghdl" "Install_Dir" $INSTDIR
+ ; Write te version
+ WriteRegStr HKLM "Software\Ghdl" "Version" ${VERSION}
; Write the uninstall keys for Windows
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Ghdl" "DisplayName" "Ghdl"
- WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Ghdl" "UninstallString" '"$INSTDIR\uninst-ghdl.exe"'
+ WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Ghdl" "UninstallString" $INSTDIR\uninst-ghdl.exe
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Ghdl" "NoModify" 1
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Ghdl" "NoRepair" 1
WriteUninstaller $INSTDIR\uninst-ghdl.exe"
@@ -102,6 +148,10 @@ Section "Synopsys libraries (Recommanded)"
File /r ..\lib\v93\synopsys
SectionEnd
+Section "Documentation (Recommanded)"
+ File ghdl.htm
+SectionEnd
+
Section "Add in PATH (Recommanded)"
WriteRegDWORD HKLM "Software\Ghdl" "PathSet" 1
Push $INSTDIR\Bin
diff --git a/translate/translation.adb b/translate/translation.adb
index 330f4a6..ff38401 100644
--- a/translate/translation.adb
+++ b/translate/translation.adb
@@ -961,8 +961,8 @@ package body Translation is
range Type_Mode_B2 .. Type_Mode_Acc;
-- These parameters are passed by copy, ie a copy of the object is created
- -- and the reference of the copy is passed. If the object will not be
- -- modified by the subprogram, the object can be passed by reference.
+ -- and the reference of the copy is passed. If the object is not
+ -- modified by the subprogram, the object could be passed by reference.
subtype Type_Mode_By_Copy is Type_Mode_Type
range Type_Mode_Fat_Acc .. Type_Mode_Fat_Acc;
@@ -4833,6 +4833,31 @@ package body Translation is
Push_Local_Factory;
Chap2.Save_Subprg_Instance (Subprg_Instances);
+ -- Init out parameter passed by value/copy.
+ declare
+ Inter : Iir;
+ Inter_Type : Iir;
+ Type_Info : Type_Info_Acc;
+ begin
+ Inter := Get_Interface_Declaration_Chain (Spec);
+ while Inter /= Null_Iir loop
+ if Get_Kind (Inter) = Iir_Kind_Variable_Interface_Declaration
+ and then Get_Mode (Inter) = Iir_Out_Mode
+ then
+ Inter_Type := Get_Type (Inter);
+ Type_Info := Get_Info (Inter_Type);
+ if (Type_Info.Type_Mode in Type_Mode_By_Value
+ or Type_Info.Type_Mode in Type_Mode_By_Copy)
+ and then Type_Info.Type_Mode /= Type_Mode_File
+ then
+ Chap4.Init_Object
+ (Chap6.Translate_Name (Inter), Inter_Type);
+ end if;
+ end if;
+ Inter := Get_Chain (Inter);
+ end loop;
+ end;
+
Chap4.Translate_Declaration_Chain (Subprg);
Rtis.Generate_Subprogram_Body (Subprg);
Chap4.Translate_Declaration_Chain_Subprograms (Subprg, Null_Iir);
@@ -5057,14 +5082,16 @@ package body Translation is
return;
end if;
+ Pkg := Get_Package (Decl);
+ Restore_Local_Identifier (Get_Info (Pkg).Package_Local_Id);
+ Chap4.Translate_Declaration_Chain (Decl);
+
if Flag_Rti then
Rtis.Generate_Unit (Decl);
end if;
- Pkg := Get_Package (Decl);
- Restore_Local_Identifier (Get_Info (Pkg).Package_Local_Id);
- Chap4.Translate_Declaration_Chain (Decl);
Chap4.Translate_Declaration_Chain_Subprograms (Decl, Null_Iir);
+
Elab_Package_Body (Pkg, Decl);
end Translate_Package_Body;
@@ -19123,12 +19150,8 @@ package body Translation is
Params (Pos) := Stabilize (Param);
if In_Conv /= Null_Iir
or else Get_Mode (Formal) = Iir_Inout_Mode
- -- or else Out_Conv = Null_Iir
then
- -- Arguments may be assigned if there is an in conversion,
- -- or no out conversion.
- -- We try to assign even OUT argument, to avoid
- -- uninitialized values.
+ -- Arguments may be assigned if there is an in conversion.
Ptr := New_Selected_Element
(New_Obj (Res), Formal_Info.Interface_Field);
Param := Lv2M (Ptr, Ftype_Info, Mode_Value);
@@ -25442,8 +25465,8 @@ package body Translation is
Generate_Declaration_Chain (Get_Declaration_Chain (Blk));
when Iir_Kind_Package_Body =>
Kind := Ghdl_Rtik_Package_Body;
- -- FIXME: yes or not ?
- --Generate_Declaration_Chain (Get_Declaration_Chain (Blk));
+ -- Required at least for 'image
+ Generate_Declaration_Chain (Get_Declaration_Chain (Blk));
when Iir_Kind_Architecture_Declaration =>
Kind := Ghdl_Rtik_Architecture;
Generate_Declaration_Chain (Get_Declaration_Chain (Blk));
diff --git a/version.ads b/version.ads
index fcd1903..82f2adb 100644
--- a/version.ads
+++ b/version.ads
@@ -1,4 +1,4 @@
package Version is
Ghdl_Version : constant String :=
- "GHDL 0.23dev (20060614) [Sokcho edition]";
+ "GHDL 0.24 (20060625) [Sokcho edition]";
end Version;