SV
=========================================================
====== Synopsys VIP SATA
=========================================================
=========================================================
top
=========================================================
//----------------------------------
// パッケージの挿入(topの外側)
//----------------------------------
// Include package and interfaces
`include "uvm_pkg.sv" // UVM should be included before VIP
//----------------------------------
// パッケージのimport(topの中)
//----------------------------------
module TB;
// Import UVM package.
import uvm_pkg::*;
// Import SVT UVM package.
import svt_uvm_pkg::*;
//----------------------------------
// class 定義、インスタンス等の include (topの中)
//----------------------------------
//----------------------------------
// DUT とインターフェイスの接続 (topの中)
//----------------------------------
//----------------------------------
// UVM run_test () 呼び出し (topの中)
//----------------------------------
initial begin
// Run UVM test.
run_test();
end
=========================================================
インスタンス
=========================================================
//----------------------------------
// 記述場所
//----------------------------------
top module の中に書く。
別ファイルにして include するのがよい
//----------------------------------
// インスタンス宣言とDUT接続
//----------------------------------
satasvc_device device0 ( ... ) ; // instantiate in test_top
=========================================================
SATA config
=========================================================
in function build_phase();
sataavc_device_uvm_component device0;
uvm_config_string::set(this, "device0", "model_instance_scope", "top.device0");
device0 = new ("device0", this);
parameters: See Table 4-1
SECTOR_SIZE (default 512 Bytes) 2の倍数
device_vars.xport[0].sector_size_var.write(status, 510);
defparam top.device0.xport0.MAX_SECTOR_SIZE = 516;
===========================================================
その他
===========================================================
sata_vip/Example
test_script.v
buffer (for temp?)
SATASVC_MEM_PATH.AllocateMemory(DISPLAY_NAME, wbuf_len*4, wbuf_ptr);
SATASVC_MEM_PATH.WriteMemory(DISPLAY_NAME, wbuf_ptr + (ii*4), data_dword, 4);
#DMA write (buff -> device)
top.tester0.ScriptDMAWriteSectors(lba, sec_cnt, ext_mode, wbuf_ptr, wbuf_len, ei_code, id);
#data compare
`SATASVC_MEM_PATH.ReadMemory(DISPLAY_NAME, rbuf_ptr + (ii*4), data_dword);
`SATASVC_MEM_PATH.ReadMemory(DISPLAY_NAME, wbuf_ptr + (ii*4), exp_data_dword)
test_script_uvm.sv
atasvc_exerciser_transaction_item::ScriptDMAWriteSectors_task;
===========================================================
output intrq is open <= no this port in device
task ReceiveDword (....);
UE(User Exits) == callbacks
PA: Protocol Analyzer
define SATASVC_INCLUDE_PA // PA logging enabled
include/satasvc_pa_pakg.sv to filelist
Memory Model
svc_mem mem0; // instance in test_top
------------------------------------------------------------
Transaction log B.2.10.4