参考UVM实战3.3 filed_automation机制 `define uvm_file_int(ARG, FLAG) class trans; rand bit [47 : 0] dmac; rand bit [31 : 0] dq []; `uvm_object_utils_begin(trans) `uvm_filed_int(dmac, UVM_ALL_ON) `uvm_filed_array_int(dq, UVM_ALL_ON) `uvm_object_utils_end endclass 域自动化后就可以直接调用copy(),compare(),print();