AXI-Verification architecture, functional coverage and assertions based coverage code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. //reset sequence
  2. class reset_sequence extends uvm_sequence #(packet);
  3. `uvm_object_utils(reset_sequence)
  4. packet pkt;
  5. function new(string name = "reset_sequence");
  6. super.new(name);
  7. endfunction
  8. virtual task body();
  9. `uvm_info(get_type_name(), $sformatf("*** RESET SEQUENCE is started ***"), UVM_MEDIUM)
  10. pkt = packet::type_id::create("pkt");
  11. start_item(pkt);
  12. assert(pkt.randomize);
  13. pkt.op = WRITE;
  14. finish_item(pkt);
  15. endtask
  16. endclass
  17. /*
  18. //read sequence
  19. class read_sequence extends uvm_sequence #(packet);
  20. `uvm_object_utils(read_sequence)
  21. packet pkt;
  22. function new(string name = "read_sequence");
  23. super.new(name);
  24. endfunction
  25. virtual task body();
  26. repeat(10)
  27. begin
  28. `uvm_info(get_type_name(), $sformatf("*** READ SEQUENCE is started ***"), UVM_MEDIUM)
  29. pkt = packet::type_id::create("pkt");
  30. //pkt.paddr_invalid.constraint_mode(0);
  31. start_item(pkt);
  32. assert(pkt.randomize);
  33. pkt.op = READ;
  34. //pkt.pwrite=0;
  35. finish_item(pkt);
  36. end
  37. endtask
  38. endclass
  39. //write sequence
  40. class write_sequence extends uvm_sequence #(packet);
  41. `uvm_object_utils(write_sequence)
  42. packet pkt;
  43. function new(string name = "write_sequence");
  44. super.new(name);
  45. endfunction
  46. virtual task body();
  47. repeat(10)
  48. begin
  49. `uvm_info(get_type_name(), $sformatf("*** WRITE SEQUENCE is started ***"), UVM_MEDIUM)
  50. pkt = packet::type_id::create("pkt");
  51. pkt.paddr_invalid.constraint_mode(0);
  52. start_item(pkt);
  53. assert(pkt.randomize);
  54. pkt.ap = WRITE;
  55. pkt.pwrite=1;
  56. finish_item(pkt);
  57. end
  58. endtask
  59. endclass
  60. //write_read_sequence
  61. class write_read_sequence extends uvm_sequence #(packet);
  62. `uvm_object_utils(write_read_sequence)
  63. packet pkt;
  64. function new(string name = "write_read_sequence");
  65. super.new(name);
  66. endfunction
  67. virtual task body();
  68. //write seq
  69. repeat(10)
  70. begin
  71. `uvm_info(get_type_name(), $sformatf("*** WRITE SEQUENCE is started ***"), UVM_MEDIUM)
  72. pkt = packet::type_id::create("pkt");
  73. pkt.paddr_invalid.constraint_mode(0);
  74. start_item(pkt);
  75. assert(pkt.randomize);
  76. pkt.ap = WRITE;
  77. pkt.pwrite=1;
  78. finish_item(pkt);
  79. //read seq
  80. `uvm_info(get_type_name(), $sformatf("*** READ SEQUENCE is started ***"), UVM_MEDIUM)
  81. pkt = packet::type_id::create("pkt");
  82. pkt.paddr_invalid.constraint_mode(0);
  83. start_item(pkt);
  84. assert(pkt.randomize);
  85. pkt.ap = READ;
  86. pkt.pwrite=0;
  87. finish_item(pkt);
  88. end
  89. endtask
  90. endclass
  91. */
  92. /*
  93. //write_read_sequence
  94. class multi_write_multi_read_sequence extends uvm_sequence #(packet);
  95. `uvm_object_utils(multi_write_multi_read_sequence)
  96. packet pkt;
  97. function new(string name = "multi_write_multi_read_sequence");
  98. super.new(name);
  99. endfunction
  100. virtual task body();
  101. int count=1;
  102. //multi write seq
  103. repeat(5)
  104. begin
  105. `uvm_info(get_type_name(), $sformatf("***MULTI WRITE SEQUENCE --> %0d is started ***",count), UVM_MEDIUM)
  106. pkt = packet::type_id::create("pkt");
  107. pkt.paddr_invalid.constraint_mode(0);
  108. start_item(pkt);
  109. assert(pkt.randomize);
  110. pkt.ap = WRITE;
  111. pkt.pwrite=1;
  112. finish_item(pkt);
  113. count++;
  114. end
  115. //multi read seq
  116. repeat(5)
  117. begin
  118. `uvm_info(get_type_name(), $sformatf("***MULTI READ SEQUENCE--> %0d is started ***",count), UVM_MEDIUM)
  119. pkt = packet::type_id::create("pkt");
  120. pkt.paddr_invalid.constraint_mode(0);
  121. start_item(pkt);
  122. assert(pkt.randomize);
  123. pkt.ap = READ;
  124. pkt.pwrite=0;
  125. finish_item(pkt);
  126. count++;
  127. end
  128. endtask
  129. endclass
  130. */
  131. /*
  132. //write_read_sequence
  133. class slaveerr_sequence extends uvm_sequence #(packet);
  134. `uvm_object_utils(slaveerr_sequence)
  135. packet pkt;
  136. function new(string name = "slaveerr_sequence");
  137. super.new(name);
  138. endfunction
  139. virtual task body();
  140. repeat(10)
  141. begin
  142. `uvm_info(get_type_name(), $sformatf("*** SLV ERROR WRITE SEQUENCE is started ***"), UVM_MEDIUM)
  143. pkt = packet::type_id::create("pkt");
  144. start_item(pkt);
  145. pkt.paddr_valid.constraint_mode(0);
  146. assert(pkt.randomize);
  147. pkt.ap = WRITE;
  148. pkt.pwrite=1;
  149. finish_item(pkt);
  150. end
  151. //multi read seq
  152. repeat(10)
  153. begin
  154. `uvm_info(get_type_name(), $sformatf("*** SLV ERROR READ OPERATION is started ***"), UVM_MEDIUM)
  155. pkt = packet::type_id::create("pkt");
  156. pkt.paddr_valid.constraint_mode(0);
  157. start_item(pkt);
  158. assert(pkt.randomize);
  159. pkt.ap = READ;
  160. pkt.pwrite=0;
  161. finish_item(pkt);
  162. end
  163. endtask
  164. endclass
  165. */