Global RAL Defines
Global RAL defines are used to configure the behavior of the RAL model and the testbench. They are typically defined in a configuration file or as command-line arguments.
Common Global RAL Defines:
Define Name | Description |
---|---|
RAL_VERBOSE |
Controls the level of debug output. |
RAL_CHECK_ACCESS |
Enables or disables checking for invalid register accesses. |
RAL_PREDICTOR_ENABLE |
Enables or disables the RAL predictor. |
RAL_DEFAULT_VALUE |
Specifies the default value for registers. |
Example:
`define RAL_VERBOSE 1
`define RAL_CHECK_ACCESS 1
Built-in RAL Defines
UVM provides several built-in defines to control the behavior of RAL components. These defines are often used to configure the default behavior of RAL objects.
Common Built-in RAL Defines:
Built-in RAL Define | Description |
---|---|
UVM_RAL_DEFAULT_WIDTH |
Specifies the default width of registers. |
UVM_RAL_DEFAULT_ACCESS |
Specifies the default access permissions for registers. |
UVM_RAL_DEFAULT_RESET_VALUE |
Specifies the default reset value for registers. |
UVM_RAL_PREDICTOR_TYPE |
Specifies the type of predictor to use. |
Example:
class my_reg_model extends uvm_reg_model;
`uvm_component_utils(my_reg_model)
// ... other component declarations
function new(string name = "my_reg_model");
super.new(name);
// Use built-in defines
`uvm_reg_default_width(32);
`uvm_reg_default_access(UVM_RDWR);
endfunction
endclass