OpenCores
URL https://opencores.org/ocsvn/uart2bus_testbench/uart2bus_testbench/trunk

Subversion Repositories uart2bus_testbench

[/] [uart2bus_testbench/] [trunk/] [tb/] [uvm_src/] [tlm1/] [uvm_imps.svh] - Blame information for rev 16

Details | Compare with Previous | View Log

Line No. Rev Author Line
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
// Title: uvm_*_imp ports
25
//
26
// The following defines the TLM implementation (imp) classes.
27
//------------------------------------------------------------------------------
28
 
29
 
30
//------------------------------------------------------------------------------
31
//
32
// CLASS: uvm_*_imp #(T,IMP)
33
//
34
// Unidirectional implementation (imp) port classes--An imp port provides access
35
// to an implementation of the associated interface to all connected ~ports~ and
36
// ~exports~. Each imp port instance ~must~ be connected to the component instance
37
// that implements the associated interface, typically the imp port's parent.
38
// All other connections-- e.g. to other ports and exports-- are prohibited.
39
//
40
// The asterisk in ~uvm_*_imp~ may be any of the following
41
//
42
//|  blocking_put
43
//|  nonblocking_put
44
//|  put
45
//|
46
//|  blocking_get
47
//|  nonblocking_get
48
//|  get
49
//|
50
//|  blocking_peek
51
//|  nonblocking_peek
52
//|  peek
53
//|
54
//|  blocking_get_peek
55
//|  nonblocking_get_peek
56
//|  get_peek
57
//
58
// Type parameters
59
//
60
// T   - The type of transaction to be communicated by the imp
61
//
62
// IMP - The type of the component implementing the interface. That is, the class
63
//       to which this imp will delegate.
64
//
65
// The interface methods are implemented in a component of type ~IMP~, a handle
66
// to which is passed in a constructor argument.  The imp port delegates all
67
// interface calls to this component.
68
//
69
//------------------------------------------------------------------------------
70
 
71
 
72
// Function: new
73
//
74
// Creates a new unidirectional imp port with the given ~name~ and ~parent~.
75
// The ~parent~ must implement the interface associated with this port.
76
// Its type must be the type specified in the imp's type-parameter, ~IMP~.
77
//
78
//|  function new (string name, IMP parent);
79
 
80
 
81
 
82
class uvm_blocking_put_imp #(type T=int, type IMP=int)
83
  extends uvm_port_base #(uvm_tlm_if_base #(T,T));
84
  `UVM_IMP_COMMON(`UVM_TLM_BLOCKING_PUT_MASK,"uvm_blocking_put_imp",IMP)
85
  `UVM_BLOCKING_PUT_IMP (m_imp, T, t)
86
endclass
87
 
88
class uvm_nonblocking_put_imp #(type T=int, type IMP=int)
89
  extends uvm_port_base #(uvm_tlm_if_base #(T,T));
90
  `UVM_IMP_COMMON(`UVM_TLM_NONBLOCKING_PUT_MASK,"uvm_nonblocking_put_imp",IMP)
91
  `UVM_NONBLOCKING_PUT_IMP (m_imp, T, t)
92
endclass
93
 
94
class uvm_put_imp #(type T=int, type IMP=int)
95
  extends uvm_port_base #(uvm_tlm_if_base #(T,T));
96
  `UVM_IMP_COMMON(`UVM_TLM_PUT_MASK,"uvm_put_imp",IMP)
97
  `UVM_PUT_IMP (m_imp, T, t)
98
endclass
99
 
100
class uvm_blocking_get_imp #(type T=int, type IMP=int)
101
  extends uvm_port_base #(uvm_tlm_if_base #(T,T));
102
  `UVM_IMP_COMMON(`UVM_TLM_BLOCKING_GET_MASK,"uvm_blocking_get_imp",IMP)
103
  `UVM_BLOCKING_GET_IMP (m_imp, T, t)
104
endclass
105
 
106
class uvm_nonblocking_get_imp #(type T=int, type IMP=int)
107
  extends uvm_port_base #(uvm_tlm_if_base #(T,T));
108
  `UVM_IMP_COMMON(`UVM_TLM_NONBLOCKING_GET_MASK,"uvm_nonblocking_get_imp",IMP)
