target.svファイル内のtargetクラスで、次のようになっています。
class target extends uvm_component; // uvm_componentを継承する local bit [31:0] m_data; uvm_tlm_b_target_socket #(target, apb_rw) sock;// TLM2のイニシエータソケット `uvm_component_utils(target) // set_config_xxx/get_config_xxxのためのおまじない function new(string name = "target", uvm_component parent = null); super.new(name, parent); // sock = new("sock", this); // ここでsockを生成してもOK m_data = 32'hDEADBEEF; endfunction function void build_phase(uvm_phase phase);// run_test()が呼ばれると実行される sock = new("sock", this); endfunction // ターゲットには、マスタから呼ばれる b_transportタスクを実装する task b_transport(apb_rw rw, uvm_tlm_time delay); case (rw.addr) 32'h0000_FF00: begin if (rw.kind == apb_rw::READ) rw.data = m_data; else m_data = rw.data; end endcase #5; // 5単位時間待つ endtask // start_of_simulationフェーズで呼ばれる // 下記のようなフォーマットでメッセージを表示する // # UVM_INFO target.sv(56) @ 0: target [TRGT/RPT/START] m_data: 'hdeadbeef function void start_of_simulation_phase(uvm_phase phase); `uvm_info("TRGT/RPT/START", $psprintf("m_data: 'h%h", m_data), UVM_NONE) endfunction // reportフェーズで呼ばれる // 下記のようなフォーマットでメッセージを表示する // # UVM_INFO target.sv(60) @ 10: target [TRGT/RPT/FINAL] m_data: 'h21524110 function void report_phase(uvm_phase phase); `uvm_info("TRGT/RPT/FINAL", $psprintf("m_data: 'h%h", m_data), UVM_NONE) endfunction endclass
UVM 1.0で導入されたTLM2 IFは、b_transportタスクです。
start_of_simulation_phaseタスクとreport_phaseタスクは無くても動作します。
検証、Verification、SystemVerilog、UVM、Unified Verification Methodology