Query on explicit prediction

Hi all,

When should we use explicit prediction in RAL ?

Thanks in Adv

In reply to bl4ckp3rl :

In UVM RAL (Register Abstraction Layer), explicit prediction is used when you want to predict the state of a register or a set of registers without actually performing a read operation from the hardware. It allows you to set the mirrored value (mirror) of a register without executing a read operation and use that value for comparison or further processing. Explicit prediction is often used in scenarios where you have external information about the state of registers.

Here are some situations where explicit prediction in RAL might be useful:

Initial Configuration:

At the beginning of a test or a sequence, you might have information about the expected state of certain registers in the DUT.
Instead of performing actual read operations, you can use explicit prediction to set the initial mirrored values based on this information.
System Initialization:

During system initialization or power-up sequences, certain registers might have known default or startup values.
Explicit prediction can be used to initialize the mirrored values of these registers without performing actual reads.
External Knowledge:

In some cases, external knowledge about the DUT state may be available. For example, you might know that a certain register will be set to a specific value due to a specific configuration or an external event.
Explicit prediction allows you to set the mirrored value without relying on the actual read values.
Performance Optimization:

In scenarios where actual read operations might be time-consuming or impact performance, explicit prediction can be used to avoid unnecessary read operations.
Explicit prediction allows you to update the mirrored values based on external information without interacting with the hardware.
Here’s a simplified example illustrating the use of explicit prediction:

// UVM RAL Sequence
task main_phase(uvm_phase phase);
    // External knowledge about the initial state of a register
    desired_value = 8'hA5;

    // Explicit prediction to set the mirrored value without a read operation
    my_register.predict(desired_value);

    // Perform a write operation
    my_register.write(desired_value, .status(status));

    // Perform a read operation to update the mirror value
    my_register.read(.status(status));

    // Compare the desired and mirror values
    if (desired_value == my_register.get_mirror()) begin
        `uvm_info("RAL_CHECK", "Register write and read successful", UVM_LOW)
    end else begin
        `uvm_error("RAL_CHECK", "Register write or read failed", UVM_LOW)
    end
endtask

In this example, the predict method is used to set the mirror value explicitly based on the external knowledge of the expected register state before performing an actual read operation.

Remember that explicit prediction is a feature provided by UVM RAL, and its usage depends on the specific requirements and characteristics of your testbench and DUT. It is a tool to optimize and enhance the predictability of your register transactions.


rahulvala@gmail.com
Freelancer/verification engineer
https://www.linkedin.com/in/rahulvala/