Synthesis of pure and impure functions

K

konstantink

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!
 
M

Mike Treseler

konstantink said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top