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

// TITLE: Explicit Register Predictor
//------------------------------------------------------------------------------
//
// The <uvm_reg_predictor> class defines a predictor component,
// which is used to update the register model's mirror values
// based on transactions explicitly observed on a physical bus.
//------------------------------------------------------------------------------ class uvm_predict_s;
bit addr[uvm_reg_addr_t];
uvm_reg_item reg_item;
endclass //------------------------------------------------------------------------------
//
// CLASS: uvm_reg_predictor
//
// Updates the register model mirror based on observed bus transactions
//
// This class converts observed bus transactions of type ~BUSTYPE~ to generic
// registers transactions, determines the register being accessed based on the
// bus address, then updates the register's mirror value with the observed bus
// data, subject to the register's access mode. See <uvm_reg::predict> for details.
//
// Memories can be large, so their accesses are not predicted.
//
//------------------------------------------------------------------------------ class uvm_reg_predictor #(type BUSTYPE=int) extends uvm_component; `uvm_component_param_utils(uvm_reg_predictor#(BUSTYPE)) // Variable: bus_in
//
// Observed bus transactions of type ~BUSTYPE~ are received from this
// port and processed.
//
// For each incoming transaction, the predictor will attempt to get the
// register or memory handle corresponding to the observed bus address.
//
// If there is a match, the predictor calls the register or memory's
// predict method, passing in the observed bus data. The register or
// memory mirror will be updated with this data, subject to its configured
// access behavior--RW, RO, WO, etc. The predictor will also convert the
// bus transaction to a generic <uvm_reg_item> and send it out the
// ~reg_ap~ analysis port.
//
// If the register is wider than the bus, the
// predictor will collect the multiple bus transactions needed to
// determine the value being read or written.
//
uvm_analysis_imp #(BUSTYPE, uvm_reg_predictor #(BUSTYPE)) bus_in; // Variable: reg_ap
//
// Analysis output port that publishes <uvm_reg_item> transactions
// converted from bus transactions received on ~bus_in~.
uvm_analysis_port #(uvm_reg_item) reg_ap; // Variable: map
//
// The map used to convert a bus address to the corresponding register
// or memory handle. Must be configured before the run phase.
//
uvm_reg_map map; // Variable: adapter
//
// The adapter used to convey the parameters of a bus operation in
// terms of a canonical <uvm_reg_bus_op> datum.
// The <uvm_reg_adapter> must be configured before the run phase.
//
uvm_reg_adapter adapter; // Function: new
//
// Create a new instance of this type, giving it the optional ~name~
// and ~parent~.
//
function new (string name, uvm_component parent);
endfunction // This method is documented in uvm_object
static string type_name = "";
virtual function string get_type_name();
endfunction // Function: pre_predict
//
// Override this method to change the value or re-direct the
// target register
//
virtual function void pre_predict(uvm_reg_item rw);
endfunction local uvm_predict_s m_pending[uvm_reg]; // Function- write
//
// not a user-level method. Do not call directly. See documentation
// for the ~bus_in~ member.
//
virtual function void write(BUSTYPE tr);
endfunction // Function: check_phase
//
// Checks that no pending register transactions are still queued. virtual function void check_phase(uvm_phase phase);
endfunction endclass

uvm_reg_predictor——寄存器模型(十七)的更多相关文章

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

    保存寄存器的值 观察DUT寄存器值的变化. //---------------------------------------------------------------------------- ...

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

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

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

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

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

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

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

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

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

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

  7. uvm_reg_item——寄存器模型(五)

    uvm_reg_item 扩展自uvm_sequence_item,也就说寄存器模型定义了transaction item. adapter 的作用是把这uvm_reg_item转换成uvm_sequ ...

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

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

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

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

随机推荐

  1. LMV实验

    在CentOS6.8上创建过程如下: #对需要创建lvm的卷进行磁盘分区[root@www ~13:40:48]#fdisk /dev/sde Device contains neither a va ...

  2. WCF IIS部署

    创建WCFHost应用程序 Iservice.cs using System; using System.Collections.Generic; using System.Linq; using S ...

  3. java之二叉树--未完待续

    参考http://how2j.cn/k/collection/collection-tree/476.html#nowhere 二叉树概念 二叉树由各种节点组成二叉树特点:每个节点都可以有左子节点,右 ...

  4. 24.集成ASP.NETCore Identity

    正常的情况下view页面的错误的显示应该是这么去判断的 这里我们就不加判断为了,直接用这个div 显示就可以了.当有错误会自动显示在div内 asp.net core Identity加入进来 这里用 ...

  5. Laravel框架的一些配置

    服务器的配置 1.在apache下的配置 配置httpd-conf:php5_module.rewrite_module.Listen 配置extra/httpd-vhost:端口.站点.域名.默认首 ...

  6. C/C++ Sleep(0)

    Sleep(0) 的意义是放弃当前线程执行的时间片,把自身放到等待队列之中.这时其它的线程就会得到时间片进行程序的程序.Sleep(0)能够降低当前线程的执行速 度,比如:现在系统中有100个线程(先 ...

  7. NOIP2014提高组 联合权值(距离为2的树形dp)

    联合权值 题目描述 无向连通图 GG 有 nn 个点,n-1n−1 条边.点从 11 到 nn 依次编号,编号为 ii 的点的权值为 W_iWi​,每条边的长度均为 11.图上两点 (u, v)(u, ...

  8. SVN版本控制图标未显示或显示异常解决方法

    SVN版本控制图标未显示问题解决方法,刚开始遇到这个问题的时候,好苦恼.经过“千辛万苦”的努力,终于得以解决,分享给大家,希望能帮到各位哦! 工具/原料   SVN安装包 方法/步骤     首先安装 ...

  9. PHP json 对象 数组互相转换

    json格式转为数组/对象 json_decode() json 对象/数组转json格式 json_encode()

  10. 洛谷P2029 跳舞

    P2029 跳舞 题目描述 小明今天得到一个跳舞毯游戏程序Dance.游戏每次连续出N个移动的“箭头”,箭头依次标号为1到N,并且的相应的分数S[1..N].如果你能“踏中”第i号箭头,你将获得相应的 ...