The factory is how one test turns the DMA bench's stream driver into a packet-truncating driver, and another turns the scoreboard into one that owns end of test, without a single edit to the env or the agents. This topic takes you from the one-line registration macro to the questions senior interviews ask: which of two overrides wins, why an override that is clearly registered never runs, and how to steer a regression from the command line.
Explain what the factory stores and what happens inside every type_id::create call.
Predict which class gets built when type and instance overrides compete, including chained overrides.
Place overrides at the right moment in build_phase, and debug one that silently does nothing.
Handle the advanced cases: parameterized and abstract classes, by-name overrides, command-line overrides, and overrides for sequence items and sequences.
Lesson | What you learn |
|---|---|
What the registry holds, and how dma_truncate_test replaces the stream driver with one line. | |
What | |
create versus new, the factory's own create methods, and the context argument for objects. | |
The one home for the rules: instance overrides first (first match wins), then type overrides, then chaining. | |
When to set an override, why a derived scoreboard's methods never ran, and the debug toolkit. | |
Chaining, | |
| |
The context argument of create, path-scoped item overrides, and swapping a sequence inside a virtual sequence. |