SystemVerilog Assertion guide

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
       

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
SystemVerilog assertion 是一种用于验证设计的属性的语言和方法。它在设计的不同阶段都有广泛的应用,从功能验证到形式验证。下面是一些关于 SystemVerilog assertion 应用的指南: 1. 语法和语义:了解 SystemVerilog assertion 的基本语法和语义是必要的。它的语法类似于其他硬件描述语言,但有一些独特的特性和用法。熟悉这些特性并理解其语义是使用 SystemVerilog assertion 的基础。 2. 功能验证:SystemVerilog assertion 可以用于功能验证,通过检查设计是否满足特定的属性来验证其行为。在功能验证,可以使用属性描述设计的预期行为,并编写验证代码来检查这些属性是否得到满足。这有助于发现设计的问题并提前修复它们。 3. 形式验证:SystemVerilog assertion 还可以用于形式验证,用于证明设计在给定约束下是否满足某些属性。形式验证通常使用形式化验证工具,它可以自动地分析设计,并生成验证结果。使用形式验证可以提供更高的覆盖率和更全面的验证结果。 4. 属性编写:编写良好的属性是成功使用 SystemVerilog assertion 的关键。属性应该具备明确的描述设计行为和目标的特点。良好的属性应该容易验证,避免模糊和歧义的描述,并覆盖设计的所有关键方面。 5. 覆盖率评估:评估 SystemVerilog assertion 的覆盖率是非常重要的。覆盖率评估可以确定设计是否存在未覆盖的行为或属性。如果存在未覆盖的属性,可能需要进一步修改验证代码来增加覆盖率。 总之,了解 SystemVerilog assertion 的语法和语义,熟悉属性编写的技巧,以及进行有效的功能验证和形式验证是使用它的关键。通过正确地应用 SystemVerilog assertion,可以提高设计的可靠性和验证的效率。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值