一、systemverilog assertion(SVA)
以下面的例子將家長的意圖拆分:(assertion property)
property pGetAcookie;
@(posedge hour_clk) hungry&&cookie_count>9 | =>eat_1_cookie;
endpropertyy:pGetAcookie
apGetAcookie:assert property (pGetAcookie);
property pCookieInJar;
@(posedge hour_clk)not(cookie_count<9);
endproperty:pCookorsInJar
apCookirsInJar:assert property(pCookiesInJar)statement;else punish
不管哪個property違反了,則assertion報錯
Assertions define property that design must meet
- capture designer intent
- reduce time to market
property:一個設計的行爲、規則、特徵的表達;分爲functional 或者structural類型。
structural property:
immediate assertion
如果expression的結果爲x、z、0,都爲false,否則爲true
concurrent assertion
sequence:時序的信號排列
sequence中包含另一個sequence
and
intersect
條件保持throughout(下例fail)
ended方法:強制執行到最後的情況
property
遞歸的情況:
多時鐘:
同樣可以使用操作符(and、or、not)
注意:兩種時鐘不可能存在overlap的情況
assert statement:
assume statement
cover statement