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: TLM Port Classes
|
25 |
|
|
//------------------------------------------------------------------------------
|
26 |
|
|
// The following classes define the TLM port classes.
|
27 |
|
|
//------------------------------------------------------------------------------
|
28 |
|
|
|
29 |
|
|
|
30 |
|
|
//------------------------------------------------------------------------------
|
31 |
|
|
//
|
32 |
|
|
// Class: uvm_*_port #(T)
|
33 |
|
|
//
|
34 |
|
|
// These unidirectional ports are instantiated by components that ~require~,
|
35 |
|
|
// or ~use~, the associated interface to convey transactions. A port can
|
36 |
|
|
// be connected to any compatible port, export, or imp port. Unless its
|
37 |
|
|
// ~min_size~ is 0, a port ~must~ be connected to at least one implementation
|
38 |
|
|
// of its associated interface.
|
39 |
|
|
//
|
40 |
|
|
// The asterisk in ~uvm_*_port~ is 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 export. The type T is not restricted
|
61 |
|
|
// to class handles and may be a value type such as int,enum,struct or similar.
|
62 |
|
|
//
|
63 |
|
|
// Ports are connected to interface implementations directly via
|
64 |
|
|
// ports or indirectly via hierarchical connections
|
65 |
|
|
// to and ports.
|
66 |
|
|
//
|
67 |
|
|
//------------------------------------------------------------------------------
|
68 |
|
|
|
69 |
|
|
|
70 |
|
|
// Function: new
|
71 |
|
|
//
|
72 |
|
|
// The ~name~ and ~parent~ are the standard constructor arguments.
|
73 |
|
|
// The ~min_size~ and ~max_size~ specify the minimum and maximum number of
|
74 |
|
|
// interfaces that must have been connected to this port by the end of elaboration.
|
75 |
|
|
//
|
76 |
|
|
//| function new (string name,
|
77 |
|
|
//| uvm_component parent,
|
78 |
|
|
//| int min_size=1,
|
79 |
|
|
//| int max_size=1)
|
80 |
|
|
|
81 |
|
|
class uvm_blocking_put_port #(type T=int)
|
82 |
|
|
extends uvm_port_base #(uvm_tlm_if_base #(T,T));
|
83 |
|
|
`UVM_PORT_COMMON(`UVM_TLM_BLOCKING_PUT_MASK,"uvm_blocking_put_port")
|
84 |
|
|
`UVM_BLOCKING_PUT_IMP (this.m_if, T, t)
|
85 |
|
|
endclass
|
86 |
|
|
|
87 |
|
|
class uvm_nonblocking_put_port #(type T=int)
|
88 |
|
|
extends uvm_port_base #(uvm_tlm_if_base #(T,T));
|
89 |
|
|
`UVM_PORT_COMMON(`UVM_TLM_NONBLOCKING_PUT_MASK,"uvm_nonblocking_put_port")
|
90 |
|
|
`UVM_NONBLOCKING_PUT_IMP (this.m_if, T, t)
|
91 |
|
|
endclass
|
92 |
|
|
|
93 |
|
|
class uvm_put_port #(type T=int)
|
94 |
|
|
extends uvm_port_base #(uvm_tlm_if_base #(T,T));
|
95 |
|
|
`UVM_PORT_COMMON(`UVM_TLM_PUT_MASK,"uvm_put_port")
|
96 |
|
|
`UVM_PUT_IMP (this.m_if, T, t)
|
97 |
|
|
endclass
|
98 |
|
|
|
99 |
|
|
class uvm_blocking_get_port #(type T=int)
|
100 |
|
|
extends uvm_port_base #(uvm_tlm_if_base #(T,T));
|
101 |
|
|
`UVM_PORT_COMMON(`UVM_TLM_BLOCKING_GET_MASK,"uvm_blocking_get_port")
|
102 |
|
|
`UVM_BLOCKING_GET_IMP (this.m_if, T, t)
|
103 |
|
|
endclass
|
104 |
|
|
|
105 |
|
|
class uvm_nonblocking_get_port #(type T=int)
|
106 |
|
|
extends uvm_port_base #(uvm_tlm_if_base #(T,T));
|
107 |
|
|
`UVM_PORT_COMMON(`UVM_TLM_NONBLOCKING_GET_MASK,"uvm_nonblocking_get_port")
|
108 |
|
|
`UVM_NONBLOCKING_GET_IMP (this.m_if, T, t)
|
109 |
|
|
endclass
|
110 |
|
|
|
111 |
|
|
class uvm_get_port #(type T=int)
|
112 |
|
|
extends uvm_port_base #(uvm_tlm_if_base #(T,T));
|
113 |
|
|
`UVM_PORT_COMMON(`UVM_TLM_GET_MASK,"uvm_get_port")
|
114 |
|
|
`UVM_GET_IMP (this.m_if, T, t)
|
115 |
|
|
endclass
|
116 |
|
|
|
117 |
|
|
class uvm_blocking_peek_port #(type T=int)
|
118 |
|
|
extends uvm_port_base #(uvm_tlm_if_base #(T,T));
|
119 |
|
|
`UVM_PORT_COMMON(`UVM_TLM_BLOCKING_PEEK_MASK,"uvm_blocking_peek_port")
|
120 |
|
|
`UVM_BLOCKING_PEEK_IMP (this.m_if, T, t)
|
121 |
|
|
endclass
|
122 |
|
|
|
123 |
|
|
class uvm_nonblocking_peek_port #(type T=int)
|
124 |
|
|
extends uvm_port_base #(uvm_tlm_if_base #(T,T));
|
125 |
|
|
`UVM_PORT_COMMON(`UVM_TLM_NONBLOCKING_PEEK_MASK,"uvm_nonblocking_peek_port")
|
126 |
|
|
`UVM_NONBLOCKING_PEEK_IMP (this.m_if, T, t)
|
127 |
|
|
endclass
|
128 |
|
|
|
129 |
|
|
class uvm_peek_port #(type T=int)
|
130 |
|
|
extends uvm_port_base #(uvm_tlm_if_base #(T,T));
|
131 |
|
|
`UVM_PORT_COMMON(`UVM_TLM_PEEK_MASK,"uvm_peek_port")
|
132 |
|
|
`UVM_PEEK_IMP (this.m_if, T, t)
|
133 |
|
|
endclass
|
134 |
|
|
|
135 |
|
|
class uvm_blocking_get_peek_port #(type T=int)
|
136 |
|
|
extends uvm_port_base #(uvm_tlm_if_base #(T,T));
|
137 |
|
|
`UVM_PORT_COMMON(`UVM_TLM_BLOCKING_GET_PEEK_MASK,"uvm_blocking_get_peek_port")
|
138 |
|
|
`UVM_BLOCKING_GET_PEEK_IMP (this.m_if, T, t)
|
139 |
|
|
endclass
|
140 |
|
|
|
141 |
|
|
class uvm_nonblocking_get_peek_port #(type T=int)
|
142 |
|
|
extends uvm_port_base #(uvm_tlm_if_base #(T,T));
|
143 |
|
|
`UVM_PORT_COMMON(`UVM_TLM_NONBLOCKING_GET_PEEK_MASK,"uvm_nonblocking_get_peek_port")
|
144 |
|
|
`UVM_NONBLOCKING_GET_PEEK_IMP (this.m_if, T, t)
|
145 |
|
|
endclass
|
146 |
|
|
|
147 |
|
|
class uvm_get_peek_port #(type T=int)
|
148 |
|
|
extends uvm_port_base #(uvm_tlm_if_base #(T,T));
|
149 |
|
|
`UVM_PORT_COMMON(`UVM_TLM_GET_PEEK_MASK,"uvm_get_peek_port")
|
150 |
|
|
`UVM_GET_PEEK_IMP (this.m_if, T, t)
|
151 |
|
|
endclass
|
152 |
|
|
|
153 |
|
|
|
154 |
|
|
//------------------------------------------------------------------------------
|
155 |
|
|
//
|
156 |
|
|
// Class: uvm_*_port #(REQ,RSP)
|
157 |
|
|
//
|
158 |
|
|
// These bidirectional ports are instantiated by components that ~require~,
|
159 |
|
|
// or ~use~, the associated interface to convey transactions. A port can
|
160 |
|
|
// be connected to any compatible port, export, or imp port. Unless its
|
161 |
|
|
// ~min_size~ is 0, a port ~must~ be connected to at least one implementation
|
162 |
|
|
// of its associated interface.
|
163 |
|
|
//
|
164 |
|
|
// The asterisk in ~uvm_*_port~ 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 |
|
|
// Ports are connected to interface implementations directly via
|
179 |
|
|
// ports or indirectly via
|
180 |
|
|
// hierarchical connections to and
|
181 |
|
|
// ports.
|
182 |
|
|
//
|
183 |
|
|
// Type parameters
|
184 |
|
|
//
|
185 |
|
|
// REQ - The type of request transaction to be communicated by the export
|
186 |
|
|
//
|
187 |
|
|
// RSP - The type of response transaction to be communicated by the export
|
188 |
|
|
//
|
189 |
|
|
//------------------------------------------------------------------------------
|
190 |
|
|
|
191 |
|
|
// Function: new
|
192 |
|
|
//
|
193 |
|
|
// The ~name~ and ~parent~ are the standard constructor arguments.
|
194 |
|
|
// The ~min_size~ and ~max_size~ specify the minimum and maximum number of
|
195 |
|
|
// interfaces that must have been supplied to this port by the end of elaboration.
|
196 |
|
|
//
|
197 |
|
|
// function new (string name,
|
198 |
|
|
// uvm_component parent,
|
199 |
|
|
// int min_size=1,
|
200 |
|
|
// int max_size=1)
|
201 |
|
|
|
202 |
|
|
|
203 |
|
|
class uvm_blocking_master_port #(type REQ=int, type RSP=REQ)
|
204 |
|
|
extends uvm_port_base #(uvm_tlm_if_base #(REQ, RSP));
|
205 |
|
|
`UVM_PORT_COMMON(`UVM_TLM_BLOCKING_MASTER_MASK,"uvm_blocking_master_port")
|
206 |
|
|
`UVM_BLOCKING_PUT_IMP (this.m_if, REQ, t)
|
207 |
|
|
`UVM_BLOCKING_GET_PEEK_IMP (this.m_if, RSP, t)
|
208 |
|
|
endclass
|
209 |
|
|
|
210 |
|
|
class uvm_nonblocking_master_port #(type REQ=int, type RSP=REQ)
|
211 |
|
|
extends uvm_port_base #(uvm_tlm_if_base #(REQ, RSP));
|
212 |
|
|
`UVM_PORT_COMMON(`UVM_TLM_NONBLOCKING_MASTER_MASK,"uvm_nonblocking_master_port")
|
213 |
|
|
`UVM_NONBLOCKING_PUT_IMP (this.m_if, REQ, t)
|
214 |
|
|
`UVM_NONBLOCKING_GET_PEEK_IMP (this.m_if, RSP, t)
|
215 |
|
|
endclass
|
216 |
|
|
|
217 |
|
|
class uvm_master_port #(type REQ=int, type RSP=REQ)
|
218 |
|
|
extends uvm_port_base #(uvm_tlm_if_base #(REQ, RSP));
|
219 |
|
|
`UVM_PORT_COMMON(`UVM_TLM_MASTER_MASK,"uvm_master_port")
|
220 |
|
|
`UVM_PUT_IMP (this.m_if, REQ, t)
|
221 |
|
|
`UVM_GET_PEEK_IMP (this.m_if, RSP, t)
|
222 |
|
|
endclass
|
223 |
|
|
|
224 |
|
|
class uvm_blocking_slave_port #(type REQ=int, type RSP=REQ)
|
225 |
|
|
extends uvm_port_base #(uvm_tlm_if_base #(RSP, REQ));
|
226 |
|
|
`UVM_PORT_COMMON(`UVM_TLM_BLOCKING_SLAVE_MASK,"uvm_blocking_slave_port")
|
227 |
|
|
`UVM_BLOCKING_PUT_IMP (this.m_if, RSP, t)
|
228 |
|
|
`UVM_BLOCKING_GET_PEEK_IMP (this.m_if, REQ, t)
|
229 |
|
|
endclass
|
230 |
|
|
|
231 |
|
|
class uvm_nonblocking_slave_port #(type REQ=int, type RSP=REQ)
|
232 |
|
|
extends uvm_port_base #(uvm_tlm_if_base #(RSP, REQ));
|
233 |
|
|
`UVM_PORT_COMMON(`UVM_TLM_NONBLOCKING_SLAVE_MASK,"uvm_nonblocking_slave_port")
|
234 |
|
|
`UVM_NONBLOCKING_PUT_IMP (this.m_if, RSP, t)
|
235 |
|
|
`UVM_NONBLOCKING_GET_PEEK_IMP (this.m_if, REQ, t)
|
236 |
|
|
endclass
|
237 |
|
|
|
238 |
|
|
class uvm_slave_port #(type REQ=int, type RSP=REQ)
|
239 |
|
|
extends uvm_port_base #(uvm_tlm_if_base #(RSP, REQ));
|
240 |
|
|
`UVM_PORT_COMMON(`UVM_TLM_SLAVE_MASK,"uvm_slave_port")
|
241 |
|
|
`UVM_PUT_IMP (this.m_if, RSP, t)
|
242 |
|
|
`UVM_GET_PEEK_IMP (this.m_if, REQ, t)
|
243 |
|
|
endclass
|
244 |
|
|
|
245 |
|
|
class uvm_blocking_transport_port #(type REQ=int, type RSP=REQ)
|
246 |
|
|
extends uvm_port_base #(uvm_tlm_if_base #(REQ, RSP));
|
247 |
|
|
`UVM_PORT_COMMON(`UVM_TLM_BLOCKING_TRANSPORT_MASK,"uvm_blocking_transport_port")
|
248 |
|
|
`UVM_BLOCKING_TRANSPORT_IMP (this.m_if, REQ, RSP, req, rsp)
|
249 |
|
|
endclass
|
250 |
|
|
|
251 |
|
|
class uvm_nonblocking_transport_port #(type REQ=int, type RSP=REQ)
|
252 |
|
|
extends uvm_port_base #(uvm_tlm_if_base #(REQ, RSP));
|
253 |
|
|
`UVM_PORT_COMMON(`UVM_TLM_NONBLOCKING_TRANSPORT_MASK,"uvm_nonblocking_transport_port")
|
254 |
|
|
`UVM_NONBLOCKING_TRANSPORT_IMP (this.m_if, REQ, RSP, req, rsp)
|
255 |
|
|
endclass
|
256 |
|
|
|
257 |
|
|
class uvm_transport_port #(type REQ=int, type RSP=REQ)
|
258 |
|
|
extends uvm_port_base #(uvm_tlm_if_base #(REQ, RSP));
|
259 |
|
|
`UVM_PORT_COMMON(`UVM_TLM_TRANSPORT_MASK,"uvm_transport_port")
|
260 |
|
|
`UVM_TRANSPORT_IMP (this.m_if, REQ, RSP, req, rsp)
|
261 |
|
|
endclass
|
262 |
|
|
|