init
This commit is contained in:
49
code/vezba5-3/vezba5/verif/calc_test_simple.sv
Normal file
49
code/vezba5-3/vezba5/verif/calc_test_simple.sv
Normal file
@@ -0,0 +1,49 @@
|
||||
`ifndef TEST_SIMPLE_SV
|
||||
`define TEST_SIMPLE_SV
|
||||
|
||||
class test_simple extends uvm_test;
|
||||
|
||||
`uvm_component_utils(test_simple)
|
||||
|
||||
virtual interface calc_if vif;
|
||||
|
||||
function new(string name = "test_simple", uvm_component parent = null);
|
||||
super.new(name,parent);
|
||||
endfunction : new
|
||||
|
||||
function void build_phase(uvm_phase phase);
|
||||
super.build_phase(phase);
|
||||
|
||||
`uvm_info(get_type_name(), "Starting build phase...", UVM_LOW)
|
||||
|
||||
// Preuzimanje virtuelnog interfejsa iz konfiguracione baze podataka.
|
||||
if (!uvm_config_db#(virtual calc_if)::get(null, "*", "calc_if", vif))
|
||||
`uvm_fatal("NOVIF",{"virtual interface must be set:",get_full_name(),".vif"})
|
||||
// ...
|
||||
endfunction : build_phase
|
||||
|
||||
|
||||
task main_phase(uvm_phase phase);
|
||||
super.main_phase(phase);
|
||||
phase.raise_objection(this); //objasnjenje u materijalu za vezbu 6
|
||||
|
||||
|
||||
`uvm_info(get_type_name(), "Starting main phase...", UVM_LOW)
|
||||
//postavljanje komande
|
||||
vif.req1_cmd_in = 4'b0001;
|
||||
//postavljanje prvog podatka
|
||||
vif.req1_data_in = 32'h0001;
|
||||
//Cekanje 1 takt
|
||||
@(posedge vif.clk);
|
||||
//Uklanjanje komande
|
||||
vif.req1_cmd_in = 4'b0000;
|
||||
//Postavljanje drugog podatka
|
||||
vif.req1_data_in = 32'h0002;
|
||||
// ...
|
||||
#1000ns;
|
||||
phase.drop_objection(this); //objasnjenje u materijalu za vezbu 6
|
||||
endtask : main_phase
|
||||
|
||||
endclass : test_simple
|
||||
|
||||
`endif
|
||||
Reference in New Issue
Block a user