- 浏览: 30225 次
最新评论
用断言风格写验证平台的基本方法
- 博客分类:
- 技术杂绘
用断言风格写验证平台的基本方法
22小时前
终于在SystemVerilog.in上面找到了Srikanth那本书的奇异用法,快收起来
Assertions Based Verification Using SystemVerilog
Introduction Assertions are primarily used to validate the behaviour of a design. ("Is it working correctly?") They may also be used to provide functional coverage information for a design ("How good is the test?"). Assertions can be checked dynamically by simulation, or statically by a separate property checker tool i.e. a formal verification tool that proves whether or not a design meets its specification. Such tools may require certain assumptions about the design’s behaviour to be specified. In SystemVerilog there are two kinds of assertions: immediate (assert) and concurrent (assert property). Coverage statements (cover property) are concurrent and have the same syntax as concurrent assertions, as do assume property statements. Another similar statement expect is used in testbenches; it is a procedural statement that checks that some specified activity occurs. The three types of concurrent assertion statement and the expect statement make use of sequences and properties that describe the design’s temporal behaviour i.e. behaviour over time, as defined by one or more clocks. Immediate Assertions: Immediate assertions are procedural statements and are mainly used in simulation. An assertion is basically a statement that something must be true, similar to the if statement. The difference is that an if statement does not assert that an expression is true, it simply checks that it is true, e.g.: if (A == B) ... // Simply checks if A equals B
assert (A == B); // Asserts that A equals B; if not, an error is generated If the conditional expression of the immediate assert evaluates to X, Z or 0, then the assertion fails and the simulator writes an error message. An immediate assertion may include a pass statement and/or a fail statement. In our example the pass statement is omitted, so no action is taken when the assert expression is true. If the pass statement exists: assert (A == B)
$display ("OK. A equals B"); it is executed immediately after the evaluation of the assert expression. The statement associated with an else is called a fail statement and is executed if the assertion fails: assert (A == B)
$display ("OK. A equals B");
else
$error("It's gone wrong"); Note that you can omit the pass statement and still have a fail statement: assert (A == B)
else
$error("It's gone wrong"); The failure of an assertion has a severity associated with it. There are three severity system tasks that can be included in the fail statement to specify a severity level: $fatal, $error (the default severity) and $warning. In addition, the system task $info indicates that the assertion failure carries no specific severity. Here are some examples:
ReadCheck: assert (data == correct_data)
else
$error("memory read error");
Igt10: assert (I > 10)
else
$warning("I has exceeded 10"); The pass and fail statements can be any legal SystemVerilog procedural statement. They can be used, for example, to write out a message, set an error flag, increment a count of errors, or signal a failure to another part of the testbench. AeqB: assert (a == b)
else begin error_count++; $err or("A should equal B"); end Concurrent Assertions The behaviour of a design may be specified using statements similar to these: "The Read and Write signals should never be asserted together." "A Request should be followed by an Acknowledge occurring no more than two clocks after the Request is asserted." Concurrent assertions are used to check behaviour such as this. These are statements that assert that specified properties must be true. For example, assert property (!(Read && Write)); asserts that the expression Read && Write is never true at any point during simulation. Properties are built using sequences. For example, assert property (@(posedge Clock) Req |-> ##[1:2] Ack); where Req is a simple sequence (it’s just a boolean expression) and ##[1:2] Ack is a more complex sequence expression, meaning that Ack is true on the next clock, or on the one following (or both). |-> is the implication operator, so this assertion checks that whenever Req is asserted, Ack must be asserted on the next clock, or the following clock. Concurrent assertions like these are checked throughout simulation. They usually appear outside any initial or always blocks in modules, interfaces and programs. (Concurrent assertions may also be used as statements in initial or always blocks. A concurrent assertion in an initial block is only tested on the first clock tick.) The first assertion example above does not contain a clock. Therefore it is checked at every point in the simulation. The second assertion is only checked when a rising clock edge has occurred; the values of Req and Ack are sampled on the rising edge of Clock.
发表评论
-
C/E盘各目录及Private文件夹详解
2012-01-20 10:59 739C/E盘各目录及Private文件夹详解 2011年09月2 ... -
中航工业洪都交付C919大飞机机身等直段部段
2012-01-20 10:59 858中航工业洪都交付C919大 ... -
I2C―― C程序
2012-01-20 10:59 1169I2C―― C程序 2012年01月09日 一、 ... -
C# 绑定值设定格式
2012-01-20 10:59 822C# 绑定值设定格式 2012年01月17日 1。日期格 ... -
boost log 使用碰到的问题.
2012-01-19 15:54 2147boost log 使用碰到的问题. 2011年12月30日 ... -
Solaris 10 U5的一个Xerror,是否是显卡未识别?
2012-01-19 15:54 1065Solaris 10 U5的一个Xerror,是否是显卡未识别 ... -
mysql pid file not found and can't connect to mysql through socket mysql.sock
2012-01-19 15:54 670mysql pid file not found and ca ... -
sco unix ftp 源代码
2012-01-19 15:54 859sco unix ftp 源代码 2012年01月08日 ... -
山寨宝马成卖点 中华V5市场展望
2012-01-17 05:47 560山寨宝马成卖点 中华V5 ... -
长安逸动 售价或与宝骏630持平
2012-01-17 05:47 718长安逸动 售价或与宝骏 ... -
商业地产招商的十大误区(转)
2012-01-17 05:47 593商业地产招商的十大误区(转) 2011年11月25日 很 ... -
现场奖品领取:11月24日,北语,法国美酒与日本寿司的对话
2012-01-17 05:40 715现场奖品领取:11月24日,北语,法国美酒与日本寿司的对话 ... -
礼制”思想的阐述
2012-01-16 04:33 766礼制”思想的阐述 2010 ... -
我为什么要找河南女人做老婆
2012-01-16 04:33 16265我为什么要找河南女人做老婆 2010年12月29日 ... -
[逸闻趣谈]中国42个城市在一个班级里的职务-----看到台北,我自己都忍不住笑了
2012-01-16 04:33 620[逸闻趣谈]中国42个城市在一个班级里的职务-----看到台北 ... -
南怀瑾-解读佛教的孝道(下)
2012-01-16 04:33 515南怀瑾-解读佛教的孝道(下) 2012年01月05日 ...
相关推荐
基于断言的验证方法在模块级验证中的应用,顾冲,贺光辉,本文以AHB Arbiter的验证为例,介绍了一种在模块级上比传统IC验证方法效率更高的验证方法--基于断言的验证,这种验证方法使一些原先难
SystemVerilog基于断言的验证技术
本文针对SoC设计方法学中如何有效、充分的功能验证问题,首先介绍了基于断言的验证方法学的定义及其所带来的好处,然后以一种断言验证语言--OVA作为具体的应用实例,通过仿真说明了断言验证是SoC设计功能验证的一种...
今天小编就为大家分享一篇python 实现selenium断言和验证的方法,具有很好的参考价值,希望对大家有所帮助。一起跟随小编过来看看吧
Cadence公司的断言验证手册,介绍基于SVA的断言验证注意事项。
该部分代码主要用于immediate assertions 和concurrent assertions 采样点的演示
多重覆盖率导向结合断言的FPGA验证方法研究及应用.pdf
JUnit常用断言方法JUnit常用断言方法.txtJUnit常用断言方法.txt
本书重点介绍硬件设计描述和验证语言SystemVerilog的基本语法及其在功能验证上的应 用;书中以功能验证为主线,讲述...的开放式验证方法学OVM介绍如何在验证平台中实现可重用性。 本资料来源于网络...
它是为了开发复杂验证平台而设计的。就如学习c语言一样(或者system verilog或者systemc),它会需要一段时间去学习avm,从而知道如何更有效地去应用所有的概念。这本书的目的就是给你一个信心。如果这本书的作者把...
书中以功能验证为主线,讲述基本的验证流程、高级验证技术和验证方法学,以System Verilog为基础结合石头、剪刀、布的应用实例,重点阐述了如何采用System Verilog实现随机激励生成、功能覆盖率驱动验证、断言验证等...
基于断言的验证技术.doc
“灵验”在用户输入RTL设计和SystemVerilog断言描述设计规范的情况下,可以自动进行语法解析、设计综合、断言解析,并且基于分布式计算理论自动调度引擎求解断言,加速验证收敛,从而降低形式验证工具的使用门槛。
使用断言的方法: 在选择的Sampler下添加对应的断言,配置好响应的检查内容。 添加一个断言结果的监听器(从监听器中添加),通过“断言结果”可以看到是否通过断言; 对于一次请求,如果通过的话,断言结果中只会...
Jmeter中断言的使用方法.doc
Junit通常用于那些有明确返回值的方法的测试,而无法对返回值是void类型的方法进行测试,因为Junit的assert断言方法只适用于预期值与实际值的比较,对于void类型的方法,我们无法从它的return语句获得具体的返回值。...