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.

97 lines
3.1 KiB

  1. //Base test
  2. class base_test extends uvm_test;
  3. `uvm_component_utils(base_test)
  4. env e;
  5. reset_sequence reset_seq;
  6. // read_sequence read_seq;
  7. // write_sequence write_seq;
  8. // write_read_sequence write_read_seq;
  9. // multi_write_multi_read_sequence multi_write_multi_read_seq;
  10. // slaveerr_sequence slaveerr_seq;
  11. function new(string name="test", uvm_component parent);
  12. super.new(name, parent);
  13. endfunction
  14. virtual function void build_phase(uvm_phase phase);
  15. super.build_phase(phase);
  16. e = env::type_id::create("e", this);
  17. reset_seq=reset_sequence::type_id::create("reset_seq");
  18. // read_seq=read_sequence::type_id::create("read_seq");
  19. // write_seq=write_sequence::type_id::create("write_seq");
  20. // write_read_seq=write_read_sequence::type_id::create("write_read_seq");
  21. //multi_write_multi_read_seq=multi_write_multi_read_sequence::type_id::create("multi_write_multi_read_seq");
  22. // slaveerr_seq=slaveerr_sequence::type_id::create("slaveerr_seq");
  23. endfunction
  24. virtual function void start_of_simulation_phase(uvm_phase phase);
  25. super.start_of_simulation_phase(phase);
  26. uvm_top.print_topology();
  27. endfunction
  28. virtual function void report_phase(uvm_phase phase);
  29. uvm_report_server svr;
  30. super.report_phase(phase);
  31. svr = uvm_report_server::get_server();
  32. if(svr.get_severity_count(UVM_FATAL)+svr.get_severity_count(UVM_ERROR)>0) begin
  33. `uvm_info(get_type_name(), "---------------------------------------", UVM_NONE)
  34. `uvm_info(get_type_name(), "---- TEST FAIL ----", UVM_NONE)
  35. `uvm_info(get_type_name(), "---------------------------------------", UVM_NONE)
  36. end
  37. else begin
  38. `uvm_info(get_type_name(), "---------------------------------------", UVM_NONE)
  39. `uvm_info(get_type_name(), "---- TEST PASS ----", UVM_NONE)
  40. `uvm_info(get_type_name(), "---------------------------------------", UVM_NONE)
  41. end
  42. endfunction
  43. endclass
  44. //multi write read test
  45. class multi_write_multi_read_test extends base_test;
  46. `uvm_component_utils(multi_write_multi_read_test)
  47. function new(string name="multi_write_multi_read_test", uvm_component parent);
  48. super.new(name, parent);
  49. endfunction
  50. virtual function void build_phase(uvm_phase phase);
  51. super.build_phase(phase);
  52. endfunction
  53. virtual task run_phase(uvm_phase phase);
  54. phase.raise_objection(this);
  55. `uvm_info(get_type_name(), "*** Starting test ***", UVM_MEDIUM)
  56. reset_seq.start(e.agnt.sqr);
  57. `uvm_info(get_type_name(), "*** Ended test ***", UVM_MEDIUM)
  58. phase.drop_objection(this);
  59. endtask
  60. endclass
  61. /*
  62. //slave error test
  63. class slaveerr_test extends base_test;
  64. `uvm_component_utils(slaveerr_test)
  65. function new(string name="slaveerr_test", uvm_component parent);
  66. super.new(name, parent);
  67. endfunction
  68. virtual function void build_phase(uvm_phase phase);
  69. super.build_phase(phase);
  70. endfunction
  71. virtual task run_phase(uvm_phase phase);
  72. phase.raise_objection(this);
  73. `uvm_info(get_type_name(), "*** Starting test ***", UVM_MEDIUM)
  74. slaveerr_seq.start(e.agnt.sqr);
  75. `uvm_info(get_type_name(), "*** Ended test ***", UVM_MEDIUM)
  76. phase.drop_objection(this);
  77. endtask
  78. endclass
  79. */