UVM Phasing Interview Questions
Questions on UVM execution phases, ranging from basic order to advanced phase jumping and domains.
Beginner Level
Fundamentals- build_phase (Function, Top-down)
- connect_phase (Function, Bottom-up)
- end_of_elaboration_phase (Function, Bottom-up)
- start_of_simulation_phase (Function, Bottom-up)
- run_phase (Task, Parallel, Time-consuming)
- extract_phase (Function, Bottom-up)
- check_phase (Function, Bottom-up)
- report_phase (Function, Bottom-up)
- final_phase (Function, Top-down)
Top-Down: `build_phase` and `final_phase`. Build must be top-down so parents are created before they try to create children.
Bottom-Up: `connect_phase` and most others. Connect is bottom-up so you connect children ports before connecting the parent to the outside.
Intermediate Level
Industry StandardUVM 1.2 introduced 12 runtime sub-phases (pre_reset, reset, ... main, ... shutdown). These run sequentially. The `run_phase` runs in parallel to these 12 phases.
Advice: Avoid mixing them. If you use `run_phase`, stick to it. If you use `main_phase`, stick to the sub-phases.
You must raise an objection. UVM naturally ends when no component has a raised objection.
phase.raise_objection(this); // Do work phase.drop_objection(this);
Advanced Level
ExpertPhase jumping allows you to abort the current phase and move to another (backward or forward). Useful for Warm Resets.
phase.jump(uvm_phase::get_phase_by_name("reset_phase"));Impact: All components are killed in the current phase and restarted in the target phase.
Yes. You need to extend `uvm_phase`, create a singleton instance, and insert it into the schedule using `uvm_domain::add_phase()`. For example, inserting a `training_phase` for link training before the `main_phase`.
You will need to manually call `super.connect_phase()` or rely on the `uvm_phase` base methods to ensure it's integrated correctly.
1. Check Objections: Use `+UVM_OBJECTION_TRACE` to see who raised but never dropped an objection.
2. Check Timeout: Use `+UVM_TIMEOUT=1000000ns,YES` to force a stop and print stack traces.
3. Check Deadlock: Drivers waiting for items that never come (sequencer empty but objection raised).