109
  `UVM_NONBLOCKING_GET_IMP (m_imp, T, t)
110
endclass
111
 
112
class uvm_get_imp #(type T=int, type IMP=int)
113
  extends uvm_port_base #(uvm_tlm_if_base #(T,T));
114
  `UVM_IMP_COMMON(`UVM_TLM_GET_MASK,"uvm_get_imp",IMP)
115
  `UVM_GET_IMP (m_imp, T, t)
116
endclass
117
 
118
class uvm_blocking_peek_imp #(type T=int, type IMP=int)
119
  extends uvm_port_base #(uvm_tlm_if_base #(T,T));
120
  `UVM_IMP_COMMON(`UVM_TLM_BLOCKING_PEEK_MASK,"uvm_blocking_peek_imp",IMP)
121
  `UVM_BLOCKING_PEEK_IMP (m_imp, T, t)
122
endclass
123
 
124
class uvm_nonblocking_peek_imp #(type T=int, type IMP=int)
125
  extends uvm_port_base #(uvm_tlm_if_base #(T,T));
126
  `UVM_IMP_COMMON(`UVM_TLM_NONBLOCKING_PEEK_MASK,"uvm_nonblocking_peek_imp",IMP)
127
  `UVM_NONBLOCKING_PEEK_IMP (m_imp, T, t)
128
endclass
129
 
130
class uvm_peek_imp #(type T=int, type IMP=int)
131
  extends uvm_port_base #(uvm_tlm_if_base #(T,T));
132
  `UVM_IMP_COMMON(`UVM_TLM_PEEK_MASK,"uvm_peek_imp",IMP)
133
  `UVM_PEEK_IMP (m_imp, T, t)
134
endclass
135
 
136
class uvm_blocking_get_peek_imp #(type T=int, type IMP=int)
137
  extends uvm_port_base #(uvm_tlm_if_base #(T,T));
138
  `UVM_IMP_COMMON(`UVM_TLM_BLOCKING_GET_PEEK_MASK,"uvm_blocking_get_peek_imp",IMP)
139
  `UVM_BLOCKING_GET_PEEK_IMP (m_imp, T, t)
140
endclass
141
 
142
class uvm_nonblocking_get_peek_imp #(type T=int, type IMP=int)
143
  extends uvm_port_base #(uvm_tlm_if_base #(T,T));
144
  `UVM_IMP_COMMON(`UVM_TLM_NONBLOCKING_GET_PEEK_MASK,"uvm_nonblocking_get_peek_imp",IMP)
