RAL Architecture
Design a register abstraction layer that remains independent from the bus protocol and trustworthy during debug.
Learning objectives
- Derive a RAL architecture from a software-visible register specification.
- Separate register modeling, bus translation, prediction, stimulus, and checking responsibilities.
- Choose evidence that distinguishes a DUT defect from a model, adapter, or predictor defect.
- Build a small RAL environment that can grow from one register to a subsystem map.
Step 1: Start with the verification contract
A register model is an executable description of the DUT programming interface. It should answer: which address is accessed, which bits are legal, what value appears after reset, what a read or write does, and how the operation reaches the DUT. It must describe the specification, not copy RTL implementation details.
Use this small CSR block for the lesson:
| Register | Offset | Fields | Reset | Access behavior |
|---|---|---|---|---|
CTRL | 0x00 | ENABLE[0] | 0 | RW; enables the block |
STATUS | 0x04 | READY[0], ERROR[1] | 0 | RO status; ERROR is W1C |
IRQ_MASK | 0x08 | DONE[0], FAULT[1] | 3 | RW mask bits |
From this table, derive model objects and tests. Do not begin by opening the DUT source and mirroring every internal signal. The register model should remain stable if the RTL implementation changes but the programming contract does not.
Step 2: Assign ownership before writing code
test / virtual sequence
| chooses scenario and expected outcome
v
register model ---- register API, map, desired and mirrored values
| ^
| adapter translates | predictor updates from observation
v |
bus sequencer --> bus driver --> DUT --> bus monitor
^ |
+--------- protocol response --------+
scoreboard and coverage consume monitor transactions independently
| Owner | Responsibility | Must not do |
|---|---|---|
| Register model | Addresses, fields, reset, access policies, abstract state | Drive pins or encode APB timing |
| Adapter | Convert uvm_reg_bus_op to the bus item and back | Decide register semantics |
| Monitor / predictor | Observe accepted bus activity and synchronize the mirror | Trust driver intent without observation |
| Sequence / test | Choose scenarios, status checks, and expected results | Call predict() to hide failures |
This ownership boundary is the main architectural decision. When a mirror mismatch occurs, you can ask which boundary first lost information instead of changing several components at once.
Step 3: Build the register model
A block creates the map and registers. Each register creates fields and configures their width, lsb position, access policy, reset value, volatility, and whether the field participates in coverage or comparison.
class csr_block extends uvm_reg_block;
rand ctrl_reg ctrl;
rand status_reg status;
rand irq_mask_reg irq_mask;
`uvm_object_utils(csr_block)
function new(string name = "csr_block");
super.new(name, UVM_NO_COVERAGE);
endfunction
function void build();
default_map = create_map("apb_map", 'h0, 4, UVM_LITTLE_ENDIAN);
ctrl = ctrl_reg::type_id::create("ctrl");
ctrl.configure(this, null, "");
ctrl.build();
default_map.add_reg(ctrl, 'h00, "RW");
status = status_reg::type_id::create("status");
status.configure(this, null, "");
status.build();
default_map.add_reg(status, 'h04, "RO");
irq_mask = irq_mask_reg::type_id::create("irq_mask");
irq_mask.configure(this, null, "");
irq_mask.build();
default_map.add_reg(irq_mask, 'h08, "RW");
lock_model();
endfunction
endclass
The map's base address, bus width, and endianness are part of the contract with the adapter. Locking catches accidental structural changes after construction. In a real environment, add model unit tests that print the map and check offsets before connecting a sequencer.
Step 4: Understand the state vocabulary
| API | Meaning | Bus activity? | Typical use |
|---|---|---|---|
set(value) | Change desired model value | No | Prepare a later update() |
get() | Read desired value from the model | No | Check test intent |
write() | Write a value through the selected path | Usually | One explicit register write |
update() | Write fields whose desired values differ | Usually | Commit a prepared configuration |
read() | Read DUT data and return it to the caller | Usually | Check a response directly |
mirror() | Read and compare or update the mirror | Usually | Synchronize/check abstract state |
The distinction prevents a common false positive. After set(1), the desired value is one but the DUT may still be zero. Only a successful write plus observed bus activity and readback establishes that the DUT changed.
uvm_status_e status;
uvm_reg_data_t value;
reg_model.ctrl.enable.set(1'b1); // model intent only
if (reg_model.ctrl.enable.get() != 1'b1)
`uvm_error("RAL_STATE", "Desired value was not stored")
reg_model.ctrl.update(status, UVM_FRONTDOOR, reg_model.default_map);
if (status != UVM_IS_OK)
`uvm_fatal("RAL_ACCESS", "CTRL update failed")
reg_model.ctrl.read(status, value, UVM_FRONTDOOR, reg_model.default_map);
if (status != UVM_IS_OK || value[0] !== 1'b1)
`uvm_error("RAL_CHECK", "CTRL.ENABLE readback mismatch")
Step 5: Connect translation and prediction
The adapter translates representation; the predictor synchronizes state from observation. They are different paths with different evidence. With explicit prediction, disable auto-prediction on the map so one bus transaction cannot update the mirror twice.
class csr_env extends uvm_env;
csr_block reg_model;
apb_reg_adapter adapter;
uvm_reg_predictor #(apb_item) predictor;
function void build_phase(uvm_phase phase);
super.build_phase(phase);
reg_model = csr_block::type_id::create("reg_model");
reg_model.build();
adapter = apb_reg_adapter::type_id::create("adapter");
predictor = uvm_reg_predictor#(apb_item)::type_id::create("predictor", this);
predictor.map = reg_model.default_map;
predictor.adapter = adapter;
endfunction
function void connect_phase(uvm_phase phase);
reg_model.default_map.set_sequencer(apb_agent.sequencer, adapter);
reg_model.default_map.set_auto_predict(0);
apb_agent.monitor.ap.connect(predictor.bus_in);
endfunction
endclass
A complete integration review asks four questions: does the map use the intended sequencer, does the adapter preserve address/data/direction/status, does the monitor publish accepted transactions, and is exactly one prediction owner enabled?
Step 6: Follow one operation end to end
- The sequence calls
ctrl.write()or prepares a value withset()and callsupdate(). - RAL creates a
uvm_reg_bus_opcontaining address, direction, data, byte enables, and map context. - The adapter converts that operation into an APB item; the driver supplies protocol timing.
- The DUT accepts or rejects the transfer. The monitor publishes the actual bus result.
- The predictor converts the observed item back into register semantics and updates the mirror only on a valid response.
- The sequence checks status and readback; scoreboards and coverage consume the same observation independently.
Log at least the register name, map, offset, direction, requested data, observed data, byte enables, bus status, and mirror after prediction. This turns a vague RAL mismatch into a traceable failure.
Step 7: Debug by symptom, not by guess
| Symptom | Likely cause | Evidence to inspect |
|---|---|---|
| Wrong bus address | Map base, offset, or bus width | Printed map and adapter item |
| Read returns write data | bus2reg() copied request instead of response | Monitor response and adapter direction |
| Mirror changes before DUT accepts write | Driver-connected prediction or auto-prediction duplicate | Monitor timestamp and prediction configuration |
| RO field matches written value | Incorrect field policy or predictor semantics | Field access policy and observed readback |
| Every mirror check fails after reset | DUT and model reset domains are unsynchronized | Reset event, model reset, first bus item |
predict() in the test until the monitor, adapter, and predictor evidence explains the mismatch. Otherwise the test can turn a broken environment into a passing one.Step 8: Advanced lab
Build the three-register CSR model above and connect it to your existing APB or memory-mapped agent. Start with a model-only map test, then add frontdoor accesses.
- Print the locked map and verify offsets, bus width, endianness, and field reset values.
- Write
CTRL.ENABLE, read it back, and show the matching monitor transaction. - Read
STATUS; prove that writing its ROREADYbit does not silently create a new DUT value. - Exercise W1C behavior for
STATUS.ERRORand verify that a write of zero does not clear it. - Force a wrong offset, a failed bus response, and duplicate prediction one at a time. Capture the first diagnostic and identify the responsible layer.
Architecture review for RAL Architecture
Apply the module's working contract to this topic: address, width, reset, access policy, volatility, side effects, byte enables, and the bus path. Identify the component that owns the behavior and the independent observer that can prove it. The implementation is not complete until both sides are named.
| Review dimension | Question to answer | Evidence to keep |
|---|---|---|
| Ownership | Which UVM object creates, configures, and controls this behavior? | build/connect/run trace |
| Correctness | What expected result is compared with the observed result? | checker, assertion, or status |
| Failure | What is the first useful symptom if the behavior is wrong? | context-rich report and transaction |
| Reuse | What changes when the interface, test, or configuration changes? | portable scenario or documented limitation |
Implementation walkthrough
- Convert the topic into one requirement with a measurable expected outcome.
- Declare the configuration and transaction types at the ownership boundary instead of using hidden globals.
- Construct objects in
build_phase, connect TLM paths inconnect_phase, and perform scenario timing in sequences or run phases. - Attach an independent monitor, checker, coverage collector, or report consumer before adding random stimulus.
- Run the smallest positive case, then a boundary and negative case, and preserve the first failure.
function void report_result(string operation,
string expected, string actual);
`uvm_info("EVIDENCE", $sformatf(
"operation=%s expected=%s actual=%s",
operation, expected, actual), UVM_LOW)
endfunction
Use structured evidence instead of a vague pass message. A report should tell a reviewer which operation ran, what was expected, what was observed, and where to look next.
Failure-driven exercise
Break one part of the implementation deliberately: remove a TLM connection, change a boundary value, delay an event, or provide an invalid configuration. Predict the symptom before running the test, then compare that prediction with the actual log.
- Record the test name, seed, configuration, phase, and transaction identity.
- Identify the first incorrect observation, not only the final cascade of errors.
- Repair the responsible owner and rerun the same reproducer.
- Explain what review or assertion would prevent the defect returning.
Architecture review for RAL Architecture
Apply the module's working contract to this topic: address, width, reset, access policy, volatility, side effects, byte enables, and the bus path. Identify the component that owns the behavior and the independent observer that can prove it. The implementation is not complete until both sides are named.
| Review dimension | Question to answer | Evidence to keep |
|---|---|---|
| Ownership | Which UVM object creates, configures, and controls this behavior? | build/connect/run trace |
| Correctness | What expected result is compared with the observed result? | checker, assertion, or status |
| Failure | What is the first useful symptom if the behavior is wrong? | context-rich report and transaction |
| Reuse | What changes when the interface, test, or configuration changes? | portable scenario or documented limitation |
Implementation walkthrough
- Convert the topic into one requirement with a measurable expected outcome.
- Declare the configuration and transaction types at the ownership boundary instead of using hidden globals.
- Construct objects in
build_phase, connect TLM paths inconnect_phase, and perform scenario timing in sequences or run phases. - Attach an independent monitor, checker, coverage collector, or report consumer before adding random stimulus.
- Run the smallest positive case, then a boundary and negative case, and preserve the first failure.
function void report_result(string operation,
string expected, string actual);
`uvm_info("EVIDENCE", $sformatf(
"operation=%s expected=%s actual=%s",
operation, expected, actual), UVM_LOW)
endfunction
Use structured evidence instead of a vague pass message. A report should tell a reviewer which operation ran, what was expected, what was observed, and where to look next.
Failure-driven exercise
Break one part of the implementation deliberately: remove a TLM connection, change a boundary value, delay an event, or provide an invalid configuration. Predict the symptom before running the test, then compare that prediction with the actual log.
- Record the test name, seed, configuration, phase, and transaction identity.
- Identify the first incorrect observation, not only the final cascade of errors.
- Repair the responsible owner and rerun the same reproducer.
- Explain what review or assertion would prevent the defect returning.
Technical deep review: RAL Architecture
Evaluate ral architecture using the module contract: address, width, reset, access policy, volatility, side effects, byte enables, and the bus path. Do not stop at whether the API call completes. Identify the state transition, the independent observation, the failure report, and the evidence that another engineer can audit.
| Dimension | Question | Evidence |
|---|---|---|
| Semantics | What does the operation mean before and after execution? | state table or transaction trace |
| Ownership | Which component is allowed to change or check the state? | build/connect/run design |
| Failure | What is the first incorrect observation? | context-rich report |
| Reuse | What can vary without changing the scenario? | configuration or extension contract |
Technical implementation checklist
- State the requirement, preconditions, expected result, and failure policy.
- Declare typed configuration and transaction boundaries instead of hidden global state.
- Construct objects in
build_phaseand connect communication inconnect_phase. - Attach an independent monitor, checker, assertion, or coverage consumer.
- Run nominal, boundary, negative, reset, and repeated cases where applicable.
- Preserve seed, phase, transaction ID, expected value, actual value, and first failure.
`uvm_info("EVIDENCE", $sformatf(
"component=%s phase=%s expected=%s actual=%s",
get_full_name(), phase_name, expected, actual), UVM_LOW)
Failure-driven lab and review rubric
Introduce one controlled defect in ral architecture: remove a connection, change a boundary, delay an event, or alter configuration. Predict the symptom, run the smallest reproducer, and repair the responsible layer.
- Pass: deterministic positive behavior is checked independently.
- Pass: a boundary and negative case produce intentional outcomes.
- Pass: the injected defect is detected with useful context.
- Pass: the remaining limitation and prevention action are documented.
Learn: RAL Architecture
In this lesson, focus on how to separate the register model, adapter, monitor, predictor, and test. This matters because the register model must agree with the software-visible specification and with observed bus activity. Start with one requirement and one expected result before adding randomization or additional components.
// Topic: RAL Architecture
// Primary API or artifact: uvm_reg_block -> uvm_reg_map -> uvm_reg_field
// Expected evidence: one observable result tied to the requirement
What to notice: uvm_reg_block -> uvm_reg_map -> uvm_reg_field is the subject of this lesson. It is not enough for the call or artifact to exist; the testbench must observe the resulting transaction, state change, checker result, coverage sample, or review decision.
Expected behavior: the normal case produces the documented result, the boundary case is deliberate, and the failure case identifies the responsible owner instead of hiding the symptom.
Try it: RAL Architecture
- Write the requirement, preconditions, expected result, and failure policy.
- Implement the smallest example that uses
uvm_reg_block -> uvm_reg_map -> uvm_reg_field. - Run a nominal case, a boundary case, and a controlled failure.
- Record the seed or configuration, transaction identity, expected result, actual result, and first incorrect observation.
- draw the data flow and identify the first observable failure.
Check your work: another engineer should be able to understand what was tested, reproduce the result, and identify what remains unverified.
Learn the idea in plain language
RAL Architecture means that you must separate the register model, adapter, monitor, predictor, and test. In practical verification, this matters because the register model must agree with the software-visible specification and with observed bus activity. Start with a small, deterministic example. Once the example works, add error cases, concurrency, and randomization.
There are three questions to ask before writing UVM code:
- What requirement or risk does this topic address?
- Which object owns the behavior, and which object observes the result independently?
- What exact evidence proves success or exposes the first failure?
Key terms
| Term | Meaning | Why it matters here |
|---|---|---|
requirement | Behavior the design must provide | defines what the test must prove |
owner | UVM object responsible for a behavior | prevents duplicated or hidden responsibilities |
observation | Independent evidence of what happened | prevents stimulus from validating itself |
boundary | Minimum, maximum, transition, or exceptional case | finds defects that nominal traffic misses |
diagnostic | Context preserved when behavior fails | reduces debug time in regressions |
Use the vocabulary consistently in code reviews. Saying “the test failed” is incomplete. Say which requirement failed, which observation was wrong, which owner produced it, and which evidence should be inspected next.
Example 1: the smallest useful pattern
// Topic: RAL Architecture
// Primary API: uvm_reg_block -> uvm_reg_map -> uvm_reg_field
function void check_result(string expected, string actual);
if (expected != actual)
`uvm_error("TOPIC", $sformatf(
"expected=%s actual=%s", expected, actual))
else
`uvm_info("TOPIC", "observable result is correct", UVM_LOW)
endfunction
This small pattern has an owner, an expected result, an actual result, and a report. It is not a complete environment, but it demonstrates the minimum contract that every advanced component should expose.
What each part does
check_resultreceives data rather than reaching into another component's private state.expectedrepresents the verification plan or reference model.actualcomes from a monitor, response, assertion, or measured artifact.uvm_errorpreserves a failure in the report stream instead of silently returning.uvm_inforecords successful evidence at a controlled verbosity.
Expected result: a passing case reports the operation as correct; a failing case names both values and allows the test to be reproduced.
Example 2: connect the pattern to UVM phases
class topic_component extends uvm_component;
`uvm_component_utils(topic_component)
topic_config cfg;
uvm_analysis_imp #(topic_item, topic_component) input_export;
function void build_phase(uvm_phase phase);
super.build_phase(phase);
input_export = new("input_export", this);
if (!uvm_config_db#(topic_config)::get(this, "", "cfg", cfg))
`uvm_fatal("CFG", "missing topic configuration")
endfunction
function void connect_phase(uvm_phase phase);
super.connect_phase(phase);
// Connect the monitor or producer to input_export.
endfunction
function void write(topic_item item);
// Apply the topic rule and publish evidence.
endfunction
endclass
This example shows where the topic belongs in a real UVM component. Construction and configuration happen in build_phase. TLM connectivity happens in connect_phase. The observed transaction is processed by write().
Do not move all behavior into the test just because the test is easy to edit. Tests choose scenarios; reusable components implement and observe the mechanism.
Step-by-step implementation
- Write the requirement in one sentence and identify the failure risk.
- List the input type, output type, configuration, and lifecycle phase.
- Choose the independent monitor, checker, assertion, coverage collector, or review artifact.
- Implement a nominal case with a known expected result.
- Add the smallest boundary case that could expose an off-by-one or ordering defect.
- Add an invalid or failure case and define whether it should error, reject, ignore, or recover.
- Record seed, configuration, component path, transaction ID, expected value, actual value, and first failure.
- Only after these checks pass, add random stimulus or broader concurrency.
This order is deliberately conservative. It gives each later test a trustworthy foundation and prevents a large regression from hiding a small wiring mistake.
Decision table
| Situation | Preferred choice | Reason |
|---|---|---|
| One reusable protocol behavior | agent, driver, monitor, or sequence | keeps protocol mechanics reusable |
| Several interfaces must coordinate | virtual sequence and typed handles | keeps scenario intent above protocol details |
| Observed behavior must be compared | scoreboard, predictor, or assertion | provides independent correctness evidence |
| A test needs controlled variation | configuration or factory extension | avoids editing shared code |
| A risk has not occurred | targeted sequence and coverage point | connects stimulus to a measurable gap |
The correct choice depends on lifetime, ownership, timing, and evidence. Familiarity alone is not an architecture decision.
Expected behavior and output
UVM_INFO @ 0: reporter [BUILD] topic configuration accepted
UVM_INFO @ 120ns: env.monitor [OBSERVE] id=7 operation completed
UVM_INFO @ 120ns: env.checker [CHECK] expected=result_7 actual=result_7
UVM_ERROR @ 240ns: env.checker [CHECK] id=8 expected=result_8 actual=result_6
The successful messages establish that construction, observation, and checking occurred. The error identifies an actual mismatch and includes the transaction identity. In a real project, include the address, phase, reset state, configuration, or coverage bin that is specific to the topic.
A report without context creates a second debugging problem. A report with too much low-value data makes the first failure hard to find. Keep high-signal fields at low verbosity and enable detailed traces for a minimized reproducer.
Common mistakes
| Mistake | Why it is dangerous | Better approach |
|---|---|---|
| Checking the driver request | the test can pass even when the DUT rejects it | check the monitor response |
| Using hidden global state | tests influence each other and reuse becomes unclear | use typed configuration and explicit connections |
| Testing only nominal traffic | boundary and recovery defects remain invisible | add boundary, negative, reset, and repeated cases |
| Weakening a checker after a failure | the environment becomes falsely green | preserve the failure and fix its owner |
| Adding randomization too early | many failures obscure the first wiring defect | prove a deterministic vertical slice first |
| Claiming coverage from API calls | an API call does not prove DUT behavior | sample observable results tied to requirements |
Mini quiz
- What requirement does RAL Architecture verify?
- Which component owns the behavior?
- Where does the independent actual result come from?
- What boundary case would be most valuable?
- What information must appear in the first failure report?
Answer guide: use the specific contract for this lesson, name one UVM owner, identify an observation path, choose a realistic edge condition, and include enough context to reproduce the failure.
Practice exercise
draw the data flow and identify the first observable failure Extend the task with a short design note containing the requirement, assumptions, component owner, positive case, boundary case, negative case, expected evidence, and remaining risk.
- Implement the smallest example and run it with a fixed seed or fixed configuration.
- Capture the expected and actual result in the report.
- Introduce one controlled defect related to ral architecture.
- Diagnose the first incorrect observation without disabling checks.
- Restore the implementation and rerun the same reproducer.
Guided walkthrough: from requirement to evidence
Use this four-pass method for RAL Architecture. First write what must be true. Next identify the UVM owner and interface. Then implement the smallest path that can produce evidence. Finally challenge the path with a boundary and a controlled defect.
- Pass 1 - describe: write one requirement, one precondition, and one expected result.
- Pass 2 - design: decide whether the owner is a sequence, component, monitor, checker, coverage collector, service, or review artifact.
- Pass 3 - implement: use uvm_reg_block -> uvm_reg_map -> uvm_reg_field and connect it through the normal UVM lifecycle.
- Pass 4 - prove: capture an observation that demonstrates the register model must agree with the software-visible specification and with observed bus activity.
This method prevents a common advanced-level mistake: writing a large amount of testbench code before deciding what the code must prove.
Guided example: make the boundary visible
class topic_checker extends uvm_component;
`uvm_component_utils(topic_checker)
function void check(topic_item actual);
topic_item expected;
expected = model.predict(actual);
if (!actual.compare(expected))
`uvm_error("TOPIC_CHECK", $sformatf(
"path=%s id=%0d expected=%s actual=%s",
get_full_name(), actual.id,
expected.sprint(), actual.sprint()))
endfunction
endclass
The checker is deliberately independent from the driver. It receives an actual observation, creates or obtains an expectation, and reports a comparison. Adapt the same boundary to the API in this lesson.
Read the example in order
- The component is created by the environment and has a stable name.
- The
check()method receives observed behavior. - The expectation is produced by a model or reference policy.
- The comparison preserves the path and transaction ID.
- The failure is actionable without opening every waveform by default.
API checklist
| Check | Question | Result to record |
|---|---|---|
| Declaration | Is the type or API strongly typed and created by the correct owner? | class path and factory type |
| Configuration | Are defaults validated and can the test override them deliberately? | resolved configuration print |
| Connection | Does the input arrive from the intended monitor or producer? | TLM topology or connection log |
| Timing | Is the operation legal in the current phase and reset state? | phase and timestamp |
| Checking | Is actual behavior compared against an independent expectation? | pass/fail report with values |
| Recovery | What happens after timeout, reset, error, or duplicate activity? | defined recovery result |
| Reuse | Can another test or interface use this without editing internals? | public API and limitation |
What should happen in each phase?
| Phase or activity | Expected work | Do not do this |
|---|---|---|
build_phase | create components, objects, and configuration | wait for clock events or drive protocol activity |
connect_phase | connect TLM ports, exports, and analysis paths | start sequences or depend on DUT responses |
end_of_elaboration | print topology and validate required handles | silently accept null sequencers or missing exports |
run_phase | execute timed stimulus and wait for observable completion | finish on sequence completion before checking drain |
report_phase | summarize errors, coverage, and residual risk | claim success from a single status bit |
The exact phase details vary by topic, but ownership remains stable. Put construction, communication, timing, and reporting in the phase where another engineer would expect to find them.
Troubleshooting playbook
| Symptom | Ask first | Useful next action |
|---|---|---|
| No transaction or result | Was the object created and connected? | print topology and resolved configuration |
| Wrong expected value | Is the reference model independent and current? | compare expected state before and after the event |
| Only boundary fails | Is the limit inclusive, exclusive, or transformed? | write a directed boundary test and inspect fields |
| Only random test fails | Which seed and ordering produced the first error? | rerun the exact command and reduce stimulus |
| Test hangs | Which objection, wait, or queue is not completing? | add timeout and report outstanding work |
| High coverage, low confidence | Did the checker prove the covered behavior? | trace the bin to a requirement and assertion/check |
Debug from the first incorrect observation forward. Later errors are often consequences. Preserve the original seed, configuration, phase, transaction ID, and time before changing the test.
Knowledge check
- State the single most important requirement for RAL Architecture.
- Name the UVM object that owns its implementation.
- Name the independent object or artifact that proves the result.
- Choose one boundary case and explain why it is valuable.
- Choose one failure injection and predict its first symptom.
- List the minimum information needed to reproduce that failure.
Self-check: your answers should identify a specific requirement, one owner, one observation, one realistic edge, one predicted symptom, and enough metadata to repeat the result. Answers such as “test everything” do not define an executable verification plan.
Lesson submission rubric
- Concept: the learner explains the topic in plain language and uses the correct UVM vocabulary.
- Implementation: the example is placed in the correct component and phase with explicit configuration and connections.
- Evidence: a monitor, checker, assertion, coverage result, report, or decision record independently supports the claim.
- Debug: one controlled failure is reproduced, diagnosed, repaired, and prevented or documented.
- Quality: assumptions, limitations, and residual risk are written down for the next engineer.
draw the data flow and identify the first observable failure The final artifact should be a small working example plus a short explanation of what it proves and what it does not prove.
Practice: build the smallest working example
Now apply the lesson to one small verification target. The target is to separate the register model, adapter, monitor, predictor, and test using uvm_reg_block -> uvm_reg_map -> uvm_reg_field. Keep the first version deliberately small: one interface, one transaction or state change, one expected result, and one independent observation.
Write these four lines before coding:
Requirement: the DUT must provide the documented behavior.
Stimulus: one legal operation reaches the DUT.
Observation: the monitor or checker sees what actually happened.
Evidence: expected and actual results are compared with context.
Replace the placeholders with the real requirement for this lesson. This habit makes advanced verification work readable to someone who did not write the original test.
Practice: read the code line by line
function void process_observation(topic_item actual);
string expected;
string actual_text;
expected = reference_model.predict(actual);
actual_text = actual.convert2string();
`uvm_info("TOPIC", $sformatf(
"id=%0d expected=%s actual=%s",
actual.id, expected, actual_text), UVM_LOW)
if (actual_text != expected)
`uvm_error("TOPIC", "verification result does not match")
endfunction
- The method receives an observation, so it is not coupled to the driver request.
- The reference model creates the expectation independently.
- The report records the identity and both sides of the comparison.
- The error is emitted only after the evidence has been captured.
For the real topic, replace the generic comparison with the appropriate register comparison, protocol rule, coverage sample, performance measurement, or architecture decision. Keep the same discipline: input, rule, observation, evidence.
Practice: positive, boundary, and failure cases
| Case | Question | Expected result |
|---|---|---|
| Positive | Does a valid operation work? | checker passes and evidence is recorded |
| Boundary | What happens at the smallest, largest, last, or transition value? | documented boundary behavior |
| Failure | What happens when the owner, input, timing, or configuration is wrong? | intentional error or recovery |
| Reset | What state is retained, cleared, or reinitialized? | model and DUT agree after reset |
| Repeat | Does the result remain correct across repeated or concurrent activity? | ordering and correlation remain valid |
Do not call a case “negative” merely because it fails. A negative test is successful when the environment detects the prohibited behavior and reports it at the correct severity with enough information to debug it.
Practice: debug the first mismatch
When the exercise fails, stop at the first incorrect observation. Use this order:
- Confirm the test name, seed, configuration, reset state, and phase.
- Compare the stimulus that was intended with the transaction the driver issued.
- Compare the driver transaction with the monitor observation.
- Check the reference model, predictor, checker, or coverage sampler that consumed the observation.
- Only then inspect the DUT response and decide whether the defect is in RTL or the testbench.
Practice: explain your result
Complete this short report after implementing the exercise:
| Report item | Your answer |
|---|---|
| Requirement | What exact behavior was verified? |
| Owner | Which UVM object implements the behavior? |
| Observation | Which monitor, checker, assertion, or artifact supplied actual behavior? |
| Positive evidence | What passing result was captured? |
| Boundary evidence | What edge case was exercised? |
| Failure evidence | What controlled defect was detected? |
| Residual risk | What remains unverified? |
draw the data flow and identify the first observable failure The work is complete only when the code and this report agree about what the test proves.
Key takeaways
- RAL is an executable software-interface contract, not a mirror of DUT internals.
- Model, adapter, predictor, monitor, and sequence each own a different part of the information flow.
- Desired state, mirrored state, and physical DUT state are not interchangeable.
- Reliable RAL debug compares the abstract operation, observed bus item, response status, and model state.