|
-
- //Base test
- class base_test extends uvm_test;
- `uvm_component_utils(base_test)
- env e;
- reset_sequence reset_seq;
- // read_sequence read_seq;
- // write_sequence write_seq;
- // write_read_sequence write_read_seq;
- // multi_write_multi_read_sequence multi_write_multi_read_seq;
- // slaveerr_sequence slaveerr_seq;
-
- function new(string name="test", uvm_component parent);
- super.new(name, parent);
- endfunction
-
- virtual function void build_phase(uvm_phase phase);
- super.build_phase(phase);
- e = env::type_id::create("e", this);
- reset_seq=reset_sequence::type_id::create("reset_seq");
- // read_seq=read_sequence::type_id::create("read_seq");
- // write_seq=write_sequence::type_id::create("write_seq");
- // write_read_seq=write_read_sequence::type_id::create("write_read_seq");
- //multi_write_multi_read_seq=multi_write_multi_read_sequence::type_id::create("multi_write_multi_read_seq");
- // slaveerr_seq=slaveerr_sequence::type_id::create("slaveerr_seq");
- endfunction
-
- virtual function void start_of_simulation_phase(uvm_phase phase);
- super.start_of_simulation_phase(phase);
- uvm_top.print_topology();
- endfunction
-
- virtual function void report_phase(uvm_phase phase);
- uvm_report_server svr;
- super.report_phase(phase);
-
- svr = uvm_report_server::get_server();
- if(svr.get_severity_count(UVM_FATAL)+svr.get_severity_count(UVM_ERROR)>0) begin
- `uvm_info(get_type_name(), "---------------------------------------", UVM_NONE)
- `uvm_info(get_type_name(), "---- TEST FAIL ----", UVM_NONE)
- `uvm_info(get_type_name(), "---------------------------------------", UVM_NONE)
- end
- else begin
- `uvm_info(get_type_name(), "---------------------------------------", UVM_NONE)
- `uvm_info(get_type_name(), "---- TEST PASS ----", UVM_NONE)
- `uvm_info(get_type_name(), "---------------------------------------", UVM_NONE)
- end
- endfunction
- endclass
-
- //multi write read test
- class multi_write_multi_read_test extends base_test;
- `uvm_component_utils(multi_write_multi_read_test)
-
- function new(string name="multi_write_multi_read_test", uvm_component parent);
- super.new(name, parent);
- endfunction
-
- virtual function void build_phase(uvm_phase phase);
- super.build_phase(phase);
- endfunction
-
- virtual task run_phase(uvm_phase phase);
- phase.raise_objection(this);
- `uvm_info(get_type_name(), "*** Starting test ***", UVM_MEDIUM)
-
- reset_seq.start(e.agnt.sqr);
- `uvm_info(get_type_name(), "*** Ended test ***", UVM_MEDIUM)
- phase.drop_objection(this);
- endtask
- endclass
-
- /*
- //slave error test
- class slaveerr_test extends base_test;
- `uvm_component_utils(slaveerr_test)
-
- function new(string name="slaveerr_test", uvm_component parent);
- super.new(name, parent);
- endfunction
-
- virtual function void build_phase(uvm_phase phase);
- super.build_phase(phase);
- endfunction
-
- virtual task run_phase(uvm_phase phase);
- phase.raise_objection(this);
- `uvm_info(get_type_name(), "*** Starting test ***", UVM_MEDIUM)
-
- slaveerr_seq.start(e.agnt.sqr);
- `uvm_info(get_type_name(), "*** Ended test ***", UVM_MEDIUM)
- phase.drop_objection(this);
- endtask
- endclass
- */
|