2.6构建-seq body task之不使用宏,使用start_item与finish_item

注1:可以了解下create_item函数;

1.使用start_item与finish_item

(1) start_item与finish_item的参数必须是transaction的指针;

注1:通过调用start_item()方法等待获得sequencer的授权许可(sequencer.wait_for_grant),其后执行parent sequence的方法pre_do();

注2:通过调用finish_item()方法执行parent_sequence的mid_do(),以及调用uvm_sequencer.send_request()和uvm_sequencer.wait_for_item_done()将item发送至sequencer,再完成与driver之间的握手;最后,执行parent_sequence的post_do();

(2) 在使用start_item与finish_item前,必须要先实例化transaction(可以通过调用new函数,也可以采用factory机制进行实例化,也可以使用uvm_sequence的create_item()函数);

(3) 其中,tr.randomize可以放在transaction实例化后,finish_item调用前的任何地方;

(4) 当uvm_do系列宏的参数是trans时,uvm_do系列宏其实对start_item, randomize以及finish_item进行了封装;

1.1 start_item与finish_item源码

 

 

 

posted on 2021-10-16 16:37  知北游。。  阅读(2046)  评论(0)    收藏  举报

导航