注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源碼