【System Verilog and UVM基础入门17】Using get_next_item()

news2024/10/6 22:23:37

从小父亲就教育我,做一个对社会有用的人!

关于握手协议的文章,网上有很多很多,这篇文章是最原滋原味的介绍,希望可以帮助到有缘人!

uvm_driver #(REQ,RSP)

The base class for drivers that initiate requests for new transactions via a uvm_seq_item_pull_port.  The ports are typically connected to the exports of an appropriate sequencer component.

This driver operates in pull mode.  Its ports are typically connected to the corresponding exports in a pull sequencer as follows:

driver.seq_item_port.connect(sequencer.seq_item_export);
driver.rsp_port.connect(sequencer.rsp_export);

uvm_driver is a child of uvm_component]that has a TLM port to communicate with the sequencer. Thedriver is a parameterized class with the type of request and response sequence items.This allows the driver to send back a different sequence item type back to the sequencer as the response.However, most drivers use a response object of the same type as the request sequence item.

The_uvm_driver gets request sequence items (REQ) from the sequencer FIFO using a handshake mechanismand optionally returns a response sequence item (RSP) back to the sequencer response FIFO.There are primarily two ways for the driver to get a sequence item from the sequencer. In this article, we'll look at anexample that uses the first style.

Using get_next_item method in a driver

In this case, the driver requests for a sequence item from the sequencer using the get_next_item methodthrough the seq_item_port TLM handle. Since the implementation of this port is defined in the sequencer,the function call makes the sequencer to pop an item from its internal FIFO and provide it to the driver viathe argument provided in get_next_item method.

Once driver gets the next item, it can drive the data in the received sequence item to the DUT via a virtual interface handle. After the driver has finished driving the item, it has to let the sequencer know that theprocess has finished using item_done method.

How does the sequencer get these sequence items ?

A uvm_sequenceis started on a sequencer which pushes the sequence item onto the sequencer's FIFO.

// -------------
/ get_next_item
// -------------

task uvm_sequencer::get_next_item(output REQ t);
  REQ req_item;

  // If a sequence_item has already been requested, then get_next_item()
  // should not be called again until item_done() has been called.

  if (get_next_item_called == 1)
    uvm_report_error(get_full_name(),
      "Get_next_item called twice without item_done or get in between", UVM_NONE);
  
  if (!sequence_item_requested)
    m_select_sequence();

  // Set flag indicating that the item has been requested to ensure that item_done or get
  // is called between requests
  sequence_item_requested = 1;
  get_next_item_called = 1;
  m_req_fifo.peek(t);
endtask

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/776215.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

CS 144 Lab One -- 流重组器

CS 144 Lab One -- 流重组器 实验结构如何调试StreamReassembler 实现 对应课程视频: 【计算机网络】 斯坦福大学CS144课程 Lab 1 对应的PDF: Lab Checkpoint 1: stitching substrings into a byte stream 实验结构 这幅图完整的说明了CS144 这门实验的结构: 其中…

MySQL约束和数据类型

目录 约束条件 MySQL数据类型 1、数值类型 2、字符串类型 3、日期时间类型 源码等资料获取方法 约束条件 约束条件就是在给字段加一些约束,使该字段存储的值更加符合我们的预期。 常用约束条件如下: UNSIGNED :无符号,值…

【数据结构与算法】哈夫曼编码(最优二叉树)实现

哈夫曼编码 等长编码:占的位置一样 变长编码(不等长编码):经常使用的编码比较短,不常用的比较短 最优:总长度最短 最优的要求:占用空间尽可能短,不占用多余空间,且不…

【MySQL】DML数据操纵语言(非常适合MySQL初学者学习)

🧑‍💻作者名称:DaenCode 🎤作者简介:啥技术都喜欢捣鼓捣鼓,喜欢分享技术、经验、生活。 😎人生感悟:尝尽人生百味,方知世间冷暖。 📖所属专栏:重…

清华大学携手蚂蚁集团,攻坚可信AI、安全通用大模型等关键技术

2023年4月7日,清华大学与蚂蚁集团签署合作协议,双方将在“下一代互联网应用安全技术”方向展开合作,聚焦智能风控、反欺诈等核心安全场景,携手攻坚可信AI、安全大模型等关键技术,并加速技术落地应用,以解决…

NodeJS内置模块 npm包管理工具 nvm版本管理工具 nrm镜像管理工具

Nodejs 下载 下载地址 node 是什么 node.js 是一个开源的,跨平台的 JavaScript 运行环境 运行 js 文件 node 文件.jsnodemon 监听文件变化 npm i nodemon -gnodemon 文件名全局变量 global globalThis node 中顶级对象为 global ,也可以使用 glo…

postgreSQL数据库的安装

文章目录 一、Linux 下安装 postgreSQL 数据库1.1、准备环境1.2、关闭防火墙跟SELinux1.2.1、关闭防火墙 firewalld1.2.2、关闭SELinux 1.3、挂载本地镜像1.4、软件包的下载postgreSQL 一、Linux 下安装 postgreSQL 数据库 1.1、准备环境 操作系统IP应用Red Hat 8192.168.192…

