Verification Mind Games---how to think like a verifier像验证工程师一样思考

1. 有效的验证需要验证工程师使用不同于设计者的思维方式思考问题。具体来说,验证更加关心在严格遵循协议的基础上发现设计里面的bug,搜索corner cases,对设计的不一致要保持零容忍的态度。

mindset:一套人们应该持有的确定的态度,有时候又被描述为心里惯性,群体思维,范式,在分析和决策过程中很难抵消mindset的影响。

举一个简单的例子,当你看到任何verification engineer的职位,你会发现这是一个关于语言,方法学,工具以及某种领域的知识集合。
 
很多有经验的工程师可以学习阅读一个规范,建立验证规范,以及编写充分的代码去实现,但是却在某个关键的点达不到验证的目的。

本文将试图使用能够出现在验证环境中的一系列关键的选择揭示验证心态:
   1. Is it the verification environment’s duty to accurately replicate the real world?
验证环境是否有责任复制真实的环境?
2.Is it acceptable for the testbench and/or testcases to make use of design signals?
是否允许TB或者testcase使用设计的信号
3. Is it worthwhile to target corner cases that designers consider invalid?
考虑设计者认为无效的corner cases是否值得

合格的验证mindset跟设计mindset有很大的不同,需要多年的经验,指点,以及在困难中摸索的经历才能培养出来。
这贯穿在:每一个决定,每一行代码,每一次会议,每一个项目。对设计为中心的验证方法说不!!!

当前,验证思维,依旧是一个被低估和弱势的产业。在本文中,我们将分析为什么这个验证有效性的话题如此关键。我们也将讨论影响一个TB debuggability的决策。在这个文章里面,我们将介绍一个验证工程师应该做的,而不是他们应该如何做。

1. INTEROPERATING VERSUS STRESSING(互操作对抗强调)
 验证里面最重要的挑战就是划出设计强调的重点,并与设计进行互操作。只有怀有正确的mindset,才可以正确的划分验证重点,
这些里面比较常见的有:
1. clock and data recovery (CDR) 时钟和数据恢复
2. 错误情况下的握手
3. 状态指标,例如fifo的空满

A. 时钟数据恢复
1. 一些协议规定,数据在发送和接收的时候没有附带的时钟信号。在这种情况下,设计需要实现这个协议需要实现一个时钟数据恢复功能,以便在传输过来的数据里面提取时钟。针对这个设计,开发VC验证组件,也有一个相似的需求,没有时钟信号发送和接收,只有数据。
252137069655373.jpg

如图所示,当实现VC的监控,验证工程师必须决定以哪种方法收到来自DUT的数据。是否应该在monitor实现一个CDR算法,而这个算法已经在设计中实现过。当然不是这样,更好的解决办法是实现一个路差分(锁相环)算法基于相同的参考时钟DUT使用作为参考,并利用锁相环的输出样本输入数据。
252137079659201.jpg
This approach accomplishes the following:
1.  It verifies that the DUT’s data stream is in sync with the reference clock
2.  It avoids any possibility of the testbench masking a problem because the CDR algorithm is too tolerant
3.  It has better simulation performance than doing costly checks on data rates
4.  It is faster and simpler to implement than CDR
我们来看看验证视角和设计视角有什么不同:
当构建一个RTL CDR组件,设计师努力用最健壮的方式构建算法,能够与广泛的外部设备交互。而验证工程师反而试图尽量创建不够强健的算法。so it stresses the design and fails on the slightest deviation from the protocol specification.
因此,验证的目标不是为了复制现实,而是尽可能全面的验证设计,虽然可能这有可能不是很现实。

B.  Handshaking Error Handling 
大部分的协议要求使用一组反馈信息 ACK/NACK报文来指示在最近接受的传输中是否有错误产生。
252137085746316.jpg

1. 如果按照设计的思维,VC的实现应该遵循协议规范,也就是说自动发送ACK,当接受到一笔没有错误的传输,自动发送NACK当接收到一笔错误的传输。
2. 上面的似乎忽视一种情况,正常情况下DUT永远不会产生错误的传输。那么TB也就会永远不会返回NACK。
3. 而验证组件需要负责产生这么一个错误,the testcase writer must be able to manually control the VC to send a NACK in response.
4. 还有另外一种情况,就是握手异常的情况,就是握手信号没有返回给design。这要求VC需要support 错误插入的功能。
5. 验证VC如果实现完整的协议会导致验证失败以及浪费精力。

C.  Status Indicators and Clocks (这是大家都知道的典型,这里省略)

