AXI-Verification architecture, functional coverage and assertions based coverage code
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

axi_coverage.sv 3.4 KiB

8 meses atrás
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. class axi_coverage extends uvm_subscriber#(sequence_item);
  2. `uvm_component_utils(axi_coverage)
  3. sequence_item txn;
  4. // Coverpoints for low power interface signals
  5. covergroup t1;
  6. coverpoint CSYSACK;
  7. coverpoint CSYSREQ;
  8. coverpoint CACTIVE;
  9. // Cross coverage between low power interface signals
  10. cross low_power_cross = {CSYSACK, CSYSREQ, CACTIVE};
  11. endgroup
  12. //t2
  13. covergroup t2;
  14. coverpoint awid{ bins ids[] =[1:16]};}
  15. coverpoint awlen{ bins len _values[] ={[1:16]};}
  16. cp1: coverpoint awsize
  17. cp2: coverpoint awaddr { 2^0 to 2^31;}
  18. cp3:coverpoint awburst{ bins busttype[] = [0:3];}
  19. endgroup
  20. //t3
  21. covergroup t3;
  22. coverpoint awlen { bins len_values[] = {[0:16], [17:32], [33:48], [49:64]}; }
  23. coverpoint wlast;
  24. // Coverpoints for read data coverpoint arlen { bins len_values[] = {[0:15]}; }
  25. coverpoint rlast; // Cross coverage between write and read data
  26. cross w_r_data_cross = {awlen, arlen, wlast, rlast};
  27. endgroup
  28. //t4
  29. covergroup t4;
  30. coverpoint awid{ bins ids[] =[1:16]};}
  31. coverpoint awlen{ bins len _values[] ={[1:16]};}
  32. cp1: coverpoint awsize
  33. cp2: coverpoint awaddr { 2^0 to 2^31;}
  34. cp3:coverpoint awburst{ bins busttype[] = [0:3];}
  35. // Coverpoints for address signals
  36. coverpoint awaddr { bins addr_range[] = {[0:255], [256:511], [512:767], [768:1023]};
  37. bins addr_alignment[] = {[0], [4], [8], [12], [16], [20], [24], [28], [32]}; }
  38. coverpoint araddr { bins addr_range[] = {[0:255], [256:511], [512:767], [768:1023]};
  39. bins addr_alignment[] = {[0], [4], [8], [12], [16], [20], [24], [28], [32]}; }
  40. // Cross coverage between awaddr and araddr
  41. cross aw_ar_address_cross = {awaddr, araddr};
  42. endgroup
  43. //t5
  44. covergroup t5;
  45. // Coverpoints for read address
  46. coverpoint araddr { bins addr_range[] = {[0:255], [256:511], [512:767], [768:1023]};
  47. bins addr_alignment[] = {[0], [4], [8], [12], [16], [20], [24], [28], [32]}; }
  48. // Cross coverage between read address and burst length
  49. cross araddr_arlen_cross = {araddr, arlen};
  50. endgroup
  51. //t6
  52. covergroup t6;
  53. // Coverpoints for read data
  54. coverpoint rdata { bins data_values[] = {[0:255], [256:511], [512:767], [768:1023]}; }
  55. coverpoint rvalid;
  56. // Cross coverage between read data and response
  57. cross rdata_rresp_cross = {rdata, rresp};
  58. cross rdata_rvalid_cross = {rdata, rvalid};
  59. endgroup
  60. //t7
  61. covergroup t7;
  62. // Coverpoints for low power interface signals
  63. coverpoint CSYSACK;
  64. coverpoint CSYSREQ;
  65. coverpoint CACTIVE;
  66. // Cross coverage between low power interface signals
  67. cross low_power_cross = {CSYSACK, CSYSREQ, CACTIVE};
  68. endgroup
  69. //t8
  70. covergroup t8;
  71. // Coverpoints for address signals
  72. coverpoint awaddr { bins addr_range[] = {[0:255], [256:511], [512:767], [768:1023]};
  73. bins addr_alignment[] = {[0], [4], [8], [12], [16], [20], [24], [28], [32]}; }
  74. coverpoint araddr { bins addr_range[] = {[0:255], [256:511], [512:767], [768:1023]};
  75. bins addr_alignment[] = {[0], [4], [8], [12], [16], [20], [24], [28], [32]}; }
  76. // Cross coverage between awaddr and araddr
  77. cross aw_ar_address_cross = {awaddr, araddr};
  78. // Coverpoints for write response
  79. coverpoint bresp { bins resp_values[] = {[0:1], [2]}; }
  80. // Coverpoints for read response
  81. coverpoint rresp { bins resp_values[] = {[0:1], [2]}; }
  82. // Cross coverage between write and read responses
  83. cross b_r_resp_cross = {bresp, rresp};
  84. endgroup
  85. function new(string name, uvm_component parent);
  86. t1=new();
  87. t2=new();
  88. t3=new();
  89. t4=new();
  90. t5=new();
  91. t8=new();
  92. endfunction
  93. endclass