ID:16794 VHDL Subprogram Body warning at <location>: function "<name>" does not always return a value
CAUSE: In a subprogram body at the specified location in a VHDL design file (.vhd), you did not specify a return value for all paths through the statements in the subprogram body. For example, in the following code, the function returns a value for
s = '0'
, but not for s = '1'
.ENTITY example IS
PORT
(
a : IN BIT;
b : IN BIT;
o : OUT BIT
);
END example;
ARCHITECTURE a OF example IS
FUNCTION exa (s,r : BIT) RETURN BIT IS
BEGIN
IF s = '0' THEN
RETURN (s and r);
END IF;
END exa;
BEGIN
o <= exa (s=>a, r=>b);
END a;
ACTION: No action is required. To remove the warning, make sure the function returns a value in all paths through the statements in the subprogram body.