OUTSIDE-THE-BOX VERIFICATION PLANNING 
A. Corner case identification:
1. Function Input Parameters
a. whether or not something is valid or invalid is in fact irrelevant; what is important is, can such a scenario ever happen, and if the answer it “yes”, then it must be simulated to ensure that the design recovers from it.  
b. It was the responsibility of the verification engineer to take a higher-level view of things in order to build the best possible verification environment. 
2. Register Accesses:
考虑这种情况:a design is specified to have a low-power mode that can be activated by writing a ‘1’ to a given register bit.  The bit’s default value is ‘0’, making the device be in normal mode by default.  In th
1. 首先我们应该很容易想到测试如下的情况: 
x  Write ‘1’ to the low-power bit
x  Check that the device enters low-power mode
x  Write ‘0’ to the low-power bit
x  Check that the device exits low-power mode
2. 但是有另外一种情况没有考虑到:
what happens when a ‘0’ is written to the bit when the bit is already ‘0’ (or a ‘1’ when it is already ‘1’)? 
这里面会隐含一个关键性的错误,说不定在0的情况下写0回不正确的进入低功耗模式。

验证计划包括所有可能发生的事情,不管是否DUT旨在处理它们,和无论设计师可能会说什么
As you can imagine, doing error injection in creative ways greatly expands the search space for finding bugs, and so experience and a degree of gut-feeling is required to target those areas most likely to be concealing real bugs.  Where is the line between inter-operating with the design and stressing it?

PRIORITIZING DEBUGGABILITY 
1. 一个良好的TB强调可调试性!!
A.  Protocols with Bi-Directional Ports 
Some devices try to save on pins and board trace routing by employing bi-directional ports for data and/or clock signals.  这种协议的本质,至少有两个设备负责驱动数据和时钟信号,否则也不会使用双向端口。
252137092932931.png
上面是一种接口的实现方式,这种方式的可调试很低,因为所有的DUT和VC连接在同一个双向端口,但是很难确定到底是哪个组件在驱动总线。

Using a verification mindset, we make use of both unidirectional and bi-directional signals to achieve both ease of debug and adherence to the protocol.  
252137105581743.png
(In Figure 10, “(highz1, strong0)” means “when signal is assigned with a ‘1’, it takes on ‘Z’; when it is assigned to with a ‘0’, it takes on ‘0’ ”). 
252137112624128.png
在DUT里面,使用如下方式驱动:
252137120741714.png

ROUNDING OUT THE MINDSET 

To what extent must the verification component follow the design protocol?
验证组件在多大程度上必须遵循设计协议?

The DUT is sending data without an accompanying clock - should my VC do Clock-Data-Recovery?...No
DUT发送数据没有附带时钟- 我的VC是否需要做Clock-Data-Recovery

The protocol has bi-directional signals with the potential for multiple masters.  Should I split each signal into two at the VC interface level?... Yes.

252137130433785.png 


​V.  ROUNDING OUT THE MINDSET 

A. No coverage without Checking:没有检查就没有覆盖率
  以前面对一个low-power使能位写0当这个bit为0的时候为例,突出了另一个验证心态,就是never do coverage on anything in the absence of doing checks.  This rules out doing register value coverage, because it is misleading at best and a waste of compute resources in a large system-on-a-chip (SOC). 

B Approach to Debugging 调试的方法:
1. 使用waveform的方式debug并不适合VC,因为很多操作并不消耗任何时间,在发送激励的时候使用动态数据结构。应该有一种心态,最好的debug 工具应该是logfile本身。对于logfile:
1. 要有适当的和一致的消息模式
2. 当然这并不是说,可以不用波形去调试,但是更应该依靠日志。
3. 如果不能够使用logfile去debug,那只能说明消息机制需要提高。

C.  Zoom-In, Zoom-Out Thinking 
When zoomed-in the engineer does tasks such as:
x  Understand design specifications
x  Write verification plans based on the specification
x  Write code to implement the verification plan
x  Write testcase code
x  Debug failing testcases 

Verification engineers must also do a series of tasks while zoomed-out such as:
x  Decide which design features to focus on to maximize bug discovery Devise creative ways to tease bugs out
x  Allocate time so as to get  the most important checking and coverage for the effort  

The main reason for this is difference is that verifiers need to deal with a larger scope than designers do.  
   1. 不同于设计必须在tapeout之前完成他们的工作,验证可以再tapeout之后继续进行,或者放弃
   2. 验证人员想做到这一点,必须要接触广泛的信息
   3. system architecture, design hot-spots, project schedule, and client deliverables.

D. What Are We Trying to Accomplish Here? 

E.  Coverage, Not Testcases 

F.  Liaison between Design Architect and Design Engineer 

G Quitting on First Error

最后简单的总结一下:

1. The protocol says that when an error condition is detected, the design must send a NACK packet.  Should my VC automatically send NACK too?... No.
协议说,当检测到一个错误条件,设计必须发送NACK包。应该我的VC也自动发送NACK吗?…不。

2. The design indicates FIFO fullness with signals “full” and “empty”.  Can my VC or testcase make use of them to prevent overflow/underflow?... Yes, but only if checks are made on them

