Skip to content

Commit 85d89c1

Browse files
library/vip/amd: Updated ADI agent function calls to fix a null-object access
Signed-off-by: Istvan-Zsolt Szekely <[email protected]>
1 parent bf9ae58 commit 85d89c1

File tree

2 files changed

+24
-14
lines changed

2 files changed

+24
-14
lines changed

library/vip/amd/axi/adi_axi_agent.sv

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,42 +70,36 @@ package adi_axi_agent_pkg;
7070
if (agent_type == SLAVE) begin
7171
this.fatal($sformatf("Agent is in slave mode!"));
7272
end
73-
this.monitor.start();
7473
endtask: start_master
7574

7675
virtual task start_slave();
7776
if (agent_type == MASTER) begin
7877
this.fatal($sformatf("Agent is in master mode!"));
7978
end
80-
this.monitor.start();
8179
endtask: start_slave
8280

8381
virtual task start_monitor();
8482
if (agent_type != PASSTHROUGH) begin
8583
this.fatal($sformatf("Agent is not in passthrough mode!"));
8684
end
87-
this.monitor.start();
8885
endtask: start_monitor
8986

9087
virtual task stop_master();
9188
if (agent_type == SLAVE) begin
9289
this.fatal($sformatf("Agent is in slave mode!"));
9390
end
94-
this.monitor.stop();
9591
endtask: stop_master
9692

9793
virtual task stop_slave();
9894
if (agent_type == MASTER) begin
9995
this.fatal($sformatf("Agent is in master mode!"));
10096
end
101-
this.monitor.stop();
10297
endtask: stop_slave
10398

10499
virtual task stop_monitor();
105100
if (agent_type != PASSTHROUGH) begin
106101
this.fatal($sformatf("Agent is not in passthrough mode!"));
107102
end
108-
this.monitor.stop();
109103
endtask: stop_monitor
110104

111105
endclass: adi_axi_agent_base
@@ -142,11 +136,13 @@ package adi_axi_agent_pkg;
142136
virtual task start_master();
143137
super.start_master();
144138
this.agent.start_master();
139+
this.monitor.start();
145140
endtask: start_master
146141

147142
virtual task stop_master();
148143
super.stop_master();
149144
this.agent.stop_master();
145+
this.monitor.stop();
150146
endtask: stop_master
151147

152148
endclass: adi_axi_master_agent
@@ -183,11 +179,13 @@ package adi_axi_agent_pkg;
183179
virtual task start_slave();
184180
super.start_slave();
185181
this.agent.start_slave();
182+
this.monitor.start();
186183
endtask: start_slave
187184

188185
virtual task stop_slave();
189186
super.stop_slave();
190187
this.agent.stop_slave();
188+
this.monitor.stop();
191189
endtask: stop_slave
192190

193191
endclass: adi_axi_slave_mem_agent
@@ -227,31 +225,37 @@ package adi_axi_agent_pkg;
227225
virtual task start_master();
228226
super.start_master();
229227
this.agent.start_master();
228+
this.monitor.start();
230229
endtask: start_master
231230

232231
virtual task start_slave();
233232
super.start_slave();
234233
this.agent.start_slave();
234+
this.monitor.start();
235235
endtask: start_slave
236236

237237
virtual task start_monitor();
238238
super.start_monitor();
239239
this.agent.start_monitor();
240+
this.monitor.start();
240241
endtask: start_monitor
241242

242243
virtual task stop_master();
243244
super.stop_master();
244245
this.agent.stop_master();
246+
this.monitor.stop();
245247
endtask: stop_master
246248

247249
virtual task stop_slave();
248250
super.stop_slave();
249251
this.agent.stop_slave();
252+
this.monitor.stop();
250253
endtask: stop_slave
251254

252255
virtual task stop_monitor();
253256
super.stop_monitor();
254257
this.agent.stop_monitor();
258+
this.monitor.stop();
255259
endtask: stop_monitor
256260

257261
endclass: adi_axi_passthrough_mem_agent

