SlideShare a Scribd company logo
SystemVerilogアサーション 入
門
ヅオン・ディエップ
 SystemVerilog Assertion?
 SystemVerilog アサーション?
 SVA Checker Library
 SVA チェック・ライブラリ
 Custom Assertion
 カスタム・アサーション
 Advanced SVA
 アドバンスト SVA
 Appendix
 A language to describe sequence of
events
 Let you test for their occurrence by adding
verification code to design
 A part of SystemVerilog language
 Concurrent (コンカレント)
 assert property
 Immediate (イミディエイト)
 assert
 Behaviors suited to assertions
 Interface protocols
 Temporal relationships
 FSM operation
 Signal/command level
 Behaviors better suited to Hardware
Verification language
 Complex mathematical formula
 Complex data transaction
 General library of common property
checks
 Two forms
 Module based and Interface based
 Directory (ディレクトリ)
 $VCS_HOME/packages/sva/
 Document (ドキュメント)
 $VCS_HOME/doc/UserGuide
 Many basic properties
can be checked using
SVA Checker Library
 Fast and easy
 Pre-written/ Pre-verified
Verilog
source
SVA
source
vcs
simv
DVE
sim
 $> vcs 
-sverilog  // Active SV(A) compilation
+define+ASSERT_ON  // Enable the checking functionality
-y $VCS_HOME/packages/sva  // Directory of Checker library
+libext+.sv  //
+incdir+$VCS_HOME/packages/sva  // Include directory
-debug_all  // Turn on debug and line stepping
-assert dve  // Dump SVA data for DVE debug
<verilog source code>
 $> ./simv -gui
 DVE
 Debug GUI
 -assert report and –assert success
 Quick debugging through textual report
 $assert_monitor
 Trace debugging in textual format
 SVA syntax (SVA シンタックス)
 SVA compile options
 Sequence (シーケンス)
 ##t1, ##[t1:t2], ##[t1:$]
 [*r1:r2], [->r1:r2], [=r1:r2]
 and, or, throughout, intersect, within, first_match, |->, |=>
 Function (ファンクション)
 $rose, $fell, $stable
 System (システム)
 $isunknow, $info, $error, $warning, $fatal, $past, $countones,
$onehot, $onehot0
 Keyword (キーワード)
 bind, sequence, property, assert, not, ended, matched
 endsequence, endproperty, assert property, cover property
 Verify Directives
 assert, cover, bind,…
 Property Operators
 |->, |=>, disable iff, not,…
 Sequence Operators
 And, or, ##t, ##[t1:t2], …
 Used to capture certain functionality
 Used to describe a pattern that we want to
check for
 Two important aspects
 Whether the simulation results match the
expression
 The start and end time of the evaluation
sequence <name>(<arguments>)
<clock> <expression>;
endsequence
 Specifying Delays
 Fixed time
 ##1
 ##0: Special case used to joint two sequences
 Time interval
 ##[1:3]
 Open ended, eventually
 ##[1:$]: Next clock cycles to the end of simulation
 The delay is in clock cycles, not nanoseconds
 How to use?
 req ##2 ack
 ack should be high two cycles after req
 req ##2 ack ##3 !ack
 ack will remain high for only 3 cycles
 req ##2 ack ##3 !ack ##[1:3] $fell(done)
 done falls 1 to 3 clocks after ack is removed
 Defines the behavior of the design
 Can be declared in a module or in an
interface
 Can optionally have formal arguments
 Built from sequences or Boolean expressions
property <name>;
<clock> <expression>;
// <clock><sequence name>;
// <sequence name>;
endproperty
 Sequences are often used to construct
properties
 Breaks down complex functionality
 Promotes re-use
Using sequence Without sequence
sequence s1;
req && !ack;
endsequence
property p1;
@(posedge clk) s1;
Endproperty
property p1;
@(posedge clk) req && !ack;
endproperty
 Produces results that are visible
externally: reports, waveforms, …
 An assert either passes, fails or remains
