SyoSil ApS UVM Scoreboard  1.0.3.0
cl_tb_cmp_seq_item_base.svh
1 /// A sequence item to be used in cmp-tests extending from cl_scb_test_cmp_base.
2 /// \param TIOBJ the type of objects that this class should contain
3 /// \param MAX_ARRAY_SIZE The maximum size of arrays in the object
4 class cl_tb_cmp_seq_item_base#(type TIOBJ = cl_tb_seq_item, int unsigned MAX_ARRAY_SIZE = 5) extends uvm_sequence_item;
5  //-------------------------------------
6  // Member variables
7  //-------------------------------------
8  rand int ival;
9  rand int ivals[];
10  rand TIOBJ iobj;
11  rand TIOBJ iobjs[];
12 
13  //-------------------------------------
14  // UVM Macros
15  //-------------------------------------
16  `uvm_object_param_utils(cl_tb_cmp_seq_item_base#(TIOBJ))
17 
18 
19  //-------------------------------------
20  // Constructor
21  //-------------------------------------
22  function new(string name = "cl_tb_cmp_seq_item_base");
23  super.new(name);
24  endfunction: new
25 
26  //-------------------------------------
27  // Constraints
28  //-------------------------------------
29  constraint co_ivals_size {
30  this.ivals.size() >= 1;
31  this.ivals.size() <= MAX_ARRAY_SIZE;
32  }
33 
34  constraint co_iobjs_size {
35  this.iobjs.size() >= 1;
36  this.iobjs.size() <= MAX_ARRAY_SIZE;
37  }
38 
39  //-------------------------------------
40  // Class methods
41  //-------------------------------------
42  extern function void pre_randomize();
44 
45 function void cl_tb_cmp_seq_item_base::pre_randomize();
46  iobj = TIOBJ::type_id::create($sformatf("iobj"));
47  ivals = new[MAX_ARRAY_SIZE];
48  iobjs = new[MAX_ARRAY_SIZE];
49  foreach(iobjs[i]) begin
50  iobjs[i] = TIOBJ::type_id::create($sformatf("iobjs_%0d", i));
51  end
52 endfunction: pre_randomize
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:27
Find a documentation bug? Report bugs to: scoreboard@syosil.com