这是寄存器模型类中唯一派生自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. Docker入门(七):部署app

    这个<Docker入门系列>文档,是根据Docker官网(https://docs.docker.com)的帮助文档大致翻译而成.主要是作为个人学习记录.有错误的地方,Robin欢迎大家指 ...

  2. eclipse中如何去除警告:Class is a raw type. References to generic type Class<T> should be parameterized

    转自:https://blog.csdn.net/zwr_1022/article/details/78583872 解决前的源代码: public class test {public static ...

  3. win10 安装nodejs,报错there is a problem in the windows installer package

    今天重装了win10系统,开始安装各种软件,装到node的时候我崩溃了,报错there is a problem in the windows installer package··· 度娘了各种安装 ...

  4. “找女神要QQ号码”——跟风篇java新手版(求指点)

    吃完粽子后闲来无事,于是准备在园子里面看看.突然看到了一个“找女神要QQ号码”的文章,顿时精力充沛了~~^_^. 该文章楼主说明此算法来自于<啊哈!算法>,图文并茂,非常不错.<啊哈 ...

  5. Git的使用 强制放弃本地所有修改,获取master中最新版本更新本地

    git fetch --all git reset --hard origin/master git fetch --all 的意思是,下载远程库的所有内容,但不与本地做任何合并 git reset ...

  6. MySQL数据库基础详解(非原创)

    文章大纲 一.数据库简介二.Mysql数据库简介三.Mysql安装与服务启动(Windows版本)四.Mysql图形化工具五.Mysql存储引擎精讲六.Mysql数据类型介绍七.Mysql主要专业名称 ...

  7. Kolla多节点环境安装OVN

    安装OVN组件 控制节点 ### 安装ovn-northd # wget https://copr.fedorainfracloud.org/coprs/leifmadsen/ovs-master/r ...

  8. 洛谷P1549 棋盘问题(2)

    P1549 棋盘问题(2) 题目描述 在N*N的棋盘上(1≤N≤10),填入1,2,…,N*N共N*N个数,使得任意两个相邻的数之和为素数. 例如:当N=2时,有: 其相邻数的和为素数的有: 1+2, ...

  9. Noip2016day1 玩具迷题toy

    题目描述 小南有一套可爱的玩具小人, 它们各有不同的职业. 有一天, 这些玩具小人把小南的眼镜藏了起来. 小南发现玩具小人们围成了一个圈,它们有的面朝圈内,有的面朝圈外.如下图: 这时singer告诉 ...

  10. HTML <!doctype>声明

    昨天看代码的时候,发现在<!doctype>中添加了新的属性,以前写代码的时候并不会在该声明里添加新的属性.昨天看到了,就把它记下来学习一下,顺便整理成文档.以便日后复习. <!DO ...