Yep, the error messages by ModelSim/QuestaSim leaves quite a bit to be
desired in the clarity department.
A year ago I entered a service request to get a more clear message for
the 'No feasible entries for subprogram "<name>"' error. Below is my
complete SR text. The answer was:
Unfortunately, the ER was turned down by Questa Engineering.
Suggested using one of the linting tools: Leda, HDLint, nLint or SureLint.
Sigh....
I have no idea if these tools would produce a better error message in my
case..
The reasons for turning down my SR are:
-criticality of the issue,
-the number of customers reporting the issue,
-the resources involved in making the change,
-strategic product direction.
Of course, we all can do something about the second point.
Anyhow, here is the text of my service request:
One of the most dreaded error messages that exists when analyzing VHDL
with vcom is the message 'No feasible entries for subprogram "<name>"'.
Even for seasoned VHDL programmers it is sometime daunting to solve such
an error. Let alone the time it takes for a novice VHDL programmer to
solve such an error.
The reason why it can be daunting to solve such an error, is that vcom
does not give any additional information as of why there are no feasible
entries. Or even what the entries are that have been considered before
deaclaring it an error.
So what I would like to suggest is to enhance the error message with
more information, and possibly the reason for the error. Ideally, this
should give the user enough information to solve the problem in no time.
I hope what I proposes is technically feasible.
As an example, take the following piece of code:
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
PACKAGE my_pkg IS
PROCEDURE my_proc (ch: natural; n: natural );
PROCEDURE my_proc (ch: natural; n: std_logic_vector );
PROCEDURE my_proc (ch: natural; n: std_ulogic );
END PACKAGE my_pkg;
PACKAGE BODY my_pkg IS
PROCEDURE my_proc (ch: natural; n: natural ) IS
BEGIN
END PROCEDURE my_proc;
PROCEDURE my_proc (ch: natural; n: std_logic_vector ) IS
BEGIN
END PROCEDURE my_proc;
PROCEDURE my_proc (ch: natural; n: std_ulogic ) IS
BEGIN
END PROCEDURE my_proc;
END PACKAGE BODY my_pkg;
ENTITY e IS
END ENTITY e;
USE work.my_pkg.ALL;
-- LIBRARY ieee;
-- USE ieee.std_logic_1164.ALL; -- Missing!
ARCHITECTURE a OF e IS
BEGIN
doit: PROCESS IS
BEGIN
my_proc(123, '0'); -- Type mismatch due to std_(u)logic is not
visible
my_proc(123, nn => 0); -- Wrong formal parameter name
WAIT;
END PROCESS doit;
END ARCHITECTURE a;
Current vcom errors:
** Error: no_feasible_entries.vhd(36): No feasible entries for
subprogram "my_proc".
** Error: no_feasible_entries.vhd(37): No feasible entries for
subprogram "my_proc".
** Error: no_feasible_entries.vhd(40): VHDL Compiler exiting
The first call of my_proc is not OK, because std_(u)logic is not
visible. Therefore, the actual for the second parameter is only
interpreted as a character or bit. It took me more than five minutes
before I figured out that USE clause with std_logic_1164 was missing and
that that was the culprit. The not so experienced user who made this
error was stumped for much much longer.
The second call of my_proc is not OK, because the name of a formal is
not correct. Also this situation can be daunting at times.
That's why I would like to propose a much more verbose error message.
Something along these lines:
** Error: no_feasible_entries.vhd(36): No feasible entries for
subprogram "my_proc".
Visible declaration of subprogram "my_proc":
work.my_pkg.my_proc(constant ch: in [natural]; constant n: in [natual]);
work.my_pkg.my_proc(constant ch: in [natural]; constant n: in
[std_logic_vector]);
work.my_pkg.my_proc(constant ch: in [natural]; constant n: in
[std_ulogic]);
Possible interpretation of subprogram call:
work.my_pkg.my_proc(ch => [natural constant]; n => [character constant]);
work.my_pkg.my_proc(ch => [natural constant]; n => [bit constant]);
Matched parameter(s) : ch
Unmatched parameter : n (type error)
** Error: no_feasible_entries.vhd(37): No feasible entries for
subprogram "my_proc".
Visible declaration of subprogram "my_proc":
work.my_pkg.my_proc(constant ch: in [natural]; constant n: in [natual]);
work.my_pkg.my_proc(constant ch: in [natural]; constant n: in
[std_logic_vector]);
work.my_pkg.my_proc(constant ch: in [natural]; constant n: in
[std_ulogic]);
Possible interpretation of subprogram call:
work.my_pkg.my_proc(ch => [natural constant]; nn => [character constant]);
work.my_pkg.my_proc(ch => [natural constant]; nn => [bit constant]);
work.my_pkg.my_proc(ch => [natural constant]; nn => [std_ulogic
constant]); (assuming missing USE clause is present)
Matched parameter(s) : ch
Unmatched parameter : nn (no such name)
Missing parameter(s) : n
So first of all I would like to know what declarations of the subprogram
are visible. Secondly, I would like to know what possible
interpretations there are for my subprogram call. Finally, it would be
very usefull to have an overview of matched, unmatched and missing
parameters, given the visible declarations and the possible
interpretations of the call.
--
Paul Uiterlinden
www.aimvalley.nl
e-mail addres: remove the not.