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.

104 regels
1.9 KiB

  1. Interface intf(input bit clock,bit reset);
  2. /////////////////write_address channel///////////////////
  3. input rand bit [3:0] awid;
  4. input rand logic [31:0]awaddr;
  5. input rand logic [3:0] awlen;
  6. input rand logic [2:0] awsize;
  7. input rand logic [1:0] awburst;
  8. input logic awvalid;
  9. output logic awready;
  10. ////////////write_data channel///////////////////////////
  11. input rand bit[3:0] wid;
  12. input rand logic [31:0]wdata[];
  13. input logic [3:0]wstrb;
  14. input logic wlast;
  15. input logic wvalid;
  16. output logic wready;
  17. //////////write_response channel////////////////////////
  18. output bit [3:0]bid;
  19. output logic [1:0]bresp;
  20. output logic bvalid;
  21. input logic bready;
  22. /////////////read_address//////////////////////////////
  23. input randc bit [3:0] arid;
  24. input rand logic [31:0]araddr;
  25. input rand logic [3:0]arlen;
  26. input rand logic [2:0]arsize;
  27. input rand logic [1:0]arburst;
  28. input logic arvalid;
  29. output logic arready;
  30. //////////////read_data/////////////////////////////
  31. input bit [3:0] rid;
  32. input logic [31:0]rdata[];
  33. output logic [1:0]rresp;
  34. output logic rlast;
  35. output logic rvalid;
  36. input logic rready;
  37. ///Value of 2'b11 on AWBURST is not permitted when AWVALID is high///
  38. property p;
  39. @(posedge clk) awvalid |-> !(awburst==2'b11);
  40. endproperty
  41. assert property(p);
  42. $display("assertion pass")
  43. else
  44. $uvm_fatal("assertion fail")
  45. ///When AWVALID is high,AWADDR cannot be unknown values////
  46. property p1;
  47. @(posedge clk) awvalid |-> !($isunknown(awaddr)) ;
  48. endproperty
  49. assert property(p1)
  50. $display("assertion pass")
  51. else
  52. $uvm_fatal("assertion fail")
  53. ///WVALID can assert before AWVALID///
  54. property p2;
  55. @(posedge clk) wvalid |=> awvalid;
  56. endproperty
  57. assert property(p2)
  58. $display("assertion pass")
  59. else
  60. $uvm_fatal("assertion fail")
  61. ///AWREADY should be asserted before or after AWVALID is asserted////
  62. property p3;
  63. @(posedge clk) awready |=> awvalid;
  64. endproperty
  65. assert property(p3)
  66. $display("assertion pass")
  67. else
  68. $uvm_fatal("assertion fail")