incomplete
<label> assert property <property_name>;
Assertions used as check Assertions used as forbid
property p1_check;
@(posedge clk) b ##1 c;
endproperty
a1: assert property (p1_check);
property p1_check;
@(posedge clk) not (b ##1 c);
endproperty
a1: assert property (p1_check);
 Assert statements can also have action block associated with
it.
 When no action block is specified its treated as null
 Action block cannot contain another assert statement
property p1_check;
@(posedge clk) b |-> ##1 c;
endproperty
a1: assert property (p1_check) else begin
$display(“the p1_check failed”);
notifier = 1;
$my_c_function; //Task call
end
 An assert statement can be embedded
within procedural always blocks
 Clock and enabling signals are automatically
inherited
 Immediate Assertion
 Evaluated when the assert statement is
executed in the procedural code.
 Good for combinational checks (non temporal)
 Only Boolean expressions are allowed
 No sequences or properties
 @(<clock_edge> <clock_name>)
Clock in sequence Clock in property Clock in assert
sequence s1;
@(posedge clk)
req && !ack;
endsequence
property p1;
s1;
endproperty
a1: assert property (p1);
sequence s1;
req && !ack;
endsequence
property p1;
@(posedge clk) s1;
endproperty
a1: assert property (p1);
sequence s1;
req && !ack;
endsequence
a1: assert property
@(posedge clk)
(s1);
 Signal level sampling (信号レベルのサンプリ
ング)
property p_reg;
@(posedge clk) reg;
endproperty
property p_ack;
@(posedge clk) !ack;
endproperty
a_req: assert property (p_reg);
a_ack: assert property (p_ack);
 Signal Edge sampling (信号エッジサンプリング)
 $rose(<signal_name>)
 Returns true if a positive edge was detected between the last
and current samples.
 $fell(<signal_name>)
 Returns true if a negative edge was detected between the
last and current samples.
 Property adds constructs for evaluation
control
 not: inverts the expression
 Good for forbid a property
 Implication: |->, |=>
 disable iff (if and only if)
 Implication is equivalent to if-then structure
 Overlapped implication: |->
 If antecedent evaluates to true, the consequent is
evaluated on same clock cycle
 Assertion does not fail if antecedent is false
 Vacuous Success
 Non-overlapped implication: |=>
 If there is a match on the antecedent, the consequent is
evaluated one clock cycle later
 The statement: a |=> b is equivalent to: a |-> ##1 b
 Useful to synchronize data between multiple clocks
 Implication has a default else clause
 The statement: req |-> ack is equivalent to: if
req then ack else 1
 The following are NOT the same:
 req && ack
 Fails when req = 0
 req |-> ack
 Succeeds when req = 0
property p_andand;
@(posedge clk) reg && ack;
endproperty
property p_ol_implication; // overlapped implication
@(posedge clk) req |-> ack;
endproperty
property p_nol_implication; // non-overlapped implication
@(posedge clk) req |=> ack;
endproperty
a_andand: assert property (p_andand);
a_ol_implication: assert property (p_ol_implication);
a_nol_implication: assert property (p_nol_implication);
 Use disable iff to abort property valuation
on a Boolean condition (e.g., reset)
 If reset is TRUE, terminates the attempt with a
vacuous success
 $stable(expr)
 Returns true if the value of an expression did not
change between the last and current samples.
 $past(expr, n)
 Returns the value of an expr n samples earlier.
 $isunknown(expr)
 Returns true if any bit of the expression is X or Z.
 $countones(expr)
 Returns an integer equal to the number of 1’s in the
expression.
 Bindings are used to attach SVAs to the
design
 Allows SVAs to be written in a separate module
 Module bindings
 The module/interface containing the properties become
part of that module and all its instances
bind <module_name> <SVA_module_name> #(parameter_list)
<instance_name> (port_list);
 Instance bindings
 The module/interface containing the properties become
part of the specific instance
bind <instance_name> <SVA_module_name> #(parameter_list)
<instance_name> (port_list);
 Bindings are easy way to use checker libraries
 Verification engineers developing complex properties to verify
interfaces should write properties in a separate module/interface and
bind it to the design
module check_par(clk, parity, data);
input clk, parity; input [31:0] data;
property p_check_par;
@(posedge clk) ^(data^parity) == 1’b0;
endproperty
a_check_par: assert property(p_check_par);
endmodule
bind data_bus check_par a1(m_clk, m_parity, m_data);
bind top.mid.u1 check_par a2 (i_clk, i_parity, i_data);
Option Description
-assert enable_diag Control assertions at runtime
-assert dve Enable dumping assertion information in a VPD file
-assert disable Disable all SVAs in the design
-assert disable_cover Disable assertion coverage
-assert dumpoff Disable the dumping of SVA information
-assert finish_maxfail=N
-assert global_finish_maxfail=N
Terminate simulation after certain number of assertion
failures
-assert success Show both passing and failing assertions
-assert maxsuccesses=N Limit the maximum number of successes reported
-assert quiet Disable the display of messages when assertions fail
-assert report=file_name Generate a report file
-cm assert Specifies monitoring for SystemVerilog assertions coverage
 Sequence repetition operators
 Consecutive repetition [*n]
 Range repetition [*min:max]/ [*min:$]
 Go to repetition [->n]
 Non-consecutive repetition [=n]
 Implication and repetition
 Repetition as an antecedent
 Repetition as an consequence
 A[*1]: A ##1 A
 A[*n]: A ##1 A ##1 A ##1 A …. ##1 A
 A[*1:$]: A[*1], A[*2], A[*3], …
 A[*min:max]
 A[->1]  (!A[*0:$] ##1 A)
 A[->n]  (!A[*0:$] ##1 A)[*n]  A[->1][*n]
 A[->1:3]  A[->1] or A[->2] or A[->3]
 A[->min:max]  A[->min] or A[->(min+1)] or… A[->(max-
1)] or A[->max]
 A[=1]  (A[->1] ##1 !A[*0:$])
 A[=n]  (A[->n] ##1 !A[*0:$])
 Use the repetition operator to loop on a
sequence or Boolean expression
 sequence [*n] // n = integer number of
iterations
 There is an implicit ##1 between each loop
 “ready asserted for 3 consecutive cycles”
 ready ##1 ready ##1 ready
property p_ready_3;
@(posedge clk) ready[*3];
endproperty
 Same as consecutive but with an upper bound
sequence [*min:max]
 Generates (max – min) + 1 threads
 There is an implicit ##1 between each loop
 “ ready repeated 1 to 3 times”
 ready or ready ##1 ready or #ready ##1 ready ##1 ready
property p_ready_13;
@(posedge clk) ready[*1:3];
endproperty
 A[*1:$]: A[*1], A[*2], A[*3], …
 Upper bound $: the sequence repeats at least the number
of times specified by the lower bound.
 Non-consecutive exact repetition' operator for
Boolean expression
 It checks if a Boolean expression has been true
for specified number of times but not necessarily
on consecutive clock cycles.
 The sequence starts with the first occurrence of
the Boolean expression and ends with the last
 A[->1]  (!A[*0:$] ##1 A)
 A[->n]  (!A[*0:$] ##1 A)[*n]  A[->1][*n]
 A[->1:3]  A[->1] or A[->2] or A[->3]
 A[->min:max]  A[->min] or A[->(min+1)] or… A[->(max-1)] or
A[->max]
 Similar to the [-> ] operator
 When the ends with the last true value of
the operand, [= ] operation may extend
beyond such last true value.
 A[=1]  (A[->1] ##1 !A[*0:$])
 A[=n]  (A[->n] ##1 !A[*0:$])
 Repetition can be used on either side of the
implication operators “|->” and “|=>”
 When repetition is used with implication:
 In antecedent:
 Vacuous successes for unmatched threads
 Matched threads result in continued evaluation of
consequent
 In consequent:
 Only one of thread needs to match
property p_antecedent;
@(posedge clk) req[*3] |=> ack;
endproperty
property p_antecedent;
@(posedge clk) req[*1:3] |=> ack;
endproperty
property p_consequence;
@(posedge clk) $rose(gnt) |-> ack[*2:3] ##1 !ack;
endproperty

More Related Content

What's hot

AMBA Ahb 2.0
AMBA Ahb 2.0AMBA Ahb 2.0
AMBA Ahb 2.0
Akhil Srivastava
 
SystemVerilog based OVM and UVM Verification Methodologies
SystemVerilog based OVM and UVM Verification MethodologiesSystemVerilog based OVM and UVM Verification Methodologies
SystemVerilog based OVM and UVM Verification Methodologies
Ramdas Mozhikunnath
 
Uvm presentation dac2011_final
Uvm presentation dac2011_finalUvm presentation dac2011_final
Uvm presentation dac2011_finalsean chen
 
Coverage and Introduction to UVM
Coverage and Introduction to UVMCoverage and Introduction to UVM
Coverage and Introduction to UVM
Dr. Shivananda Koteshwar
 
System verilog control flow
System verilog control flowSystem verilog control flow
System verilog control flow
Pushpa Yakkala
 
System Verilog Functional Coverage
System Verilog Functional CoverageSystem Verilog Functional Coverage
System Verilog Functional Coverage
rraimi
 
Session 7 code_functional_coverage
Session 7 code_functional_coverageSession 7 code_functional_coverage
Session 7 code_functional_coverageNirav Desai
 
Challenges in Using UVM at SoC Level
Challenges in Using UVM at SoC LevelChallenges in Using UVM at SoC Level
Challenges in Using UVM at SoC LevelDVClub
 
Uvm dac2011 final_color
Uvm dac2011 final_colorUvm dac2011 final_color
Uvm dac2011 final_color
Jamal EL HAITOUT
 
APB protocol v1.0
APB protocol v1.0APB protocol v1.0
APB protocol v1.0
Azad Mishra
 
How to create SystemVerilog verification environment?
How to create SystemVerilog verification environment?How to create SystemVerilog verification environment?
How to create SystemVerilog verification environment?
Sameh El-Ashry
 
CPU Verification
CPU VerificationCPU Verification
CPU Verification
Ramdas Mozhikunnath
 
UVM: Basic Sequences
UVM: Basic SequencesUVM: Basic Sequences
UVM: Basic Sequences
Arrow Devices
 
UVM ARCHITECTURE FOR VERIFICATION
UVM ARCHITECTURE FOR VERIFICATIONUVM ARCHITECTURE FOR VERIFICATION
UVM ARCHITECTURE FOR VERIFICATION
IAEME Publication
 
SOC Verification using SystemVerilog
SOC Verification using SystemVerilog SOC Verification using SystemVerilog
SOC Verification using SystemVerilog
Ramdas Mozhikunnath
 
SystemVerilog OOP Ovm Features Summary
SystemVerilog OOP Ovm Features SummarySystemVerilog OOP Ovm Features Summary
SystemVerilog OOP Ovm Features Summary
Amal Khailtash
 
AMBA AHB 5
AMBA AHB 5AMBA AHB 5
AMBA AHB 5
SUNODH GARLAPATI
 
Axi protocol
Axi protocolAxi protocol
Axi protocol
Rohit Kumar Pathak
 
Apb
ApbApb
Delays in verilog
Delays in verilogDelays in verilog
Delays in verilog
JITU MISTRY
 

What's hot (20)

AMBA Ahb 2.0
AMBA Ahb 2.0AMBA Ahb 2.0
AMBA Ahb 2.0
 
SystemVerilog based OVM and UVM Verification Methodologies
SystemVerilog based OVM and UVM Verification MethodologiesSystemVerilog based OVM and UVM Verification Methodologies
SystemVerilog based OVM and UVM Verification Methodologies
 
Uvm presentation dac2011_final
Uvm presentation dac2011_finalUvm presentation dac2011_final
Uvm presentation dac2011_final
 
Coverage and Introduction to UVM
Coverage and Introduction to UVMCoverage and Introduction to UVM
Coverage and Introduction to UVM
 
System verilog control flow
System verilog control flowSystem verilog control flow
System verilog control flow
 
System Verilog Functional Coverage
System Verilog Functional CoverageSystem Verilog Functional Coverage
System Verilog Functional Coverage
 
Session 7 code_functional_coverage
Session 7 code_functional_coverageSession 7 code_functional_coverage
Session 7 code_functional_coverage
 
Challenges in Using UVM at SoC Level
Challenges in Using UVM at SoC LevelChallenges in Using UVM at SoC Level
Challenges in Using UVM at SoC Level
 
Uvm dac2011 final_color
Uvm dac2011 final_colorUvm dac2011 final_color
Uvm dac2011 final_color
 
APB protocol v1.0
APB protocol v1.0APB protocol v1.0
APB protocol v1.0
 
How to create SystemVerilog verification environment?
How to create SystemVerilog verification environment?How to create SystemVerilog verification environment?
How to create SystemVerilog verification environment?
 
CPU Verification
CPU VerificationCPU Verification
CPU Verification
 
UVM: Basic Sequences
UVM: Basic SequencesUVM: Basic Sequences
UVM: Basic Sequences
 
UVM ARCHITECTURE FOR VERIFICATION
UVM ARCHITECTURE FOR VERIFICATIONUVM ARCHITECTURE FOR VERIFICATION
UVM ARCHITECTURE FOR VERIFICATION
 
SOC Verification using SystemVerilog
SOC Verification using SystemVerilog SOC Verification using SystemVerilog
SOC Verification using SystemVerilog
 
SystemVerilog OOP Ovm Features Summary
SystemVerilog OOP Ovm Features SummarySystemVerilog OOP Ovm Features Summary
SystemVerilog OOP Ovm Features Summary
 
AMBA AHB 5
AMBA AHB 5AMBA AHB 5
AMBA AHB 5
 
Axi protocol
Axi protocolAxi protocol
Axi protocol
 
Apb
ApbApb
Apb
 
Delays in verilog
Delays in verilogDelays in verilog
Delays in verilog
 

Similar to SystemVerilog Assertion.pptx

Tdd iPhone For Dummies
Tdd iPhone For DummiesTdd iPhone For Dummies
Tdd iPhone For Dummies
Giordano Scalzo
 
bluespec talk
bluespec talkbluespec talk
bluespec talk
Suman Karumuri
 
Asynchronous programming done right - Node.js
Asynchronous programming done right - Node.jsAsynchronous programming done right - Node.js
Asynchronous programming done right - Node.js
Piotr Pelczar
 
Evolution of asynchrony in (ASP).NET
Evolution of asynchrony in (ASP).NETEvolution of asynchrony in (ASP).NET
Evolution of asynchrony in (ASP).NETAliaksandr Famin
 
Puppet Camp DC 2015: Distributed OpenSCAP Compliance Validation with MCollective
Puppet Camp DC 2015: Distributed OpenSCAP Compliance Validation with MCollectivePuppet Camp DC 2015: Distributed OpenSCAP Compliance Validation with MCollective
Puppet Camp DC 2015: Distributed OpenSCAP Compliance Validation with MCollective
Puppet
 
Celery
CeleryCelery
Formal Verification of Transactional Interaction Contract
Formal Verification of Transactional Interaction ContractFormal Verification of Transactional Interaction Contract
Formal Verification of Transactional Interaction ContractGera Shegalov
 
How To Test Everything
How To Test EverythingHow To Test Everything
How To Test Everything
noelrap
 
assertion.pptx
assertion.pptxassertion.pptx
assertion.pptx
VarunP31
 
Kotlin Coroutines and Rx
Kotlin Coroutines and RxKotlin Coroutines and Rx
Kotlin Coroutines and Rx
Shaul Rosenzwieg
 
Asynchronous t sql
Asynchronous t sqlAsynchronous t sql
Asynchronous t sqlRemus Rusanu
 
The Ring programming language version 1.8 book - Part 88 of 202
The Ring programming language version 1.8 book - Part 88 of 202The Ring programming language version 1.8 book - Part 88 of 202
The Ring programming language version 1.8 book - Part 88 of 202
Mahmoud Samir Fayed
 
Continuations
ContinuationsContinuations
Continuationsopenbala
 
Introduction to nsubstitute
Introduction to nsubstituteIntroduction to nsubstitute
Introduction to nsubstitute
Suresh Loganatha
 
Advanced patterns in asynchronous programming
Advanced patterns in asynchronous programmingAdvanced patterns in asynchronous programming
Advanced patterns in asynchronous programming
Michael Arenzon
 
Behind modern concurrency primitives
Behind modern concurrency primitivesBehind modern concurrency primitives
Behind modern concurrency primitives
Bartosz Sypytkowski
 
Behind modern concurrency primitives
Behind modern concurrency primitivesBehind modern concurrency primitives
Behind modern concurrency primitives
Bartosz Sypytkowski
 
Asynchronous Orchestration DSL on squbs
Asynchronous Orchestration DSL on squbsAsynchronous Orchestration DSL on squbs
Asynchronous Orchestration DSL on squbs
Anil Gursel
 
Expert JavaScript tricks of the masters
Expert JavaScript  tricks of the mastersExpert JavaScript  tricks of the masters
Expert JavaScript tricks of the masters
Ara Pehlivanian
 
Varnish presentation for the Symfony Zaragoza user group
Varnish presentation for the Symfony Zaragoza user groupVarnish presentation for the Symfony Zaragoza user group
Varnish presentation for the Symfony Zaragoza user group
Jorge Nerín
 

Similar to SystemVerilog Assertion.pptx (20)

Tdd iPhone For Dummies
Tdd iPhone For DummiesTdd iPhone For Dummies
Tdd iPhone For Dummies
 
bluespec talk
bluespec talkbluespec talk
bluespec talk
 
Asynchronous programming done right - Node.js
Asynchronous programming done right - Node.jsAsynchronous programming done right - Node.js
Asynchronous programming done right - Node.js
 
Evolution of asynchrony in (ASP).NET
Evolution of asynchrony in (ASP).NETEvolution of asynchrony in (ASP).NET
Evolution of asynchrony in (ASP).NET
 
Puppet Camp DC 2015: Distributed OpenSCAP Compliance Validation with MCollective
Puppet Camp DC 2015: Distributed OpenSCAP Compliance Validation with MCollectivePuppet Camp DC 2015: Distributed OpenSCAP Compliance Validation with MCollective
Puppet Camp DC 2015: Distributed OpenSCAP Compliance Validation with MCollective
 
Celery
CeleryCelery
Celery
 
Formal Verification of Transactional Interaction Contract
Formal Verification of Transactional Interaction ContractFormal Verification of Transactional Interaction Contract
Formal Verification of Transactional Interaction Contract
 
How To Test Everything
How To Test EverythingHow To Test Everything
How To Test Everything
 
assertion.pptx
assertion.pptxassertion.pptx
assertion.pptx
 
Kotlin Coroutines and Rx
Kotlin Coroutines and RxKotlin Coroutines and Rx
Kotlin Coroutines and Rx
 
Asynchronous t sql
Asynchronous t sqlAsynchronous t sql
Asynchronous t sql
 
The Ring programming language version 1.8 book - Part 88 of 202
The Ring programming language version 1.8 book - Part 88 of 202The Ring programming language version 1.8 book - Part 88 of 202
The Ring programming language version 1.8 book - Part 88 of 202
 
Continuations
ContinuationsContinuations
Continuations
 
Introduction to nsubstitute
Introduction to nsubstituteIntroduction to nsubstitute
Introduction to nsubstitute
 
Advanced patterns in asynchronous programming
Advanced patterns in asynchronous programmingAdvanced patterns in asynchronous programming
Advanced patterns in asynchronous programming
 
Behind modern concurrency primitives
Behind modern concurrency primitivesBehind modern concurrency primitives
Behind modern concurrency primitives
 
Behind modern concurrency primitives
Behind modern concurrency primitivesBehind modern concurrency primitives
Behind modern concurrency primitives
 
Asynchronous Orchestration DSL on squbs
Asynchronous Orchestration DSL on squbsAsynchronous Orchestration DSL on squbs
Asynchronous Orchestration DSL on squbs
 
Expert JavaScript tricks of the masters
Expert JavaScript  tricks of the mastersExpert JavaScript  tricks of the masters
Expert JavaScript tricks of the masters
 
Varnish presentation for the Symfony Zaragoza user group
Varnish presentation for the Symfony Zaragoza user groupVarnish presentation for the Symfony Zaragoza user group
Varnish presentation for the Symfony Zaragoza user group
 

Recently uploaded

一比一原版(UNUK毕业证书)诺丁汉大学毕业证如何办理
一比一原版(UNUK毕业证书)诺丁汉大学毕业证如何办理一比一原版(UNUK毕业证书)诺丁汉大学毕业证如何办理
一比一原版(UNUK毕业证书)诺丁汉大学毕业证如何办理
7sd8fier
 
一比一原版(毕业证)长崎大学毕业证成绩单如何办理
一比一原版(毕业证)长崎大学毕业证成绩单如何办理一比一原版(毕业证)长崎大学毕业证成绩单如何办理
一比一原版(毕业证)长崎大学毕业证成绩单如何办理
taqyed
 
一比一原版(Glasgow毕业证书)格拉斯哥大学毕业证成绩单如何办理
一比一原版(Glasgow毕业证书)格拉斯哥大学毕业证成绩单如何办理一比一原版(Glasgow毕业证书)格拉斯哥大学毕业证成绩单如何办理
一比一原版(Glasgow毕业证书)格拉斯哥大学毕业证成绩单如何办理
n0tivyq
 
一比一原版(Bolton毕业证书)博尔顿大学毕业证成绩单如何办理
一比一原版(Bolton毕业证书)博尔顿大学毕业证成绩单如何办理一比一原版(Bolton毕业证书)博尔顿大学毕业证成绩单如何办理
一比一原版(Bolton毕业证书)博尔顿大学毕业证成绩单如何办理
h7j5io0
 
一比一原版(MMU毕业证书)曼彻斯特城市大学毕业证成绩单如何办理
一比一原版(MMU毕业证书)曼彻斯特城市大学毕业证成绩单如何办理一比一原版(MMU毕业证书)曼彻斯特城市大学毕业证成绩单如何办理
一比一原版(MMU毕业证书)曼彻斯特城市大学毕业证成绩单如何办理
7sd8fier
 
Can AI do good? at 'offtheCanvas' India HCI prelude
Can AI do good? at 'offtheCanvas' India HCI preludeCan AI do good? at 'offtheCanvas' India HCI prelude
Can AI do good? at 'offtheCanvas' India HCI prelude
Alan Dix
 
Expert Accessory Dwelling Unit (ADU) Drafting Services
Expert Accessory Dwelling Unit (ADU) Drafting ServicesExpert Accessory Dwelling Unit (ADU) Drafting Services
Expert Accessory Dwelling Unit (ADU) Drafting Services
ResDraft
 
一比一原版(Columbia毕业证)哥伦比亚大学毕业证如何办理
一比一原版(Columbia毕业证)哥伦比亚大学毕业证如何办理一比一原版(Columbia毕业证)哥伦比亚大学毕业证如何办理
一比一原版(Columbia毕业证)哥伦比亚大学毕业证如何办理
asuzyq
 
一比一原版(RHUL毕业证书)伦敦大学皇家霍洛威学院毕业证如何办理
一比一原版(RHUL毕业证书)伦敦大学皇家霍洛威学院毕业证如何办理一比一原版(RHUL毕业证书)伦敦大学皇家霍洛威学院毕业证如何办理
一比一原版(RHUL毕业证书)伦敦大学皇家霍洛威学院毕业证如何办理
9a93xvy
 
一比一原版(Brunel毕业证书)布鲁内尔大学毕业证成绩单如何办理
一比一原版(Brunel毕业证书)布鲁内尔大学毕业证成绩单如何办理一比一原版(Brunel毕业证书)布鲁内尔大学毕业证成绩单如何办理
一比一原版(Brunel毕业证书)布鲁内尔大学毕业证成绩单如何办理
smpc3nvg
 
Portfolio.pdf
Portfolio.pdfPortfolio.pdf
Portfolio.pdf
garcese
 
Borys Sutkowski portfolio interior design
Borys Sutkowski portfolio interior designBorys Sutkowski portfolio interior design
Borys Sutkowski portfolio interior design
boryssutkowski
 
Exploring the Future of Smart Garages.pdf
Exploring the Future of Smart Garages.pdfExploring the Future of Smart Garages.pdf
Exploring the Future of Smart Garages.pdf
fastfixgaragedoor
 
Between Filth and Fortune- Urban Cattle Foraging Realities by Devi S Nair, An...
Between Filth and Fortune- Urban Cattle Foraging Realities by Devi S Nair, An...Between Filth and Fortune- Urban Cattle Foraging Realities by Devi S Nair, An...
Between Filth and Fortune- Urban Cattle Foraging Realities by Devi S Nair, An...
Mansi Shah
 
20 slides of research movie and artists .pdf
20 slides of research movie and artists .pdf20 slides of research movie and artists .pdf
20 slides of research movie and artists .pdf
ameli25062005
 
Design Thinking Design thinking Design thinking
Design Thinking Design thinking Design thinkingDesign Thinking Design thinking Design thinking
Design Thinking Design thinking Design thinking
cy0krjxt
 
Коричневый и Кремовый Деликатный Органический Копирайтер Фрилансер Марке...
Коричневый и Кремовый Деликатный Органический Копирайтер Фрилансер Марке...Коричневый и Кремовый Деликатный Органический Копирайтер Фрилансер Марке...
Коричневый и Кремовый Деликатный Органический Копирайтер Фрилансер Марке...
ameli25062005
 
Transforming Brand Perception and Boosting Profitability
Transforming Brand Perception and Boosting ProfitabilityTransforming Brand Perception and Boosting Profitability
Transforming Brand Perception and Boosting Profitability
aaryangarg12
 
Research 20 slides Amelia gavryliuks.pdf
Research 20 slides Amelia gavryliuks.pdfResearch 20 slides Amelia gavryliuks.pdf
Research 20 slides Amelia gavryliuks.pdf
ameli25062005
 
Let's Summon Demons Shirt Let's Summon Demons Shirt
Let's Summon Demons Shirt Let's Summon Demons ShirtLet's Summon Demons Shirt Let's Summon Demons Shirt
Let's Summon Demons Shirt Let's Summon Demons Shirt
TeeFusion
 

Recently uploaded (20)

一比一原版(UNUK毕业证书)诺丁汉大学毕业证如何办理
一比一原版(UNUK毕业证书)诺丁汉大学毕业证如何办理一比一原版(UNUK毕业证书)诺丁汉大学毕业证如何办理
一比一原版(UNUK毕业证书)诺丁汉大学毕业证如何办理
 
一比一原版(毕业证)长崎大学毕业证成绩单如何办理
一比一原版(毕业证)长崎大学毕业证成绩单如何办理一比一原版(毕业证)长崎大学毕业证成绩单如何办理
一比一原版(毕业证)长崎大学毕业证成绩单如何办理
 
一比一原版(Glasgow毕业证书)格拉斯哥大学毕业证成绩单如何办理
一比一原版(Glasgow毕业证书)格拉斯哥大学毕业证成绩单如何办理一比一原版(Glasgow毕业证书)格拉斯哥大学毕业证成绩单如何办理
一比一原版(Glasgow毕业证书)格拉斯哥大学毕业证成绩单如何办理
 
一比一原版(Bolton毕业证书)博尔顿大学毕业证成绩单如何办理
一比一原版(Bolton毕业证书)博尔顿大学毕业证成绩单如何办理一比一原版(Bolton毕业证书)博尔顿大学毕业证成绩单如何办理
一比一原版(Bolton毕业证书)博尔顿大学毕业证成绩单如何办理
 
一比一原版(MMU毕业证书)曼彻斯特城市大学毕业证成绩单如何办理
一比一原版(MMU毕业证书)曼彻斯特城市大学毕业证成绩单如何办理一比一原版(MMU毕业证书)曼彻斯特城市大学毕业证成绩单如何办理
一比一原版(MMU毕业证书)曼彻斯特城市大学毕业证成绩单如何办理
 
Can AI do good? at 'offtheCanvas' India HCI prelude
Can AI do good? at 'offtheCanvas' India HCI preludeCan AI do good? at 'offtheCanvas' India HCI prelude
Can AI do good? at 'offtheCanvas' India HCI prelude
 
Expert Accessory Dwelling Unit (ADU) Drafting Services
Expert Accessory Dwelling Unit (ADU) Drafting ServicesExpert Accessory Dwelling Unit (ADU) Drafting Services
Expert Accessory Dwelling Unit (ADU) Drafting Services
 
一比一原版(Columbia毕业证)哥伦比亚大学毕业证如何办理
一比一原版(Columbia毕业证)哥伦比亚大学毕业证如何办理一比一原版(Columbia毕业证)哥伦比亚大学毕业证如何办理
一比一原版(Columbia毕业证)哥伦比亚大学毕业证如何办理
 
一比一原版(RHUL毕业证书)伦敦大学皇家霍洛威学院毕业证如何办理
一比一原版(RHUL毕业证书)伦敦大学皇家霍洛威学院毕业证如何办理一比一原版(RHUL毕业证书)伦敦大学皇家霍洛威学院毕业证如何办理
一比一原版(RHUL毕业证书)伦敦大学皇家霍洛威学院毕业证如何办理
 
一比一原版(Brunel毕业证书)布鲁内尔大学毕业证成绩单如何办理
一比一原版(Brunel毕业证书)布鲁内尔大学毕业证成绩单如何办理一比一原版(Brunel毕业证书)布鲁内尔大学毕业证成绩单如何办理
一比一原版(Brunel毕业证书)布鲁内尔大学毕业证成绩单如何办理
 
Portfolio.pdf
Portfolio.pdfPortfolio.pdf
Portfolio.pdf
 
Borys Sutkowski portfolio interior design
Borys Sutkowski portfolio interior designBorys Sutkowski portfolio interior design
Borys Sutkowski portfolio interior design
 
Exploring the Future of Smart Garages.pdf
Exploring the Future of Smart Garages.pdfExploring the Future of Smart Garages.pdf
Exploring the Future of Smart Garages.pdf
 
Between Filth and Fortune- Urban Cattle Foraging Realities by Devi S Nair, An...
Between Filth and Fortune- Urban Cattle Foraging Realities by Devi S Nair, An...Between Filth and Fortune- Urban Cattle Foraging Realities by Devi S Nair, An...
Between Filth and Fortune- Urban Cattle Foraging Realities by Devi S Nair, An...
 
20 slides of research movie and artists .pdf
20 slides of research movie and artists .pdf20 slides of research movie and artists .pdf
20 slides of research movie and artists .pdf
 
Design Thinking Design thinking Design thinking
Design Thinking Design thinking Design thinkingDesign Thinking Design thinking Design thinking
Design Thinking Design thinking Design thinking
 
Коричневый и Кремовый Деликатный Органический Копирайтер Фрилансер Марке...
Коричневый и Кремовый Деликатный Органический Копирайтер Фрилансер Марке...Коричневый и Кремовый Деликатный Органический Копирайтер Фрилансер Марке...
Коричневый и Кремовый Деликатный Органический Копирайтер Фрилансер Марке...
 
Transforming Brand Perception and Boosting Profitability
Transforming Brand Perception and Boosting ProfitabilityTransforming Brand Perception and Boosting Profitability
Transforming Brand Perception and Boosting Profitability
 
Research 20 slides Amelia gavryliuks.pdf
Research 20 slides Amelia gavryliuks.pdfResearch 20 slides Amelia gavryliuks.pdf
Research 20 slides Amelia gavryliuks.pdf
 
Let's Summon Demons Shirt Let's Summon Demons Shirt
Let's Summon Demons Shirt Let's Summon Demons ShirtLet's Summon Demons Shirt Let's Summon Demons Shirt
Let's Summon Demons Shirt Let's Summon Demons Shirt
 

SystemVerilog Assertion.pptx

  • 2.  SystemVerilog Assertion?  SystemVerilog アサーション?  SVA Checker Library  SVA チェック・ライブラリ  Custom Assertion  カスタム・アサーション  Advanced SVA  アドバンスト SVA  Appendix
  • 3.  A language to describe sequence of events  Let you test for their occurrence by adding verification code to design  A part of SystemVerilog language
  • 4.  Concurrent (コンカレント)  assert property  Immediate (イミディエイト)  assert
  • 5.  Behaviors suited to assertions  Interface protocols  Temporal relationships  FSM operation  Signal/command level  Behaviors better suited to Hardware Verification language  Complex mathematical formula  Complex data transaction
  • 6.  General library of common property checks  Two forms  Module based and Interface based  Directory (ディレクトリ)  $VCS_HOME/packages/sva/  Document (ドキュメント)  $VCS_HOME/doc/UserGuide
  • 7.  Many basic properties can be checked using SVA Checker Library  Fast and easy  Pre-written/ Pre-verified Verilog source SVA source vcs simv DVE sim
  • 8.  $> vcs -sverilog // Active SV(A) compilation +define+ASSERT_ON // Enable the checking functionality -y $VCS_HOME/packages/sva // Directory of Checker library +libext+.sv // +incdir+$VCS_HOME/packages/sva // Include directory -debug_all // Turn on debug and line stepping -assert dve // Dump SVA data for DVE debug <verilog source code>  $> ./simv -gui
  • 9.  DVE  Debug GUI  -assert report and –assert success  Quick debugging through textual report  $assert_monitor  Trace debugging in textual format
  • 10.  SVA syntax (SVA シンタックス)  SVA compile options
  • 11.  Sequence (シーケンス)  ##t1, ##[t1:t2], ##[t1:$]  [*r1:r2], [->r1:r2], [=r1:r2]  and, or, throughout, intersect, within, first_match, |->, |=>  Function (ファンクション)  $rose, $fell, $stable  System (システム)  $isunknow, $info, $error, $warning, $fatal, $past, $countones, $onehot, $onehot0  Keyword (キーワード)  bind, sequence, property, assert, not, ended, matched  endsequence, endproperty, assert property, cover property
  • 12.  Verify Directives  assert, cover, bind,…  Property Operators  |->, |=>, disable iff, not,…  Sequence Operators  And, or, ##t, ##[t1:t2], …
  • 13.  Used to capture certain functionality  Used to describe a pattern that we want to check for  Two important aspects  Whether the simulation results match the expression  The start and end time of the evaluation sequence <name>(<arguments>) <clock> <expression>; endsequence
  • 14.  Specifying Delays  Fixed time  ##1  ##0: Special case used to joint two sequences  Time interval  ##[1:3]  Open ended, eventually  ##[1:$]: Next clock cycles to the end of simulation  The delay is in clock cycles, not nanoseconds
  • 15.  How to use?  req ##2 ack  ack should be high two cycles after req  req ##2 ack ##3 !ack  ack will remain high for only 3 cycles  req ##2 ack ##3 !ack ##[1:3] $fell(done)  done falls 1 to 3 clocks after ack is removed
  • 16.  Defines the behavior of the design  Can be declared in a module or in an interface  Can optionally have formal arguments  Built from sequences or Boolean expressions property <name>; <clock> <expression>; // <clock><sequence name>; // <sequence name>; endproperty
  • 17.  Sequences are often used to construct properties  Breaks down complex functionality  Promotes re-use Using sequence Without sequence sequence s1; req && !ack; endsequence property p1; @(posedge clk) s1; Endproperty property p1; @(posedge clk) req && !ack; endproperty
  • 18.  Produces results that are visible externally: reports, waveforms, …  An assert either passes, fails or remains incomplete <label> assert property <property_name>; Assertions used as check Assertions used as forbid property p1_check; @(posedge clk) b ##1 c; endproperty a1: assert property (p1_check); property p1_check; @(posedge clk) not (b ##1 c); endproperty a1: assert property (p1_check);
  • 19.  Assert statements can also have action block associated with it.  When no action block is specified its treated as null  Action block cannot contain another assert statement property p1_check; @(posedge clk) b |-> ##1 c; endproperty a1: assert property (p1_check) else begin $display(“the p1_check failed”); notifier = 1; $my_c_function; //Task call end
  • 20.  An assert statement can be embedded within procedural always blocks  Clock and enabling signals are automatically inherited  Immediate Assertion  Evaluated when the assert statement is executed in the procedural code.  Good for combinational checks (non temporal)  Only Boolean expressions are allowed  No sequences or properties
  • 21.  @(<clock_edge> <clock_name>) Clock in sequence Clock in property Clock in assert sequence s1; @(posedge clk) req && !ack; endsequence property p1; s1; endproperty a1: assert property (p1); sequence s1; req && !ack; endsequence property p1; @(posedge clk) s1; endproperty a1: assert property (p1); sequence s1; req && !ack; endsequence a1: assert property @(posedge clk) (s1);
  • 22.  Signal level sampling (信号レベルのサンプリ ング) property p_reg; @(posedge clk) reg; endproperty property p_ack; @(posedge clk) !ack; endproperty a_req: assert property (p_reg); a_ack: assert property (p_ack);
  • 23.  Signal Edge sampling (信号エッジサンプリング)  $rose(<signal_name>)  Returns true if a positive edge was detected between the last and current samples.  $fell(<signal_name>)  Returns true if a negative edge was detected between the last and current samples.
  • 24.  Property adds constructs for evaluation control  not: inverts the expression  Good for forbid a property  Implication: |->, |=>  disable iff (if and only if)
  • 25.  Implication is equivalent to if-then structure  Overlapped implication: |->  If antecedent evaluates to true, the consequent is evaluated on same clock cycle  Assertion does not fail if antecedent is false  Vacuous Success  Non-overlapped implication: |=>  If there is a match on the antecedent, the consequent is evaluated one clock cycle later  The statement: a |=> b is equivalent to: a |-> ##1 b  Useful to synchronize data between multiple clocks
  • 26.  Implication has a default else clause  The statement: req |-> ack is equivalent to: if req then ack else 1  The following are NOT the same:  req && ack  Fails when req = 0  req |-> ack  Succeeds when req = 0
  • 27. property p_andand; @(posedge clk) reg && ack; endproperty property p_ol_implication; // overlapped implication @(posedge clk) req |-> ack; endproperty property p_nol_implication; // non-overlapped implication @(posedge clk) req |=> ack; endproperty a_andand: assert property (p_andand); a_ol_implication: assert property (p_ol_implication); a_nol_implication: assert property (p_nol_implication);
  • 28.  Use disable iff to abort property valuation on a Boolean condition (e.g., reset)  If reset is TRUE, terminates the attempt with a vacuous success
  • 29.  $stable(expr)  Returns true if the value of an expression did not change between the last and current samples.  $past(expr, n)  Returns the value of an expr n samples earlier.  $isunknown(expr)  Returns true if any bit of the expression is X or Z.  $countones(expr)  Returns an integer equal to the number of 1’s in the expression.
  • 30.  Bindings are used to attach SVAs to the design  Allows SVAs to be written in a separate module  Module bindings  The module/interface containing the properties become part of that module and all its instances bind <module_name> <SVA_module_name> #(parameter_list) <instance_name> (port_list);  Instance bindings  The module/interface containing the properties become part of the specific instance bind <instance_name> <SVA_module_name> #(parameter_list) <instance_name> (port_list);
  • 31.  Bindings are easy way to use checker libraries  Verification engineers developing complex properties to verify interfaces should write properties in a separate module/interface and bind it to the design module check_par(clk, parity, data); input clk, parity; input [31:0] data; property p_check_par; @(posedge clk) ^(data^parity) == 1’b0; endproperty a_check_par: assert property(p_check_par); endmodule bind data_bus check_par a1(m_clk, m_parity, m_data); bind top.mid.u1 check_par a2 (i_clk, i_parity, i_data);
  • 32. Option Description -assert enable_diag Control assertions at runtime -assert dve Enable dumping assertion information in a VPD file -assert disable Disable all SVAs in the design -assert disable_cover Disable assertion coverage -assert dumpoff Disable the dumping of SVA information -assert finish_maxfail=N -assert global_finish_maxfail=N Terminate simulation after certain number of assertion failures -assert success Show both passing and failing assertions -assert maxsuccesses=N Limit the maximum number of successes reported -assert quiet Disable the display of messages when assertions fail -assert report=file_name Generate a report file -cm assert Specifies monitoring for SystemVerilog assertions coverage
  • 33.  Sequence repetition operators  Consecutive repetition [*n]  Range repetition [*min:max]/ [*min:$]  Go to repetition [->n]  Non-consecutive repetition [=n]  Implication and repetition  Repetition as an antecedent  Repetition as an consequence
  • 34.  A[*1]: A ##1 A  A[*n]: A ##1 A ##1 A ##1 A …. ##1 A  A[*1:$]: A[*1], A[*2], A[*3], …  A[*min:max]  A[->1]  (!A[*0:$] ##1 A)  A[->n]  (!A[*0:$] ##1 A)[*n]  A[->1][*n]  A[->1:3]  A[->1] or A[->2] or A[->3]  A[->min:max]  A[->min] or A[->(min+1)] or… A[->(max- 1)] or A[->max]  A[=1]  (A[->1] ##1 !A[*0:$])  A[=n]  (A[->n] ##1 !A[*0:$])
  • 35.  Use the repetition operator to loop on a sequence or Boolean expression  sequence [*n] // n = integer number of iterations  There is an implicit ##1 between each loop  “ready asserted for 3 consecutive cycles”  ready ##1 ready ##1 ready property p_ready_3; @(posedge clk) ready[*3]; endproperty
  • 36.  Same as consecutive but with an upper bound sequence [*min:max]  Generates (max – min) + 1 threads  There is an implicit ##1 between each loop  “ ready repeated 1 to 3 times”  ready or ready ##1 ready or #ready ##1 ready ##1 ready property p_ready_13; @(posedge clk) ready[*1:3]; endproperty  A[*1:$]: A[*1], A[*2], A[*3], …  Upper bound $: the sequence repeats at least the number of times specified by the lower bound.
  • 37.  Non-consecutive exact repetition' operator for Boolean expression  It checks if a Boolean expression has been true for specified number of times but not necessarily on consecutive clock cycles.  The sequence starts with the first occurrence of the Boolean expression and ends with the last  A[->1]  (!A[*0:$] ##1 A)  A[->n]  (!A[*0:$] ##1 A)[*n]  A[->1][*n]  A[->1:3]  A[->1] or A[->2] or A[->3]  A[->min:max]  A[->min] or A[->(min+1)] or… A[->(max-1)] or A[->max]
  • 38.  Similar to the [-> ] operator  When the ends with the last true value of the operand, [= ] operation may extend beyond such last true value.  A[=1]  (A[->1] ##1 !A[*0:$])  A[=n]  (A[->n] ##1 !A[*0:$])
  • 39.  Repetition can be used on either side of the implication operators “|->” and “|=>”  When repetition is used with implication:  In antecedent:  Vacuous successes for unmatched threads  Matched threads result in continued evaluation of consequent  In consequent:  Only one of thread needs to match
  • 40. property p_antecedent; @(posedge clk) req[*3] |=> ack; endproperty property p_antecedent; @(posedge clk) req[*1:3] |=> ack; endproperty
  • 41. property p_consequence; @(posedge clk) $rose(gnt) |-> ack[*2:3] ##1 !ack; endproperty