UVM學習之 uvm object類

2021-09-18 06:45:31 字數 3919 閱讀 9512

1. 層次結構

2. 類的預定義

typedef class uvm_report_object;

typedef class uvm_objection; // uvm_object類中未使用

typedef class uvm_component; // uvm_object類中未使用

typedef class uvm_status_container;

3. 類的宣告

virtual class uvm_object extends uvm_void;

endclass

4. 類的方法

變數的宣告

// 靜態變數,決定是否使能uvm中的播種機制,影響全域性的reseed()方法;

static bit use_uvm_seeding = 1;

// 區域性變數,通過new函式將類的例項化名傳遞給該變數,變數對子類及外部不可見;

local string m_leaf_name;

// 區域性變數,使用new()函式例項化類時,m_inst_count自動加1並傳遞給該區域性變數,用於返回例項化id,變數對子類及外部不可見;

local int m_inst_id;

// 靜態區域性變數,用於返回例項化次數,該區域性變數對子類可見,對外部不可見;

static protected int m_inst_count;

static uvm_status_container __m_uvm_status_container = new;

// 查詢表,用於copy()函式的實現;

local static uvm_object uvm_global_copy_map[uvm_object];

方法的宣告
extern function new (string name="");

extern static function int get_inst_count();

extern virtual function int get_inst_id ();

extern virtual function string get_name ();

extern virtual function string get_full_name ();

extern virtual function void set_name (string name);

virtual function string get_type_name (); return ""; endfunction

virtual function uvm_object create (string name=""); return null; endfunction

extern function void reseed ();

extern virtual function uvm_object clone ();

extern function void print (uvm_printer printer=null);

extern function string sprint (uvm_printer printer=null);

extern virtual function void do_print (uvm_printer printer);

extern virtual function string convert2string();

extern function void record (uvm_recorder recorder=null);

extern virtual function void do_record (uvm_recorder recorder);

extern function void copy (uvm_object rhs);

extern virtual function void do_copy (uvm_object rhs);

extern function bit compare (uvm_object rhs, uvm_comparer comparer=null);

extern virtual function bit do_compare (uvm_object rhs,

uvm_comparer comparer);

extern function int pack (ref bit bitstream,

input uvm_packer packer=null);

extern function int pack_bytes (ref byte unsigned bytestream,

input uvm_packer packer=null);

extern function int pack_ints (ref int unsigned intstream,

input uvm_packer packer=null);

extern virtual function void do_pack (uvm_packer packer);

extern function int unpack (ref bit bitstream,

input uvm_packer packer=null);

extern function int unpack_bytes (ref byte unsigned bytestream,

input uvm_packer packer=null);

extern function int unpack_ints (ref int unsigned intstream,

input uvm_packer packer=null);

extern virtual function void do_unpack (uvm_packer packer);

extern virtual function void set_int_local (string field_name,

uvm_bitstream_t value,

bit recurse=1);

extern virtual function void set_string_local (string field_name,

string value,

bit recurse=1);

extern virtual function void set_object_local (string field_name,

uvm_object value,

bit clone=1,

bit recurse=1);

extern local function void m_pack (inout uvm_packer packer);

extern local function void m_unpack_pre (inout uvm_packer packer);

extern local function void m_unpack_post (uvm_packer packer);

extern virtual function void __m_uvm_field_automation (uvm_object tmp_data__,

int what__,

string str__);

extern protected virtual function uvm_report_object m_get_report_object();

方法的實

UVM原始碼學習 uvm queue

uvm queue從uvm object擴充套件而來,是對sv queue的擴充套件。sv中,佇列queue有以下幾種方法 假設已定義int q q.push back a 元素a壓入隊尾 q.push front a 元素a壓入隊首 q.pop front 彈出隊首元素 q.pop back 彈出...

UVM原始碼學習 uvm misc

uvm misc,uvm雜貨鋪,定義了uvm用到但不好歸類的雜散的task function class。uvm void,基類,所有uvm類都直接或間接擴充套件自uvm void。uvm void中沒有任何成員變數或方法,是個抽象類,其作用與c語言中的void相似。uvm scope stack,...

UVM原始碼學習 uvm barrier

uvm barrier直接擴充套件自uvm object,提供多程序間的同步機制。簡單講就是使用者設定乙個閾值,每個等待同步的程序在執行完之後進入wait for等待事假觸發,當進入wait for的程序數達到閾值時觸發該事件,所有等待同步的程序跳出wait for繼續執行,從而實現多個程序的同步。...