neoflash
Community Fellow
![* *](https://designers-guide.org/forum/Templates/Forum/default/starsilver.gif) ![* *](https://designers-guide.org/forum/Templates/Forum/default/starsilver.gif) ![* *](https://designers-guide.org/forum/Templates/Forum/default/starsilver.gif) ![* *](https://designers-guide.org/forum/Templates/Forum/default/starsilver.gif)
Offline
![](http://avatar.elektroda.net/gallery/00fun/download.php-1072.gif)
Mixed-Signal Designer
Posts: 397
|
I observed one interesting phenomenon:
When variables used in one cross() function are assigned value outside of this cross() function, the sequence of execution is not predictable.
Below is the code I used for simulation, up0 is expected to be updated before used for calculation of up_int, however, it is not. Up_int still calculates based on old up0 value, although up0 seems to be updated immediately with new e0 value.
As a comparison, e0_int is using the new e0 value all the time.
This is really unpredictable whether veriloga's cross function is based on blocking or non-blocking assignment.
Any comments?
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ @(cross(V(ck_i)-0.5,+1,1e-12)) begin e0= (V(rxp) > V(rxn)) ? 1 : 0; e0_int = e0; ... up_int=up0+up1; // up_int is using old up0 value. end
... up0= (d0 + e0) %2; \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
|