3. Is it sufficient to limit error injection to  the scenarios for which the DUT has  detection capabilities?... No.

4. A design has a register bit that defaults to ‘0’, and causes the DUT to enter low-power mode when written with ‘1’.  Is writing ‘0’ when it is already at ‘0’ important to test?... Yes.

5. Can I snoop the design’s internal clock to synchronize my VC to?... No.

6. Should I ask myself “what is it I’m trying to accomplish here?” when embarking on a new verification task... Yes
我应该问自己“是什么我想完成吗?“当开始一个新的验证任务……是的

7. Is it my responsibility to ensure that the design architect and design engineer are on the same page?... Yes.
这是我的责任,以确保设计建筑师和设计工程师在同一页面吗?…是的。

8.  Should I regularly step back from low-level implementation and take a high-level view of the verification effort as a whole?... Yes.

9. A design draws circles of radius given by an input parameter.  Is testing a radius of zero important?... Yes

10. Should I implement coverage on individual register values?...No.

11. Should I be relying mainly on waveforms to debug my VC?...No.

12. Is coverage closure more important than testcase passing rate?... Yes.


13. Is it necessary to allow a simulation to continue running after it has encountered an error?... No.




来自为知笔记(Wiz)


转载于:https://www.cnblogs.com/bob62/p/4050968.html

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

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

相关文章

discuz安装_手动搭建 Discuz! 论坛

一、搭建LAMP环境安装软件(Apache、MariaDB、PHP)yum install httpd php php-fpm php-mysql mariadb mariadb-server -y2.启动服务systemctl start httpdsystemctl start mariadbsystemctl start php-fpm3.安装后首次启动mariadb设置mysql_secure_installation4.登录 MariaDB&a…

关系数据库的几种设计范式介绍

关系数据库的几种设计范式介绍1、第一范式(1NF) 在任何一个关系数据库中,第一范式(1NF)是对关系模式的基本要求,不满足第一范式(1NF)的数据库就不是关系数据库。 所谓…

蓝桥杯 1223 第 2 场 小白入门赛

