6 string queues[] = '{
"Q1",
"Q2",
"Q3"};
7 string producers[] =
'{"P1", "P2"}; 9 //------------------------------------- 11 //------------------------------------- 12 `uvm_component_utils(cl_scb_test_copy_cfg) 14 //------------------------------------- 16 //------------------------------------- 17 extern function new(string name = "cl_scb_test_copy_cfg", uvm_component parent = null); 19 //------------------------------------- 21 //------------------------------------- 22 extern task run_phase(uvm_phase phase); 23 endclass: cl_scb_test_copy_cfg 25 function cl_scb_test_copy_cfg::new(string name = "cl_scb_test_copy_cfg", uvm_component parent = null); 26 super.new(name, parent); 29 task cl_scb_test_copy_cfg::run_phase(uvm_phase phase); 31 cl_tb_cfg_rnd cfg_rnd; 32 cl_syoscb_cfg cfg1, cfg2, cfg3; 38 uvm_printer default_printer; 40 uvm_comparer default_comparer; 45 cfg_rnd = this.config_create_and_randomize(); 49 default_comparer = new; 52 packer.use_metadata = 1'b1;
56 cfg_rnd.set_rnd_fields(cfg1);
58 void'(cfg1.set_producer("P1", queues)); 67 for(
int i=0; i<3; i++) begin
85 $display(
"Packed %0d bits when packing cfg1", cfg1.pack(pack1, packer));
86 $display(
"Packed %0d bits when packing cfg2", cfg2.pack(pack2, packer));
88 foreach(pack1[i]) begin
89 if(pack1[i] != pack2[i]) begin
90 `uvm_error(
"CFG_COPY", $sformatf(
"Error when copying cfg1 to cfg2. Should be similar, but found a difference in pack @ %0d", i))
98 $display(
"Unpacked %0d bits into cfg3 from cfg2's pack", cfg3.unpack(pack2));
99 $display(
"Packed %0d bits when packing cfg3", cfg3.pack(pack3, packer));
100 foreach(pack2[i]) begin
101 if(pack2[i] != pack3[i]) begin
102 `uvm_error(
"CFG_COPY", $sformatf(
"Error when comparing cfg2 and cfg3. Should be equal, but found a difference in pack @ %0d", i))
116 void'(cfg2.pack(pack2, packer)); 119 foreach(pack1[i]) begin 120 if(pack1[i] != pack2[i]) begin 124 if(miscnt == 0) begin 125 `uvm_error("CFG_COPY", "Error when copying cfg1 to cfg2. No packed difference found when introducing errors"); static uvm_printer get_printer_of_type(t_printer_type ptype)
Generates a new printer of the correct type.
static void set_verbosity(uvm_comparer comparer, int unsigned cv=UVM_DEBUG)
Sets the verbosity level of a given comparer.
virtual void set_default_comparer(uvm_comparer comparer)
Configuration API: Set the value of the default_comparer member variable
virtual void set_printer(uvm_printer printer, string queue_names[], string producer_names[])
Configuration API: Sets the given uvm_printer to be used for some queue/producer-combinations.
This test is used to ensure that copying data from one cl_syoscb_cfg object to the next correctly mov...
virtual void set_default_printer(uvm_printer printer)
Configuration API: Set the value of the default_printer member variable
Base class for all SCB tests.
static void set_file_descriptor(uvm_printer printer, int fd=0)
Sets the file descriptor to be used for a given printer.
virtual bit set_producer(string producer, queue_names[])
Configuration API: Sets the given producer for the listed queues If any errors occur, information about this is printed as a UVM_DEBUG message If a list of queues has already been set for a given producer, overrides that list.
virtual void set_comparer(uvm_comparer comparer, string queue_names[], string producer_names[])
Configuration API: Sets the comparer to be used for a number of queues.
virtual void set_queues(string queue_names[])
Configuration API: Will set the legal queues when provided with a list of queue names.