12 `uvm_component_utils_begin(cl_scb_test_md5_hash_collisions)
14 `uvm_component_utils_end
19 function new(string name = "cl_scb_test_md5_hash_collisions", uvm_component parent = null);
20 super.new(name, parent);
26 extern function void pre_build();
27 extern task main_phase(uvm_phase phase);
28 extern function void hash_collision_test();
33 function void cl_scb_test_md5_hash_collisions::pre_build();
37 this.syoscb_cfgs.syoscb_cfg[0].set_queue_type(pk_syoscb::SYOSCB_QUEUE_MD5);
38 this.syoscb_cfgs.syoscb_cfg[0].set_compare_type(pk_syoscb::SYOSCB_COMPARE_OOO);
39 this.syoscb_cfgs.syoscb_cfg[0].set_disable_clone(1'b1);
40 endfunction: pre_build
42 function void cl_scb_test_md5_hash_collisions::hash_collision_test();
43 cl_tb_seq_item items[3];
44 cl_tb_seq_item remaining_item;
49 foreach(items[i]) begin
50 items[i] = cl_tb_seq_item::type_id::create("item");
54 this.scb_env.syoscb[0].add_item("Q1", "P1", items[0]);
55 this.scb_env.syoscb[0].add_item("Q1", "P1", items[1]);
60 this.scb_env.syoscb[0].add_item("Q2", "P1", items[2]);
62 q = this.syoscb_cfgs.syoscb_cfg[0].get_queue("Q1");
63 iter = q.create_iterator();
66 if(!$cast(remaining_item, iter.next().get_item().get_item())) begin
67 `uvm_fatal("CAST", "Unable to typecast seq item back to cl_tb_seq_item");
69 if(remaining_item.int_a != 6) begin
70 `uvm_error("MD5_HASH_COLL", $sformatf("int_a of remaining item was %0d, expected 6", remaining_item.int_a))
72 this.scb_env.syoscb[0].flush_queues_all();
73 void'(q.delete_iterator(iter));
75 endfunction: hash_collision_test
77 task cl_scb_test_md5_hash_collisions::main_phase(uvm_phase phase);
78 phase.raise_objection(this);
79 super.main_phase(phase);
81 this.syoscb_cfgs.syoscb_cfg[0].set_ordered_next(1'b0);
82 this.hash_collision_test();
83 `uvm_info("MD5_HASH_COLL", "Hash collision comparisons passed for ordered_next=0", UVM_NONE)
84 this.syoscb_cfgs.syoscb_cfg[0].set_ordered_next(1'b1);
85 this.hash_collision_test();
86 `uvm_info("MD5_HASH_COLL", "Hash collision comparisons passed for ordered_next=1", UVM_NONE)
88 phase.drop_objection(this);
Test to verify that comparisons still work correctly on hash items with multiple entries where hash c...
Queue iterator base class defining the iterator API used for iterating over queues.
Class which represents the base concept of a queue.