| 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, 69 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 |
atul_123 Senior


Joined: May 30, 2007 Posts: 134
|
Posted: Thu Oct 13, 2011 4:36 am Post subject: Can I gice x inside the constraint block of system verilog |
|
|
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 |
|
 |
atul_123 Senior


Joined: May 30, 2007 Posts: 134
|
Posted: Thu Oct 13, 2011 4:40 am Post subject: |
|
|
I see this error:
Invalid X or Z in state expression value for constraint |
|
| Back to top |
|
 |
dave_59 Senior


Joined: Jun 22, 2004 Posts: 974 Location: Fremont, CA
|
Posted: Thu Oct 13, 2011 1:06 pm Post subject: |
|
|
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 |
|
 |
|
|
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
|
| |
|
|