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.

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