|
发表于 2017-11-7 19:00:01
|
显示全部楼层
回复 1# liheng369
Hi, 参考Mentor 的uvm_cookbook 的描述:
phase_ready_to_end
For sequences, tests, and many complete testbenches, the raising and dropping of phase objections during the normal
lifetime of the phase, as described above, is quite sufficient.
However, sometimes a component does not want to actively raise and drop objections during the normal lifetime of a
phase, but does want to delay the transition from one phase to the next. This is very often the case in transactors, which
for performance reasons cannot raise and drop an objection for every transaction, and is quite often the case for
end-to-end scoreboards.
To delay the end of phase after all other components have agreed that the phase should end, that component should raise
objections in the phase_ready_to_end method. It is then responsible for dropping those objections, either in the main
body of the component or in a task fork / join none'd from the phase_ready_end_method.
An example of using fork / join_none is shown below :
- 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
复制代码
Ready_to_end_phase without fork / join_none is used in the Object-to-All and Object-to-One phasing policies often
used in components such as transactors and scoreboards. |
|