Hi all ,
SV LRM 8.25 ::
"A specialization is the combination of a specific generic class with a unique set of parameters. Two sets of
parameters shall be unique unless all parameters are the same, as defined by the following rules:
a) A parameter is a type parameter and the two types are matching types.
b) A parameter is a value parameter and both their type and their value are the same."
Since uvm_config_db is a Parameterized class , I was trying codes to check if the set() N get() calls work with matching types !!
`include "uvm_pkg.sv"
`include "uvm_macros.svh"
import uvm_pkg::*;
`define COMP_NEW function new ( string name , uvm_component parent ) ; \
super.new(name,parent);\
endfunction
class agent extends uvm_agent ;
`uvm_component_utils( agent )
`COMP_NEW
function void build_phase ( uvm_phase phase ) ;
int active;
`uvm_info(get_name(),"In build_phase",UVM_NONE)
if ( get_config_int("is_active",active) ) // NOTE :: Deprecated from UVM 1.2 !!
begin
`uvm_info(get_name()," get_config_int is Successful !! ",UVM_NONE)
is_active = uvm_active_passive_enum'(active);
`uvm_info(get_name(),{" agent is ", ( (is_active) ? "UVM_ACTIVE" : "UVM_PASSIVE" ) },UVM_NONE) // typedef enum bit { UVM_PASSIVE=0, UVM_ACTIVE=1 } uvm_active_passive_enum ;
end
endfunction
endclass
typedef reg signed [4095:0] my_type ;
class test extends uvm_component ;
`uvm_component_utils( test )
`COMP_NEW
agent ag ;
function void build_phase ( uvm_phase phase ) ;
`uvm_info(get_name(),"In build_phase",UVM_NONE)
uvm_config_db#(my_type)::set(uvm_top,"*","is_active",100) ; // Value of 100 set i.e Passive ( Since LSB is 0 ) !! !!
ag = new("ag",this) ;
endfunction
function void end_of_elaboration_phase ( uvm_phase phase ) ;
uvm_top.print_topology();
endfunction
endclass
I observe that get() is Unsuccessful
Since uvm_bit_stream_t is actually logic signed [4095:0]
Shouldn’t reg signed [4095:0] work ?
( Since both are matching types i.e both are 4-state , Same Sized , Same Packed Range )