Reputation: 1992
In program block, we can't give non-blocking assignment to any of the variable. If we try to do it, it shows error like "Program variable: d can only be assigned using blocking assignments".
Similarly, in clocking block, if we try to assign it using blocking assignment then it shows the error like "Clocking block output cb1.d signal must be driven by a non-blocking assignment".
What is the reason behind these rules??
Upvotes: 0
Views: 1274
Reputation: 42616
I do not recommend using program blocks - they are a massive source of confusion and completely unnecessary. Check out one of my more popular blog posts.
To answer your first question, the rule about not being able to use NBAs to program variables was eliminated long ago. You must not be using a recent version of software.
To answer your second question, clocking block outputs use drive statements which are different from blocking and nonblocking assignments. See section 14.16.1 Drives and nonblocking assignments in the 1800-2012 LRM.
Upvotes: 1