11-08-2017 08:31 AM
12-19-2017 10:45 AM
1) It's not an error to pass signals (or variables) to constant parameters - the constants simply take on the values of the signals.
2) Using signals, you can access signal attributes, and not just the value. Famous example:
FUNCTION rising_edge (SIGNAL s : std_ulogic) RETURN BOOLEAN IS BEGIN RETURN (s'EVENT AND (To_X01(s) = '1') AND (To_X01(s'LAST_VALUE) = '0')); END;
3) Not sure of exact answer.. never tried it. I suppose the compiler could temporarily make a signal out of a constant, but then the attributes would be unknown. Also, signals are not created/destroyed runtime , so the signal would magically appear when the function is called... and then go away when function finishes?