蓝桥小课堂-平方和 模拟 1 2 2 2 3 2 ⋯ n 2 n ⋅ ( n 1 ) ⋅ ( 2 n 1 ) 6 1^22^23^2\cdotsn^2\dfrac{n\;\cdot\;(n 1)\;\cdot\;(2n1)}{6} 122232⋯n26n⋅(n1)⋅(2n1)​。 write(n * (n 1) * (n * 2 1) / 6);房顶漏水啦 m a x ( 最大的行 − 最小的行 , 最大的列 −…

jar包是什么意思_面试难度五颗星:JVM有Full GC,为什么还会 OutOfMemoryError?

点击上方蓝色“后端面试那些事儿”,选择“设为星标”学最好的别人,做最好的我们来源:R 大zhihu.com/question/38511221问题:R大回复平时有逛知乎的习惯,一般对JVM相关话题比较感兴趣。偶然看到这个问题,结果…

mapreduce介绍_MapReduce:简单介绍

mapreduce介绍MapReduce是Google流行的一种并行编程技术。 它用于处理大量数据。 仅通过将工作并行分配给多台机器,就可以在合理的时间内完成这种处理。 每台机器都处理一小部分数据。 MapReduce是一种编程模型,使开发人员可以专注于编写处理数据的代码&…

系统执行sql很慢达梦工具执行很快的简单解决方式

现象描述:系统功能查询很慢,拷贝查询sql到达梦工具中执行速度很快 1.问题分析: 达梦SQL执行耗时异常问题排查_qq_39693441的博客-CSDN博客_sql耗时分析 2.解决方式1: 在程序sql中拼接随机数如: select /*动态随机数*…

PHP在程序处理过程中动态输出内容

在安装discuz或其他一些开源产品的时候&#xff0c;在安装数据库时页面上的安装信息都是动态输出出来的&#xff0c;主要通过php两个函数来实现的&#xff0c; flush();ob_flush(); 代码如下 <html xmlns"http://www.w3.org/1999/xhtml"><head> <meta…

roads 构筑极致用户体验_长安马自达「悦马星空」计划上线,为用户带来极致服务体验...

日前,第十八届广州车展顺利举行。期间各大汽车品牌齐聚亮相,这其中,也包括众人熟悉的长安马自达。据悉,在本次车展上,长安马自达除携品牌全系车型次世代MAZDA3 昂克赛拉、2020款MAZDA CX-5、MAZDA CX-30和MAZDA CX-8亮相外,还正式发布「悦马星空」用户共创计划。资料显示,「悦马…

从数百万个光纤(而不是数千个线程)中查询数据库

jOOQ是在Java中执行SQL的好方法&#xff0c; Quasar光纤带来了大大提高的并发性 我们很高兴在平行宇宙的 Fabio Tudone的jOOQ博客上宣布另一个非常有趣的来宾帖子。 Parallel Universe开发了一个开源堆栈&#xff0c;使开发人员可以轻松地在JVM上对极端的并发应用程序进行编码…

matlab向量的排序(自写函数)

function a_ed arraysort(a) %冒泡排序法 for i 1:length(a)-1%进行多少次比较for j1i:length(a)%每次求出最大的数&#xff0c;放在最后if(a(j)<a(i))tem a(i);a(i) a(j);a(j) tem;endenda_ed a; endclc; clear; a [2 4 4 6 14 0 2 8 4 1 9 4] b arraysort(a)转载于…

标准错误处理机制——error

在 Golang 中&#xff0c;错误处理机制一般是函数返回时使用的&#xff0c;是对外的接口&#xff0c;而异常处理机制 panic-recover 一般用在函数内部。 error 类型介绍 error 类型实际上是抽象了 Error() 方法的 error 接口&#xff0c;Golang 使用该接口进行标准的错误处理。…

ejb 2.0 3.0_EJB 3.1全局JNDI访问

ejb 2.0 3.0如本系列前面部分所述&#xff0c;EJB 3.0版规范的主要缺点是缺少可移植的全局JNDI名称。 这意味着没有可移植的方式将EJB引用链接到应用程序外部的Bean。 EJB v。3.1规范用自己的话填补了这一定义&#xff1a; “一个标准化的全局JNDI名称空间和一系列相关的名称空…

Oracle11.2.0.4 RAC安装文档

1 环境配置 参考官方文档《Grid Infrastructure Installation Guide for Linux》 1.1 软件环境 操作系统&#xff1a; [roothowe1 ~]# cat /etc/redhat-release Red Hat Enterprise Linux Server release 6.2 (Santiago) [roothowe1 ~]# uname -a Linux howe1 2.6.32-220.el6.i…

威海二职工业机器人专业_现在各大专开设的工业机器人专业前景如何?

我就是某专科学校工业机器人技术专业人的学生&#xff0c;专业是现在专业几个负责人15年向教育局申请申办的&#xff0c;16年正式招生&#xff0c;我也有幸作为第一届学生来到了该学校。先说教学吧&#xff0c;因为是第一届所以很多设备、设施都不完善&#xff0c;我觉得最重要…

协同遗漏的效果–使用简单的NIO客户端/服务器测量回送延迟

在这篇文章中&#xff0c;我演示了许多想法和技术&#xff1a; 如何编写一个简单的非阻塞NIO客户端/服务器 协调遗漏的影响 如何测量百分位数的延迟&#xff08;相对于简单平均&#xff09; 如何在计算机上计时延迟回送 我最近正在为客户端服务器应用程序开发低延迟基准测…

python 画蜘蛛_如何学习 R 绘图?

写在前面&#xff1a;为啥不用excel绘制这些图&#xff0c;用PoweBI&#xff0c;帆软BI等可视化软件来绘图&#xff0c;不是更方便吗&#xff1f;的确&#xff0c;这些工具都很方便&#xff0c;但同时&#xff0c;它们显得很呆&#xff0c;不够灵活&#xff0c;更为致命的是&am…

conflicting types for ‘方法名’ 的错误

将main()的实现写在drawShapes(),drawCircle(),drawRectangle()...之前. 结果编译的时候出现了 conflicting types for "方法名"的错误。故到网上查找答案&#xff0c;发现在这里需要严格按照函数出现的先后顺序才能成功编译&#xff0c;也就是main()要定义在最后&a…

Oracle用户system解锁

1.首先进入sql plus窗口&#xff08;参见上一篇文章&#xff09; 2.进入后&#xff1a;输入select username,account_status from dba_users where usernameSYSTEM; 3.查询system用户的状态和用户名&#xff0c;这里能查询出密码&#xff0c;但是查出来的密码是密文&#xff0c…

captcha库_将CAPTCHA添加到您的GWT应用程序

captcha库什么是验证码&#xff1f; 在一个充满恶意机器人的世界中&#xff0c;您应该怎么做才能保护您宝贵的Web应用程序&#xff1f; 您真正应该做的基本事情之一就是向其中添加CAPTCHA功能。 如果您不熟悉&#xff08;听起来有些奇怪&#xff09;&#xff0c;则CAPTCHA是确保…

GCD6: 在GCD上异步执行非UI相关任务

讨论&#xff1a;在主队列、串行队列和并发队列上异步执行代码块才能见识到 GCD 的真正实力。 要在分派队列上执行异步任务,你必须使用下面这些函数中的其中一个: dispatch_async为了异步执行向分派队列提交一个 Block Object(2 项都通过参数指定) dispatch_async_f为了异步执行…