类加载的过程(简单介绍)

目录 一、类加载过程一览 加载: 验证: 准备: 解析: 初始化: 二:类加载器分类 启动类加载器(bootstrap class loader) 扩展类加载器(extensions class loader&…

Nginx外网访问内网如何实现

1、背景 项目要求:将甲方内网的项目能够对外访问,甲方提供一个中间过渡服务器,中间过渡服务器与外网互通,且中间服务器可以访问内网; 外网客户端->中间过渡服务器开放端口:80 中间过渡服务器->内网服…

Cadence Allegro PCB设计88问解析(三十一) 之 Allegro 中 打印(Plot)设置

一个学习信号完整性仿真的layout工程师 在PCB进行投板时,往往会打印一下装备层(Assembly),给贴片,用于核对器件的信息等。下面简单介绍Allegro中打印(Plot)设置。 1. 在Allegro的菜单下选择File命令,点击Plot Setup,会…

无线振弦采集仪应用于岩土工程安全监测的解决方案

无线振弦采集仪应用于岩土工程安全监测的解决方案 随着现代岩土工程的发展,工程规模越来越大,地质灾害频发,安全监测成为岩土工程的重要组成部分。传统的安全监测方法存在一些局限性,如无法实时监测,监测精度不高等问…

途乐证券-沪指震荡跌0.25%,半导体等板块走弱,地产等板块拉升

19日早盘,沪指窄幅震动下探,深成指、创业板指均走低;两市半日成交约4300亿元,北向资金净卖出超40亿元。 截至午间收盘,沪指跌0.25%报3189.81点,深成指跌0.51%,创业板指跌1%;两市合计…

《2023购物中心运营数字化白皮书》正式发布!|爱分析报告

在国家政策鼓励线下实体经济发展、鼓励消费的大背景下,购物中心的发展潜力巨大。但另一方面,随着行业进入存量时代,竞争愈发激烈,品牌扩张乏力,购物中心招商压力增大。以数字化手段加持的精细化运营,成为购…

侦听器watch

在代码逻辑中监听某个数据的变化&#xff0c;这个时候就需要用侦听器 watch 来完成了&#xff1b; 1.data的watch <html lang"en"> <head><meta charset"UTF-8"><meta http-equiv"X-UA-Compatible" content"IEedge&q…

备战秋招 | 笔试强训6

目录 一、选择题 二、编程题 三、选择题题解 四、编程题题解 一、选择题 1、十进制变量i的值为100&#xff0c;那么八进制的变量i的值为&#xff08;&#xff09; A. 146 B. 148 C. 144 D. 142 2、执行下面语句后的输出为 int I1; if(I<0)printf("****\n") …

Java框架 Mybatis入门

0目录 Java框架Mybatis 1..框架介绍 2.Mybatis实战 1.框架介绍 补充MVC思想 为什么使用框架&#xff1f; 效率高&#xff0c;成本低 框架是别人写好的&#xff0c;可以直接调用 框架是基于MVC的思想 框架包中含有MVC思想的所有组成模块&#xff1a;控制层&#xff1b;模型…

zabbix 企业级监控(1) 监控自己

重点一 Zabbix简介在企业网络运维过程中&#xff0c;管理员必须随时关注各服务器和网络的运行状况&#xff0c;以便及时发现问题&#xff0c;尽可能减少故障的发生。当网络中的设备&#xff0c;服务器等数量较多时&#xff0c;为了更加方便&#xff0c;快捷的获得监控信息&…

欧姆龙CP系列PLC以太网通讯欧姆龙cp1e怎么用以太网通讯

大家好&#xff0c;今天要和大家分享的是一款在工控领域中非常实用的产品——捷米特JM-ETH-CP转以太网模块。这款模块采用了即插即用的设计&#xff0c;不仅不会占用PLC的通讯口&#xff0c;而且可以通过复用接口让触摸屏与PLC进行通讯。这个设计真的非常巧妙&#xff0c;相信会…

7-Spring cloud之路由网关zuul

7-Spring cloud之路由网关zuul 1. 前言2. 关于zuul2.1 zuul基本原理2.2 为什么要使用zuul 3. 搭建zuul3.1 项目结构3.2 基本配置3.2.1 pom文件3.2.2 yml文件3.3.3 启动类 3.3 测试看效果3.3.1 演示3.3.1 架构图 4. zuul路由访问映射规则4.1 映射服务提供者的服务名4.2 访问加前…

概率论的学习和整理--番外13:一个经典dubo模型的概率计算等

目录 1 经典模型知识科普 1.1 知识来源 1.2 下面是摘取的部分规则 2 这个经典dubo的概率和期望 2.1 网上计算的概率&#xff0c;期望全是负&#xff0c;赌徒悲剧 2.2 为什么会这样呢 3 假设把下注庄家不抽水&#xff0c;获得100%收益而不是95&#xff0c;多少次后可以赢…