| Login | | Don't have an account yet? You can create one. As a registered user you have some advantages like theme manager, comments configuration and post comments with your name. | |
| Who's Online | There are currently, 53 guest(s) and 0 member(s) that are online.
You are Anonymous user. You can register for free by clicking here | |
 | |
|
Verification Guild: Forums |
|
| View previous topic :: View next topic |
| Author |
Message |
spartanthewarrior Senior


Joined: Aug 15, 2009 Posts: 32
|
Posted: Thu Jun 14, 2012 1:29 am Post subject: Effect Of Using BitWise and Logical Operators !! |
|
|
Hi All,
I have a question:
How can I measure performance of simulator when, I am using (BitWise) or (Logical) operators.
How can I check the difference these operators are making ?
Example:
property Compare(disable_assertion) ;
logic [17:0] val;
disable iff (~rst | disable_assertion )
(`TRUE, val = selected_val) ##5
1) (val === out_val);
2) (val ~^ out_val); |
|
| Back to top |
|
 |
dave_59 Senior


Joined: Jun 22, 2004 Posts: 974 Location: Fremont, CA
|
Posted: Thu Jun 14, 2012 2:29 am Post subject: |
|
|
I hope you realize the two choices are not equivalent. 2) should be
&(val ~^ out_val);
Questa can show you the intermediate expressions in an assertion.
I don't think you will see much difference in performance because accessing a 4-state value can be more expensive that performing an operation on it.
Dave Rich
Mentor Graphics |
|
| Back to top |
|
 |
chrisspear Senior


Joined: Jun 15, 2004 Posts: 202 Location: Marlboro, MA
|
Posted: Sun Jun 17, 2012 2:05 pm Post subject: |
|
|
Before you worry too much about performance, run your simulator's profiling tool to see if this is a problem. Trying to write optimal code can take more time than writing comprehensible code, and will take more time to decode by other people. If this code only consumes 1% of the total simulation time, what have you gained?
Instead, run the profile tool and look for the "whales". A few hours tweaking your code can save hundreds of simulation hours. If you've never tried this before, call your Application Engineer and have him or her walk you through the process. The payback will be great! _________________ Chris Spear
Co-Author: SystemVerilog for Verification - 3rd edition!
http://chris.spear.net/systemverilog |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
| |
|
|