uvm_reg_item 扩展自uvm_sequence_item,也就说寄存器模型定义了transaction item. adapter 的作用是把这uvm_reg_item转换成uvm_sequence_item,再经由uvm_sequencer发送个uvm_driver,最终在总线上传输。

//------------------------------------------------------------------------------
// Title: Generic Register Operation Descriptors
//
// This section defines the abstract register transaction item. It also defines
// a descriptor for a physical bus operation that is used by <uvm_reg_adapter>
// subtypes to convert from a protocol-specific address/data/rw operation to
// a bus-independent, canonical r/w operation.
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// CLASS: uvm_reg_item
//
// Defines an abstract register transaction item. No bus-specific information
// is present, although a handle to a <uvm_reg_map> is provided in case a user
// wishes to implement a custom address translation algorithm.
//------------------------------------------------------------------------------ class uvm_reg_item extends uvm_sequence_item; `uvm_object_utils(uvm_reg_item) // Variable: element_kind
//
// Kind of element being accessed: REG, MEM, or FIELD. See <uvm_elem_kind_e>.
//
uvm_elem_kind_e element_kind; uvm_object element;
rand uvm_access_e kind; // Variable: value
//
// The value to write to, or after completion, the value read from the DUT.
// Burst operations use the <values> property.
//
rand uvm_reg_data_t value[]; // TODO: parameterize
constraint max_values { value.size() > && value.size() < ; } rand uvm_reg_addr_t offset;
uvm_status_e status;
uvm_reg_map local_map;
uvm_reg_map map;
uvm_path_e path;
rand uvm_sequence_base parent;
int prior = -;
rand uvm_object extension;
string bd_kind;
string fname;
int lineno; function new(string name="");
super.new(name);
value = new[];
endfunction // Function: convert2string
//
// Returns a string showing the contents of this transaction.
//
virtual function string convert2string();
string s,value_s;
s = {"kind=",kind.name(),
" ele_kind=",element_kind.name(),
" ele_name=",element==null?"null":element.get_full_name() }; if (value.size() > && uvm_report_enabled(UVM_HIGH, UVM_INFO, "RegModel")) begin
value_s = "'{";
foreach (value[i])
value_s = {value_s,$sformatf("%0h,",value[i])};
value_s[value_s.len()-]="}";
end
else
value_s = $sformatf("%0h",value[]);
s = {s, " value=",value_s}; if (element_kind == UVM_MEM)
s = {s, $sformatf(" offset=%0h",offset)};
s = {s," map=",(map==null?"null":map.get_full_name())," path=",path.name()};
s = {s," status=",status.name()};
return s;
endfunction virtual function void do_copy(uvm_object rhs);
endfunction endclass //------------------------------------------------------------------------------
//
// CLASS: uvm_reg_bus_op
//
// Struct that defines a generic bus transaction for register and memory accesses, having
// ~kind~ (read or write), ~address~, ~data~, and ~byte enable~ information.
// If the bus is narrower than the register or memory location being accessed,
// there will be multiple of these bus operations for every abstract
// <uvm_reg_item> transaction. In this case, ~data~ represents the portion
// of <uvm_reg_item::value> being transferred during this bus cycle.
// If the bus is wide enough to perform the register or memory operation in
// a single cycle, ~data~ will be the same as <uvm_reg_item::value>.
//------------------------------------------------------------------------------ typedef struct { // Variable: kind
//
// Kind of access: READ or WRITE.
//
uvm_access_e kind; // Variable: addr
//
// The bus address.
//
uvm_reg_addr_t addr; // Variable: data
//
// The data to write. If the bus width is smaller than the register or
// memory width, ~data~ represents only the portion of ~value~ that is
// being transferred this bus cycle.
//
uvm_reg_data_t data; // Variable: n_bits
//
// The number of bits of <uvm_reg_item::value> being transferred by
// this transaction. int n_bits; /*
constraint valid_n_bits {
n_bits > 0;
n_bits <= `UVM_REG_DATA_WIDTH;
}
*/ // Variable: byte_en
//
// Enables for the byte lanes on the bus. Meaningful only when the
// bus supports byte enables and the operation originates from a field
// write/read.
//
uvm_reg_byte_en_t byte_en; // Variable: status
//
// The result of the transaction: UVM_IS_OK, UVM_HAS_X, UVM_NOT_OK.
// See <uvm_status_e>.
//
uvm_status_e status; } uvm_reg_bus_op;

uvm_reg_item——寄存器模型(五)的更多相关文章

  1. uvm_reg_predictor——寄存器模型(十七)

    这是寄存器模型类中唯一派生自uvm_component的类,我们的寄存器模式需要实时,以最接近的方式知道DUT中寄存器的变化,uvm_reg_predictor就是为这个而生的. // TITLE: ...

  2. uvm_reg_sequence——寄存器模型(六)

    寄存器模型 uvm_reg_sequence是UVM自带所有register sequence 的基类. 该类包含model, adapter, reg_seqr(uvm_sequencer). 感觉 ...

  3. uvm_reg_model——寄存器模型(一)

    对于一个复杂设计,寄存器模型要能够模拟任意数量的寄存器域操作.UVM提供标准的基类库,UVM的寄存器模型来自于继承自VMM的RAL(Register Abstract Layer),现在可以先将寄存器 ...

  4. [Beego模型] 五、构造查询

    [Beego模型] 一.ORM 使用方法 [Beego模型] 二.CRUD 操作 [Beego模型] 三.高级查询 [Beego模型] 四.使用SQL语句进行查询 [Beego模型] 五.构造查询 [ ...

  5. uvm_reg_cbs——寄存器模型(十六)

    当你完成寄存器模型的时候,你就会想到给后来的人一个接口,给他更多的扩展,让他做更多的事,一般而言,只有做VIP时,会想到做callbacks. typedef class uvm_reg; typed ...

  6. uvm_reg_block——寄存器模型(七)

    这是寄存器模型的顶层 //------------------------------------------------------------------------ // Class: uvm_ ...

  7. uvm_reg_defines——寄存器模型(四)

    文件: src/marcos/uvm_reg_defines 类: 无 该文件是寄存器模型src/reg/* 文件对于的宏文件,主要定义了寄存器地址位宽,寄存器数据位宽,字节的大小.计算机从最初的8, ...

  8. UVM——寄存器模型相关的一些函数

    0. 引言 在UVM支持的寄存器操作中,有get.update.mirror.write等等一些方法,在这里整理一下他们的用法. 寄存器模型中的寄存器值应该与DUT保持同步,但是由于DUT的值是实时更 ...

  9. uvm_reg_fifo——寄存器模型(十五)

    当我们对寄存器register, 存储器memory, 都进行了建模,是时候对FIFO进行建模了 uvm_reg_fifo毫无旁贷底承担起了这个责任,包括:set, get, update, read ...

随机推荐

  1. bzoj 1014 [JSOI2008]火星人prefix——splay+哈希

    题目:https://www.lydsy.com/JudgeOnline/problem.php?id=1014 用splay维护字符串,每个点记录子树的哈希值,然后二分查询. 二分不是把两个点的哈希 ...

  2. 禁用ubuntu 客人会话

    sudo vi /usr/share/lightdm/lightdm.conf.d/50-guest-wrapper.conf 添加: allow-guest=false 重启.

  3. 使用tableview的表头button 实现多 cell 的选择

    首先声明本篇博文是作者原创,在QQ群里看到一枚猿友求助,问题描述:使用UItableView 实现在表头里点击不同的按钮,去刷新当前的界面(界面是大的 cell),自己就实现了一下. 实验原材料:故事 ...

  4. POI生成Excel工具类

    import java.io.BufferedInputStream; import java.io.BufferedOutputStream; import java.io.ByteArrayInp ...

  5. iOS 中使用 MJExtension 遇到 关键字(id) 怎么办

    MJExtension 是个人比较喜欢用的json 转model 的软件,当遇到系统关键字时就会出现崩溃,解决方式如下 1.建立Modle 解析类,服务返回数据中带有id,这个时候用字典转Mode(m ...

  6. CodeForces 644B【模拟】

    题意: 查询数 和 最大的队列容量+1: 按时间顺序 ti代表,第i个出线的时间: di代表,第i个需要处理的时间: 对于第i个输出他所需要的时间完成,或者拒绝进入输出-1: 思路: 真是MDZZ了, ...

  7. hdoj5493【树状数组+二分】

    题意: 给你n个人的高度, 再给出一个值代表该高度下有前面比他高的 或 后面比他高的人数, 求满足条件下的最小字典序, 不行的话输出"impossible" 思路: 对于最小字典序 ...

  8. 基于ndk_r7_windows编译实现ndk项目,不需要cygwin

    下面就介绍下Android NDK的入门学习过程: 入门的最好办法就是学习Android自带的例子, 这里就通过学习Android的NDK自带的demo程序:hello-jni来达到这个目的. 一. ...

  9. bzoj5093:图的价值(第二类斯特林数+NTT)

    传送门 首先,题目所求为\[n\times 2^{C_{n-1}^2}\sum_{i=0}^{n-1}C_{n-1}^ii^k\] 即对于每个点\(i\),枚举它的度数,然后计算方案.因为有\(n\) ...

  10. [HNOI2010] 矩阵 matrix

    标签:dfs+剪枝. 题解: 这道题看着就像一道dfs题目,没有什么算法可以用来算这个东西,于是想想暴搜. 如果我们确定因为是2*2的子矩阵的和,如果确定了其中三个,那么就可以确定第四个,发现如果确定 ...