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),

> 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.

I now have a solution for this.

It arises because the procedure Sem_As_Method_Call returns the first
matching declaration in the protected object's declaration chain,
instead of creating an Overload_List containing all matching
declarations.

Replace it with the following, and I can build the failing packages.
(sem_names.adb line 1448)

---------------------------------------------------------------------
      procedure Sem_As_Method_Call (Sub_Name : Iir)
      is
         Prot_Type : Iir;
         Method : Iir;
         Found : Boolean := False;
      begin
         Prot_Type := Get_Type (Sub_Name);

-- bld 26 apr 2013 : the original returned the FIRST method 
-- matching name rather than the full overload list.
         -- build overload list from all declarations in chain, 
         -- matching name, which are actually functions or procedures. 
         -- TODO: should we error here if there's a variable 
         -- with matching name? currently we warn...
         Method := Get_Declaration_Chain (Prot_Type);
         while Method /= Null_Iir loop
            If Get_Identifier (Method) = Suffix then -- found the name
               -- check it's a method!
               case Get_Kind (Method) is
                  when Iir_Kind_Function_Declaration |
                       Iir_Kind_Procedure_Declaration =>
                     Found := True;
                     Add_Result (Res, Method);
                  when others =>
                     Warning_Msg_Sem ("sem_as_method_call", Method);
               end case;
            end if;
            Method := Get_Chain (Method);
         end loop;
         if not Found then 
            Error_Msg_Sem
              ("no method " & Name_Table.Image (Suffix) & " in "
               & Disp_Node (Prot_Type), Name);
            return;
         end if;
      end Sem_As_Method_Call;
---------------------------------------------------------------------

Tested on SVN revision 150 plus the two patches I needed to get 150 to
build, Gnat/GCC version 4.7.2.

- Brian


_______________________________________________
Ghdl-discuss mailing list
[email protected]
https://mail.gna.org/listinfo/ghdl-discuss

Reply via email to