No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

axi_seq_item.sv 2.3 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. class axi_seq_item extends uvm_sequence_item;
  2. //FACTORY REGISTRATION
  3. 'uvm_object_utils(axi_seq_item);
  4. //WRITE ADDRESS CHANNEL
  5. rand logic [31:0] AWADDR;
  6. rand logic [3:0] AWLEN;
  7. rand logic [2:0] AWSIZE;
  8. rand logic [1:0] AWBURST;
  9. bit AWVALID;
  10. bit AWREADY;
  11. bit [1:0] AWLOCK;
  12. rand logic [2:0] AWPROT;
  13. rand logic [3:0] AWCACHE;
  14. rand bit [3:0] AWID;
  15. //WRITE DATA CHANNEL
  16. rand bit [3:0] WID;
  17. bit [2:0] WSTRB;
  18. rand logic [7:0] WDATA;
  19. bit WVALID;
  20. bit WREADY;
  21. bit WLAST;
  22. //WRITE RESPONSE CHANNEL
  23. bit [1:0] BRESP;
  24. bit BVALID;
  25. bit BREADY;
  26. //READ ADDRESS CHANNEL
  27. rand bit [3:0] ARID;
  28. rand logic [31:0] ARADDR;
  29. rand logic [2:0] ARSIZE;
  30. rand logic [1:0] ARBURST;
  31. rand logic [3:0] ARLEN;
  32. rand logic [2:0] ARPROT;
  33. rand logic [3:0] ARCACHE;
  34. rand logic [1:0] AELOCK;
  35. bit ARVALID;
  36. bit ARREADY;
  37. //READ DATA CHANNEL
  38. bit [3:0] RID;
  39. logic [7:0] RDATA;
  40. bit [1:0] RRESP;
  41. bit RVALID;
  42. bit RREADY;
  43. bit [3:0] RSTRB;
  44. bit RLAST;
  45. //==============================================4kb boundary=====================================//
  46. constraint awaddr_4k{ AWADDR % 4096 + (AWLEN + (1 << AWSIZE) <= 4096;}
  47. constraint araddr_4k{ ARADDR % 4096 + (ARLEN + (1 << ARSIZE) <= 4096;}
  48. //==============================================id must be same for bot read/write operation =====================================//
  49. constraint ali_w_addr{ AWID==ARID;}
  50. constraint ali_r_addr{WID==RID;}
  51. //==============================================burst type always not reserved=====================================//
  52. constraint burst_type{ AWBURST!=2'b11; ARBURST!=2'b11;}
  53. constraint wr_data_size{if(AWBURST==2'b01)
  54. (WDATA inside{[1:((2**AWSIZE)*16)]});}
  55. constraint rd_data_size{if(ARBURST==2'b01)
  56. (RDATA inside{[1:((2**ARSIZE)*16)]});}
  57. constraint wrap_data{ if(AWBURST==2'b10)
  58. WDATA inside {((2**AWSIZE)*2),((2**AWSIZE)*4),((2**AWSIZE)*8),((2**AWSIZE)*16)};}
  59. endclass