Verification Guild
A Community of Verification Professionals

 Create an AccountHome | Calendar | Downloads | FAQ | Links | Site Admin | Your Account  

Login
Nickname

Password

Security Code: Security Code
Type Security Code
BACKWARD

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.

Modules
· Home
· Downloads
· FAQ
· Feedback
· Recommend Us
· Web Links
· Your Account

Advertising

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

 Forum FAQForum FAQ   SearchSearch   UsergroupsUsergroups   ProfileProfile  ProfileDigest    Log inLog in 

Effect Of Using BitWise and Logical Operators !!

 
Post new topic   Reply to topic    Verification Guild Forum Index -> Main
View previous topic :: View next topic  
Author Message
spartanthewarrior
Senior
Senior


Joined: Aug 15, 2009
Posts: 32

PostPosted: Thu Jun 14, 2012 1:29 am    Post subject: Effect Of Using BitWise and Logical Operators !! Reply with quote

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
View user's profile
dave_59
Senior
Senior


Joined: Jun 22, 2004
Posts: 974
Location: Fremont, CA

PostPosted: Thu Jun 14, 2012 2:29 am    Post subject: Reply with quote

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
View user's profile Send e-mail Visit poster's website
chrisspear
Senior
Senior


Joined: Jun 15, 2004
Posts: 202
Location: Marlboro, MA

PostPosted: Sun Jun 17, 2012 2:05 pm    Post subject: Reply with quote

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
View user's profile Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Verification Guild Forum Index -> Main All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
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
Verification Guild © 2006 Janick Bergeron
Web site engine's code is Copyright © 2003 by PHP-Nuke. All Rights Reserved. PHP-Nuke is Free Software released under the GNU/GPL license.
Page Generation: 0.202 Seconds