145
  `UVM_NONBLOCKING_GET_PEEK_IMP (m_imp, T, t)
146
endclass
147
 
148
class uvm_get_peek_imp #(type T=int, type IMP=int)
149
  extends uvm_port_base #(uvm_tlm_if_base #(T,T));
150
  `UVM_IMP_COMMON(`UVM_TLM_GET_PEEK_MASK,"uvm_get_peek_imp",IMP)
151
  `UVM_GET_PEEK_IMP (m_imp, T, t)
152
endclass
153
 
154
//------------------------------------------------------------------------------
155
//
156
// CLASS: uvm_*_imp #(REQ, RSP, IMP, REQ_IMP, RSP_IMP)
157
//
158
// Bidirectional implementation (imp) port classes--An imp port provides access
159
// to an implementation of the associated interface to all connected ~ports~ and
160
// ~exports~. Each imp port instance ~must~ be connected to the component instance
161
// that implements the associated interface, typically the imp port's parent.
162
// All other connections-- e.g. to other ports and exports-- are prohibited.
163
//
164
// The interface represented by the asterisk is any of the following
165
//
166
//|  blocking_transport
167
//|  nonblocking_transport
168
//|  transport
169
//|
170
//|  blocking_master
171
//|  nonblocking_master
172
//|  master
173
//|
174
//|  blocking_slave
175
//|  nonblocking_slave
176
//|  slave
177
//
178
// Type parameters
179
//
180
// REQ  - Request transaction type
181
//
182
// RSP  - Response transaction type
183
//
184
// IMP  - Component type that implements the interface methods, typically the
185
//        the parent of this imp port.
186
//
187
// REQ_IMP - Component type that implements the request side of the
188
//           interface. Defaults to IMP. For master and slave imps only.
189
//
190
// RSP_IMP - Component type that implements the response side of the
191
//           interface. Defaults to IMP. For master and slave imps only.
192
//
193
// The interface methods are implemented in a component of type ~IMP~, a handle
194
// to which is passed in a constructor argument.  The imp port delegates all
195
// interface calls to this component.
196
//
197
// The master and slave imps have two modes of operation.
198
//
199
// - A single component of type IMP implements the entire interface for
200
//   both requests and responses.
201
//
202
// - Two sibling components of type REQ_IMP and RSP_IMP implement the request
203
//   and response interfaces, respectively.  In this case, the IMP parent
204
//   instantiates this imp port ~and~ the REQ_IMP and RSP_IMP components.
205
//
206
// The second mode is needed when a component instantiates more than one imp
207
// port, as in the  channel.
208
//
209
//------------------------------------------------------------------------------
210
 
211
 
212
// Function: new
213
//
214
// Creates a new bidirectional imp port with the given ~name~ and ~parent~.
215
// The ~parent~, whose type is specified by ~IMP~ type parameter,
216
// must implement the interface associated with this port.
217
//
218
// Transport imp constructor
219
//
220
//|  function new(string name, IMP imp)
221
//
222
// Master and slave imp constructor
223
//
224
// The optional ~req_imp~ and ~rsp_imp~ arguments, available to master and
225
// slave imp ports, allow the requests and responses to be handled by different
226
// subcomponents. If they are specified, they must point to the underlying
227
// component that implements the request and response methods, respectively.
228
//
229
//|  function new(string name, IMP imp,
230
//|                            REQ_IMP req_imp=imp, RSP_IMP rsp_imp=imp)
231
 
232
class uvm_blocking_master_imp #(type REQ=int, type RSP=REQ, type IMP=int,
233
                                type REQ_IMP=IMP, type RSP_IMP=IMP)
234
  extends uvm_port_base #(uvm_tlm_if_base #(REQ, RSP));
235
  typedef IMP     this_imp_type;
236
  typedef REQ_IMP this_req_type;
237
  typedef RSP_IMP this_rsp_type;
238
  `UVM_MS_IMP_COMMON(`UVM_TLM_BLOCKING_MASTER_MASK,"uvm_blocking_master_imp")
239
  `UVM_BLOCKING_PUT_IMP (m_req_imp, REQ, t)
240
  `UVM_BLOCKING_GET_PEEK_IMP (m_rsp_imp, RSP, t)
241
endclass
242
 
243
class uvm_nonblocking_master_imp #(type REQ=int, type RSP=REQ, type IMP=int,
244
                                   type REQ_IMP=IMP, type RSP_IMP=IMP)
245
  extends uvm_port_base #(uvm_tlm_if_base #(REQ, RSP));
246
  typedef IMP     this_imp_type;
247
  typedef REQ_IMP this_req_type;
248
  typedef RSP_IMP this_rsp_type;
249
  `UVM_MS_IMP_COMMON(`UVM_TLM_NONBLOCKING_MASTER_MASK,"uvm_nonblocking_master_imp")
250
  `UVM_NONBLOCKING_PUT_IMP (m_req_imp, REQ, t)
251
  `UVM_NONBLOCKING_GET_PEEK_IMP (m_rsp_imp, RSP, t)
252
endclass
253
 
254
class uvm_master_imp #(type REQ=int, type RSP=REQ, type IMP=int,
255
                       type REQ_IMP=IMP, type RSP_IMP=IMP)
256
  extends uvm_port_base #(uvm_tlm_if_base #(REQ, RSP));
257
  typedef IMP     this_imp_type;
258
  typedef REQ_IMP this_req_type;
259
  typedef RSP_IMP this_rsp_type;
260
  `UVM_MS_IMP_COMMON(`UVM_TLM_MASTER_MASK,"uvm_master_imp")
