Hi,
I am a newbie with UVM/SV. I have a simple sequence_item with 2 random int variables. I am instantiating a dynamic array of the sequence_item in my sequence. Now I want to constrain the sequence_item in such a way that the random variables inside should not be the same. Below code gives run time Fatal error when it reaches the mentioned line. Solutions appreciated.
class my_transaction extends uvm_sequence_item;
rand int a;
rand int b;
– registered with factory and added field macros here –
endclass
class my_sequence extends uvm_sequence_item;
rand my_transaction items;
constraint c_txn {
items.size>0 && items.size<=10;
foreach(items[i]) {
items[i].ina != items[i].inb[1]; // FATAL ERROR on this line
}
}
endclass
=================================================
Transcript of log:
items[i].ina != items[i].inb[1];
|
ncsim: *E,RNDCNSTE (…/…my_seq_lib.sv,34|12): Randomization constraint has this error, which will cause the randomize function to return 0 and no new rand values will be set:
Null handle references in constraints are not supported.
if (!seq.do_not_randomize && !seq.randomize()) begin
|
ncsim: *W,SVRNDF (/tools/cadence/INCISIV14.10-s014/Linux/tools/methodology/UVM/CDNS-1.1d/sv/src/seq/uvm_sequencer_base.svh,1398|46): The randomize method call failed.
Observed simulation time : 0 FS + 99
UVM_FATAL /tools/cadence/INCISIV14.10-s014/Linux/tools/methodology/UVM/CDNS-1.1d/sv/src/seq/uvm_sequencer_base.svh(1400) @ 0: uvm_test_top.sa_env.sa_agent.sequencer [STRDEFSEQ] Randomization failed for default sequence ‘my_sequence’ for phase ‘main’
=======================================================
thanks
myashu