AXI muckbucket
axi_if_abstract.svh
Go to the documentation of this file.
1 //
3 // Copyright (C) 2017, Matt Dew @ Dew Technologies, LLC
4 //
5 // This program is free software (logic verification): you can redistribute it
6 // and/or modify it under the terms of the GNU Lesser General Public License (LGPL)
7 // as published by the Free Software Foundation, either version 3 of the License,
8 // or (at your option) any later version.
9 //
10 // This program is distributed in the hope that it will be useful, but WITHOUT
11 // ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY or
12 // FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
13 // for more details.
14 //
15 // License: LGPL, v3, as defined and found on www.gnu.org,
16 // http://www.gnu.org/licenses/lgpl.html
17 //
18 //
19 // Author's intent: If you use this AXI verification code and find or fix bugs
20 // or make improvements, then share those fixes or improvements.
21 // If you use this in a bigger project, I don't care about,
22 // or want, any changes or code outside this block.
23 // Example: If you use this in an SoC simulation/testbench
24 // I don't want, or care about, your SoC or other blocks.
25 // I just care about the enhancements to these AXI files.
26 // That's why I have choosen the LGPL instead of the GPL.
29 
37 class axi_if_abstract : public uvm_object { public:
39 
40  new (string name="axi_if_abstract");
41 
42  virtual int get_data_bus_width();
43 
44  virtual task wait_for_clks(int cnt=1);
45  virtual task wait_for_not_in_reset();
46 
47  virtual task wait_for_awready_awvalid();
48  virtual task wait_for_awvalid();
49  virtual task wait_for_wready();
50  virtual task wait_for_bvalid();
51 
52  virtual task wait_for_write_address (output axi_seq_item_aw_vector_s s);
53  virtual task wait_for_write_data (output axi_seq_item_w_vector_s s);
54  virtual task wait_for_write_response (output axi_seq_item_b_vector_s s);
55  virtual task wait_for_read_address (output axi_seq_item_ar_vector_s s);
56  virtual task wait_for_read_data (output axi_seq_item_r_vector_s s);
57 
58  virtual bit get_awready_awvalid();
59  virtual bit get_awready();
60  virtual bit get_wready_wvalid();
61  virtual bit get_wvalid();
62  virtual bit get_wready();
63  virtual bit get_bready_bvalid();
64  virtual bit get_bvalid();
65  virtual bit get_bready();
66  virtual bit get_arready_arvalid();
67  virtual bit get_arready();
68  virtual bit get_rready_rvalid();
69  virtual bit get_rvalid();
70  virtual bit get_rready();
71 
72  virtual task set_awvalid(bit state);
73  virtual task set_awready(bit state);
74  virtual task set_wvalid(bit state);
75  virtual task set_wready(bit state);
76  virtual task set_bvalid(bit state);
77  virtual task set_bready(bit state);
78  virtual task set_arvalid(bit state);
79  virtual task set_rvalid(bit state);
80  virtual task set_rready(bit state);
81 
82 
83  virtual void enable_awready_toggle_pattern(bit <31:0> pattern);
84  virtual void disable_awready_toggle_pattern();
85  virtual void enable_wready_toggle_pattern( bit <31:0> pattern);
86  virtual void disable_wready_toggle_pattern();
87  virtual void enable_bready_toggle_pattern( bit <31:0> pattern);
88  virtual void disable_bready_toggle_pattern();
89  virtual void enable_arready_toggle_pattern(bit <31:0> pattern);
90  virtual void disable_arready_toggle_pattern();
91  virtual void enable_rready_toggle_pattern( bit <31:0> pattern);
92  virtual void disable_rready_toggle_pattern();
93 
94  virtual void write_aw(axi_seq_item_aw_vector_s s, bit valid=0b1);
95  virtual void write_w (axi_seq_item_w_vector_s s);
96  virtual void write_b (axi_seq_item_b_vector_s s, bit valid=0b1);
97  virtual void read_aw (output axi_seq_item_aw_vector_s s);
98  virtual void read_w (output axi_seq_item_w_vector_s s);
99  virtual void read_b (output axi_seq_item_b_vector_s s);
100 
101 
102  virtual void write_ar(axi_seq_item_ar_vector_s s, bit valid=0b1);
103  virtual void write_r (axi_seq_item_r_vector_s s);
104  virtual void read_ar (output axi_seq_item_ar_vector_s s);
105  virtual void read_r (output axi_seq_item_r_vector_s s);
106 
107 
108 };
109 
110  axi_if_abstract::new (string name="axi_if_abstract") {
111  super.new(name);
112 }
113 
115 
118  uvm_error(this.get_type_name(),
119  "WARNING. Virtual function get_data_bus_width() not defined.")
120  return -1;
121 }
122 
124 
128  uvm_error(this.get_type_name(),
129  "WARNING. Virtual task wait_for_clks() not defined.")
130 }
131 
134  uvm_error(this.get_type_name(),
135  "WARNING. Virtual task wait_for_not_in_reset() not defined.")
136 }
137 
139 
142  uvm_error(this.get_type_name(),
143  "WARNING. Virtual task wait_for_awready_awvalid() not defined.")
144 }
145 
147 
150  uvm_error(this.get_type_name(),
151  "WARNING. Virtual task wait_for_awvalid() not defined.")
152 }
153 
155 
158  uvm_error(this.get_type_name(),
159  "WARNING. Virtual task wait_for_wready() not defined.")
160 }
161 
163 
166  uvm_error(this.get_type_name(),
167  "WARNING. Virtual task wait_for_bvalid() not defined.")
168 }
169 
171 
175  uvm_error(this.get_type_name(),
176  "WARNING. Virtual task wait_for_write_address() not defined.")
177 }
178 
180 
184  uvm_error(this.get_type_name(),
185  "WARNING. Virtual task wait_for_write_data() not defined.")
186 }
187 
189 
193  uvm_error(this.get_type_name(),
194  "WARNING. Virtual task wait_for_write_response() not defined.")
195 }
196 
198 
202  uvm_error(this.get_type_name(),
203  "WARNING. Virtual task wait_for_read_address() not defined.")
204 }
205 
207 
211  uvm_error(this.get_type_name(),
212  "WARNING. Virtual task wait_for_read_address() not defined.")
213 }
214 
216 
222  uvm_error(this.get_type_name(),
223  "WARNING. Virtual function get_awready_awvalid() not defined.")
224  return 0;
225 }
226 
227 
229 
233  uvm_error(this.get_type_name(),
234  "WARNING. Virtual function get_awready() not defined.")
235  return 0;
236 }
237 
239 
245  uvm_error(this.get_type_name(),
246  "WARNING. Virtual function get_wready_wvalid() not defined.")
247  return 0;
248 }
249 
251 
255  uvm_error(this.get_type_name(),
256  "WARNING. Virtual function get_wvalid() not defined.")
257  return 0;
258 }
259 
261 
265  uvm_error(this.get_type_name(),
266  "WARNING. Virtual function get_wready() not defined.")
267  return 0;
268 }
269 
271 
277  uvm_error(this.get_type_name(),
278  "WARNING. Virtual function get_bready_bvalid() not defined.")
279  return 0;
280 }
281 
283 
287  uvm_error(this.get_type_name(),
288  "WARNING. Virtual function get_bvalid() not defined.")
289  return 0;
290 }
291 
293 
297  uvm_error(this.get_type_name(),
298  "WARNING. Virtual function get_bready() not defined.")
299  return 0;
300 }
301 
303 
309  uvm_error(this.get_type_name(),
310  "WARNING. Virtual function get_arready_arvalid() not defined.")
311  return 0;
312 }
313 
315 
319  uvm_error(this.get_type_name(),
320  "WARNING. Virtual function get_arready() not defined.")
321  return 0;
322 }
323 
325 
331  uvm_error(this.get_type_name(),
332  "WARNING. Virtual function get_rready_rvalid() not defined.")
333  return 0;
334 }
335 
337 
341  uvm_error(this.get_type_name(),
342  "WARNING. Virtual function get_rvalid() not defined.")
343  return 0;
344 }
345 
347 
351  uvm_error(this.get_type_name(),
352  "WARNING. Virtual function get_rready() not defined.")
353  return 0;
354 }
355 
357 
361  uvm_error(this.get_type_name(),
362  "WARNING. Virtual task set_awvalid() not defined.")
363 }
364 
366 
370  uvm_error(this.get_type_name(),
371  "WARNING. Virtual task set_awready() not defined.")
372 }
373 
375 
379  uvm_error(this.get_type_name(),
380  "WARNING. Virtual task set_wvalid() not defined.")
381 }
382 
384 
388  uvm_error(this.get_type_name(),
389  "WARNING. Virtual task set_wready() not defined.")
390 }
391 
393 
397  uvm_error(this.get_type_name(),
398  "WARNING. Virtual task set_bvalid() not defined.")
399 }
400 
402 
406  uvm_error(this.get_type_name(),
407  "WARNING. Virtual task set_bready() not defined.")
408 }
409 
411 
415  uvm_error(this.get_type_name(),
416  "WARNING. Virtual task set_arvalid() not defined.")
417 }
418 
420 
424  uvm_error(this.get_type_name(),
425  "WARNING. Virtual task set_rvalid() not defined.")
426 }
427 
429 
433  uvm_error(this.get_type_name(),
434  "WARNING. Virtual task set_rready() not defined.")
435 }
436 
438 
442  uvm_error(this.get_type_name(),
443  "WARNING. Virtual function enable_awready_toggle_pattern() not defined.")
444 }
445 
447 
451  uvm_error(this.get_type_name(),
452  "WARNING. Virtual task disable_awready_toggle_pattern() not defined.")
453 }
454 
456 
460  uvm_error(this.get_type_name(),
461  "WARNING. Virtual function enable_wready_toggle_pattern() not defined.")
462 }
463 
465 
469  uvm_error(this.get_type_name(),
470  "WARNING. Virtual task disable_wready_toggle_pattern() not defined.")
471 }
472 
474 
478  uvm_error(this.get_type_name(),
479  "WARNING. Virtual function enable_bready_toggle_pattern() not defined.")
480 }
481 
483 
487  uvm_error(this.get_type_name(),
488  "WARNING. Virtual task disable_bready_toggle_pattern() not defined.")
489 }
490 
492 
496  uvm_error(this.get_type_name(),
497  "WARNING. Virtual function enable_arready_toggle_pattern() not defined.")
498 }
499 
501 
505  uvm_error(this.get_type_name(),
506  "WARNING. Virtual task disable_arready_toggle_pattern() not defined.")
507 }
508 
510 
514  uvm_error(this.get_type_name(),
515  "WARNING. Virtual function enable_rready_toggle_pattern() not defined.")
516 }
517 
519 
523  uvm_error(this.get_type_name(),
524  "WARNING. Virtual task disable_rready_toggle_pattern() not defined.")
525 }
526 
528 
533  uvm_error(this.get_type_name(),
534  "WARNING. Virtual function write_aw() not defined.")
535 }
536 
538 
543  uvm_error(this.get_type_name(),
544  "WARNING. Virtual function write_w() not defined.")
545 }
546 
548 
553  uvm_error(this.get_type_name(),
554  "WARNING. Virtual function write_b() not defined.")
555 }
556 
558 
562  uvm_error(this.get_type_name(),
563  "WARNING. Virtual function read_aw() not defined.")
564 }
565 
567 
571  uvm_error(this.get_type_name(),
572  "WARNING. Virtual function read_w() not defined.")
573 }
574 
576 
580  uvm_error(this.get_type_name(),
581  "WARNING. Virtual function read_b() not defined.")
582 }
583 
585 
590  uvm_error(this.get_type_name(),
591  "WARNING. Virtual function write_ar() not defined.")
592 }
593 
595 
599  uvm_error(this.get_type_name(),
600  "WARNING. Virtual function read_ar() not defined.")
601 }
602 
604 
608  uvm_error(this.get_type_name(),
609  "WARNING. Virtual function write_r() not defined.")
610 }
611 
613 
617  uvm_error(this.get_type_name(),
618  "WARNING. Virtual function read_r() not defined.")
619 }
620 
621 
622  /*
623  3. what does disabling toggle patterns do?
624  */
virtual bit get_bready()
Get the value of bready.
virtual task wait_for_wready()
Wait for awready to assert.
virtual task wait_for_awready_awvalid()
Wait for both awready awvalid to assert.
virtual bit get_arready_arvalid()
Get the value of arready and arvalid.
virtual bit get_wready_wvalid()
Get the value of wready and wvalid.
This packed struct is used to send read data channel information between the DUT and TB...
Definition: axi_pkg.sv:205
virtual bit get_awready_awvalid()
Get the value of awready and awvalid.
virtual void write_aw(axi_seq_item_aw_vector_s s, bit valid=0b1)
Drive all the signals on the write address channel with the specified values.
uvm_object_utils(axi_if_abstract) new(string name
This packed struct is used to send write address channel information between the DUT and TB...
Definition: axi_pkg.sv:113
virtual void write_ar(axi_seq_item_ar_vector_s s, bit valid=0b1)
Drive all the signals on the read address channel with the specified values.
virtual task wait_for_write_data(output axi_seq_item_w_vector_s s)
Wait for a valid write data to be acknowledged and return it.
virtual void disable_arready_toggle_pattern()
Disable arready toggling.
virtual task set_awvalid(bit state)
Set the value of awvalid.
virtual task set_awready(bit state)
Set the value of awready.
virtual void enable_awready_toggle_pattern(bit< 31:0 > pattern)
Set the value of awready toggle pattern and enable toggling.
virtual int get_data_bus_width()
returns data bus width
virtual bit get_bready_bvalid()
Get the value of bready and bvalid.
virtual task wait_for_clks(int cnt=1)
used for waiting
abstract base class for polymorphic interface class (axi_if_concrete) for AXI UVM environment ...
virtual bit get_rready_rvalid()
Get the value of rready and rvalid.
virtual task wait_for_awvalid()
Wait for awvalid to assert.
virtual task set_bready(bit state)
Set the value of bready.
virtual void write_b(axi_seq_item_b_vector_s s, bit valid=0b1)
Drive all the signals on the write response channel with the specified values.
virtual void enable_rready_toggle_pattern(bit< 31:0 > pattern)
Set the value of rready toggle pattern and enable toggling.
virtual void disable_rready_toggle_pattern()
Disable rready toggling.
virtual task set_rready(bit state)
Set the value of rready.
virtual bit get_awready()
Get the value of awready.
virtual task wait_for_write_response(output axi_seq_item_b_vector_s s)
Wait for a valid write response to be acknowledged and return it.
virtual void read_aw(output axi_seq_item_aw_vector_s s)
Get the values on the write address channel.
virtual void enable_bready_toggle_pattern(bit< 31:0 > pattern)
Set the value of bready toggle pattern and enable toggling.
virtual void write_w(axi_seq_item_w_vector_s s)
Drive all the signals on the write data channel with the specified values.
virtual task wait_for_bvalid()
Wait for bvalid to assert.
virtual task set_rvalid(bit state)
Set the value of rvalid.
virtual task wait_for_write_address(output axi_seq_item_aw_vector_s s)
Wait for a valid write address to be acknowledged and return it.
This packed struct is used to send write data channel information between the DUT and TB...
Definition: axi_pkg.sv:141
virtual task set_bvalid(bit state)
Set the value of bvalid.
virtual task wait_for_read_data(output axi_seq_item_r_vector_s s)
Wait for a valid read data to be acknowledged and return it.
virtual bit get_wready()
Get the value of wready.
virtual void read_ar(output axi_seq_item_ar_vector_s s)
Get the values on the read address channel.
virtual task set_wvalid(bit state)
Set the value of wvalid.
virtual task set_arvalid(bit state)
Set the value of arvalid.
virtual task wait_for_read_address(output axi_seq_item_ar_vector_s s)
Wait for a valid read address to be acknowledged and return it.
virtual bit get_arready()
Get the value of arready.
virtual task set_wready(bit state)
Set the value of wready.
virtual bit get_rready()
Get the value of rready.
virtual void disable_wready_toggle_pattern()
Disable wready toggling.
virtual void disable_bready_toggle_pattern()
Disable bready toggling.
virtual void read_b(output axi_seq_item_b_vector_s s)
Get the values on the write response channel.
virtual void write_r(axi_seq_item_r_vector_s s)
Drive all the signals on the read data channel with the specified values.
This packed struct is used to send write response channel information between the DUT and TB...
Definition: axi_pkg.sv:162
virtual void enable_arready_toggle_pattern(bit< 31:0 > pattern)
Set the value of arready toggle pattern and enable toggling.
virtual void disable_awready_toggle_pattern()
Disable awready toggling.
virtual void read_r(output axi_seq_item_r_vector_s s)
Get the values on the read data channel.
virtual void enable_wready_toggle_pattern(bit< 31:0 > pattern)
Set the value of wready toggle pattern and enable toggling.
virtual bit get_wvalid()
Get the value of wvalid.
virtual void read_w(output axi_seq_item_w_vector_s s)
Get the values on the write data channel.
virtual bit get_bvalid()
Get the value of bvalid.
virtual task wait_for_not_in_reset()
Wait for reset to deassert.
This packed struct is used to send read address channel information between the DUT and TB...
Definition: axi_pkg.sv:178
virtual bit get_rvalid()
Get the value of rvalid.