261
  `UVM_PUT_IMP (m_req_imp, REQ, t)
262
  `UVM_GET_PEEK_IMP (m_rsp_imp, RSP, t)
263
endclass
264
 
265
class uvm_blocking_slave_imp #(type REQ=int, type RSP=REQ, type IMP=int,
266
                               type REQ_IMP=IMP, type RSP_IMP=IMP)
267
  extends uvm_port_base #(uvm_tlm_if_base #(RSP, REQ));
268
  typedef IMP     this_imp_type;
269
  typedef REQ_IMP this_req_type;
270
  typedef RSP_IMP this_rsp_type;
271
  `UVM_MS_IMP_COMMON(`UVM_TLM_BLOCKING_SLAVE_MASK,"uvm_blocking_slave_imp")
272
  `UVM_BLOCKING_PUT_IMP (m_rsp_imp, RSP, t)
273
  `UVM_BLOCKING_GET_PEEK_IMP (m_req_imp, REQ, t)
274
endclass
275
 
276
class uvm_nonblocking_slave_imp #(type REQ=int, type RSP=REQ, type IMP=int,
277
                                  type REQ_IMP=IMP, type RSP_IMP=IMP)
278
  extends uvm_port_base #(uvm_tlm_if_base #(RSP, REQ));
279
  typedef IMP     this_imp_type;
280
  typedef REQ_IMP this_req_type;
281
  typedef RSP_IMP this_rsp_type;
282
  `UVM_MS_IMP_COMMON(`UVM_TLM_NONBLOCKING_SLAVE_MASK,"uvm_nonblocking_slave_imp")
283
  `UVM_NONBLOCKING_PUT_IMP (m_rsp_imp, RSP, t)
284
  `UVM_NONBLOCKING_GET_PEEK_IMP (m_req_imp, REQ, t)
285
endclass
286
 
287
class uvm_slave_imp #(type REQ=int, type RSP=REQ, type IMP=int,
288
                      type REQ_IMP=IMP, type RSP_IMP=IMP)
289
  extends uvm_port_base #(uvm_tlm_if_base #(RSP, REQ));
290
  typedef IMP     this_imp_type;
291
  typedef REQ_IMP this_req_type;
292
  typedef RSP_IMP this_rsp_type;
293
  `UVM_MS_IMP_COMMON(`UVM_TLM_SLAVE_MASK,"uvm_slave_imp")
294
  `UVM_PUT_IMP (m_rsp_imp, RSP, t)
295
  `UVM_GET_PEEK_IMP (m_req_imp, REQ, t)
296
endclass
297
 
298
class uvm_blocking_transport_imp #(type REQ=int, type RSP=REQ, type IMP=int)
299
  extends uvm_port_base #(uvm_tlm_if_base #(REQ, RSP));
300
  `UVM_IMP_COMMON(`UVM_TLM_BLOCKING_TRANSPORT_MASK,"uvm_blocking_transport_imp",IMP)
301
  `UVM_BLOCKING_TRANSPORT_IMP (m_imp, REQ, RSP, req, rsp)
302
endclass
303
 
304
class uvm_nonblocking_transport_imp #(type REQ=int, type RSP=REQ, type IMP=int)
305
  extends uvm_port_base #(uvm_tlm_if_base #(REQ, RSP));
306
  `UVM_IMP_COMMON(`UVM_TLM_NONBLOCKING_TRANSPORT_MASK,"uvm_nonblocking_transport_imp",IMP)
307
  `UVM_NONBLOCKING_TRANSPORT_IMP (m_imp, REQ, RSP, req, rsp)
308
endclass
309
 
310
class uvm_transport_imp #(type REQ=int, type RSP=REQ, type IMP=int)
311
  extends uvm_port_base #(uvm_tlm_if_base #(REQ, RSP));
312
  `UVM_IMP_COMMON(`UVM_TLM_TRANSPORT_MASK,"uvm_transport_imp",IMP)
313
  `UVM_BLOCKING_TRANSPORT_IMP (m_imp, REQ, RSP, req, rsp)
314
  `UVM_NONBLOCKING_TRANSPORT_IMP (m_imp, REQ, RSP, req, rsp)
315
endclass
316
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.