SyoSil ApS UVM Scoreboard  1.0.3.0
cl_tb_cmp_a_d_seq_item.svh
1 /// An "a" type item which used a manual do_compare implementation instead of field macros
2 class cl_tb_cmp_a_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_a_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_a_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 endclass
26 
27 function bit cl_tb_cmp_a_d_seq_item::do_compare(uvm_object rhs, uvm_comparer comparer);
28  cl_tb_cmp_seq_item_base#(TIOBJ) that;
29  do_compare = super.do_compare(rhs, comparer);
30  $cast(that, rhs);
31 
32  //Top level ivals
33  do_compare &= comparer.compare_field_int("ival", this.ival, that.ival, $bits(this.ival));
34  if(this.ivals.size() == that.ivals.size()) begin
35  foreach(this.ivals[i]) begin
36  do_compare &= comparer.compare_field_int($sformatf("ivals[%0d]", i), this.ivals[i], that.ivals[i], $bits(this.ivals[i]));
37  end
38  end else begin
39  do_compare &= 0;
40  end
41 
42  //Compare objects
43  do_compare &= comparer.compare_object("iobj", this.iobj, that.iobj);
44  if(this.iobjs.size() == that.iobjs.size()) begin
45  foreach(this.iobjs[i]) begin
46  do_compare &= comparer.compare_object($sformatf("iobjs[%0d]", i), this.iobjs[i], that.iobjs[i]);
47  end
48  end else begin
49  do_compare &= 0;
50  end
51 endfunction: do_compare
An "a" 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:12
Find a documentation bug? Report bugs to: scoreboard@syosil.com