Hardware interview practice
UVM build_phase vs. connect_phase
Which allocation of work follows normal UVM phase intent?
Answer choices
- A. Create all transactions in connect_phase and connect interfaces in report_phase
- B. Connect ports in build_phase and create children in run_phase
- C. Create child components in build_phase and connect their transaction-level modeling (TLM) ports in connect_phase
- D. Create child components in final_phase because the hierarchy is complete
Concise answer
The answer and the key reason
Deeper explanation
Work through the implementation and tradeoffs
`build_phase` is where a component reads construction-time configuration and creates its children, normally through factory `create` calls. Its top-down traversal lets a parent establish settings before a child executes its own build logic. By the end of this phase, the intended testbench hierarchy should be present.
`connect_phase` follows construction and is used to join TLM ports, exports, implementations, analysis paths, and related handles. Because the hierarchy already exists, connections can refer safely to both endpoints. Building children in a runtime or final phase is too late for normal topology setup, while connecting them prematurely can reference objects that have not yet been created.
What to remember
- Build creates children
- Connect binds endpoints
- Construction precedes wiring
Practice the complete prompt
