End Of Test Mechanisms(從EndOfTest開始)
上一篇 /
下一篇 2018-12-28 15:47:39
EndOfTest
UVM test結束指南 - 了解可用的test結束機制和phase objections。
“End of Test”章節內容:
EndOfTest (this page)
Objections
Topic Overview
End of Test in the UVM
如果使用標準phasing,UVM測試平臺有許多零耗時的phase來構建和連接測試平臺,然后是一些耗時的phase,最后是一些零耗時的清理phase。
所有耗時phase結束時,test結束。當該phase不再有任何待決objections時,每個phase結束。因此,通過管理phase objections來控制UVM中的test結束。從Phasing Introduction Page鏈接到的文章中描述了使用階段異議的最佳方法
一個簡單的測試可能如下所示:
task reset_phase( uvm_phase phase);
phase.raise_objection( this );
reset_seq.start( m_sequencer );
phase.drop_objection( this );
endtask
task configure_phase( uvm_phase phase);
phase.raise_objection( this );
program_control_registers_seq.start( m_sequencer );
phase.drop_objection( this );
endtask
task main_phase( uvm_phase phase);
phase.raise_objection( this );
data_transfer_seq.start( m_sequencer );
phase.drop_objection( this );
endtask
task shutdown_phase( uvm_phase phase);
phase.raise_objection( this );
read_status_registers_seq.start( m_sequencer );
phase.drop_objection( this );
endtask
上述test中的四個phase中的每個phase都會提起objection和撤銷objection。由于上述特定phase按順序發生,因此一個phase在前一phase完成之前無法啟動。在每個phase開始時提起objection會阻止phase立即終止,而撤銷objection意味著該組件不再對phase結束有異議。如果其他組件或objects沒有提出其他待決異議,則該phase將終止。當對特定phase沒有待決異議時,仿真將在下一類phase進行。當沒有耗時的phase要執行時,仿真繼續進行cleanup phase并且test結束。
phase_ready_to_end
對于sequences, tests和許多完整的測試平臺,如上所述,在phase的正常壽命期間phase objections的提起和撤銷是足夠的。
但是,有時某個組件不希望在phase的正常生命周期內主動提起和撤銷objections,但確實希望延遲從一個phase到下一類phase的過渡。在事務生產者中經常出現這種情況,出于性能原因,不能針對每筆事務提出objection,并且通常情況下是端到端的記分板。
為了在所有其他組件同意該phase應該結束之后延遲phase結束,該組件應該在phase_ready_to_end方法中提出objections。然后它負責在組件的主體中或在phase_ready_end_method的任務fork / join none中撤銷這些objections。
使用fork / join_none的示例如下所示:
function void my_component::phase_ready_to_end( uvm_phase phase );
if( !is_ok_to_end() ) begin
phase.raise_objection( this , "not yet ready to end phase" );
fork begin
wait_for_ok_end();
phase.drop_objection( this , "ok to end phase" );
end
join_none
end
endfunction : phase_ready_to_end
沒有fork / join_none的Ready_to_end_phase用于通常用于事務生產者和記分板等組件的Object-to-All和Object-to-One的phasing策略。
導入論壇
收藏
分享給好友
管理
舉報
TAG: