SystemVerilog Assertion guide

本文探讨了在电子设计中,验证工程师和设计工程师如何利用断言(asserts)进行功能性覆盖检测、检查模块输入状态、设计假设、仲裁公平性以及监测 RTL 代码的一致性。同时,阐述了不同类型的断言(即时断言和并发断言)及其在不同设计阶段的应用。文章还详细介绍了断言的分类、严重度级别、条件序列操作以及用于测试计划的构建方法。最后,讨论了断言在 RAM 模块验证过程中的关键作用。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1. An assertion is a statement of fact--声明某种属性为真

 

2. Assertion coverage 报告 never triggered, vacuous success(前提从来没满足过), not tested branch(某个条件分支没有有效过).

 

3. Design Engineer用 assert来检查

     1)模块输入有没有X,Z态

     2)发现design不支持的用法,报警

     3)设计时的假设,包括接口的时序

     4) buffer/FIFO 的overflow

     5) 一些不能出现的情况,譬如read和write同时有效

     6) 握手总是能够完成 (ack总是跟在req之后)

     7) case语句不会进入未曾预料的区域

     8) not duplicate RTL.   (monitor output changes, and verifiy the input value will cause that changes)

 

4. verification Engineer 用 assert 来

     1) 进行functional coverage检测

     2) 衡量仲裁的公平性。。。

 

5. 两种类型的assertion

     1) immediate   

            [ name : ] assert ( expression ) [ pass_statement ] [ else fail_statement ]

            一般只是dynamic cast和randomize时使用,只在当前时刻做一次check

 

     2) concurrent

            [ name : ] assert property ( property_specification ) pass_statement [ else fail_statement ]

 

           

            是一种持续属性,在整个simulation阶段都做check。如果没有指定事件,那么就是在每个point都check。一般独立于initial和always快之外,但是放在initial 块中就只检测一次(第一次运行时刻),如果放在always块中每次事件发生时检测。

 

6. 四种assertion严重度

    1) $fatal [ ( finish_number, “message”, message_arguments ) ];

    2) $error [ ( “message”, message_arguments ) ] ;

    3) $warning [ ( “message”, message_arguments ) ] ;

    4) $info [ ( “message”, message_arguments ) ] ;

 

7. assertion的分类

    1) Invariant assertions

    2) Sequential assertions

    3) Eventuality assertions

 

8. The Assertions Test Plan should be developed before any design code is written!

 

RAM assertions
 Functionality to Verify                 Assertion Type       Assigned To
!rdN and !wrN are mutually exclusiveinvariantdesign team

address never has any X or Z bits when reading

from or writing to the RAM

invariantdesign team

data never has any X or Z bits when reading

from or writing to the RAM

sequentialdesign team

 

9. Simulators might report an assertion that never completed as a failure or as an uncompleted assertion

 

 

10. declarative and procedural concurrent assertion

      1) declarative:   runs thoughout the simulation and fires every clock cycles

      2) procedural:    runs when calls with parallel thread

 

11. 条件 sequence 用implication operators

       1) |->   overlapping

       2) |=>  non-overlapping  (助记: 等号意味着等一个cycle)

 

12. seqence value change

       1)  $rose(expression)    

       2)  $fall(expression)

       3)  $stable(expression)

 

13.  consecutive sequence & non-consecutive sequence

       non-consecutive(goto repetition):                        a ##1 b[->1:3] ##1 c  // E.g. a !b b b !b !b b c

       non-consecutive(non-consecutive repetition):    a ##1 b [=1:3] ##1 c // E.g. a !b b b !b !b b !b !b c

 

14. Testing for a Cause

       SVA provides three ways to look back into the past
       

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值