1 |
16 |
HanySalah |
//
|
2 |
|
|
//------------------------------------------------------------------------------
|
3 |
|
|
// Copyright 2007-2011 Mentor Graphics Corporation
|
4 |
|
|
// Copyright 2007-2011 Cadence Design Systems, Inc.
|
5 |
|
|
// Copyright 2010-2011 Synopsys, Inc.
|
6 |
|
|
// Copyright 2013 NVIDIA Corporation
|
7 |
|
|
// All Rights Reserved Worldwide
|
8 |
|
|
//
|
9 |
|
|
// Licensed under the Apache License, Version 2.0 (the
|
10 |
|
|
// "License"); you may not use this file except in
|
11 |
|
|
// compliance with the License. You may obtain a copy of
|
12 |
|
|
// the License at
|
13 |
|
|
//
|
14 |
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
15 |
|
|
//
|
16 |
|
|
// Unless required by applicable law or agreed to in
|
17 |
|
|
// writing, software distributed under the License is
|
18 |
|
|
// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
19 |
|
|
// CONDITIONS OF ANY KIND, either express or implied. See
|
20 |
|
|
// the License for the specific language governing
|
21 |
|
|
// permissions and limitations under the License.
|
22 |
|
|
//------------------------------------------------------------------------------
|
23 |
|
|
|
24 |
|
|
// Class: uvm_set_get_dap_base
|
25 |
|
|
// Provides the 'set' and 'get' interface for Data Access Policies (DAPs)
|
26 |
|
|
//
|
27 |
|
|
// The 'Set/Get' base class simply provides a common interface for
|
28 |
|
|
// the various DAPs to implement. This provides a mechanism for
|
29 |
|
|
// consistent implementations of similar DAPs.
|
30 |
|
|
//
|
31 |
|
|
|
32 |
|
|
virtual class uvm_set_get_dap_base#(type T=int) extends uvm_object;
|
33 |
|
|
|
34 |
|
|
// Used for self references
|
35 |
|
|
typedef uvm_set_get_dap_base#(T) this_type;
|
36 |
|
|
|
37 |
|
|
// Function: new
|
38 |
|
|
// Constructor
|
39 |
|
|
function new(string name="unnamed-uvm_set_get_dap_base#(T)");
|
40 |
|
|
super.new(name);
|
41 |
|
|
endfunction : new
|
42 |
|
|
|
43 |
|
|
// Group: Set/Get Interface
|
44 |
|
|
//
|
45 |
|
|
// All implementations of the ~uvm_set_get_dap_base~ class must
|
46 |
|
|
// provide an implementation of the four basic "Set and Get"
|
47 |
|
|
// accessors.
|
48 |
|
|
//
|
49 |
|
|
|
50 |
|
|
// Function: set
|
51 |
|
|
// Sets the value contained within the resource.
|
52 |
|
|
//
|
53 |
|
|
// Depending on the DAP policies, an error may be reported if
|
54 |
|
|
// it is illegal to 'set' the value at this time.
|
55 |
|
|
pure virtual function void set(T value);
|
56 |
|
|
|
57 |
|
|
// Function: try_set
|
58 |
|
|
// Attempts to set the value contained within the resource.
|
59 |
|
|
//
|
60 |
|
|
// If the DAP policies forbid setting at this time, then
|
61 |
|
|
// the method will return 0, however no errors will be
|
62 |
|
|
// reported. Otherwise, the method will return 1, and
|
63 |
|
|
// will be treated like a standard call.
|
64 |
|
|
pure virtual function bit try_set(T value);
|
65 |
|
|
|
66 |
|
|
// Function: get
|
67 |
|
|
// Retrieves the value contained within the resource.
|
68 |
|
|
//
|
69 |
|
|
// Depending on the DAP policies, an error may be reported
|
70 |
|
|
// if it is illegal to 'get' the value at this time.
|
71 |
|
|
pure virtual function T get();
|
72 |
|
|
|
73 |
|
|
// Function: try_get
|
74 |
|
|
// Attempts to retrieve the value contained within the resource.
|
75 |
|
|
//
|
76 |
|
|
// If the DAP policies forbid retrieving at this time, then
|
77 |
|
|
// the method will return 0, however no errors will be
|
78 |
|
|
// reported. Otherwise, the method will return 1, and will
|
79 |
|
|
// be treated like a standard call.
|
80 |
|
|
pure virtual function bit try_get(output T value);
|
81 |
|
|
|
82 |
|
|
endclass : uvm_set_get_dap_base
|
83 |
|
|
|