1 |
16 |
HanySalah |
//----------------------------------------------------------------------
|
2 |
|
|
// Copyright 2010 Mentor Graphics Corporation
|
3 |
|
|
// Copyright 2010 Synopsys, Inc.
|
4 |
|
|
// All Rights Reserved Worldwide
|
5 |
|
|
//
|
6 |
|
|
// Licensed under the Apache License, Version 2.0 (the
|
7 |
|
|
// "License"); you may not use this file except in
|
8 |
|
|
// compliance with the License. You may obtain a copy of
|
9 |
|
|
// the License at
|
10 |
|
|
//
|
11 |
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
12 |
|
|
//
|
13 |
|
|
// Unless required by applicable law or agreed to in
|
14 |
|
|
// writing, software distributed under the License is
|
15 |
|
|
// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
16 |
|
|
// CONDITIONS OF ANY KIND, either express or implied. See
|
17 |
|
|
// the License for the specific language governing
|
18 |
|
|
// permissions and limitations under the License.
|
19 |
|
|
//----------------------------------------------------------------------
|
20 |
|
|
|
21 |
|
|
//----------------------------------------------------------------------
|
22 |
|
|
// Title: TLM Socket Base Classes
|
23 |
|
|
//
|
24 |
|
|
// A collection of base classes, one for each socket type. The reason
|
25 |
|
|
// for having a base class for each socket is that all the socket (base)
|
26 |
|
|
// types must be known before connect is defined. Socket connection
|
27 |
|
|
// semantics are provided in the derived classes, which are user
|
28 |
|
|
// visible.
|
29 |
|
|
//
|
30 |
|
|
// Termination Sockets - A termination socket must be the terminus
|
31 |
|
|
// of every TLM path. A transaction originates with an initiator socket
|
32 |
|
|
// and ultimately ends up in a target socket. There may be zero or more
|
33 |
|
|
// pass-through sockets between initiator and target.
|
34 |
|
|
//
|
35 |
|
|
// Pass-through Sockets - Pass-through initiators are ports and contain
|
36 |
|
|
// exports for instance IS-A port and HAS-A export. Pass-through targets
|
37 |
|
|
// are the opposite, they are exports and contain ports.
|
38 |
|
|
//----------------------------------------------------------------------
|
39 |
|
|
|
40 |
|
|
|
41 |
|
|
//----------------------------------------------------------------------
|
42 |
|
|
// Class: uvm_tlm_b_target_socket_base
|
43 |
|
|
//
|
44 |
|
|
// IS-A forward imp; has no backward path except via the payload
|
45 |
|
|
// contents.
|
46 |
|
|
//----------------------------------------------------------------------
|
47 |
|
|
class uvm_tlm_b_target_socket_base #(type T=uvm_tlm_generic_payload)
|
48 |
|
|
extends uvm_port_base #(uvm_tlm_if #(T));
|
49 |
|
|
|
50 |
|
|
function new (string name, uvm_component parent);
|
51 |
|
|
super.new (name, parent, UVM_IMPLEMENTATION, 1, 1);
|
52 |
|
|
m_if_mask = `UVM_TLM_B_MASK;
|
53 |
|
|
endfunction
|
54 |
|
|
|
55 |
|
|
`UVM_TLM_GET_TYPE_NAME("uvm_tlm_b_target_socket")
|
56 |
|
|
|
57 |
|
|
endclass
|
58 |
|
|
|
59 |
|
|
//----------------------------------------------------------------------
|
60 |
|
|
// Class: uvm_tlm_b_initiator_socket_base
|
61 |
|
|
//
|
62 |
|
|
// IS-A forward port; has no backward path except via the payload
|
63 |
|
|
// contents
|
64 |
|
|
//----------------------------------------------------------------------
|
65 |
|
|
class uvm_tlm_b_initiator_socket_base #(type T=uvm_tlm_generic_payload)
|
66 |
|
|
extends uvm_port_base #(uvm_tlm_if #(T));
|
67 |
|
|
|
68 |
|
|
`UVM_PORT_COMMON(`UVM_TLM_B_MASK, "uvm_tlm_b_initiator_socket")
|
69 |
|
|
`UVM_TLM_B_TRANSPORT_IMP(this.m_if, T, t, delay)
|
70 |
|
|
|
71 |
|
|
endclass
|
72 |
|
|
|
73 |
|
|
//----------------------------------------------------------------------
|
74 |
|
|
// Class: uvm_tlm_nb_target_socket_base
|
75 |
|
|
//
|
76 |
|
|
// IS-A forward imp; HAS-A backward port
|
77 |
|
|
//----------------------------------------------------------------------
|
78 |
|
|
class uvm_tlm_nb_target_socket_base #(type T=uvm_tlm_generic_payload,
|
79 |
|
|
type P=uvm_tlm_phase_e)
|
80 |
|
|
extends uvm_port_base #(uvm_tlm_if #(T,P));
|
81 |
|
|
|
82 |
|
|
uvm_tlm_nb_transport_bw_port #(T,P) bw_port;
|
83 |
|
|
|
84 |
|
|
function new (string name, uvm_component parent);
|
85 |
|
|
super.new (name, parent, UVM_IMPLEMENTATION, 1, 1);
|
86 |
|
|
m_if_mask = `UVM_TLM_NB_FW_MASK;
|
87 |
|
|
endfunction
|
88 |
|
|
|
89 |
|
|
`UVM_TLM_GET_TYPE_NAME("uvm_tlm_nb_target_socket")
|
90 |
|
|
|
91 |
|
|
`UVM_TLM_NB_TRANSPORT_BW_IMP(bw_port, T, P, t, p, delay)
|
92 |
|
|
|
93 |
|
|
endclass
|
94 |
|
|
|
95 |
|
|
//----------------------------------------------------------------------
|
96 |
|
|
// Class: uvm_tlm_nb_initiator_socket_base
|
97 |
|
|
//
|
98 |
|
|
// IS-A forward port; HAS-A backward imp
|
99 |
|
|
//----------------------------------------------------------------------
|
100 |
|
|
class uvm_tlm_nb_initiator_socket_base #(type T=uvm_tlm_generic_payload,
|
101 |
|
|
type P=uvm_tlm_phase_e)
|
102 |
|
|
extends uvm_port_base #(uvm_tlm_if #(T,P));
|
103 |
|
|
|
104 |
|
|
function new (string name, uvm_component parent);
|
105 |
|
|
super.new (name, parent, UVM_PORT, 1, 1);
|
106 |
|
|
m_if_mask = `UVM_TLM_NB_FW_MASK;
|
107 |
|
|
endfunction
|
108 |
|
|
|
109 |
|
|
`UVM_TLM_GET_TYPE_NAME("uvm_tlm_nb_initiator_socket")
|
110 |
|
|
|
111 |
|
|
`UVM_TLM_NB_TRANSPORT_FW_IMP(this.m_if, T, P, t, p, delay)
|
112 |
|
|
|
113 |
|
|
endclass
|
114 |
|
|
|
115 |
|
|
|
116 |
|
|
|
117 |
|
|
|
118 |
|
|
//----------------------------------------------------------------------
|
119 |
|
|
// Class: uvm_tlm_nb_passthrough_initiator_socket_base
|
120 |
|
|
//
|
121 |
|
|
// IS-A forward port; HAS-A backward export
|
122 |
|
|
//----------------------------------------------------------------------
|
123 |
|
|
class uvm_tlm_nb_passthrough_initiator_socket_base #(type T=uvm_tlm_generic_payload,
|
124 |
|
|
type P=uvm_tlm_phase_e)
|
125 |
|
|
extends uvm_port_base #(uvm_tlm_if #(T,P));
|
126 |
|
|
|
127 |
|
|
uvm_tlm_nb_transport_bw_export #(T,P) bw_export;
|
128 |
|
|
|
129 |
|
|
function new (string name, uvm_component parent,
|
130 |
|
|
int min_size=1, int max_size=1);
|
131 |
|
|
super.new (name, parent, UVM_PORT, min_size, max_size);
|
132 |
|
|
m_if_mask = `UVM_TLM_NB_FW_MASK;
|
133 |
|
|
bw_export = new("bw_export", get_comp());
|
134 |
|
|
endfunction
|
135 |
|
|
|
136 |
|
|
`UVM_TLM_GET_TYPE_NAME("uvm_tlm_nb_passthrough_initiator_socket")
|
137 |
|
|
|
138 |
|
|
`UVM_TLM_NB_TRANSPORT_FW_IMP(this.m_if, T, P, t, p, delay)
|
139 |
|
|
`UVM_TLM_NB_TRANSPORT_BW_IMP(bw_export, T, P, t, p, delay)
|
140 |
|
|
|
141 |
|
|
endclass
|
142 |
|
|
|
143 |
|
|
//----------------------------------------------------------------------
|
144 |
|
|
// Class: uvm_tlm_nb_passthrough_target_socket_base
|
145 |
|
|
//
|
146 |
|
|
// IS-A forward export; HAS-A backward port
|
147 |
|
|
//----------------------------------------------------------------------
|
148 |
|
|
class uvm_tlm_nb_passthrough_target_socket_base #(type T=uvm_tlm_generic_payload,
|
149 |
|
|
type P=uvm_tlm_phase_e)
|
150 |
|
|
extends uvm_port_base #(uvm_tlm_if #(T,P));
|
151 |
|
|
|
152 |
|
|
uvm_tlm_nb_transport_bw_port #(T,P) bw_port;
|
153 |
|
|
|
154 |
|
|
function new (string name, uvm_component parent,
|
155 |
|
|
int min_size=1, int max_size=1);
|
156 |
|
|
super.new (name, parent, UVM_EXPORT, min_size, max_size);
|
157 |
|
|
m_if_mask = `UVM_TLM_NB_FW_MASK;
|
158 |
|
|
bw_port = new("bw_port", get_comp());
|
159 |
|
|
endfunction
|
160 |
|
|
|
161 |
|
|
`UVM_TLM_GET_TYPE_NAME("uvm_tlm_nb_passthrough_target_socket")
|
162 |
|
|
|
163 |
|
|
`UVM_TLM_NB_TRANSPORT_FW_IMP(this.m_if, T, P, t, p, delay)
|
164 |
|
|
`UVM_TLM_NB_TRANSPORT_BW_IMP(bw_port, T, P, t, p, delay)
|
165 |
|
|
|
166 |
|
|
endclass
|
167 |
|
|
|
168 |
|
|
//----------------------------------------------------------------------
|
169 |
|
|
// Class: uvm_tlm_b_passthrough_initiator_socket_base
|
170 |
|
|
//
|
171 |
|
|
// IS-A forward port
|
172 |
|
|
//----------------------------------------------------------------------
|
173 |
|
|
class uvm_tlm_b_passthrough_initiator_socket_base #(type T=uvm_tlm_generic_payload)
|
174 |
|
|
extends uvm_port_base #(uvm_tlm_if #(T));
|
175 |
|
|
|
176 |
|
|
`UVM_PORT_COMMON(`UVM_TLM_B_MASK, "uvm_tlm_b_passthrough_initiator_socket")
|
177 |
|
|
`UVM_TLM_B_TRANSPORT_IMP(this.m_if, T, t, delay)
|
178 |
|
|
|
179 |
|
|
endclass
|
180 |
|
|
|
181 |
|
|
|
182 |
|
|
//----------------------------------------------------------------------
|
183 |
|
|
// Class: uvm_tlm_b_passthrough_target_socket_base
|
184 |
|
|
//
|
185 |
|
|
// IS-A forward export
|
186 |
|
|
//----------------------------------------------------------------------
|
187 |
|
|
class uvm_tlm_b_passthrough_target_socket_base #(type T=uvm_tlm_generic_payload)
|
188 |
|
|
extends uvm_port_base #(uvm_tlm_if #(T));
|
189 |
|
|
|
190 |
|
|
`UVM_EXPORT_COMMON(`UVM_TLM_B_MASK, "uvm_tlm_b_passthrough_target_socket")
|
191 |
|
|
`UVM_TLM_B_TRANSPORT_IMP(this.m_if, T, t, delay)
|
192 |
|
|
|
193 |
|
|
endclass
|
194 |
|
|
|