Hallo GHDL users,
i try to compile the vhdl-files of the OSVVM (open source vhdl verification library), a verification library which you can find under http://osvvm.org/ The authors claim, that the lib should run fine with VHDL-2002. For this, you have to compile and include the ieee_proposed packages, which add the VHDL-2008 features to the simulator. So, i have done following steps in my makefile (sensors.vhd is the test design) sensors.ghw : *.vhd ghdl -a --std=02 --work=ieee_proposed ieee_proposed/standard_additions_c.vhdl ghdl -a --std=02 --work=ieee_proposed ieee_proposed/standard_textio_additions_c.vhdl ghdl -a --std=02 --work=ieee_proposed ieee_proposed/env_c.vhdl ghdl -a --std=02 --work=ieee_proposed ieee_proposed/std_logic_1164_additions.vhdl ghdl -a --std=02 --work=ieee_proposed ieee_proposed/numeric_std_additions.vhdl ghdl -a --std=02 --work=ieee_proposed ieee_proposed/numeric_std_unsigned_c.vhdl ghdl -a --std=02 --work=ieee_proposed ieee_proposed/fixed_float_types_c.vhdl ghdl -a --std=02 --ieee=synopsys SortListPkg_int.vhd ghdl -a --std=02 --ieee=synopsys RandomBasePkg.vhd ghdl -a --std=02 --ieee=synopsys RandomPkg.vhd ghdl -a --std=02 --ieee=synopsys CoveragePkg.vhd ghdl -a --std=02 sensors.vhd ghdl -e sensors ghdl -r sensors --wave=sensors.ghw --assert-level=error The ieee_proposed are analysed fine with some minor warnings: ieee_proposed/standard_textio_additions_c.vhdl:368:13:warning: procedure "read" is never referenced ieee_proposed/standard_textio_additions_c.vhdl:391:13:warning: procedure "read" is never referenced ieee_proposed/standard_textio_additions_c.vhdl:413:13:warning: procedure "write" is never referenced ieee_proposed/numeric_std_additions.vhdl:1176:12:warning: function "sll" is never referenced ieee_proposed/numeric_std_additions.vhdl:1191:12:warning: function "sll" is never referenced ieee_proposed/numeric_std_additions.vhdl:1206:12:warning: function "srl" is never referenced ieee_proposed/numeric_std_additions.vhdl:1221:12:warning: function "srl" is never referenced ieee_proposed/numeric_std_additions.vhdl:1236:12:warning: function "rol" is never referenced ieee_proposed/numeric_std_additions.vhdl:1251:12:warning: function "rol" is never referenced ieee_proposed/numeric_std_additions.vhdl:1266:12:warning: function "ror" is never referenced ieee_proposed/numeric_std_additions.vhdl:1281:12:warning: function "ror" is never referenced These warnings are not nce, but i think they have nothing to do with the error I get when analysing the SortListPkg_int.vhd package in the next step: SortListPkg_int.vhd:370:17: can't associate 'a' with constant interface "a" SortListPkg_int.vhd:370:17: (type of 'a' is arrayofelementtype) SortListPkg_int.vhd:75:30: (type of constant interface "a" is elementtype) The problem here, as i think, is that GHDL selects the false (overloaded) procedure. Line 370 is inside a function of name 'sort': 367: impure function sort (constant A : in ArrayofElementType) return ArrayofElementType is 368: variable Result : SortListPType ; 369: begin 370: Result.Add(A) ; 371: return Result.to_array(EraseList => TRUE) ; 372: end function sort ; So, in line 370 a function Add() of a protected type SortListPType is called. This procedure has 4 definitions, dependent on the types of its parameters: 74: type SortListPType is protected 75: procedure add ( constant A : in ElementType ) ; 76: procedure add ( constant A : in ArrayofElementType ) ; 77: procedure add ( constant A : in ArrayofElementType ; Min, Max : integer ) ; 78: procedure add ( variable A : inout SortListPType ) ; ...... 94: end protected SortListPType ; You can see that there are 4 versions of this procedure to overload it to support various types of parameters. In line 367, the beginning of the function sort() which causes the error, the parameter A is of type ArrayofElementType. So, the procedure call Result.Add(A) in line 370 should use the overloaded procedure with parameter type ArrayofElementType as defined in line 76: procedure add ( constant A : in ArrayofElementType ). Instead it want to use the first definition on line 75: procedure add ( constant A : in ElementType) which throws (logically) an error because of the wrong parameter type. I think GHDL makes an mistake here in selection the wrong procedure. What do you think? Is there a way to work around this? I have attached the SortListPkg_int.vhd file for you to analyse. If you need all these files, you can dl them at the http://osvvm.org/downloads website. Thanks in advance for your support :) Greetings, Torsten -- Mail: [email protected] Blog: http://blog.goodcleanfun.de Github: https://github.com/tmeissner _______________________________________________ Ghdl-discuss mailing list [email protected] https://mail.gna.org/listinfo/ghdl-discuss
