[SystemVerilog][SVA] アサーションの停止・再開
シミュレーション中、アサーション(assert, cover, assume)の開始・停止(有効・無効)をシステムタスクで制御できます。
| システムタスク | 説明 |
|---|---|
| $asserton | アサーションの実行を有効化 |
| $assertoff | アサーションを無効化 |
| $assertkill | アサーションを無効化(強制終了) |
$assertkill と $assertoff の違いは、呼び出し時に実行中のアサーション(複数クロックにわたるものなど)を強制終了するか、しないかです。
initial begin
$assertoff;
wait(ev.triggered);
$asserton;
end
適用する範囲やアサーションの指定もできます。
$asserton(0, top); // (levels [, list_of_modules_or_assertions])
これらのシステムタスクは、利便性のため用意されていて $assertcontrol で細かく制御でき、等価な動作ができます。
| $asserton | $assertcontrol(3, 15, 7) |
| $assertoff | $assertcontrol(4, 15, 7) |
| $assertkill | $assertcontrol(5, 15, 7) |
VCS では、アサーションにカテゴリーを設定し、カテゴリー単位で有効・無効もできる模様。キーワードは、$assert_category_start や $assert_severity_start など。
