1 |
16 |
HanySalah |
//
|
2 |
|
|
//------------------------------------------------------------------------------
|
3 |
|
|
// Copyright 2007-2011 Mentor Graphics Corporation
|
4 |
|
|
// Copyright 2007-2010 Cadence Design Systems, Inc.
|
5 |
|
|
// Copyright 2010 Synopsys, Inc.
|
6 |
|
|
// All Rights Reserved Worldwide
|
7 |
|
|
//
|
8 |
|
|
// Licensed under the Apache License, Version 2.0 (the
|
9 |
|
|
// "License"); you may not use this file except in
|
10 |
|
|
// compliance with the License. You may obtain a copy of
|
11 |
|
|
// the License at
|
12 |
|
|
//
|
13 |
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
14 |
|
|
//
|
15 |
|
|
// Unless required by applicable law or agreed to in
|
16 |
|
|
// writing, software distributed under the License is
|
17 |
|
|
// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
18 |
|
|
// CONDITIONS OF ANY KIND, either express or implied. See
|
19 |
|
|
// the License for the specific language governing
|
20 |
|
|
// permissions and limitations under the License.
|
21 |
|
|
//------------------------------------------------------------------------------
|
22 |
|
|
|
23 |
|
|
//------------------------------------------------------------------------------
|
24 |
|
|
//
|
25 |
|
|
// CLASS: uvm_test
|
26 |
|
|
//
|
27 |
|
|
// This class is the virtual base class for the user-defined tests.
|
28 |
|
|
//
|
29 |
|
|
// The uvm_test virtual class should be used as the base class for user-defined
|
30 |
|
|
// tests. Doing so provides the ability to select which test to execute using
|
31 |
|
|
// the UVM_TESTNAME command line or argument to the task.
|
32 |
|
|
//
|
33 |
|
|
// For example
|
34 |
|
|
//
|
35 |
|
|
//| prompt> SIM_COMMAND +UVM_TESTNAME=test_bus_retry
|
36 |
|
|
//
|
37 |
|
|
// The global run_test() task should be specified inside an initial block
|
38 |
|
|
// such as
|
39 |
|
|
//
|
40 |
|
|
//| initial run_test();
|
41 |
|
|
//
|
42 |
|
|
// Multiple tests, identified by their type name, are compiled in and then
|
43 |
|
|
// selected for execution from the command line without need for recompilation.
|
44 |
|
|
// Random seed selection is also available on the command line.
|
45 |
|
|
//
|
46 |
|
|
// If +UVM_TESTNAME=test_name is specified, then an object of type 'test_name'
|
47 |
|
|
// is created by factory and phasing begins. Here, it is presumed that the
|
48 |
|
|
// test will instantiate the test environment, or the test environment will
|
49 |
|
|
// have already been instantiated before the call to run_test().
|
50 |
|
|
//
|
51 |
|
|
// If the specified test_name cannot be created by the , then a
|
52 |
|
|
// fatal error occurs. If run_test() is called without UVM_TESTNAME being
|
53 |
|
|
// specified, then all components constructed before the call to run_test will
|
54 |
|
|
// be cycled through their simulation phases.
|
55 |
|
|
//
|
56 |
|
|
// Deriving from uvm_test will allow you to distinguish tests from other
|
57 |
|
|
// component types that inherit from uvm_component directly. Such tests will
|
58 |
|
|
// automatically inherit features that may be added to uvm_test in the future.
|
59 |
|
|
//
|
60 |
|
|
//------------------------------------------------------------------------------
|
61 |
|
|
|
62 |
|
|
virtual class uvm_test extends uvm_component;
|
63 |
|
|
|
64 |
|
|
// Function: new
|
65 |
|
|
//
|
66 |
|
|
// Creates and initializes an instance of this class using the normal
|
67 |
|
|
// constructor arguments for : ~name~ is the name of the
|
68 |
|
|
// instance, and ~parent~ is the handle to the hierarchical parent, if any.
|
69 |
|
|
|
70 |
|
|
function new (string name, uvm_component parent);
|
71 |
|
|
super.new(name,parent);
|
72 |
|
|
endfunction
|
73 |
|
|
|
74 |
|
|
const static string type_name = "uvm_test";
|
75 |
|
|
|
76 |
|
|
virtual function string get_type_name ();
|
77 |
|
|
return type_name;
|
78 |
|
|
endfunction
|
79 |
|
|
|
80 |
|
|
endclass
|
81 |
|
|
|