uvm_object_utils_begin(my_transaction) uvm_field_int(dmac, UVM_ALL_ON) uvm_field_int(smac, UVM_ALL_ON) uvm_field_int(ether_type, UVM_ALL_ON) uvm_field_array_int(pload, UVM_ALL_ON) uvm_field_int(crc, UVM_ALL_ON)
`uvm_field_int(ARG, FLAG) //整数 `uvm_field_real(ARG, FLAG) //实数 `uvm_field_enum(T, ARG, FLAG) //枚举 `uvm_field_object(ARG, FLAG) //object `uvm_field_event(ARG, FLAG) //事件 `uvm_field_string(ARG, FLAG) //字符串 与动态数组有关的uvm_field宏: `uvm_field_array_enum(AR...
30`uvm_field_int(dmac, UVM_ALL_ON) 31`uvm_field_int(smac, UVM_ALL_ON) 32`uvm_field_int(ether_type, UVM_ALL_ON) 33`uvm_field_array_int(pload, UVM_ALL_ON) 34`uvm_field_int(crc, UVM_ALL_ON) 35`uvm_field_int(crc_err, UVM_ALL_ON | UVM_NOPACK) 36`uvm_object_utils_end ...
`uvm_object_utils_begin(my_transaction) `uvm_field_int(dmac, UVM_ALL_ON) `uvm_field_int(smac, UVM_ALL_ON) `uvm_field_int(ether_type, UVM_ALL_ON) `uvm_field_array_int(pload, UVM_ALL_ON) `uvm_field_int(crc, UVM_ALL_ON) `uvm_field_int(crc_err, UVM_ALL_ON | UVM_NOPACK) ...
`uvm_field_array_int(pload, UVM_ALL_ON) //byte `uvm_field_int(crc, UVM_ALL_ON) `uvm_object_utils_end Sequencer extends uvm_sequencer #(my_transaction); 产生transaction sequencer与driver的关系非常密切,因此要把其加入agent中 一个sequence在向sequencer发送transaction前,要先向sequencer发送一个请求...
`defineuvm_field_array_object(ARG,FLAG) `defineuvm_field_array_string(ARG,FLAG) 这里只有4种,相比于前面的uvm_field系列宏少了event类型和real类型。另外一个重要的变化是enum类型的数组里也只有两个参数。 与静态数组相关的uvm_field系列宏有:
这里大家注意下,数组类型声明的是uvm_field_sarray_int, 传递参数的时候还是按照int的方式传递,只不过变量名字带了数组元素下表,并且支持星号通配符。 2.5 传递string数组和enum数组 string数组、enum数组的使用方法和int数组类似,没什么可说的。参照图9的声明方法和图10的命令行参数。
`uvm_object_utils(my_transaction)30`uvm_object_utils_begin(my_transaction)31`uvm_field_int(dmac,UVM_ALL_ON)32`uvm_field_int(smac,UVM_ALL_ON)33`uvm_field_int(ether_type,UVM_ALL_ON)34`uvm_field_array_int(pload,UVM_ALL_ON)35`uvm_field_int(crc,UVM_ALL_ON)36`uvm_object_utils_end...
这里使用uvm_object_utils_begin和uvm_object_utils_end来实现my_transaction的factory注册,在这两个宏中间,使用uvm_field宏注册所有字段。uvm_field系列宏随着transaction成员变量的不同而不同,如上面的定义中出现了针对bit类型的uvm_field_int及针对 byte类型动态数组的uvm_field_array_int。
登录后复制`uvm_object_utils_begin(my_transaction) `uvm_field_int(dmac, UVM_ALL_ON) `uvm_field_int(smac, UVM_ALL_ON) `uvm_field_int(ether_type, UVM_ALL_ON) `uvm_field_array_int(pload, UVM_ALL_ON) `uvm_field_int(crc, UVM_ALL_ON) ...