Synthesis of pure and impure functions

K

konstantink

Guest
Hi, experts!

Is there any difference in synthesis of pure and impure functions if
both of them don't access to any of the global signals?

Thanks!
 
konstantink wrote:

Is there any difference in synthesis of pure and impure functions if
both of them don't access to any of the global signals?

Well, the default "function" is pure,
and I leave it that way when I can.

Declaring a function used purely
as impure is bad style because
it confuses the reader and slightly
dangerous because unintended side
effects would be accepted without error.

I do most of my synthesis work at process scope.
If a subprogram *assigns* a value to an object,
I use a procedure rather than an impure function.

If a subprogram just *uses* values,
then I prefer calling an impure function.

For example:

impure function bit_done return boolean is
begin
return TxBitSampleCount_v = tic_per_bit_c;
end function bit_done;

-- Mike Treseler
 

Welcome to EDABoard.com

Sponsor

Back
Top