On Fri, 2013-04-26 at 21:55 +0200, Torsten Meißner wrote:
> Hello,
>
>
> thanks for your patch. I will try it, but first I must look how and if I
> can compile GHDL under OSX.
> Am 26.04.2013 um 20:54 schrieb Brian Drummond:
>
> > On Fri, 2013-04-26 at 17:29 +0100, Brian Drummond wrote:
> >> On Sat, 2013-03-09 at 18:59 +0100, Torsten Meißner wrote:
> >>> Hallo GHDL users,
> >>> i try to compile the vhdl-files of the OSVVM (open source vhdl
> >>> verification library),
> >>> SortListPkg_int.vhd:370:17: can't associate 'a' with constant interface
> >>> "a"
> >>> The problem here, as i think, is that GHDL selects the false (overloaded)
> >>> procedure.
> >>
> >> I now have a solution for this.
Earlier solution overcame the compile failure for the OSVVM support
packages, but left 2 further failures building the demo application.
1) turned out to be a misleading error message, combined with an actual
error in the OSVVM demo! (when building for VHDL-2002)
The error message was
"prefix is neither a function name nor can it be sliced or indexed"
which appears twice in the source (in sem_names.adb); once for a sliced
or indexed array, and once for a failure to find an overloaded function.
In the latter case I have improved the error report, to
"No overloaded subprogram found matching 'randint'"
The overload failure was not a failing on GHDL's part, but a missing
pair of "Library/Use" clauses in the example program Demo_Rand.vhd.
-------------------------------------------------------------------------
-- comment out following 2 lines with VHDL-2008. Leave in for
VHDL-2002
library ieee_proposed ; -- remove with VHDL-2008
use ieee_proposed.standard_additions.all ; -- remove with VHDL-2008
-------------------------------------------------------------------------
An additional failure came from an unsupported VHDL feature to stop
simulation after all tests : this can simply be commented out.
Attached patch demo_rand.patch resolves both of these.
2) gave link time errors on elaborating the main unit (entity Demo_Rand)
-------------------------------------------------------------------------
ghdl -e --std=02 --ieee=synopsys Demo_Rand
RandomPkg.o: In function `work__randompkg__readO1':
RandomPkg.vhd:(.text+0x955): undefined reference to `__ghdl_value_e8'
RandomPkg.o: In function `work__randompkg__readO3':
RandomPkg.vhd:(.text+0xecb): undefined reference to `__ghdl_value_e8'
collect2: error: ld returned 1 exit status
ghdl: compilation error
-------------------------------------------------------------------------
These occur because - as reported in
https://mail.gna.org/public/ghdl-discuss/2009-02/msg00012.html
the 'value attribute is only implemented for Integer types; the missing
functions reported above implement 'value for small enumerations.
So I have added 'value handlers for the other types : in stub form
(which report themselves as missing, and exit) for Float and physical
types, and functional for enumerations.
All the above plus previous fixes (with one exception) are rolled into
one patch to be applied on top of SVN R150.
Patch is named as "osvvm_for_svn_r150.patch" and rather than attach it
here, it is available at https://gna.org/bugs/?20769
The exception is a small patch for successful builds on 64-bit systems;
available at the same place, named "ortho_lang_c_for_64bit.patch"
GHDL built with this patch (these patches, for 64 bit) should be able to
compile and run the OSVVM packages and demo, as below:
-------------------------------------------------------------------------
ghdl -a --std=02 --work=ieee_proposed \
../OS-VVM_2_3_1/vhdl_2002_versions/standard_additions_c.vhdl
ghdl -a --std=02 --work=ieee_proposed \
../OS-VVM_2_3_1/vhdl_2002_versions/standard_textio_additions_c.vhdl
ghdl -a --std=02 --ieee=synopsys ../OS-VVM_2_3_1/SortListPkg_int.vhd
ghdl -a --std=02 --ieee=synopsys ../OS-VVM_2_3_1/RandomBasePkg.vhd
ghdl -a --std=02 --ieee=synopsys ../OS-VVM_2_3_1/RandomPkg.vhd
ghdl -a --std=02 --ieee=synopsys ../OS-VVM_2_3_1/CoveragePkg.vhd
ghdl -a --std=02 --ieee=synopsys ../OS-VVM_2_3_1/Demo_Rand.vhd
ghdl -e --std=02 --ieee=synopsys Demo_Rand
./Demo_rand
-------------------------------------------------------------------------
Patches and some information at
https://gna.org/bugs/index.php?20769
Enjoy,
-- Brian
--- /home/brian/Projects/ghdl/osvvm/OS-VVM_2_3_1/Demo_Rand.vhd 2012-06-22 17:33:00.000000000 +0100
+++ ../OS-VVM_2_3_1/Demo_Rand.vhd 2013-04-29 15:39:34.516588778 +0100
@@ -103,6 +103,10 @@
use work.TestSupportPkg.all ;
+-- comment out following 2 lines with VHDL-2008. Leave in for VHDL-2002
+library ieee_proposed ; -- remove with VHDL-2008
+use ieee_proposed.standard_additions.all ; -- remove with VHDL-2008
+
entity Demo_Rand is
end Demo_Rand ;
architecture test of Demo_Rand is
@@ -276,8 +280,8 @@
PrintResults (Results) ;
write(OUTPUT, "Demo_Rand Done" & LF) ;
- std.env.stop(0) ;
+ -- std.env.stop(0) ;
wait ;
end process RandomGenProc ;
-end test ;
\ No newline at end of file
+end test ;
_______________________________________________
Ghdl-discuss mailing list
[email protected]
https://mail.gna.org/listinfo/ghdl-discuss