AXI-Verification architecture, functional coverage and assertions based coverage code
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.

82 lines
2.2 KiB

  1. `include "uvm_macros.svh"
  2. import uvm_pkg::*;
  3. import my_pkg::*;
  4. `include "design.sv"
  5. `include "pkg.sv"
  6. `include "axi_sequence_item.sv"
  7. `include "axi_sequence.sv"
  8. `include "axi_sequencer.sv"
  9. `include "axi_env.sv"
  10. `include "axi_interface.sv"
  11. `include "axi_driver.sv"
  12. `include "axi_test.sv"
  13. `include "axi_agent.sv"
  14. module top;
  15. //interface instance
  16. axi_if vif ();
  17. //connecting dut signals with interface and gloable signals
  18. axi_slave dut(.clk(vif.clk),
  19. .resetn(vif.resetn),
  20. ///////////////////write address channel
  21. .awvalid(vif.awvalid),
  22. .awready(vif.awready),
  23. .awid(vif.awid),
  24. .awlen(vif.awlen),
  25. .awsize(vif.awsize),
  26. .awaddr(vif.awaddr),
  27. .awburst(vif.awburst),
  28. /////////////////////write data channel
  29. .wvalid(vif.wvalid),
  30. .wready(vif.wready),
  31. .wid(vif.wid),
  32. .wdata(vif.wdata),
  33. .wstrb(vif.wstrb),
  34. .wlast(vif.wlast),
  35. ///////////////write response channel
  36. .bready(vif.bready),
  37. .bvalid(vif.bvalid),
  38. .bid(vif.bid),
  39. .bresp(vif.bresp),
  40. ////////////// read address channel
  41. .arready(vif.arready),
  42. .arid(vif.arid),
  43. .araddr(vif.araddr),
  44. .arlen(vif.arlen),
  45. .arsize(vif.arsize),
  46. .arburst(vif.arburst),
  47. .arvalid(vif.arvalid),
  48. ///////////////////read data channel
  49. .rid(vif.rid),
  50. .rdata(vif.rdata),
  51. .rresp(vif.rresp),
  52. .rlast(vif.rlast),
  53. .rvalid(vif.rvalid),
  54. .rready(vif.rready));
  55. initial begin
  56. vif.clk <= 0;
  57. vif.resetn <=0;
  58. end
  59. initial begin
  60. #10
  61. vif.resetn <=1;
  62. end
  63. //clock generator
  64. always #5 vif.clk <= ~vif.clk;
  65. initial begin
  66. //pass interface to lower hierarchy
  67. uvm_config_db#(virtual axi_if)::set(null, "*", "vif", vif);
  68. run_test("give test name please");// need to write UVM_test name
  69. end
  70. initial begin
  71. $dumpfile("dump.vcd");
  72. $dumpvars;
  73. end
  74. endmodule