Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

111 rader
4.8 KiB

  1. interface axi_intf #(parameter A_WIDTH = 16, D_WIDTH = 16)(input bit clk, bit rstn);
  2. // Write Address
  3. logic [8:0] AWID;
  4. logic [A_WIDTH-1:0] AWADDR;
  5. logic [3:0] AWLEN;
  6. logic [2:0] AWSIZE;
  7. logic [1:0] AWBURST;
  8. logic AWVALID, AWREADY;
  9. logic WRITE;
  10. // Write Data
  11. logic [8:0] WID;
  12. logic [D_WIDTH-1:0] WDATA;
  13. logic [(D_WIDTH/8)-1:0] WSTRB;
  14. logic WLAST, WVALID, WREADY;
  15. // Write Response
  16. logic [8:0] BID;
  17. logic [1:0] BRESP;
  18. logic BVALID, BREADY;
  19. // Read Address
  20. logic [8:0] ARID;
  21. logic [A_WIDTH-1:0] ARADDR;
  22. logic [3:0] ARLEN;
  23. logic [2:0] ARSIZE;
  24. logic [1:0] ARBURST;
  25. logic ARVALID, ARREADY;
  26. // Read Data
  27. logic [8:0] RID;
  28. logic [D_WIDTH-1:0] RDATA;
  29. logic [1:0] RRESP;
  30. logic RLAST, RVALID, RREADY;
  31. /* Clocking Blocks: 3 CBs are defined as follows
  32. 1. m_drv_cb - Clocking block for master driver
  33. 2. s_drv_cb - Clocking block for slave driver
  34. 3. mon_cb - Clocking block for monitors of both master and slave */
  35. clocking m_drv_cb @(posedge clk);
  36. output AWID, AWADDR, AWLEN, AWSIZE, AWBURST,AWVALID, WID, WDATA, WSTRB, WLAST, WVALID,
  37. BREADY, ARID, ARADDR, ARLEN, ARSIZE, ARBURST, ARVALID, RREADY,WRITE;
  38. input AWREADY, WREADY, BID, BRESP, BVALID, ARREADY, RID, RDATA, RRESP, RLAST, RVALID;
  39. endclocking
  40. clocking mon_cb @(posedge clk);
  41. input AWID, AWADDR, AWLEN, AWSIZE, AWBURST,AWVALID, WID, WDATA, WSTRB, WLAST, WVALID,
  42. BREADY, ARID, ARADDR, ARLEN, ARSIZE, ARBURST, ARVALID, RREADY,WRITE;
  43. input AWREADY, WREADY, BID, BRESP, BVALID, ARREADY, RID, RDATA, RRESP, RLAST, RVALID;
  44. endclocking
  45. clocking s_drv_cb @(posedge clk);
  46. input AWID, AWADDR, AWLEN, AWSIZE, AWBURST,AWVALID, WID, WDATA, WSTRB, WLAST, WVALID,
  47. BREADY, ARID, ARADDR, ARLEN, ARSIZE, ARBURST, ARVALID, RREADY,WRITE;
  48. output AWREADY, WREADY, BID, BRESP, BVALID, ARREADY, RID, RDATA, RRESP, RLAST, RVALID;
  49. endclocking
  50. modport MDRV(clocking m_drv_cb, input rstn);
  51. modport MMON(clocking mon_cb, input rstn);
  52. modport SDRV(clocking s_drv_cb, input rstn);
  53. modport SMON(clocking mon_cb, input rstn);
  54. // *************************************************************************************************
  55. // Assertions
  56. // *************************************************************************************************
  57. // Property to check whether all write address channel remains stable after AWVALID is asserted
  58. property aw_valid;
  59. @(posedge clk) $rose(AWVALID) |-> ( $stable(AWID)
  60. &&$stable(AWADDR)
  61. &&$stable(AWLEN)
  62. &&$stable(AWSIZE)
  63. &&$stable(AWBURST)) throughout AWREADY[->1];
  64. endproperty
  65. // Property to check whether all write address channel remains stable after AWVALID is asserted
  66. property w_valid;
  67. @(posedge clk) $rose(WVALID) |-> ( $stable(WID)
  68. && $stable(WDATA)
  69. && $stable(WSTRB)
  70. && $stable(WLAST)) throughout WREADY[->1];
  71. endproperty
  72. // Property to check whether all write address channel remains stable after AWVALID is asserted
  73. property b_valid;
  74. @(posedge clk) $rose(BVALID) |-> ( $stable(BID)
  75. && $stable(BRESP)) throughout BREADY[->1];
  76. endproperty
  77. // Property to check whether all write address channel remains stable after AWVALID is asserted
  78. property ar_valid;
  79. @(posedge clk) $rose(ARVALID) |-> ( $stable(ARID)
  80. &&$stable(ARADDR)
  81. &&$stable(ARLEN)
  82. &&$stable(ARSIZE)
  83. &&$stable(ARBURST)) throughout ARREADY[->1];
  84. endproperty
  85. // Property to check whether all write address channel remains stable after AWVALID is asserted
  86. property r_valid;
  87. @(posedge clk) $rose(RVALID) |-> ( $stable(RID)
  88. && $stable(RDATA)
  89. && $stable(RRESP)
  90. && $stable(RLAST)) throughout RREADY[->1];
  91. endproperty
  92. // assert property (aw_valid);
  93. // assert property (w_valid);
  94. //assert property (b_valid);
  95. // assert property (ar_valid);
  96. // assert property (r_valid);
  97. endinterface //axi_intf