rpms/ghdl/devel ghdl-shgrt.spec, NONE, 1.1 ghdl-svn133.patch, NONE, 1.1 ghdl.spec, 1.59, 1.60
sailer
sailer at fedoraproject.org
Wed Dec 16 22:26:48 UTC 2009
Author: sailer
Update of /cvs/extras/rpms/ghdl/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv28996
Modified Files:
ghdl.spec
Added Files:
ghdl-shgrt.spec ghdl-svn133.patch
Log Message:
update to svn133
--- NEW FILE ghdl-shgrt.spec ---
# This does not work yet.
# There is a wild calling orgy between grt and e~xx.o going on
# grt calls into e~xx.o for __ghdl_ELABORATE and various std__*
# but grt.ver unglobals all except VPI symbols
%global gccver 4.3.4
%global ghdlver 0.28
%global ghdlsvnver 133
Summary: A VHDL simulator, using the GCC technology
Name: ghdl
Version: %{ghdlver}
Release: 0.%{ghdlsvnver}svn.0%{?dist}
License: GPLv2+
Group: Development/Languages
URL: http://ghdl.free.fr/
# HOWTO create source files from ghdl SVN at https://gna.org/projects/ghdl/
# check out the SVN repo
# cd translate/gcc/
# ./dist.sh sources
Source0: ftp://gcc.gnu.org/pub/gcc/releases/gcc-%{gccver}/gcc-core-%{gccver}.tar.bz2
Source100: http://ghdl.free.fr/ghdl-%{ghdlver}.tar.bz2
Patch100: ghdl-svn%{ghdlsvnver}.patch
Patch103: ghdl-noruntime.patch
Patch104: ghdl-svn110-libgnat44.patch
Patch105: ghdl-grtadac.patch
# Both following patches have been sent to upstream mailing list:
# From: Thomas Sailer <t.sailer at alumni.ethz.ch>
# To: ghdl-discuss at gna.org
# Date: Thu, 02 Apr 2009 15:36:00 +0200
# https://gna.org/bugs/index.php?13390
Patch106: ghdl-ppc64abort.patch
# https://gna.org/bugs/index.php?13389
Patch107: ieee-mathreal.patch
Patch110: grt-so.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Requires(post): /sbin/install-info
Requires(preun): /sbin/install-info
Requires: gcc
# (Build)Requires from fc gcc41 package
%global multilib_64_archs sparc64 ppc64 s390x x86_64
%ifarch s390x
%global multilib_32_arch s390
%endif
%ifarch sparc64
%global multilib_32_arch sparc
%endif
%ifarch ppc64
%global multilib_32_arch ppc
%endif
%ifarch x86_64
%global multilib_32_arch i386
%endif
# Need binutils with -pie support >= 2.14.90.0.4-4
# Need binutils which can omit dot symbols and overlap .opd on ppc64 >= 2.15.91.0.2-4
# Need binutils which handle -msecure-plt on ppc >= 2.16.91.0.2-2
# Need binutils which support .weakref >= 2.16.91.0.3-1
BuildRequires: binutils >= 2.16.91.0.3-1
BuildRequires: zlib-devel, gettext, bison, flex, texinfo, gawk
# Make sure pthread.h doesn't contain __thread tokens
# Make sure glibc supports stack protector
BuildRequires: glibc-devel >= 2.3.90-2
%ifarch ppc ppc64 s390 s390x sparc sparcv9 alpha
# Make sure glibc supports TFmode long double
BuildRequires: glibc >= 2.3.90-35
%endif
# Ada requires Ada to build
BuildRequires: gcc-gnat >= 4.3, libgnat >= 4.3
# GCC build requirements
BuildRequires: gmp-devel >= 4.1, mpfr-devel >= 2.3.0
# Need .eh_frame ld optimizations
# Need proper visibility support
# Need -pie support
# Need --as-needed/--no-as-needed support
# On ppc64, need omit dot symbols support and --non-overlapping-opd
# Need binutils that owns /usr/bin/c++filt
# Need binutils that support .weakref
Requires: binutils >= 2.16.91.0.3-1
# Make sure gdb will understand DW_FORM_strp
Conflicts: gdb < 5.1-2
Requires: glibc-devel >= 2.2.90-12
%ifarch ppc ppc64 s390 s390x sparc sparcv9 alpha
# Make sure glibc supports TFmode long double
Requires: glibc >= 2.3.90-35
%endif
Requires: ghdl-devel = %{version}-%{release}
# Make sure we don't use clashing namespaces
%global _vendor fedora_ghdl
%global _gnu %{nil}
%ifarch sparc
%global gcc_target_platform sparc64-%{_vendor}-%{_target_os}
%endif
%ifarch ppc
%global gcc_target_platform ppc64-%{_vendor}-%{_target_os}
%endif
%ifnarch sparc ppc
%global gcc_target_platform %{_target_platform}
%endif
# do not strip libgrt.a -- makes debugging tedious otherwise
%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's#/usr/lib/rpm/redhat/brp-strip-static-archive .*##g')
%global all_x86 %{ix86} x86_64
%description
GHDL is a VHDL simulator, using the GCC technology. VHDL is a language
standardized by the IEEE, intended for developing electronic systems. GHDL
implements the VHDL language according to the IEEE 1076-1987 or the IEEE
1076-1993 standard. It compiles VHDL files and creates a binary that simulates
(or executes) your design. GHDL does not do synthesis: it cannot translate your
design into a netlist.
Since GHDL is a compiler (i.e., it generates object files), you can call
functions or procedures written in a foreign language, such as C, C++, or
Ada95.
%package devel
Summary: GHDL libraries
Group: Development/Libraries
# rhbz #316311
Requires: zlib-devel, libgnat >= 4.3
Obsoletes: ghdl-grt
%description devel
This package contains the runtime libraries needed to link ghdl-compiled
object files into simulator executables. This package also contains sources
and precompiled binaries for standard VHDL packages.
%ifarch %{all_x86}
%package libs
Summary: GHDL runtime libraries
Group: Development/Libraries
%description libs
This package contains the runtime libraries needed to run ghdl-compiled
simulator executables. grt contains the simulator kernel that tracks
signal updates and schedules processes.
%endif
%ifarch x86_64
%package libs32
Summary: GHDL 32bit runtime libraries
Group: Development/Libraries
%description libs32
This package contains the runtime libraries needed to run ghdl-compiled
simulator executables. grt contains the simulator kernel that tracks
signal updates and schedules processes. This package is needed to compile
32bit executables with ghdl -m32.
%endif
%prep
%setup -q -n gcc-%{gccver} -T -b 0 -a 100
pushd ghdl-%{ghdlver}
%patch100 -p1
%patch103 -p0 -b .noruntime
%patch107 -p0 -b .ieeemathreal
%patch110 -p0 -b .grtso
%{__mv} vhdl ../gcc/
popd
#patch102 -p1 -b .makeinfo
%patch104 -p0 -b .libgnat44
%patch105 -p1 -b .grtadac
%patch106 -p0 -b .ppc64abort
%build
%{__rm} -fr obj-%{gcc_target_platform}
%{__mkdir} obj-%{gcc_target_platform}
pushd obj-%{gcc_target_platform}
# Flag settings cribbed from gcc package
OPT_FLAGS=$(echo %{optflags} | %{__sed} \
-e 's/\(-Wp,\)\?-D_FORTIFY_SOURCE=[12]//g' \
-e 's/-m64//g;s/-m32//g;s/-m31//g' \
%ifarch sparc sparc64
-e 's/-mcpu=ultrasparc/-mtune=ultrasparc/g' \
%endif
-e 's/[[:blank:]]\+/ /g')
# These compiler flags in rawhide seem to break the build, so get rid of them
OPT_FLAGS=$(echo $OPT_FLAGS | %{__sed} \
%ifarch i386 i486 i586 i686
-e 's/-mtune=atom/-mtune=pentium4/g' \
%endif
%ifarch x86_64
-e 's/-mtune=generic/-mtune=nocona/g' \
%endif
-e 's/-fstack-protector//g ' \
-e 's/--param=ssp-buffer-size=[0-9]*//g')
# gcc -m32 fails, so we disable multilibbing.
# so far multilib isn't very valuable, as the VHDL libraries aren't multilibbed
# either; Bug 174731
export CFLAGS="$OPT_FLAGS"
export XCFLAGS="$OPT_FLAGS"
export TCFLAGS="$OPT_FLAGS"
#configure --enable-languages=vhdl
../configure \
--program-prefix=%{?_program_prefix} \
--prefix=%{_prefix} \
--exec-prefix=%{_exec_prefix} \
--bindir=%{_bindir} \
--sbindir=%{_sbindir} \
--sysconfdir=%{_sysconfdir} \
--datadir=%{_datadir} \
--includedir=%{_includedir} \
--libdir=%{_libdir} \
--libexecdir=%{_libexecdir} \
--localstatedir=%{_localstatedir} \
--sharedstatedir=%{_sharedstatedir} \
--mandir=%{_mandir} \
--infodir=%{_infodir} \
--with-bugurl=http://bugzilla.redhat.com/bugzilla \
--enable-languages=vhdl \
%{!?_without_mock:--disable-multilib} \
--enable-shared \
--enable-threads=posix \
--enable-checking=release \
--with-system-zlib \
--enable-__cxa_atexit \
--disable-libunwind-exceptions \
--disable-libgcj \
%ifarch sparc
--host=%{gcc_target_platform} \
--build=%{gcc_target_platform} \
--target=%{gcc_target_platform} \
--with-cpu=v7
%endif
%ifarch ppc
--host=%{gcc_target_platform} \
--build=%{gcc_target_platform} \
--target=%{gcc_target_platform} \
--with-cpu=default32
%endif
%ifnarch sparc ppc
--host=%{gcc_target_platform} \
--build=%{gcc_target_platform}
%endif
# Parallel make doesn't work, so not using %{?_smp_mflags}
#{__make} all-host
%{__make}
popd
%install
%{__rm} -rf %{buildroot}
%{__make} -C obj-%{gcc_target_platform} DESTDIR=%{buildroot} install-host
%ifarch %{all_x86}
pushd obj-%{gcc_target_platform}/gcc/vhdl
make grt-clean
make GRT_ADD_FLAGS="-g -O2 -fPIC" GNATVER=4.4 grt-so
%{__install} -d %{buildroot}%{_libdir}
%{__install} libghdlgrt.so* %{buildroot}%{_libdir}
pushd %{buildroot}%{_libdir}
%{__ln_s} libghdlgrt.so* libghdlgrt.so
popd
pushd %{buildroot}/%{_libdir}/gcc/%{gcc_target_platform}/%{gccver}/vhdl/lib
%{__sed} -e 's,@/libgrt.a,-lghdlgrt,g' < grt.lst > grt.lst.1
%{__mv} grt.lst.1 grt.lst
popd
popd
%ifarch x86_64
pushd obj-%{gcc_target_platform}/gcc/vhdl
make grt-clean
make GRT_ADD_FLAGS="-g -O2 -fPIC -m32" GNATVER=4.4 GRT_TARGET_OBJS="i386.o linux.o times.o" grt-so
%{__install} -d %{buildroot}%{_exec_prefix}/lib
%{__install} libghdlgrt.so* %{buildroot}%{_exec_prefix}/lib
pushd %{buildroot}%{_exec_prefix}/lib
%{__ln_s} libghdlgrt.so* libghdlgrt.so
popd
popd
%endif
%endif
%ifarch x86_64
pushd obj-%{gcc_target_platform}/gcc/vhdl
P32=%{buildroot}/%{_libdir}/gcc/%{gcc_target_platform}/%{gccver}/vhdl/lib/32/
%{__install} -d ${P32}
make ghdllibs-clean
%if %{!?_without_mock:0}%{?_without_mock:1}
make grt-clean
make GRT_FLAGS="-m32 -O -g" GRT_TARGET_OBJS="i386.o linux.o times.o" ghdllib
make grt.lst
%{__sed} -e 's,@/libgrt.a,-lghdlgrt,g' < grt.lst > grt.lst.1
%{__install} -m 644 libgrt.a ${P32}/libgrt.a
%{__install} -m 644 grt.lst.1 ${P32}/grt.lst
%{__install} -m 644 grt.ver ${P32}/grt.ver
%endif
PDIR=`pwd`
pushd ${P32}/../..
%{__install} -d lib/32/v93
%{__install} -d lib/32/v87
%{__make} -f ${PDIR}/Makefile REL_DIR=../../../.. \
LIBSRC_DIR="src" LIB93_DIR=lib/32/v93 LIB87_DIR=lib/32/v87 \
ANALYZE="${PDIR}/../ghdl -a -m32 --GHDL1=${PDIR}/../ghdl1 --ieee=none" \
std.v93 std.v87 ieee.v93 ieee.v87 synopsys.v93 synopsys.v87 mentor.v93
popd
../ghdl1 -m32 --std=87 -quiet -o std_standard.s --compile-standard
../xgcc -m32 -c -o std_standard.o std_standard.s
%{__mv} std_standard.o ${P32}/v87/std/std_standard.o
../ghdl1 -m32 --std=93 -quiet -o std_standard.s --compile-standard
../xgcc -m32 -c -o std_standard.o std_standard.s
%{__mv} std_standard.o ${P32}/v93/std/std_standard.o
popd
%endif
# Add additional libraries to link
(
echo "-lm"
%ifarch x86_64
echo "-ldl"
%endif
) >> %{buildroot}%{_libdir}/gcc/%{gcc_target_platform}/%{gccver}/vhdl/lib/grt.lst
# Remove files not to be packaged
pushd %{buildroot}
%{__rm} -f \
.%{_bindir}/{cpp,gcc,gccbug,gcov} \
.%{_bindir}/%{gcc_target_platform}-gcc{,-%{gccver}} \
.%{_includedir}/mf-runtime.h \
.%{_libdir}/libiberty* \
.%{_infodir}/dir \
.%{_infodir}/{cpp,cppinternals,gcc,gccinstall,gccint}.info* \
.%{_datadir}/locale/*/LC_MESSAGES/{gcc,cpplib}.mo \
.%{_mandir}/man1/{cpp,gcc,gcov}.1* \
.%{_mandir}/man7/{fsf-funding,gfdl,gpl}.7* \
.%{_exec_prefix}/lib/libgcc_s.* \
.%{_exec_prefix}/lib/libmudflap.* \
.%{_exec_prefix}/lib/libmudflapth.* \
.%{_libdir}/32/libiberty.a
# Remove crt/libgcc, as ghdl invokes the native gcc to perform the linking
%{__rm} -f \
.%{_libdir}/gcc/%{gcc_target_platform}/%{gccver}/crt* \
.%{_libdir}/gcc/%{gcc_target_platform}/%{gccver}/libgc* \
.%{_libexecdir}/gcc/%{gcc_target_platform}/%{gccver}/{cc1,collect2}
# Remove directory hierarchies not to be packaged
%{__rm} -rf \
.%{_libdir}/gcc/%{gcc_target_platform}/%{gccver}/{include,install-tools} \
.%{_libexecdir}/gcc/%{gcc_target_platform}/%{gccver}/install-tools
popd
# copy v08 libraries from v93 for now
P64=%{buildroot}/%{_libdir}/gcc/%{gcc_target_platform}/%{gccver}/vhdl/lib/
%{__cp} -rv ${P64}v93 ${P64}v08
%{__mv} ${P64}v08/std/std-obj93.cf ${P64}v08/std/std-obj08.cf
%{__mv} ${P64}v08/ieee/ieee-obj93.cf ${P64}v08/ieee/ieee-obj08.cf
%{__mv} ${P64}v08/mentor/ieee-obj93.cf ${P64}v08/mentor/ieee-obj08.cf
%{__mv} ${P64}v08/synopsys/ieee-obj93.cf ${P64}v08/synopsys/ieee-obj08.cf
%ifarch x86_64
%{__cp} -rv ${P32}v93 ${P32}v08
%{__mv} ${P32}v08/std/std-obj93.cf ${P32}v08/std/std-obj08.cf
%{__mv} ${P32}v08/ieee/ieee-obj93.cf ${P32}v08/ieee/ieee-obj08.cf
%{__mv} ${P32}v08/mentor/ieee-obj93.cf ${P32}v08/mentor/ieee-obj08.cf
%{__mv} ${P32}v08/synopsys/ieee-obj93.cf ${P32}v08/synopsys/ieee-obj08.cf
%endif
%clean
%{__rm} -rf %{buildroot}
%post
[ -f %{_infodir}/ghdl.info.gz ] && \
/sbin/install-info %{_infodir}/ghdl.info.gz %{_infodir}/dir || :
%preun
[ -f %{_infodir}/ghdl.info.gz ] && [ $1 = 0 ] && \
/sbin/install-info --delete %{_infodir}/ghdl.info.gz %{_infodir}/dir || :
%files
%defattr(-,root,root,-)
%doc ghdl-%{ghdlver}/COPYING
%{_bindir}/ghdl
%{_infodir}/ghdl.info.gz
# Need to own directory %{_libexecdir}/gcc even though we only want the
# %{gcc_target_platform}/%{gccver} subdirectory
%{_libexecdir}/gcc/
%{_mandir}/man1/*
%files devel
%defattr(-,root,root,-)
# Need to own directory %{_libdir}/gcc even though we only want the
# %{gcc_target_platform}/%{gccver} subdirectory
%{_libdir}/gcc/
%ifarch %{all_x86}
%{_libdir}/libghdlgrt.so
%endif
%ifarch x86_64
%{_exec_prefix}/lib/libghdlgrt.so
%endif
%ifarch %{all_x86}
%files libs
%defattr(-,root,root,-)
%{_libdir}/libghdlgrt.so.*
%endif
%ifarch x86_64
%files libs32
%defattr(-,root,root,-)
%{_exec_prefix}/lib/libghdlgrt.so.*
%endif
%changelog
* Wed Dec 16 2009 Thomas Sailer <t.sailer at alumni.ethz.ch> - 0.28-0.133svn.0
- update to svn133
- drop upstreamed patches
* Mon Dec 14 2009 Thomas Sailer <t.sailer at alumni.ethz.ch> - 0.28-0.131svn.2
- Process Timeout Chain bugfix
- --trace-signals memory leak fix
* Wed Dec 2 2009 Thomas Sailer <t.sailer at alumni.ethz.ch> - 0.28-0.131svn.1
- copy v08 libraries instead of symlink
* Wed Dec 2 2009 Thomas Sailer <t.sailer at alumni.ethz.ch> - 0.28-0.131svn.0
- update to 0.28/svn131
- symlink v08 libraries to v93 for now
* Wed Sep 23 2009 Thomas Sailer <t.sailer at alumni.ethz.ch> - 0.28-0.130svn.0
- update to 0.28/svn130
* Sun Sep 20 2009 Thomas Sailer <t.sailer at alumni.ethz.ch> - 0.27-0.126svn.0
- update to svn126
* Sun Jul 26 2009 Thomas Sailer <t.sailer at alumni.ethz.ch> - 0.27-0.110svn.8
- this gcc does not understand -mtune=atom
* Fri Jul 24 2009 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0.27-0.110svn.7.1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
* Tue May 26 2009 Thomas Sailer <t.sailer at alumni.ethz.ch> - 0.27-0.110svn.7
- fix bug in std.textio.read (string)
* Wed Apr 2 2009 Thomas Sailer <t.sailer at alumni.ethz.ch> - 0.27-0.110svn.6
- actually add the patch
* Wed Apr 1 2009 Thomas Sailer <t.sailer at alumni.ethz.ch> - 0.27-0.110svn.5
- make ieee.math_real more standards compliant
* Sun Mar 15 2009 Thomas Sailer <t.sailer at alumni.ethz.ch> - 0.27-0.110svn.4
- gnat version is now 4.4
* Tue Feb 24 2009 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0.27-0.110svn.3.1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
* Fri Feb 13 2009 Thomas Sailer <t.sailer at alumni.ethz.ch> - 0.27-0.110svn.3
- prevent ppc64 abort due to unknown language type
* Fri Feb 13 2009 Thomas Sailer <t.sailer at alumni.ethz.ch> - 0.27-0.110svn.2
- rebuild with ppc64
* Thu Oct 9 2008 Thomas Sailer <t.sailer at alumni.ethz.ch> - 0.27-0.110svn.1
- rebuild
* Tue Oct 7 2008 Thomas Sailer <t.sailer at alumni.ethz.ch> - 0.27-0.110svn.0
- update to svn110
* Tue Oct 7 2008 Thomas Sailer <t.sailer at alumni.ethz.ch> - 0.27-0.105svn.0
- update to svn105
* Mon Jun 2 2008 Thomas Sailer <t.sailer at alumni.ethz.ch> - 0.26-0.98svn.0
- update to svn98
* Fri May 16 2008 Thomas Sailer <t.sailer at alumni.ethz.ch> - 0.26-0.94svn.7
- update to svn94
* Sun Jan 6 2008 Thomas Sailer <t.sailer at alumni.ethz.ch> - 0.25-0.89svn.7
- disable Pragma No_Run_Time; it does not seem to make much sense and causes
problems with gcc-4.3
* Mon Oct 8 2007 Thomas Sailer <t.sailer at alumni.ethz.ch> - 0.25-0.89svn.6
- ghdl-grt requires zlib-devel (rhbz 316311)
- make it build with makeinfo >= 4.10
* Fri Aug 24 2007 Thomas Sailer <t.sailer at alumni.ethz.ch> - 0.25-0.89svn.5
- excludearch ppc64
* Fri Aug 24 2007 Thomas Sailer <t.sailer at alumni.ethz.ch> - 0.25-0.89svn.4
- fix BR
* Fri Aug 24 2007 Thomas Sailer <t.sailer at alumni.ethz.ch> - 0.25-0.89svn.3
- fix license tag
* Fri Jan 5 2007 Thomas Sailer <t.sailer at alumni.ethz.ch> - 0.25-0.89svn.2
- do not try to set user/group during install
* Fri Jan 5 2007 Thomas Sailer <t.sailer at alumni.ethz.ch> - 0.25-0.89svn.1
- back out hunks that cause build failures
- un-exclude ppc
* Mon Nov 20 2006 Thomas Sailer <t.sailer at alumni.ethz.ch> - 0.25-0.89svn.0
- update to svn89
* Fri Oct 6 2006 Thomas Sailer <t.sailer at alumni.ethz.ch> - 0.25-0.73svn.0
- update to svn73
* Thu Oct 5 2006 Thomas Sailer <t.sailer at alumni.ethz.ch> - 0.25-0.71svn.1
- bump release
* Thu Oct 5 2006 Thomas Sailer <t.sailer at alumni.ethz.ch> - 0.25-0.71svn.0
- update to svn71
* Sun Aug 27 2006 Thomas Sailer <t.sailer at alumni.ethz.ch> - 0.25-0.61svn.0
- update to svn61
* Sun Aug 6 2006 Thomas Sailer <t.sailer at alumni.ethz.ch> - 0.24-0.60svn.0
- update to svn60
* Tue Jul 11 2006 Thomas Sailer <t.sailer at alumni.ethz.ch> - 0.24-0.59svn.2
- rebuild
* Mon Jul 10 2006 Thomas Sailer <t.sailer at alumni.ethz.ch> - 0.24-0.59svn.1
- add missing manpage
* Mon Jul 10 2006 Thomas Sailer <t.sailer at alumni.ethz.ch> - 0.24-0.59svn.0
- update to svn59
* Sun Jun 25 2006 Thomas Sailer <t.sailer at alumni.ethz.ch> - 0.23-0.58svn.0
- update to svn58
* Tue Jun 20 2006 Thomas Sailer <t.sailer at alumni.ethz.ch> - 0.23-0.57svn.0
- update to svn57
* Fri Mar 24 2006 Thomas Sailer <t.sailer at alumni.ethz.ch> - 0.22-0.50svn.1
- do not require /lib/libc.so.* on x86_64, this does not work under mock
* Wed Mar 22 2006 Thomas Sailer <t.sailer at alumni.ethz.ch> - 0.22-0.50svn.0
- update to svn50, to fix x86_64 breakage
- move grt (ghdl runtime library) into separate package, to allow parallel
install of i386 and x86_64 grt on x86_64 machines, thus making -m32 work
- back to using FSF gcc as base compiler sources, using core gcc sources
causes segfaults during library compile on x86_64
* Sun Mar 19 2006 Thomas Sailer <t.sailer at alumni.ethz.ch> - 0.22-0.49svn.1
- use core gcc as base compiler sources
* Thu Mar 16 2006 Thomas Sailer <t.sailer at alumni.ethz.ch> - 0.22-0.49svn.0
- update to svn49, using gcc 4.1.0
* Mon Mar 6 2006 Thomas Sailer <t.sailer at alumni.ethz.ch> - 0.22-0.40svn.0
- update to svn40, to fix an array bounds checking bug apparently
introduced in svn39
* Thu Feb 16 2006 Thomas Sailer <t.sailer at alumni.ethz.ch> - 0.22-0.39svn.0
- update to svn39, to fix some constant bugs
* Wed Feb 14 2006 Thomas Sailer <t.sailer at alumni.ethz.ch> - 0.22-0.38svn.1
- rebuild with new compiler for FC5
* Wed Dec 21 2005 Thomas Sailer <t.sailer at alumni.ethz.ch> - 0.22-0.38svn.0
- update to svn38, to fix a ghw output bug
* Sun Dec 18 2005 Thomas Sailer <t.sailer at alumni.ethz.ch> - 0.21-1
- update to 0.21
* Thu Dec 15 2005 Thomas Sailer <t.sailer at alumni.ethz.ch> - 0.21-0.35svn.1
- update to svn35 for more x86_64 "Ada cannot portably call C vararg functions"
fixes
- first stab at -m32 library building
* Sat Dec 10 2005 Thomas Sailer <t.sailer at alumni.ethz.ch> - 0.21-0.33svn.1
- update to svn33, to fix x86_64 issues (real'image, -m32)
- rpmbuild option --without mock enables multilib builds
* Mon Dec 5 2005 Thomas Sailer <t.sailer at alumni.ethz.ch> - 0.21-0.24svn.3
- disable multilib and remove exclude of x86_64
* Thu Dec 1 2005 Thomas Sailer <t.sailer at alumni.ethz.ch> - 0.21-0.24svn.2
- Exclude ppc because gcc-gnat is missing
- Exclude x86_64 because of mock build issues
* Fri Nov 25 2005 Thomas Sailer <t.sailer at alumni.ethz.ch> - 0.21-0.24svn.1
- update to SVN rev 24
- remove additional files to fix x86_64 build
* Tue Nov 22 2005 Thomas Sailer <t.sailer at alumni.ethz.ch> - 0.21-0.23svn.1
- update to SVN rev 23
* Mon Nov 14 2005 Paul Howarth <paul at city-fan.org> - 0.21-0.21.1
- spec file cosmetic cleanups
- incorporate some architecture tweaks from gcc package
- remove files we don't want packaged so that we can turn the unpackaged file
check back on
- use fedora_ghdl as the machine vendor name to avoid namespace clashes with
other packages
- own {%%{_libdir},%%{_libexecdir}}/gcc directories since this package does not
depend on gcc
- add buildreq texinfo, needed to make info file
- don't include README, which is aimed at building ghdl rather than using it
- remove install-tools and munged header files, not needed for ghdl
- only run install-info if the info file is installed
- patch ghdl.texi to include info dir entry
* Fri Nov 11 2005 Thomas Sailer <t.sailer at alumni.ethz.ch> - 0.21-0.21
- update to 0.21pre, svn rev 21
- incorporate changes from Paul Howarth
* Sat Mar 12 2005 Thomas Sailer <t.sailer at alumni.ethz.ch> - 0.18-1
- update to 0.18
* Sat Feb 26 2005 Thomas Sailer <t.sailer at alumni.ethz.ch> - 0.17-1
- update to 0.17
* Tue Feb 8 2005 Thomas Sailer <t.sailer at alumni.ethz.ch> - 0.16-1
- Initial build.
ghdl-svn133.patch:
errorout.adb | 6
ghdldrv/ghdllocal.adb | 2
grt/grt-processes.adb | 448 ++++++++++++++++++++++++++++++-------------------
grt/grt-processes.ads | 31 +--
grt/grt-rtis_utils.adb | 1
grt/grt-signals.adb | 31 +--
grt/grt-signals.ads | 33 ++-
grt/grt-types.ads | 4
grt/grt-unithread.adb | 9
grt/grt-unithread.ads | 6
ortho-lang.c | 2
version.ads | 4
12 files changed, 346 insertions(+), 231 deletions(-)
--- NEW FILE ghdl-svn133.patch ---
diff -urN ghdl-0.28/vhdl/errorout.adb ghdl-0.29dev/vhdl/errorout.adb
--- ghdl-0.28/vhdl/errorout.adb 2008-09-27 03:27:50.000000000 +0200
+++ ghdl-0.29dev/vhdl/errorout.adb 2009-12-16 14:31:15.000000000 +0100
@@ -893,8 +893,12 @@
procedure Append_Type (Def : Iir)
is
use Name_Table;
+ Decl : Iir := Get_Type_Declarator (Def);
begin
- Image (Get_Identifier (Get_Type_Declarator (Def)));
+ if Decl = Null_Iir then
+ Decl := Get_Type_Declarator (Get_Base_Type (Def));
+ end if;
+ Image (Get_Identifier (Decl));
Append (Res, Name_Buffer (1 .. Name_Length));
end Append_Type;
diff -urN ghdl-0.28/vhdl/ghdldrv/ghdllocal.adb ghdl-0.29dev/vhdl/ghdldrv/ghdllocal.adb
--- ghdl-0.28/vhdl/ghdldrv/ghdllocal.adb 2009-08-13 06:21:29.000000000 +0200
+++ ghdl-0.29dev/vhdl/ghdldrv/ghdllocal.adb 2009-12-16 14:31:12.000000000 +0100
@@ -223,7 +223,7 @@
if Prefix_Path = null then
Prefix_Path := new String'(Default_Pathes.Prefix);
else
- -- assume the user has set the correct path, so do not insert 32
+ -- Assume the user has set the correct path, so do not insert 32.
Flag_32bit := False;
end if;
diff -urN ghdl-0.28/vhdl/grt/grt-processes.adb ghdl-0.29dev/vhdl/grt/grt-processes.adb
--- ghdl-0.28/vhdl/grt/grt-processes.adb 2008-08-29 01:40:50.000000000 +0200
+++ ghdl-0.29dev/vhdl/grt/grt-processes.adb 2009-12-16 14:31:13.000000000 +0100
@@ -36,27 +36,30 @@
package body Grt.Processes is
Last_Time : constant Std_Time := Std_Time'Last;
+ -- Identifier for a process.
+ type Process_Id is new Integer;
+
-- Table of processes.
package Process_Table is new Grt.Table
- (Table_Component_Type => Process_Type,
+ (Table_Component_Type => Process_Acc,
Table_Index_Type => Process_Id,
Table_Low_Bound => 1,
Table_Initial => 16);
-- List of non_sensitized processes.
package Non_Sensitized_Process_Table is new Grt.Table
- (Table_Component_Type => Process_Id,
+ (Table_Component_Type => Process_Acc,
Table_Index_Type => Natural,
Table_Low_Bound => 1,
Table_Initial => 2);
-- List of processes to be resume at next cycle.
- type Process_Id_Array is array (Natural range <>) of Process_Id;
- type Process_Id_Array_Acc is access Process_Id_Array;
+ type Process_Acc_Array is array (Natural range <>) of Process_Acc;
+ type Process_Acc_Array_Acc is access Process_Acc_Array;
- Resume_Process_Table : Process_Id_Array_Acc;
+ Resume_Process_Table : Process_Acc_Array_Acc;
Last_Resume_Process : Natural := 0;
- Postponed_Resume_Process_Table : Process_Id_Array_Acc;
+ Postponed_Resume_Process_Table : Process_Acc_Array_Acc;
Last_Postponed_Resume_Process : Natural := 0;
-- Number of postponed processes.
@@ -66,8 +69,9 @@
-- Number of resumed processes.
Nbr_Resumed_Processes : Natural := 0;
- procedure Free is new Ada.Unchecked_Deallocation
- (Name => Sensitivity_Acc, Object => Sensitivity_El);
+ -- Earliest time out within non-sensitized processes.
+ Process_First_Timeout : Std_Time := Last_Time;
+ Process_Timeout_Chain : Process_Acc := null;
procedure Init is
begin
@@ -105,6 +109,7 @@
function To_Proc_Acc is new Ada.Unchecked_Conversion
(Source => System.Address, Target => Proc_Acc);
Stack : Stack_Type;
+ P : Process_Acc;
begin
if State /= State_Sensitized then
Stack := Stack_Create (Proc, This);
@@ -114,22 +119,22 @@
else
Stack := Null_Stack;
end if;
- Process_Table.Increment_Last;
- Process_Table.Table (Process_Table.Last) :=
- (Subprg => To_Proc_Acc (Proc),
- This => This,
- Rti => Ctxt,
- Sensitivity => null,
- Resumed => False,
- Postponed => Postponed,
- State => State,
- Timeout => Bad_Time,
- Stack => Stack);
+ P := new Process_Type'(Subprg => To_Proc_Acc (Proc),
+ This => This,
+ Rti => Ctxt,
+ Sensitivity => null,
+ Resumed => False,
+ Postponed => Postponed,
+ State => State,
+ Timeout => Bad_Time,
+ Timeout_Chain_Next => null,
+ Timeout_Chain_Prev => null,
+ Stack => Stack);
+ Process_Table.Append (P);
-- Used to create drivers.
- Set_Current_Process (Process_Table.Last, null);
-
+ Set_Current_Process (P);
if State /= State_Sensitized then
- Non_Sensitized_Process_Table.Append (Process_Table.Last);
+ Non_Sensitized_Process_Table.Append (P);
end if;
if Postponed then
Nbr_Postponed_Processes := Nbr_Postponed_Processes + 1;
@@ -145,7 +150,7 @@
Addr : System.Address)
is
begin
- Process_Register (Instance, Proc, (Addr, Ctxt), State_Timeout, False);
+ Process_Register (Instance, Proc, (Addr, Ctxt), State_Ready, False);
end Ghdl_Process_Register;
procedure Ghdl_Sensitized_Process_Register
@@ -165,7 +170,7 @@
Addr : System.Address)
is
begin
- Process_Register (Instance, Proc, (Addr, Ctxt), State_Timeout, True);
+ Process_Register (Instance, Proc, (Addr, Ctxt), State_Ready, True);
end Ghdl_Postponed_Process_Register;
procedure Ghdl_Postponed_Sensitized_Process_Register
@@ -184,20 +189,22 @@
is
function To_Proc_Acc is new Ada.Unchecked_Conversion
(Source => System.Address, Target => Proc_Acc);
+ P : Process_Acc;
begin
- Process_Table.Increment_Last;
- Process_Table.Table (Process_Table.Last) :=
- (Rti => Ctxt,
- Sensitivity => null,
- Resumed => False,
- Postponed => False,
- State => State_Sensitized,
- Timeout => Bad_Time,
- Subprg => To_Proc_Acc (Proc),
- This => This,
- Stack => Null_Stack);
+ P := new Process_Type'(Rti => Ctxt,
+ Sensitivity => null,
+ Resumed => False,
+ Postponed => False,
+ State => State_Sensitized,
+ Timeout => Bad_Time,
+ Timeout_Chain_Next => null,
+ Timeout_Chain_Prev => null,
+ Subprg => To_Proc_Acc (Proc),
+ This => This,
+ Stack => Null_Stack);
+ Process_Table.Append (P);
-- Used to create drivers.
- Set_Current_Process (Process_Table.Last, null);
+ Set_Current_Process (P);
end Verilog_Process_Register;
procedure Ghdl_Initial_Register (Instance : System.Address;
@@ -217,16 +224,16 @@
procedure Ghdl_Process_Add_Sensitivity (Sig : Ghdl_Signal_Ptr)
is
begin
- Resume_Process_If_Event (Sig, Process_Table.Last);
+ Resume_Process_If_Event
+ (Sig, Process_Table.Table (Process_Table.Last));
end Ghdl_Process_Add_Sensitivity;
- procedure Resume_Process (Proc : Process_Id)
+ procedure Resume_Process (Proc : Process_Acc)
is
- P : Process_Type renames Process_Table.Table (Proc);
begin
- if not P.Resumed then
- P.Resumed := True;
- if P.Postponed then
+ if not Proc.Resumed then
+ Proc.Resumed := True;
+ if Proc.Postponed then
Last_Postponed_Resume_Process := Last_Postponed_Resume_Process + 1;
Postponed_Resume_Process_Table (Last_Postponed_Resume_Process)
:= Proc;
@@ -260,26 +267,66 @@
Grt.Stack2.Release (Get_Stack2, Mark);
end Ghdl_Stack2_Release;
- function To_Acc is new Ada.Unchecked_Conversion
- (Source => System.Address, Target => Process_Acc);
-
procedure Ghdl_Process_Wait_Add_Sensitivity (Sig : Ghdl_Signal_Ptr)
is
- El : Sensitivity_Acc;
+ Proc : constant Process_Acc := Get_Current_Process;
+ El : Action_List_Acc;
begin
- El := new Sensitivity_El'(Sig => Sig,
- Next => Get_Current_Process.Sensitivity);
- Get_Current_Process.Sensitivity := El;
+ El := new Action_List'(Dynamic => True,
+ Next => Sig.Event_List,
+ Proc => Proc,
+ Prev => null,
+ Sig => Sig,
+ Chain => Proc.Sensitivity);
+ if Sig.Event_List /= null and then Sig.Event_List.Dynamic then
+ Sig.Event_List.Prev := El;
+ end if;
+ Sig.Event_List := El;
+ Proc.Sensitivity := El;
end Ghdl_Process_Wait_Add_Sensitivity;
+ procedure Update_Process_First_Timeout (Proc : Process_Acc) is
+ begin
+ if Proc.Timeout < Process_First_Timeout then
+ Process_First_Timeout := Proc.Timeout;
+ end if;
+ Proc.Timeout_Chain_Next := Process_Timeout_Chain;
+ Proc.Timeout_Chain_Prev := null;
+ if Process_Timeout_Chain /= null then
+ Process_Timeout_Chain.Timeout_Chain_Prev := Proc;
+ end if;
+ Process_Timeout_Chain := Proc;
+ end Update_Process_First_Timeout;
+
+ procedure Remove_Process_From_Timeout_Chain (Proc : Process_Acc) is
+ begin
+ -- Remove Proc from the timeout list.
+ if Proc.Timeout_Chain_Prev /= null then
+ Proc.Timeout_Chain_Prev.Timeout_Chain_Next :=
+ Proc.Timeout_Chain_Next;
+ -- Be sure a second call won't corrupt the chain.
+ Proc.Timeout_Chain_Prev := null;
+ elsif Process_Timeout_Chain = Proc then
+ -- Only if Proc is in the chain.
+ Process_Timeout_Chain := Proc.Timeout_Chain_Next;
+ end if;
+ if Proc.Timeout_Chain_Next /= null then
+ Proc.Timeout_Chain_Next.Timeout_Chain_Prev :=
+ Proc.Timeout_Chain_Prev;
+ Proc.Timeout_Chain_Next := null;
+ end if;
+ end Remove_Process_From_Timeout_Chain;
+
procedure Ghdl_Process_Wait_Set_Timeout (Time : Std_Time)
is
+ Proc : constant Process_Acc := Get_Current_Process;
begin
if Time < 0 then
-- LRM93 8.1
Error ("negative timeout clause");
end if;
- Get_Current_Process.Timeout := Current_Time + Time;
+ Proc.Timeout := Current_Time + Time;
+ Update_Process_First_Timeout (Proc);
end Ghdl_Process_Wait_Set_Timeout;
function Ghdl_Process_Wait_Suspend return Boolean
@@ -295,27 +342,75 @@
-- Cur_Proc.Timeout := Std_Time'Last;
-- end if;
Stack_Switch (Get_Main_Stack, Proc.Stack);
- -- Note: in case of timeout, the timeout is removed when processis is
+ -- Note: in case of timeout, the timeout is removed when process is
-- woken up.
return Proc.State = State_Timeout;
end Ghdl_Process_Wait_Suspend;
+ procedure Free is new Ada.Unchecked_Deallocation
+ (Action_List, Action_List_Acc);
+
procedure Ghdl_Process_Wait_Close
is
Proc : constant Process_Acc := Get_Current_Process;
- El : Sensitivity_Acc;
- N_El : Sensitivity_Acc;
+ El : Action_List_Acc;
+ N_El : Action_List_Acc;
begin
-- Remove the sensitivity.
El := Proc.Sensitivity;
Proc.Sensitivity := null;
while El /= null loop
- N_El := El.Next;
+ pragma Assert (El.Proc = Get_Current_Process);
+ if El.Prev = null then
+ El.Sig.Event_List := El.Next;
+ else
+ pragma Assert (El.Prev.Dynamic);
+ El.Prev.Next := El.Next;
+ end if;
+ if El.Next /= null and then El.Next.Dynamic then
+ El.Next.Prev := El.Prev;
+ end if;
+ N_El := El.Chain;
Free (El);
El := N_El;
end loop;
- -- Remove the timeout.
- Proc.Timeout := Bad_Time;
+
+ -- Remove Proc from the timeout list.
+ Remove_Process_From_Timeout_Chain (Proc);
+
+ -- This is necessary when the process has been woken-up by an event
+ -- before the timeout triggers.
+ if Process_First_Timeout = Proc.Timeout then
+ -- Remove the timeout.
+ Proc.Timeout := Bad_Time;
+
+ declare
+ Next_Timeout : Std_Time;
+ P : Process_Acc;
+ begin
+ Next_Timeout := Last_Time;
+ P := Process_Timeout_Chain;
+ while P /= null loop
+ case P.State is
+ when State_Delayed
+ | State_Wait =>
+ if P.Timeout > 0
+ and then P.Timeout < Next_Timeout
+ then
+ Next_Timeout := P.Timeout;
+ end if;
+ when others =>
+ null;
+ end case;
+ P := P.Timeout_Chain_Next;
+ end loop;
+ Process_First_Timeout := Next_Timeout;
+ end;
+ else
+ -- Remove the timeout.
+ Proc.Timeout := Bad_Time;
+ end if;
+ Proc.State := State_Ready;
end Ghdl_Process_Wait_Close;
procedure Ghdl_Process_Wait_Exit
@@ -345,8 +440,13 @@
end if;
Proc.Timeout := Current_Time + Time;
Proc.State := State_Wait;
+ Update_Process_First_Timeout (Proc);
-- Suspend this process.
Stack_Switch (Get_Main_Stack, Proc.Stack);
+ -- Clean-up.
+ Proc.Timeout := Bad_Time;
+ Remove_Process_From_Timeout_Chain (Proc);
+ Proc.State := State_Ready;
end Ghdl_Process_Wait_Timeout;
-- Verilog.
@@ -356,6 +456,7 @@
begin
Proc.Timeout := Current_Time + Std_Time (Del);
Proc.State := State_Delayed;
+ Update_Process_First_Timeout (Proc);
end Ghdl_Process_Delay;
-- Protected object lock.
@@ -364,7 +465,7 @@
type Object_Lock is record
-- The owner of the lock.
-- Nul_Process_Id means the lock is free.
- Process : Process_Id;
+ Process : Process_Acc;
-- Number of times the lock has been acquired.
Count : Natural;
end record;
@@ -379,14 +480,14 @@
is
Lock : constant Object_Lock_Acc := To_Lock_Acc_Acc (Obj).all;
begin
- if Lock.Process = Nul_Process_Id then
+ if Lock.Process = null then
if Lock.Count /= 0 then
Internal_Error ("protected_enter");
end if;
- Lock.Process := Get_Current_Process_Id;
+ Lock.Process := Get_Current_Process;
Lock.Count := 1;
else
- if Lock.Process /= Get_Current_Process_Id then
+ if Lock.Process /= Get_Current_Process then
Internal_Error ("protected_enter(2)");
end if;
Lock.Count := Lock.Count + 1;
@@ -397,7 +498,7 @@
is
Lock : constant Object_Lock_Acc := To_Lock_Acc_Acc (Obj).all;
begin
- if Lock.Process /= Get_Current_Process_Id then
+ if Lock.Process /= Get_Current_Process then
Internal_Error ("protected_leave(1)");
end if;
@@ -406,7 +507,7 @@
end if;
Lock.Count := Lock.Count - 1;
if Lock.Count = 0 then
- Lock.Process := Nul_Process_Id;
+ Lock.Process := null;
end if;
end Ghdl_Protected_Leave;
@@ -414,8 +515,7 @@
is
Lock : constant Object_Lock_Acc_Acc := To_Lock_Acc_Acc (Obj);
begin
- Lock.all := new Object_Lock'(Process => Nul_Process_Id,
- Count => 0);
+ Lock.all := new Object_Lock'(Process => null, Count => 0);
end Ghdl_Protected_Init;
procedure Ghdl_Protected_Fini (Obj : System.Address)
@@ -425,7 +525,7 @@
Lock : constant Object_Lock_Acc_Acc := To_Lock_Acc_Acc (Obj);
begin
- if Lock.all.Count /= 0 or Lock.all.Process /= Nul_Process_Id then
+ if Lock.all.Count /= 0 or Lock.all.Process /= null then
Internal_Error ("protected_fini");
end if;
Deallocate (Lock.all);
@@ -448,40 +548,63 @@
end if;
-- 3) The next time at which a process resumes.
- for I in Non_Sensitized_Process_Table.First ..
- Non_Sensitized_Process_Table.Last
- loop
- declare
- Pid : constant Process_Id :=
- Non_Sensitized_Process_Table.Table (I);
- Proc : Process_Type renames Process_Table.Table (Pid);
- begin
- if Proc.State = State_Wait
- and then Proc.Timeout < Res
- and then Proc.Timeout >= 0
- then
- -- No signals to be updated.
- Grt.Signals.Flush_Active_List;
-
- if Proc.Timeout = Current_Time then
- -- Can't be better.
- return Current_Time;
- else
- Res := Proc.Timeout;
- end if;
- end if;
- end;
- end loop;
+ if Process_First_Timeout < Res then
+ -- No signals to be updated.
+ Grt.Signals.Flush_Active_List;
+
+ Res := Process_First_Timeout;
+ end if;
return Res;
end Compute_Next_Time;
- procedure Disp_Process_Name (Stream : Grt.Stdio.FILEs; Proc : Process_Id)
+ procedure Disp_Process_Name (Stream : Grt.Stdio.FILEs; Proc : Process_Acc)
is
begin
- Grt.Rtis_Utils.Put (Stream, Process_Table.Table (Proc).Rti);
+ Grt.Rtis_Utils.Put (Stream, Proc.Rti);
end Disp_Process_Name;
+ procedure Disp_All_Processes
+ is
+ use Grt.Stdio;
+ use Grt.Astdio;
+ begin
+ for I in Process_Table.First .. Process_Table.Last loop
+ declare
+ Proc : constant Process_Acc := Process_Table.Table (I);
+ begin
+ Disp_Process_Name (stdout, Proc);
+ New_Line (stdout);
+ Put (stdout, " State: ");
+ case Proc.State is
+ when State_Sensitized =>
+ Put (stdout, "sensitized");
+ when State_Wait =>
+ Put (stdout, "wait");
+ if Proc.Timeout /= Bad_Time then
+ Put (stdout, " until ");
+ Put_Time (stdout, Proc.Timeout);
+ end if;
+ when State_Ready =>
+ Put (stdout, "ready");
+ when State_Timeout =>
+ Put (stdout, "timeout");
+ when State_Delayed =>
+ Put (stdout, "delayed");
+ when State_Dead =>
+ Put (stdout, "dead");
+ end case;
+-- Put (stdout, ": time: ");
+-- Put_U64 (stdout, Proc.Stats_Time);
+-- Put (stdout, ", runs: ");
+-- Put_U32 (stdout, Proc.Stats_Run);
+ New_Line (stdout);
+ end;
+ end loop;
+ end Disp_All_Processes;
+
+ pragma Unreferenced (Disp_All_Processes);
+
type Run_Handler is access function return Integer;
-- pragma Convention (C, Run_Handler);
@@ -502,12 +625,12 @@
Run_Failure : constant Integer := -1;
Mt_Last : Natural;
- Mt_Table : Process_Id_Array_Acc;
+ Mt_Table : Process_Acc_Array_Acc;
Mt_Index : aliased Natural;
procedure Run_Processes_Threads
is
- Pid : Process_Id;
+ Proc : Process_Acc;
Idx : Natural;
begin
loop
@@ -516,41 +639,36 @@
if Idx > Mt_Last then
return;
end if;
- Pid := Mt_Table (Idx);
+ Proc := Mt_Table (Idx);
- declare
- Proc : Process_Type renames Process_Table.Table (Pid);
- begin
- if Grt.Options.Trace_Processes then
- Grt.Astdio.Put ("run process ");
- Disp_Process_Name (Stdio.stdout, Pid);
- Grt.Astdio.Put (" [");
- Grt.Astdio.Put (Stdio.stdout, Proc.This);
- Grt.Astdio.Put ("]");
- Grt.Astdio.New_Line;
- end if;
- if not Proc.Resumed then
- Internal_Error ("run non-resumed process");
- end if;
- Proc.Resumed := False;
- Set_Current_Process
- (Pid, To_Acc (Process_Table.Table (Pid)'Address));
- if Proc.State = State_Sensitized then
- Proc.Subprg.all (Proc.This);
- else
- Stack_Switch (Proc.Stack, Get_Main_Stack);
- end if;
- if Grt.Options.Checks then
- Ghdl_Signal_Internal_Checks;
- Grt.Stack2.Check_Empty (Get_Stack2);
- end if;
- end;
+ if Grt.Options.Trace_Processes then
+ Grt.Astdio.Put ("run process ");
+ Disp_Process_Name (Stdio.stdout, Proc);
+ Grt.Astdio.Put (" [");
+ Grt.Astdio.Put (Stdio.stdout, Proc.This);
+ Grt.Astdio.Put ("]");
+ Grt.Astdio.New_Line;
+ end if;
+ if not Proc.Resumed then
+ Internal_Error ("run non-resumed process");
+ end if;
+ Proc.Resumed := False;
+ Set_Current_Process (Proc);
+ if Proc.State = State_Sensitized then
+ Proc.Subprg.all (Proc.This);
+ else
+ Stack_Switch (Proc.Stack, Get_Main_Stack);
+ end if;
+ if Grt.Options.Checks then
+ Ghdl_Signal_Internal_Checks;
+ Grt.Stack2.Check_Empty (Get_Stack2);
+ end if;
end loop;
end Run_Processes_Threads;
function Run_Processes (Postponed : Boolean) return Integer
is
- Table : Process_Id_Array_Acc;
+ Table : Process_Acc_Array_Acc;
Last : Natural;
begin
if Options.Flag_Stats then
@@ -571,15 +689,14 @@
if Options.Nbr_Threads = 1 then
for I in 1 .. Last loop
declare
- Pid : constant Process_Id := Table (I);
- Proc : Process_Type renames Process_Table.Table (Pid);
+ Proc : constant Process_Acc := Table (I);
begin
if not Proc.Resumed then
Internal_Error ("run non-resumed process");
end if;
if Grt.Options.Trace_Processes then
Grt.Astdio.Put ("run process ");
- Disp_Process_Name (Stdio.stdout, Pid);
+ Disp_Process_Name (Stdio.stdout, Proc);
Grt.Astdio.Put (" [");
Grt.Astdio.Put (Stdio.stdout, Proc.This);
Grt.Astdio.Put ("]");
@@ -587,8 +704,7 @@
end if;
Proc.Resumed := False;
- Set_Current_Process
- (Pid, To_Acc (Process_Table.Table (Pid)'Address));
+ Set_Current_Process (Proc);
if Proc.State = State_Sensitized then
Proc.Subprg.all (Proc.This);
else
@@ -642,7 +758,7 @@
null;
for I in Process_Table.First .. Process_Table.Last loop
- Resume_Process (I);
+ Resume_Process (Process_Table.Table (I));
end loop;
-- - Each nonpostponed process in the model is executed until it
@@ -697,47 +813,43 @@
-- d) For each process P, if P is currently sensitive to a signal S and
-- if an event has occured on S in this simulation cycle, then P
-- resumes.
- for I in Non_Sensitized_Process_Table.First ..
- Non_Sensitized_Process_Table.Last
- loop
+ if Current_Time = Process_First_Timeout then
+ Tn := Last_Time;
declare
- Pid : constant Process_Id :=
- Non_Sensitized_Process_Table.Table (I);
- Proc : Process_Type renames Process_Table.Table (Pid);
- El : Sensitivity_Acc;
+ Proc : Process_Acc;
begin
- case Proc.State is
- when State_Sensitized =>
- null;
- when State_Delayed =>
- if Proc.Timeout = Current_Time then
- Proc.Timeout := Bad_Time;
- Resume_Process (Pid);
- Proc.State := State_Sensitized;
- end if;
- when State_Wait =>
- if Proc.Timeout = Current_Time then
- Proc.Timeout := Bad_Time;
- Resume_Process (Pid);
- Proc.State := State_Timeout;
- else
- El := Proc.Sensitivity;
- while El /= null loop
- if El.Sig.Event then
- Resume_Process (Pid);
- exit;
- else
- El := El.Next;
- end if;
- end loop;
- end if;
- when State_Timeout =>
- Internal_Error ("process in timeout");
- when State_Dead =>
- null;
- end case;
+ Proc := Process_Timeout_Chain;
+ while Proc /= null loop
+ case Proc.State is
+ when State_Sensitized =>
+ null;
+ when State_Delayed =>
+ if Proc.Timeout = Current_Time then
+ Proc.Timeout := Bad_Time;
+ Resume_Process (Proc);
+ Proc.State := State_Sensitized;
+ elsif Proc.Timeout > 0 and then Proc.Timeout < Tn then
+ Tn := Proc.Timeout;
+ end if;
+ when State_Wait =>
+ if Proc.Timeout = Current_Time then
+ Proc.Timeout := Bad_Time;
+ Resume_Process (Proc);
+ Proc.State := State_Timeout;
+ elsif Proc.Timeout > 0 and then Proc.Timeout < Tn then
+ Tn := Proc.Timeout;
+ end if;
+ when State_Timeout
+ | State_Ready =>
+ Internal_Error ("process in timeout");
+ when State_Dead =>
+ null;
+ end case;
+ Proc := Proc.Timeout_Chain_Next;
+ end loop;
end;
- end loop;
+ Process_First_Timeout := Tn;
+ end if;
-- e) Each nonpostponed that has resumed in the current simulation cycle
-- is executed until it suspends.
@@ -810,9 +922,9 @@
-- Allocate processes arrays.
Resume_Process_Table :=
- new Process_Id_Array (1 .. Nbr_Non_Postponed_Processes);
+ new Process_Acc_Array (1 .. Nbr_Non_Postponed_Processes);
Postponed_Resume_Process_Table :=
- new Process_Id_Array (1 .. Nbr_Postponed_Processes);
+ new Process_Acc_Array (1 .. Nbr_Postponed_Processes);
Status := Run_Through_Longjump (Initialization_Phase'Access);
if Status /= Run_Resumed then
diff -urN ghdl-0.28/vhdl/grt/grt-processes.ads ghdl-0.29dev/vhdl/grt/grt-processes.ads
--- ghdl-0.28/vhdl/grt/grt-processes.ads 2008-08-28 06:38:08.000000000 +0200
+++ ghdl-0.29dev/vhdl/grt/grt-processes.ads 2009-12-16 14:31:13.000000000 +0100
@@ -42,6 +42,9 @@
-- If true, the simulation should be stopped.
Break_Simulation : Boolean;
+ type Process_Type is private;
+ -- type Process_Acc is access all Process_Type;
+
-- Return the identifier of the current process.
-- During the elaboration, this is the identifier of the last process
-- being elaborated. So, this function can be used to create signal
@@ -56,7 +59,7 @@
function Get_Nbr_Resumed_Processes return Natural;
-- Disp the name of process PROC.
- procedure Disp_Process_Name (Stream : Grt.Stdio.FILEs; Proc : Process_Id);
+ procedure Disp_Process_Name (Stream : Grt.Stdio.FILEs; Proc : Process_Acc);
-- Register a process during elaboration.
-- This procedure is called by vhdl elaboration code.
@@ -88,7 +91,7 @@
procedure Ghdl_Process_Add_Sensitivity (Sig : Ghdl_Signal_Ptr);
-- Resume a process.
- procedure Resume_Process (Proc : Process_Id);
+ procedure Resume_Process (Proc : Process_Acc);
-- Wait without timeout or sensitivity.
procedure Ghdl_Process_Wait_Exit;
@@ -118,26 +121,19 @@
procedure Ghdl_Protected_Init (Obj : System.Address);
procedure Ghdl_Protected_Fini (Obj : System.Address);
- type Process_Type is private;
- type Process_Acc is access all Process_Type;
private
- -- Access to a process subprogram.
+ -- Access to a process subprogram.
type Proc_Acc is access procedure (Self : System.Address);
- -- Simply linked list for sensitivity.
- type Sensitivity_El;
- type Sensitivity_Acc is access Sensitivity_El;
- type Sensitivity_El is record
- Sig : Ghdl_Signal_Ptr;
- Next : Sensitivity_Acc;
- end record;
-
-- State of a process.
type Process_State is
(
-- Sensitized process. Its state cannot change.
State_Sensitized,
+ -- Non-sensitized process, ready to run.
+ State_Ready,
+
-- Verilog process, being suspended.
State_Delayed,
@@ -146,6 +142,8 @@
-- Non-sensitized process being awaked by a wait timeout. This state
-- is transcient.
+ -- This is necessary so that the process will exit immediately from the
+ -- wait statements without checking if the wait condition is true.
State_Timeout,
-- Non-sensitized process waiting until end.
@@ -178,8 +176,11 @@
-- Timeout value for wait.
Timeout : Std_Time;
- -- Sensitivity list.
- Sensitivity : Sensitivity_Acc;
+ -- Sensitivity list while the (non-sensitized) process is waiting.
+ Sensitivity : Action_List_Acc;
+
+ Timeout_Chain_Next : Process_Acc;
+ Timeout_Chain_Prev : Process_Acc;
end record;
pragma Export (C, Ghdl_Process_Register,
diff -urN ghdl-0.28/vhdl/grt/grt-rtis_utils.adb ghdl-0.29dev/vhdl/grt/grt-rtis_utils.adb
--- ghdl-0.28/vhdl/grt/grt-rtis_utils.adb 2008-12-31 05:41:58.000000000 +0100
+++ ghdl-0.29dev/vhdl/grt/grt-rtis_utils.adb 2009-12-16 14:31:13.000000000 +0100
@@ -502,6 +502,7 @@
begin
Rtis_Utils.Get_Value (Name, Value, Type_Rti);
Put (Stream, Name);
+ Free (Name);
end Disp_Value;
procedure Get_Enum_Value
diff -urN ghdl-0.28/vhdl/grt/grt-signals.adb ghdl-0.29dev/vhdl/grt/grt-signals.adb
--- ghdl-0.28/vhdl/grt/grt-signals.adb 2008-09-12 21:34:38.000000000 +0200
+++ ghdl-0.29dev/vhdl/grt/grt-signals.adb 2009-12-16 14:31:13.000000000 +0100
@@ -266,9 +266,9 @@
/ System.Storage_Unit);
end Size;
- Id : Process_Id;
+ Proc : Process_Acc;
begin
- Id := Get_Current_Process_Id;
+ Proc := Get_Current_Process;
if Sign.S.Nbr_Drivers = 0 then
Check_New_Source (Sign);
Sign.S.Drivers := Malloc (Size (1));
@@ -276,7 +276,7 @@
else
-- Do not create a driver twice.
for I in 0 .. Sign.S.Nbr_Drivers - 1 loop
- if Sign.S.Drivers (I).Proc = Id then
+ if Sign.S.Drivers (I).Proc = Proc then
return True;
end if;
end loop;
@@ -287,7 +287,7 @@
Sign.S.Drivers (Sign.S.Nbr_Drivers - 1) :=
(First_Trans => Trans,
Last_Trans => Trans,
- Proc => Id);
+ Proc => Proc);
return False;
end Ghdl_Signal_Add_Driver;
@@ -444,14 +444,14 @@
function Find_Driver (Sig : Ghdl_Signal_Ptr) return Ghdl_Index_Type
is
- Id : Process_Id;
+ Proc : Process_Acc;
begin
if Sig.S.Drivers = null then
Error ("assignment to a signal without any driver");
end if;
- Id := Get_Current_Process_Id;
+ Proc := Get_Current_Process;
for I in 0 .. Sig.S.Nbr_Drivers - 1 loop
- if Sig.S.Drivers (I).Proc = Id then
+ if Sig.S.Drivers (I).Proc = Proc then
return I;
end if;
end loop;
@@ -460,14 +460,14 @@
function Get_Driver (Sig : Ghdl_Signal_Ptr) return Driver_Acc
is
- Id : Process_Id;
+ Proc : Process_Acc;
begin
if Sig.S.Drivers = null then
return null;
end if;
- Id := Get_Current_Process_Id;
+ Proc := Get_Current_Process;
for I in 0 .. Sig.S.Nbr_Drivers - 1 loop
- if Sig.S.Drivers (I).Proc = Id then
+ if Sig.S.Drivers (I).Proc = Proc then
return Sig.S.Drivers (I)'Access;
end if;
end loop;
@@ -1815,11 +1815,11 @@
end Call_Conversion_Function;
procedure Resume_Process_If_Event
- (Sig : Ghdl_Signal_Ptr; Proc : Process_Id)
+ (Sig : Ghdl_Signal_Ptr; Proc : Process_Acc)
is
El : Action_List_Acc;
begin
- El := new Action_List'(Kind => Action_Process,
+ El := new Action_List'(Dynamic => False,
Proc => Proc,
Next => Sig.Event_List);
Sig.Event_List := El;
@@ -2745,12 +2745,7 @@
El := Sig.Event_List;
while El /= null loop
- case El.Kind is
- when Action_Process =>
- Resume_Process (El.Proc);
- when Action_Signal =>
- Internal_Error ("set_effective_value");
- end case;
+ Resume_Process (El.Proc);
El := El.Next;
end loop;
end if;
diff -urN ghdl-0.28/vhdl/grt/grt-signals.ads ghdl-0.29dev/vhdl/grt/grt-signals.ads
--- ghdl-0.28/vhdl/grt/grt-signals.ads 2008-08-21 04:50:51.000000000 +0200
+++ ghdl-0.29dev/vhdl/grt/grt-signals.ads 2009-12-16 14:31:13.000000000 +0100
@@ -20,6 +20,7 @@
with Grt.Table;
with Grt.Types; use Grt.Types;
with Grt.Rtis; use Grt.Rtis;
+limited with Grt.Processes;
pragma Elaborate_All (Grt.Table);
package Grt.Signals is
@@ -59,12 +60,14 @@
end case;
end record;
+ type Process_Acc is access Grt.Processes.Process_Type;
+
-- A driver is bound to a process (PROC) and contains a list of
-- transactions.
type Driver_Type is record
First_Trans : Transaction_Acc;
Last_Trans : Transaction_Acc;
- Proc : Process_Id;
+ Proc : Process_Acc;
end record;
type Driver_Acc is access all Driver_Type;
@@ -89,19 +92,33 @@
function To_Signal_Arr_Ptr is new Ada.Unchecked_Conversion
(Source => System.Address, Target => Signal_Arr_Ptr);
+ -- List of processes to wake-up in case of event on the signal.
type Action_List;
type Action_List_Acc is access Action_List;
- type Action_Kind is (Action_Signal, Action_Process);
- type Action_List (Kind : Action_Kind) is record
+
+ type Action_List (Dynamic : Boolean) is record
+ -- Next action for the current signal.
Next : Action_List_Acc;
- case Kind is
- when Action_Signal =>
+
+ -- Process to wake-up.
+ Proc : Process_Acc;
+
+ case Dynamic is
+ when True =>
+ -- For a non-sensitized process.
+ -- Previous action (to speed-up remove from the chain).
+ Prev : Action_List_Acc;
+
Sig : Ghdl_Signal_Ptr;
- when Action_Process =>
- Proc : Process_Id;
+
+ -- Chain of signals for the process.
+ Chain : Action_List_Acc;
+ when False =>
+ null;
end case;
end record;
+
-- How to compute resolved signal.
type Resolved_Signal_Type is record
Resolv_Proc : System.Address;
@@ -408,7 +425,7 @@
-- Add PROC in the list of processes to be resumed in case of event on
-- SIG.
procedure Resume_Process_If_Event
- (Sig : Ghdl_Signal_Ptr; Proc : Process_Id);
+ (Sig : Ghdl_Signal_Ptr; Proc : Process_Acc);
procedure Ghdl_Signal_Name_Rti (Sig : Ghdl_Rti_Access;
Ctxt : Ghdl_Rti_Access;
diff -urN ghdl-0.28/vhdl/grt/grt-types.ads ghdl-0.29dev/vhdl/grt/grt-types.ads
--- ghdl-0.28/vhdl/grt/grt-types.ads 2007-12-02 02:56:05.000000000 +0100
+++ ghdl-0.29dev/vhdl/grt/grt-types.ads 2009-12-16 14:31:13.000000000 +0100
@@ -139,10 +139,6 @@
end record;
type Ghdl_Location_Ptr is access Ghdl_Location;
- -- Identifier for a process.
- type Process_Id is new Integer;
- Nul_Process_Id : constant Process_Id := 0;
-
-- Signal index.
type Sig_Table_Index is new Integer;
diff -urN ghdl-0.28/vhdl/grt/grt-unithread.adb ghdl-0.29dev/vhdl/grt/grt-unithread.adb
--- ghdl-0.28/vhdl/grt/grt-unithread.adb 2008-08-29 02:01:16.000000000 +0200
+++ ghdl-0.29dev/vhdl/grt/grt-unithread.adb 2009-12-16 14:31:13.000000000 +0100
@@ -52,7 +52,6 @@
end Atomic_Inc;
Current_Process : Process_Acc;
- Current_Process_Id : Process_Id;
-- Called by linux.c
function Grt_Get_Current_Process return Process_Acc;
@@ -64,10 +63,9 @@
end Grt_Get_Current_Process;
- procedure Set_Current_Process (Id : Process_Id; Proc : Process_Acc) is
+ procedure Set_Current_Process (Proc : Process_Acc) is
begin
Current_Process := Proc;
- Current_Process_Id := Id;
end Set_Current_Process;
function Get_Current_Process return Process_Acc is
@@ -75,11 +73,6 @@
return Current_Process;
end Get_Current_Process;
- function Get_Current_Process_Id return Process_Id is
- begin
- return Current_Process_Id;
- end Get_Current_Process_Id;
-
Stack2 : Stack2_Ptr;
function Get_Stack2 return Stack2_Ptr is
diff -urN ghdl-0.28/vhdl/grt/grt-unithread.ads ghdl-0.29dev/vhdl/grt/grt-unithread.ads
--- ghdl-0.28/vhdl/grt/grt-unithread.ads 2008-08-21 04:57:53.000000000 +0200
+++ ghdl-0.29dev/vhdl/grt/grt-unithread.ads 2009-12-16 14:31:13.000000000 +0100
@@ -20,8 +20,6 @@
with Grt.Signals; use Grt.Signals;
with Grt.Stack2; use Grt.Stack2;
with Grt.Stacks; use Grt.Stacks;
-with Grt.Types; use Grt.Types;
-with Grt.Processes; use Grt.Processes;
package Grt.Unithread is
procedure Init;
@@ -38,9 +36,8 @@
function Atomic_Inc (Val : access Natural) return Natural;
-- Set and get the current process being executed by the thread.
- procedure Set_Current_Process (Id : Process_Id; Proc : Process_Acc);
+ procedure Set_Current_Process (Proc : Process_Acc);
function Get_Current_Process return Process_Acc;
- function Get_Current_Process_Id return Process_Id;
-- The secondary stack for the thread.
function Get_Stack2 return Stack2_Ptr;
@@ -62,6 +59,5 @@
pragma Inline (Set_Current_Process);
pragma Inline (Get_Current_Process);
- pragma Inline (Get_Current_Process_Id);
end Grt.Unithread;
diff -urN ghdl-0.28/vhdl/ortho-lang.c ghdl-0.29dev/vhdl/ortho-lang.c
--- ghdl-0.28/vhdl/ortho-lang.c 2008-08-28 05:29:25.000000000 +0200
+++ ghdl-0.29dev/vhdl/ortho-lang.c 2009-12-16 14:31:14.000000000 +0100
@@ -385,7 +385,7 @@
filename = in_fnames[0];
linemap_add (line_table, LC_ENTER, 0, filename ? filename :"*no-file*", 1);
- input_location = linemap_line_start (line_table, 0, 252);
+ input_location = linemap_line_start (line_table, 1, 252);
if (!lang_parse_file (filename))
errorcount++;
diff -urN ghdl-0.28/vhdl/version.ads ghdl-0.29dev/vhdl/version.ads
--- ghdl-0.28/vhdl/version.ads 2009-09-17 03:31:54.000000000 +0200
+++ ghdl-0.29dev/vhdl/version.ads 2009-12-16 14:31:15.000000000 +0100
@@ -1,5 +1,5 @@
package Version is
Ghdl_Release : constant String :=
- "GHDL 0.28 (20090917) [Sokcho edition]";
- Ghdl_Ver : constant String := "0.28";
+ "GHDL 0.29dev (20090921) [Sokcho edition]";
+ Ghdl_Ver : constant String := "0.29dev";
end Version;
Index: ghdl.spec
===================================================================
RCS file: /cvs/extras/rpms/ghdl/devel/ghdl.spec,v
retrieving revision 1.59
retrieving revision 1.60
diff -u -p -r1.59 -r1.60
--- ghdl.spec 14 Dec 2009 09:33:26 -0000 1.59
+++ ghdl.spec 16 Dec 2009 22:26:47 -0000 1.60
@@ -1,11 +1,11 @@
%global gccver 4.3.4
%global ghdlver 0.28
-%global ghdlsvnver 131
+%global ghdlsvnver 133
Summary: A VHDL simulator, using the GCC technology
Name: ghdl
Version: %{ghdlver}
-Release: 0.%{ghdlsvnver}svn.2%{?dist}
+Release: 0.%{ghdlsvnver}svn.0%{?dist}
License: GPLv2+
Group: Development/Languages
URL: http://ghdl.free.fr/
@@ -27,10 +27,6 @@ Patch105: ghdl-grtadac.patch
Patch106: ghdl-ppc64abort.patch
# https://gna.org/bugs/index.php?13389
Patch107: ieee-mathreal.patch
-# https://gna.org/bugs/index.php?14930
-Patch108: grt-processtimeoutchain.patch
-# https://gna.org/bugs/index.php?14931
-Patch109: grt-dispmemleak.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Requires(post): /sbin/install-info
Requires(preun): /sbin/install-info
@@ -136,8 +132,6 @@ popd
%patch104 -p0 -b .libgnat44
%patch105 -p1 -b .grtadac
%patch106 -p0 -b .ppc64abort
-%patch108 -p0 -b .processtimeoutchain
-%patch109 -p0 -b .dispmemleak
%build
%{__rm} -fr obj-%{gcc_target_platform}
@@ -335,6 +329,9 @@ P64=%{buildroot}/%{_libdir}/gcc/%{gcc_ta
%changelog
+* Wed Dec 16 2009 Thomas Sailer <t.sailer at alumni.ethz.ch> - 0.28-0.133svn.0
+- update to svn133, drop upstreamed patches
+
* Mon Dec 14 2009 Thomas Sailer <t.sailer at alumni.ethz.ch> - 0.28-0.131svn.2
- Process Timeout Chain bugfix
- --trace-signals memory leak fix
More information about the fedora-extras-commits
mailing list