library/vip/amd/axis/adi_axis_agent.sv

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,44 +70,36 @@ package adi_axis_agent_pkg;
7070
if (agent_type == SLAVE) begin
7171
this.fatal($sformatf("Agent is in slave mode!"));
7272
end
73-
this.monitor.start();
7473
endtask: start_master
7574

7675
virtual task start_slave();
7776
if (agent_type == MASTER) begin
7877
this.fatal($sformatf("Agent is in master mode!"));
7978
end
80-
this.monitor.start();
8179
endtask: start_slave
8280

8381
virtual task start_monitor();
8482
if (agent_type != PASSTHROUGH) begin
8583
this.fatal($sformatf("Agent is not in passthrough mode!"));
8684
end
87-
this.monitor.start();
8885
endtask: start_monitor
8986

9087
virtual task stop_master();
9188
if (agent_type == SLAVE) begin
9289
this.fatal($sformatf("Agent is in slave mode!"));
9390
end
94-
this.master_sequencer.stop();
95-
this.monitor.stop();
9691
endtask: stop_master
9792

9893
virtual task stop_slave();
9994
if (agent_type == MASTER) begin
10095
this.fatal($sformatf("Agent is in master mode!"));
10196
end
102-
this.slave_sequencer.stop();
103-
this.monitor.stop();
10497
endtask: stop_slave
10598

10699
virtual task stop_monitor();
107100
if (agent_type != PASSTHROUGH) begin
108101
this.fatal($sformatf("Agent is not in passthrough mode!"));
109102
end
110-
this.monitor.stop();
111103
endtask: stop_monitor
112104

113105
endclass: adi_axis_agent_base
@@ -144,11 +136,14 @@ package adi_axis_agent_pkg;
144136
virtual task start_master();
145137
super.start_master();
146138
this.agent.start_master();
139+
this.monitor.start();
147140
endtask: start_master
148141

149142
virtual task stop_master();
150143
super.stop_master();
151144
this.agent.stop_master();
145+
this.master_sequencer.stop();
146+
this.monitor.stop();
152147
endtask: stop_master
153148

154149
endclass: adi_axis_master_agent
@@ -185,11 +180,14 @@ package adi_axis_agent_pkg;
185180
virtual task start_slave();
186181
super.start_slave();
187182
this.agent.start_slave();
183+
this.monitor.start();
188184
endtask: start_slave
189185

190186
virtual task stop_slave();
191187
super.stop_slave();
192188
this.agent.stop_slave();
189+
this.slave_sequencer.stop();
190+
this.monitor.stop();
193191
endtask: stop_slave
194192

195193
endclass: adi_axis_slave_agent
@@ -229,33 +227,41 @@ package adi_axis_agent_pkg;
229227
virtual task start_master();
230228
super.start_master();
231229
this.agent.start_master();
230+
this.monitor.start();
232231
this.warning($sformatf("Sequencer must be started manually!"));
233232
endtask: start_master
234233

235234
virtual task start_slave();
236235
super.start_slave();
237236
this.agent.start_slave();
237+
this.monitor.start();
238238
this.warning($sformatf("Sequencer must be started manually!"));
239239
endtask: start_slave
240240

241241
virtual task start_monitor();
242242
super.start_monitor();
243243
this.agent.start_monitor();
244+
this.monitor.start();
244245
endtask: start_monitor
245246

246247
virtual task stop_master();
247248
super.stop_master();
248249
this.agent.stop_master();
250+
this.master_sequencer.stop();
251+
this.monitor.stop();
249252
endtask: stop_master
250253

251254
virtual task stop_slave();
252255
super.stop_slave();
253256
this.agent.stop_slave();
257+
this.slave_sequencer.stop();
258+
this.monitor.stop();
254259
endtask: stop_slave
255260

256261
virtual task stop_monitor();
257262
super.stop_monitor();
258263
this.agent.stop_monitor();
264+
this.monitor.stop();
259265
endtask: stop_monitor
260266

261267
endclass: adi_axis_passthrough_mem_agent

0 commit comments

Comments
 (0)