Generally for functions you want to instead use a constant class parameter.
Signal class parameters require that you connect them to a signal - ie: no expressions. You only need a signal inside of a function when you use a signal parameter, such as 'event. For a procedure, you also need a signal when you expect the object to update - such as when it is used in a wait statement or is read after a wait statement (and you expect a potentially updated value).
With a constant class parameters allow you to connect them with any value of that type. That value can come from an expression or a literal value (X"4A"). A signal name or a variable name are simple forms of expressions.
Constant class also happens to be the default for inputs of you do not specify the class of the parameter. In the following code, parameters A and B are both constant class parameters.
function fred (
constant A : integer ;
B : integer
) return integer is
...
end function fred ;
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…