Learn the difference between an impure function and a normal function in VHDL.
The blog post for this video:
https://vhdlwhiz.com/impure-function/
Functions in VHDL can be prefixed with the keywords “pure” or “impure”. By default, functions are pure in VHDL. If you don’t use the pure or impure keywords, you will get a pure function.
That a function is pure simply means that it cannot read or write to any external signals or variables. This means that if a pure function is called with the same parameters over and over again, it is guaranteed to return the same result.
Impure functions, one the other hand, can read any signals within their scope. Therefore, the return value may depend not only on the inputs through the parameter list, but also on external signals.
Furthermore, impure functions may alter any signal or variable within their scope. This is different from a normal function where signal assignments are performed by the caller, using the received return value from the function.