SyoSil ApS UVM Scoreboard  1.0.3.0
cl_tb_cmp_b_d_seq_item.svh
1 /// A "b" type item which used a manual do_compare implementation instead of field macros
2 class cl_tb_cmp_b_d_seq_item#(type TIOBJ = cl_tb_seq_item) extends cl_tb_cmp_seq_item_base#(TIOBJ);
3  //-------------------------------------
4  // UVM Macros
5  //-------------------------------------
6  `uvm_object_param_utils_begin(cl_tb_cmp_b_d_seq_item#(TIOBJ))
7  `uvm_field_int(ival, UVM_NOCOMPARE)
8  `uvm_field_object(iobj, UVM_NOCOMPARE)
9  `uvm_field_array_int(ivals, UVM_NOCOMPARE)
10  `uvm_field_array_object(iobjs, UVM_NOCOMPARE)
11  `uvm_object_utils_end
12 
13 
14  //-------------------------------------
15  // Constructor
16  //-------------------------------------
17  function new(string name = "cl_tb_cmp_b_d_seq_item");
18  super.new(name);
19  endfunction
20 
21  //-------------------------------------
22  // Class methods
23  //-------------------------------------
24  extern virtual function bit do_compare(uvm_object rhs, uvm_comparer comparer);
25 
26 endclass
27 
28 function bit cl_tb_cmp_b_d_seq_item::do_compare(uvm_object rhs, uvm_comparer comparer);
29  cl_tb_cmp_seq_item_base#(TIOBJ) that;
30  do_compare = super.do_compare(rhs, comparer);
31  $cast(that, rhs);
32 
33  //Top level ivals
34  do_compare &= comparer.compare_field_int("ival", this.ival, that.ival, $bits(this.ival));
35  if(this.ivals.size() == that.ivals.size()) begin
36  foreach(this.ivals[i]) begin
37  do_compare &= comparer.compare_field_int($sformatf("ivals[%0d]", i), this.ivals[i], that.ivals[i], $bits(this.ival));
38  end
39  end else begin
40  do_compare = 0;
41  end
42 
43  //Compare objects
44  do_compare &= comparer.compare_object("iobj", this.iobj, that.iobj);
45  if(this.iobjs.size() == that.iobjs.size()) begin
46  foreach(this.iobjs[i]) begin
47  do_compare &= comparer.compare_object($sformatf("iobjs[%0d]", i), this.iobjs[i], that.iobjs[i]);
48  end
49  end else begin
50  do_compare &= 0;
51  end
52 endfunction: do_compare
A "b" type item which used a manual do_compare implementation instead of field macros.
A sequence item to be used in cmp-tests extending from cl_scb_test_cmp_base.

Project: SyoSil ApS UVM Scoreboard, Revision: 1.0.3.0

Copyright 2014-2022 SyoSil ApS
All Rights Reserved Worldwide

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
doxygen
Doxygen Version: 1.8.14
Generated with IDV SV Filter Version: 2.6.3
Fri Sep 2 2022 14:40:19
Find a documentation bug? Report bugs to: scoreboard@syosil.com