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, 38 guest(s) and 1 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 

Can I gice x inside the constraint block of system verilog

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


Joined: May 30, 2007
Posts: 134

PostPosted: Thu Oct 13, 2011 4:36 am    Post subject: Can I gice x inside the constraint block of system verilog Reply with quote

Hello,

I need to constraint a variable as value x. It is defined as logic in the base class.

e.g
`ovm_do_on_with(myseq , p_sequencer.mst_sequencer[0],
{

my_seq.wr == 1'bx;
});

I get compilation error when i do this.
Back to top
View user's profile
atul_123
Senior
Senior


Joined: May 30, 2007
Posts: 134

PostPosted: Thu Oct 13, 2011 4:40 am    Post subject: Reply with quote

I see this error:


Invalid X or Z in state expression value for constraint
Back to top
View user's profile
dave_59
Senior
Senior


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

PostPosted: Thu Oct 13, 2011 1:06 pm    Post subject: Reply with quote

The constraint solver can only handle 2-state values.

You can either either set wr to 'x and do my_seq.wr.rand_mode(0) before calling `ovm_do_on_with(), or the preferred method is not to use the `ovm_do macro at all. Just write
Code:

my_seq = create(...);
start_item(my_seq,,p_sequencer.mst_sequencer[0])
my_seq.randomize();
my_seq.wr='x;
finish_item(my_seq);

Dave Rich
Mentor Graphics
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.216 Seconds