Quantcast
Channel: UVM Forums RSS Feed
Viewing all articles
Browse latest Browse all 756

Constraining Sequencer from testcase

$
0
0

Hi ,

 

Sorry the heading should be Constraint Sequence from testcase

 

I am unable to change it , seen after posted

 

I am wondering to constrain my sequence from testcase, is there any good way of doing it ?

----------------------------Test Code----------------------------------------------\\
class card_test extends uvm_test;

task run_phase(uvm_phase phase);
    card_seq card_seq_i;
    repeat(3) begin
      phase.raise_objection(.obj(this));
      card_seq_i = card_seq::type_id::create(.name("card_seq_i"), .contxt(get_full_name()));
      //assert(card_seq_i.randomize());// actual test case
      //assert(card_seq_i.randomize() with { card_seq_i.pkt_state == READY;}); // dedicated test
      `uvm_info("card_test", { "\n", card_seq_i.sprint() }, UVM_LOW)
      card_seq_i.start(card_env_i.card_agent_e.m_sequencer);
      #10ns ;
      phase.drop_objection(.obj(this));
	end
   endtask: run_phase

The line 09 and 10 if chosen gives me error.

 

Thanks for help

 

Regards,

KS 


Viewing all articles
Browse latest Browse all 756

Trending Articles