AXI muckbucket
axi_seq_item.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.
28 
34 class axi_seq_item : public uvm_sequence_item { public:
36 
37  //localparam ADDR_WIDTH = 32;
38  //localparam ID_WIDTH = 7;
39 
40  //widths are top-level parameters. but we're setting to max here.
41  // A recommendation from veloce docs
42  rand axi_protocol_version_t protocol; // AXI3 or AXI4
43  rand bit <ADDR_WIDTH-1:0> addr;
44  rand bit <7:0> data [];
45  rand int len;// =0;
46 
47  rand bit <ID_WIDTH-1:0> id;
48  rand logic <2:0> burst_size; // Burst size
49  rand logic <1:0> burst_type;
50 
51 
52  rand bit valid []; // keep valid with data,
53  // then can also toggle independently and have easy playback on failure
54  // @Todo: play around more with the do_record
55 
56  rand bit wstrb [];
57  rand bit wlast [];
58  bit <LEN_WIDTH-1:0> axlen; //used by monitor and coverage
59 
60  //rand burst_size_t burst_size; // Burst size
61  //rand burst_type_t burst_type;
62 
63  logic <0:0> lock = 0x0;
64  logic <3:0> cache = 0x0;
65  logic <2:0> prot = 0x0;
66  logic <3:0> qos = 0x0;
67 
68  logic <ID_WIDTH-1:0> bid = 0xF;
69  logic <1:0> bresp = 0x3;
70 
71  rand cmd_t cmd; // read or write
72 
73  rand logic <31:0> toggle_pattern = 0xFFFF_FFFF;
74 
75  // These variables below are used by anything operating on the
76  // bus itself that needs to calculate addresses and wstrbs
77  // IE: drivers and monitors
78  // Putting this logic here guarantees the logic is with the data
79  // The downside is it enlarges the sequence item. ;(
80  // Could/Should(?) put it in axi_pkg or axi_uvm_pkg?
81  // if in axi_pkg the logic could be synthesizable functions
82  // and then a non-UVM BFM could easily be created
83 
84  //int validcntr;
85  // int validcntr_max;
86 
87 
88 
89  const shortint c_AXI3_MAXBEATCNT=16;
90  const shortint c_AXI4_MAXBEATCNT=256;
91 
92 // burst_size_t foo [];
93 // constraint foo_c {burst_size inside {foo};}
94 
95  constraint protocol_c() { solve protocol before len;
96  if (LEN_WIDTH < 8) {
97  protocol == e_AXI3;
98  }
99  }
100 // protocol inside { axi_uvm_pkg::e_AXI4, axi_uvm_pkg::e_AXI4};}
101  //
102  constraint burst_type_c() { solve burst_type before addr;
103  burst_type != axi_pkg::e_RESERVED; }
104 
105  // Address must be aligned if burst_type==Fixed
106  // per spec, sect. a3.4.1, fixed and wrap burst types have alignment requirements
107  constraint addr_c() { solve addr before burst_size;
108  // if 2 byte aligned, zero out lowest 1 addr bit,
109  // if 4 byte aligned, zero out lowest 2 addr bits
110  // if 8 byte aligned, zero out lowest 3 addr bits
111  // ...
112  // but if I try this:
113  // if ((burst_type == axi_pkg::e_FIXED || burst_type == axi_pkg::e_WRAP) &&
114  // (burst_size != axi_pkg::e_1BYTE))
115  // addr[burst_size-1:0] == 'h0;
116  // at least one tool complains about ""Expected a constant as index:"
117  // Better way??
118 
119  if ((burst_type == axi_pkg::e_FIXED || burst_type == axi_pkg::e_WRAP) &&
120  (burst_size == axi_pkg::e_2BYTES))
121  addr[0] == 0b0;
122  else if ((burst_type == axi_pkg::e_FIXED || burst_type == axi_pkg::e_WRAP) &&
123  (burst_size == axi_pkg::e_4BYTES))
124  addr[2] == 0b00;
125  else if ((burst_type == axi_pkg::e_FIXED || burst_type == axi_pkg::e_WRAP) &&
126  (burst_size == axi_pkg::e_8BYTES))
127  addr[3] == 0b000;
128  else if ((burst_type == axi_pkg::e_FIXED || burst_type == axi_pkg::e_WRAP) &&
129  (burst_size == axi_pkg::e_16BYTES))
130  addr[4] == 0b0000;
131  else if ((burst_type == axi_pkg::e_FIXED || burst_type == axi_pkg::e_WRAP) &&
132  (burst_size == axi_pkg::e_32BYTES))
133  addr[5] == 0b00000;
134  else if ((burst_type == axi_pkg::e_FIXED || burst_type == axi_pkg::e_WRAP) &&
135  (burst_size == axi_pkg::e_64BYTES))
136  addr[6] == 0b00_0000;
137  else if ((burst_type == axi_pkg::e_FIXED || burst_type == axi_pkg::e_WRAP) &&
138  (burst_size == axi_pkg::e_128BYTES))
139  addr[7] == 0b000_0000;
140 
141  }
142  constraint burst_size_c() { solve burst_size before len; }
143 
144  constraint max_len() { len > 0;
145  //len < 10000;
146 
147  if ((burst_type == axi_pkg::e_FIXED) && (burst_size == axi_pkg::e_1BYTE)) {
148  len <= (1*c_AXI3_MAXBEATCNT);
149  } else if ((burst_type == axi_pkg::e_FIXED) && (burst_size == axi_pkg::e_2BYTES)) {
150  len[0] == 0b0;
151  len <= (2*c_AXI3_MAXBEATCNT);
152  } else if ((burst_type == axi_pkg::e_FIXED) && (burst_size == axi_pkg::e_4BYTES)) {
153  len[2] == 0b00;
154  len <= (4*c_AXI3_MAXBEATCNT);
155  } else if ((burst_type == axi_pkg::e_FIXED) && (burst_size == axi_pkg::e_8BYTES)) {
156  len[3] == 0b000;
157  len <= (8*c_AXI3_MAXBEATCNT);
158  } else if ((burst_type == axi_pkg::e_FIXED) && (burst_size == axi_pkg::e_16BYTES)) {
159  len[4] == 0b0000;
160  len <= (16*c_AXI3_MAXBEATCNT);
161  } else if ((burst_type == axi_pkg::e_FIXED) && (burst_size == axi_pkg::e_32BYTES)) {
162  len[5] == 0b0_0000;
163  len <= (32*c_AXI3_MAXBEATCNT);
164  } else if ((burst_type == axi_pkg::e_FIXED) && (burst_size == axi_pkg::e_64BYTES)) {
165  len[6] == 0b00_0000;
166  len <= (64*c_AXI3_MAXBEATCNT);
167  } else if ((burst_type == axi_pkg::e_FIXED) && (burst_size == axi_pkg::e_128BYTES)) {
168  len[7] == 0b000_0000;
169  len <= (128*c_AXI3_MAXBEATCNT);
170 
171 
172  // wrap is slightly more difficult.
173  // per spec:A3.4.1, "the length of the burst must be 2,4,8 or 16 beats
174  // however it can be different bytes within those bursts.
175  // IE: 2 beat burst,of 4 byte beats could be length=(5,6,7,8) bytes
176  // 2 beat burst of 2 byte beats could be length=(3,4) bytes
177  } else if (burst_type == axi_pkg::e_WRAP && (burst_size == axi_pkg::e_1BYTE))
178  len inside {2, 4, 8, 16};
179  else if (burst_type == axi_pkg::e_WRAP && (burst_size == axi_pkg::e_2BYTES))
180  len inside {3,4, 7,8, 15,16, 31,32};
181  else if (burst_type == axi_pkg::e_WRAP && (burst_size == axi_pkg::e_4BYTES))
182  len inside {[4], [13:16], [29:32], [61:64]};
183  else if (burst_type == axi_pkg::e_WRAP && (burst_size == axi_pkg::e_8BYTES))
184  len inside {[9:16], [25:32], [57:64], [121:128]};
185 
186  else if (burst_type == axi_pkg::e_WRAP && (burst_size == axi_pkg::e_16BYTES))
187  len inside {[17:32], [49:64], [113:128], [241:256]};
188  else if (burst_type == axi_pkg::e_WRAP && (burst_size == axi_pkg::e_32BYTES))
189  len inside {[33:64], [97:128], [225:256], [481:512]};
190  else if (burst_type == axi_pkg::e_WRAP && (burst_size == axi_pkg::e_64BYTES))
191  len inside {[65:128], [193:256], [449:512], [960:1024]};
192  else if (burst_type == axi_pkg::e_WRAP && (burst_size == axi_pkg::e_128BYTES))
193  len inside {[129:256], [385:512], [897:1024], [1921:2048]};
194 
195 
196  // else if ((protocol == axi_uvm_pkg::e_AXI4) && (burst_type == axi_pkg::e_INCR) && (burst_size == axi_pkg::e_1BYTE))
197  // len <= c_AXI4_MAXBEATCNT;
198  else if ((protocol == axi_uvm_pkg::e_AXI4) && (burst_type == axi_pkg::e_INCR) && (burst_size == axi_pkg::e_2BYTES))
199  len <= ((2**byte(burst_size)) * c_AXI4_MAXBEATCNT) - byte(addr[0]);
200  else if ((protocol == axi_uvm_pkg::e_AXI4) && (burst_type == axi_pkg::e_INCR) && (burst_size == axi_pkg::e_4BYTES))
201  len <= ((2**byte(burst_size)) * c_AXI4_MAXBEATCNT) - byte(addr[2]);
202  else if ((protocol == axi_uvm_pkg::e_AXI4) && (burst_type == axi_pkg::e_INCR) && (burst_size == axi_pkg::e_8BYTES))
203  len <= ((2**byte(burst_size)) * c_AXI4_MAXBEATCNT) - byte(addr[3]);
204  else if ((protocol == axi_uvm_pkg::e_AXI4) && (burst_type == axi_pkg::e_INCR) && (burst_size == axi_pkg::e_16BYTES))
205  len <= ((2**byte(burst_size)) * c_AXI4_MAXBEATCNT) - byte(addr[4]);
206  else if ((protocol == axi_uvm_pkg::e_AXI4) && (burst_type == axi_pkg::e_INCR) && (burst_size == axi_pkg::e_32BYTES))
207  len <= ((2**byte(burst_size)) * c_AXI4_MAXBEATCNT) - byte(addr[5]);
208  else if ((protocol == axi_uvm_pkg::e_AXI4) && (burst_type == axi_pkg::e_INCR) && (burst_size == axi_pkg::e_64BYTES))
209  len <= ((2**byte(burst_size)) * c_AXI4_MAXBEATCNT) - byte(addr[6]);
210  else if ((protocol == axi_uvm_pkg::e_AXI4) && (burst_type == axi_pkg::e_INCR) && (burst_size == axi_pkg::e_128BYTES))
211  len <= ((2**byte(burst_size)) * c_AXI4_MAXBEATCNT) - byte(addr[7]);
212 
213  // else if ((protocol == axi_uvm_pkg::e_AXI3) && (burst_type == axi_pkg::e_INCR) && (burst_size == axi_pkg::e_1BYTE))
214  // len <= c_AXI3_MAXBEATCNT;
215  else if ((protocol == axi_uvm_pkg::e_AXI3) && (burst_type == axi_pkg::e_INCR) && (burst_size == axi_pkg::e_2BYTES))
216  len <= ((2**byte(burst_size)) * c_AXI3_MAXBEATCNT) - byte(addr[0]);
217  else if ((protocol == axi_uvm_pkg::e_AXI3) && (burst_type == axi_pkg::e_INCR) && (burst_size == axi_pkg::e_4BYTES))
218  len <= ((2**byte(burst_size)) * c_AXI3_MAXBEATCNT) - byte(addr[2]);
219  else if ((protocol == axi_uvm_pkg::e_AXI3) && (burst_type == axi_pkg::e_INCR) && (burst_size == axi_pkg::e_8BYTES))
220  len <= ((2**byte(burst_size)) * c_AXI3_MAXBEATCNT) - byte(addr[3]);
221 
222  else if ((protocol == axi_uvm_pkg::e_AXI3) && (burst_type == axi_pkg::e_INCR) && (burst_size == axi_pkg::e_16BYTES))
223  len <= ((2**byte(burst_size)) * c_AXI3_MAXBEATCNT) - byte(addr[4]);
224  else if ((protocol == axi_uvm_pkg::e_AXI3) && (burst_type == axi_pkg::e_INCR) && (burst_size == axi_pkg::e_32BYTES))
225  len <= ((2**byte(burst_size)) * c_AXI3_MAXBEATCNT) - byte(addr[5]);
226  else if ((protocol == axi_uvm_pkg::e_AXI3) && (burst_type == axi_pkg::e_INCR) && (burst_size == axi_pkg::e_64BYTES))
227  len <= ((2**byte(burst_size)) * c_AXI3_MAXBEATCNT) - byte(addr[6]);
228  else if ((protocol == axi_uvm_pkg::e_AXI3) && (burst_type == axi_pkg::e_INCR) && (burst_size == axi_pkg::e_128BYTES))
229  len <= ((2**byte(burst_size)) * c_AXI3_MAXBEATCNT) - byte(addr[7]);
230  // some weird problem with Riviera Pro that won't access those above. so I put them here
231  else if ((burst_type == axi_pkg::e_INCR) && (burst_size == axi_pkg::e_1BYTE)) {
232  if (protocol == axi_uvm_pkg::e_AXI4) {
233  len <= c_AXI4_MAXBEATCNT;
234  } else {
235  len <= c_AXI3_MAXBEATCNT ;
236  }
237  } else {
238  len == 0;
239  }
240  }
241 //these aredonein post-randomize
242 // constraint valid_c { solve len before valid;
243 // valid.size() == len; }
244 // constraint data_c { solve len before data;
245 // data.size() == len; }
246 // constraint wstrb_c { solve len before wstrb;
247 // wstrb.size() == len; }
248 
249  //constraint wlast_c { solve len before wlast;
250  // wlast.size() == len/4;
251  // } //only the last bit is set, do that in post-randomize
252 
253  // UVM sequence item functions
254  new (string name="axi_seq_item");
255  string convert2string();
256  void do_copy (uvm_object rhs);
257  bit do_compare (uvm_object rhs, uvm_comparer comparer);
258  void do_print (uvm_printer printer);
259 
260  void pre_randomize();
261  void post_randomize();
262 
263 
264  void get_beat_N_data(input int beat_cnt,
265  input int data_bus_bytes,
266  ref bit <7:0> data[],
267  ref bit wstrb[],
268  output bit wlast);
269 
270 
271 };
272 
276  axi_seq_item::new (string name="axi_seq_item") {
277  super.new(name);
278 
279 
280 // foo = new[1];
281 // foo[0] = e_2BYTES;
282 
283 }
284 
289  string s;
290  string sdata;
291  int j=0;
292  sdata="";
293  $sformat(s, "%s", super.convert2string());
294  $sformat(s, "%s Protocol: %s", s, protocol.name);
295  $sformat(s, "%s Cmd: %s ", s, cmd.name);
296  $sformat(s, "%s Addr = 0x%0x ", s, addr);
297  $sformat(s, "%s ID = 0x%0x ", s, id);
298  $sformat(s, "%s Len = 0x%0x (%0d) ", s, len,len);
299  $sformat(s, "%s BurstSize = 0x%0x ", s, burst_size);
300  $sformat(s, "%s BurstType = 0x%0x ", s, burst_type);
301  $sformat(s, "%s BID = 0x%0x", s, bid);
302  $sformat(s, "%s BRESP = 0x%0x", s, bresp);
303 
304  j=data.size();
305  sdata="";
306  for (int i =0; i < j; i++) {
307  $sformat(sdata, "%s 0x%02x ", sdata, data[i]);
308  }
309  $sformat(s, "%s Data[]: %s", s, sdata);
310 
311  j=valid.size();
312  sdata="";
313  for (int i =0; i < j; i++) {
314  $sformat(sdata, "%s%0b", sdata, valid[i]);
315  }
316  $sformat(s, "%s valid[]: %s", s, sdata);
317 
318 
319 /*
320  j=wstrb.size();
321  sdata="";
322  for (int i =0; i< j; i++) begin
323  $sformat(sdata, "%s %b ", sdata, wstrb[i]);
324  end
325  $sformat(s, "%s wstrb[]: %s", s, sdata);
326 */
327 
328  return s;
329 }
330 
334  void axi_seq_item::do_copy(uvm_object rhs) {
335  int i;
336  int j;
337  axi_seq_item _rhs;
338  $cast(_rhs, rhs);
339  super.do_copy(rhs);
340 
341  addr = _rhs.addr;
342  id = _rhs.id;
343  len = _rhs.len;
344 
345  burst_size = _rhs.burst_size;
346  burst_type = _rhs.burst_type;
347  lock = _rhs.lock;
348  cache = _rhs.cache;
349  prot = _rhs.prot;
350  qos = _rhs.qos;
351 
352  bid = _rhs.bid;
353  bresp = _rhs.bresp;
354 
355  cmd = _rhs.cmd;
356 
357  data = new[_rhs.data.size()](_rhs.data);
358  wstrb = new[_rhs.wstrb.size()](_rhs.wstrb);
359  valid = new[_rhs.valid.size()](_rhs.valid);
360  wlast = new[_rhs.wlast.size()](_rhs.wlast);
361 
362 }
363 
369  bit axi_seq_item::do_compare(uvm_object rhs, uvm_comparer comparer) {
370  axi_seq_item _rhs;
371  bit comp=1;
372 
373  return 0; // this function needs love, fail until love received.
374  if(!$cast(_rhs, rhs)) {
375  return 0;
376  }
377 
378  for (int i=0;i <len;i++) {
379  comp &= (data[i] == _rhs.data[i]);
380  }
381  return (super.do_compare(rhs, comparer) &&
382  (addr == _rhs.addr) &&
383  (len == _rhs.len) &&
384  (id == _rhs.id) &&
385  comp
386  );
387 }
388 
392  void axi_seq_item::do_print(uvm_printer printer) {
393  printer.m_string = convert2string();
394 }
395 
396 
398  uvm_info(this.get_type_name(), "Starting pre_randomize", UVM_HIGH)
399 
400  uvm_info(this.get_type_name(), "Done pre_randomize", UVM_HIGH)
401 }
402 
410  int j;
411  string valid_s;
412  int valid_asserts;
413  int valid_assert_bit;
414 
415  uvm_info(this.get_type_name(), "Starting post_randomize", UVM_HIGH)
416 
417 
418  super.post_randomize;
419 
420 
421  data=new[len];
422  wstrb=new[len];
423  valid=new[len]; // only need one per beat instead of one per byte,
424  // we won't use the extras.
425  // \todo: howto guaranteesufficient valid
426 
427 
428  if (cmd == e_WRITE) {
429  for (int i=0; i < len; i++) {
430  data[i] = i;
431  wstrb[i]=0b1; // $random();
432  // wlast[i]=1'b0;
433  //valid[i]=$random();
434  //valid[i+len]=$random();
435  // data[i] = $random;
436  }
437 
438  j=wlast.size();
439  for (int i=0;i <j;i++) {
440  wlast[i] = 0b1;
441  }
442  wlast[0] = 0b1;
443 
444 
445  valid_asserts = 0;
446  j=valid.size();
447  for (int i=0;i <j;i++) {
448  valid[i] = $random;
449  if (valid[i] == 0b1) {
450  valid_asserts++;
451  }
452  }
453 
454  // valid must be asserted at least once to avoid never sending data.
455  if (valid_asserts==0) {
456  valid_assert_bit=$urandom_range(j-1,0);
457  valid[valid_assert_bit] = 0b1;
458  uvm_info("axi_seq_item.post_randomize()",$sformatf("All zeros. Settin bit %0d to 1", valid_assert_bit), UVM_INFO)
459  }
460 
461  valid_s="";
462  for (int i=0;i <j;i++) {
463  $sformat(valid_s, "%s%0b", valid_s, valid[i]);
464  }
465 
466  data[len-1] = 0xFE; // specific value to eaily identify last byte
467  } // if (cmd == e_WRITE)
468 
469 
470 // if ($clog2(len) > (LEN_WIDTH*(2**burst_size)) begin
471 // `uvm_error("POST_RANDOMIZATION", $sformatf("LEN OVERRUN ERROR. Protocol = %s. Len=%0d(0x%0x), burst_size=%0d but LEN_WIDTH=%0d.", protocol.name, len, len, burst_size,LEN_WIDTH))
472 // end
473 
474 
475  uvm_info(this.get_type_name(), "Done post_randomize", UVM_HIGH)
476  //assert(valid.randomize()) else begin
477  // `uvm_error(this.get_type_name, "Unable to randomize valid");
478  //end
479 }
480 
493  input int beat_cnt,
494  input int data_bus_bytes,
495  ref bit <7:0> data[],
496  ref bit wstrb[],
497  output bit wlast) {
498 
499  int Lower_Byte_Lane;
500  int Upper_Byte_Lane;
501  int data_offset;
502  int last_beat_cnt;
503 
504  string data_s;
505  string msg_s;
506  string wstrb_s;
507 
508 
509  if (data.size() != data_bus_bytes) {
510  data = new[data_bus_bytes];
511  }
512  for (int z=0;z <data_bus_bytes;z++) {
513  data[z] = 0x0;
514  }
515 
516 
517  if (wstrb.size() != data_bus_bytes) {
518  wstrb = new[data_bus_bytes];
519  }
520  for (int z=0;z <data_bus_bytes;z++) {
521  wstrb[z] = 0b0;
522  }
523 
524 
525  last_beat_cnt = axi_pkg::calculate_axlen(.addr (addr),
527  .burst_length (len));
528  //last_beat_cnt -= 1;
529 
530  if (beat_cnt == last_beat_cnt) {
531  wlast = 0b1;
532  } else {
533  wlast = 0b0;
534  }
535 
536 
539  .burst_length (len),
541  .beat_cnt (beat_cnt),
542  .data_bus_bytes (data_bus_bytes),
543  .Lower_Byte_Lane (Lower_Byte_Lane),
544  .Upper_Byte_Lane (Upper_Byte_Lane),
545  .offset (data_offset));
546 
547 
548  for (int i=Lower_Byte_Lane;i <=Upper_Byte_Lane;i++) {
549  if (data_offset+i-Lower_Byte_Lane < len) {
550  wstrb[i] = 0b1;
551  data[i] = this.data[data_offset+i-Lower_Byte_Lane];
552  }
553  }
554 
555  data_s = " ";
556  wstrb_s = " ";
557  for (int i=data_bus_bytes-1; i>=0;i--) {
558  $sformat(data_s, " %s 0x%2x", data_s, data[i]);
559  $sformat(wstrb_s, " %s%0b", wstrb_s, wstrb[i]);
560  }
561 
562  msg_s="";
563  $sformat(msg_s, "%s beat_cnt:%0d", msg_s, beat_cnt);
564  $sformat(msg_s, "%s Lower_Byte_Lane:%0d", msg_s, Lower_Byte_Lane);
565  $sformat(msg_s, "%s Upper_Byte_Lane:%0d", msg_s, Upper_Byte_Lane);
566  $sformat(msg_s, "%s data_offset:%0d", msg_s, data_offset);
567 
568  $sformat(msg_s, "%s wstrb:%s", msg_s, wstrb_s);
569  $sformat(msg_s, "%s data:%s", msg_s, data_s);
570 
571  uvm_info("axi_seq_item::get_beat_N_data", msg_s, UVM_HIGH)
572 
573 }
574 
rand cmd_t cmd
rand bit< 7:0 > data[]
logic< ID_WIDTH-1:0 > bid
bit< C_AXI_LEN_WIDTH-1:0 > calculate_axlen(input bit< C_AXI_ADDR_WIDTH-1:0 > addr, input bit< 2:0 > burst_size, input shortint burst_length)
calculate awlen or arlen
Definition: axi_pkg.sv:320
localparam LEN_WIDTH
Definition: axi_uvm_pkg.sv:41
rand int len
string convert2string()
Convert item&#39;s variable into one printable string.
void pre_randomize()
const shortint c_AXI4_MAXBEATCNT
rand bit< ID_WIDTH-1:0 > id
logic< 3:0 > cache
constraint burst_type_c()
logic< 2:0 > prot
rand bit wstrb[]
localparam ID_WIDTH
Definition: axi_uvm_pkg.sv:40
constraint burst_size_c()
rand bit< ADDR_WIDTH-1:0 > addr
uvm_object_utils(axi_seq_item) rand axi_protocol_version_t protocol
rand logic< 2:0 > burst_size
void get_beat_N_data(input int beat_cnt, input int data_bus_bytes, ref bit< 7:0 > data[], ref bit wstrb[], output bit wlast)
return beat values for write data and read data channels
logic< 3:0 > qos
rand bit valid[]
const shortint c_AXI3_MAXBEATCNT
constraint max_len()
void get_beat_N_byte_lanes(input bit< C_AXI_ADDR_WIDTH-1:0 > addr, input bit< 2:0 > burst_size, input shortint burst_length, input bit< 1:0 > burst_type, input int beat_cnt, input int data_bus_bytes, output int Lower_Byte_Lane, output int Upper_Byte_Lane, output int offset)
return byte lanes that contain valid data
Definition: axi_pkg.sv:538
bit< LEN_WIDTH-1:0 > axlen
rand bit wlast[]
new(string name="axi_seq_item")
Constructor.
logic< 0:0 > lock
void post_randomize()
Tweak things after randomization.
logic< 1:0 > bresp
bit do_compare(uvm_object rhs, uvm_comparer comparer)
Deep compare.
rand logic< 31:0 > toggle_pattern
void do_print(uvm_printer printer)
prints out immediate object, but no parents&#39; stuff.
cmd_t
Command type - what is the purpose of this packet?
Definition: axi_uvm_pkg.sv:57
rand logic< 1:0 > burst_type
constraint protocol_c()
constraint addr_c()
void do_copy(uvm_object rhs)
Deep copy.
contains all data and functions related to axi and usage
axi_protocol_version_t
Version 3 or Version 4.
Definition: axi_uvm_pkg.sv:52
localparam ADDR_WIDTH
Definition: axi_uvm_pkg.sv:39