Forum Discussion
Altera_Forum
Honored Contributor
13 years agoits constant in that its return by value, rather than reference. So when you call
a <= f(b,c); a only changes the next time you call a <= f(b,a). if you call: b <= f(c,d); the a value is still the same, but b will have a different value. So calling a function to set up a constant means it is called once, returns a fixed value and is never called again, hence why the return value is constant. An impure function is only impure because it does something to an external value (like assigning a shared variable) but it otherwise does the same as a normal function, it returns a value. This is why many functions on a protected type end up being impure.