寄存器模块代码详解
好戏开始:
`include "param_def.v"
package mcdf_rgm_pkg;
import uvm_pkg::*;
`include "uvm_macros.svh"
import reg_pkg::*;
//具有uvm_reg类型的专用寄存器描述[write-red-reg]
class ctrl_reg extends uvm_reg;
`uvm_object_utils(ctrl_reg)
//注册、声明
uvm_reg_field reserved;//声明寄存器字段reserved
rand uvm_reg_field pkt_len;//声明寄存器字段pkt_len
rand uvm_reg_field prio_level;//声明寄存器字段prio_level
rand uvm_reg_field chnl_en;
//写覆盖组,覆盖点以及点数
covergroup value_cg;//声明一个覆盖组实例value_cg
option.per_instance = 1;// 选项,指定每个实例有自己的覆盖计数器
reserved: c