PageRenderTime 54ms CodeModel.GetById 40ms app.highlight 3ms RepoModel.GetById 9ms app.codeStats 0ms

/ovm-2.0.1/examples/configuration/automated/my_env_pkg.sv

http://camlet.googlecode.com/
SystemVerilog | 59 lines | 29 code | 10 blank | 20 comment | 0 complexity | 7608184039643c5d02e087d9abac482a MD5 | raw file
Possible License(s): Apache-2.0
 1// $Id: //dvt/vtech/dev/main/ovm/examples/configuration/automated/my_env_pkg.sv#6 $
 2//----------------------------------------------------------------------
 3//   Copyright 2007-2008 Mentor Graphics Corporation
 4//   Copyright 2007-2008 Cadence Design Systems, Inc.
 5//   All Rights Reserved Worldwide
 6//
 7//   Licensed under the Apache License, Version 2.0 (the
 8//   "License"); you may not use this file except in
 9//   compliance with the License.  You may obtain a copy of
10//   the License at
11//
12//       http://www.apache.org/licenses/LICENSE-2.0
13//
14//   Unless required by applicable law or agreed to in
15//   writing, software distributed under the License is
16//   distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
17//   CONDITIONS OF ANY KIND, either express or implied.  See
18//   the License for the specific language governing
19//   permissions and limitations under the License.
20//----------------------------------------------------------------------
21
22package my_env_pkg;
23  import ovm_pkg::*;
24
25  `include "ovm_macros.svh"
26  `include "classA.svh"
27  `include "classB.svh"
28  
29  class my_env extends ovm_env;
30    bit debug = 0;
31    A inst1;
32    B inst2;
33  
34    function new(string name, ovm_component parent);
35      super.new(name, parent);
36    endfunction
37  
38    function void build();
39      super.build();
40      set_config_int("inst1.u2", "v", 5);
41      set_config_int("inst2.u1", "v", 3);
42      set_config_int("inst1.*", "s", 'h10);
43  
44      $display("%s: In Build: debug = %0d", get_full_name(), debug);
45  
46      inst1 = new("inst1", this); inst1.build();
47      inst2 = new("inst2", this); inst2.build();
48    endfunction
49
50    task run;
51      begin end
52    endtask
53  
54    `ovm_component_utils_begin(my_env)
55      `ovm_field_int(debug, OVM_DEFAULT)
56    `ovm_component_utils_end
57  endclass
58  
59endpackage : my_env_pkg