SlideShare une entreprise Scribd logo
1  sur  36
1SystemVerilog Verification Building Blocks
(Program blocks, Clocking blocks,Interfaces
and Packages)
1
-
1
 Overview
 Interfaces
 Program Block
 Clocking Block
 fork-join
 Packages
 Summary
Overview
1
-
2
In Verilog, testbench code and design code are in a separate
module
— Much effort is required to set the environment to be properly initialized and
synchronized
 To avoid race conditions between the design and testbench
SystemVerilog introduces the program block to separate the
testbench
Connections between the blocks increases as the design grows
— Any wrong connection stops the design from working
SystemVerilog also introduces the interface construct to
encapsulate the communication between design and verification
blocks
SystemVerilog Verification Building Blocks
1
-
3
 Overview
 Interfaces
 Program Block
 Clocking Block
 fork-join
 Packages
 Summary
Interfaces
1
-
4
The communication between blocks
of a digital system is a critical
— Manually connecting many ports can lead
to errors
— Port declaration in many modules
— Change in the design makes it difficult to
change
SystemVerilog adds a powerful
feature called interface
Interface encapsulates the
interconnection and communication
between blocks
Interface
1
-
5
An interface port declaration
syntax is the same as that of
modules
An interface can contain
subroutines
An interface can also contain
processes (i.e., initial or always
procedures) and continuous
assignments
This allows the interface to include
a verifier such as its own protocol
checker that automatically verifies
all modules connected via the
interface to conform to the
specified protocol
Interface Syntax
1
-
6
Without Interface Example
1
-
7
With Interface Example
1
-
8
In the previous example, if the same identifier u_if had been used
to name the uart_if interface in the uart_rx and uart_rx_ctl module
headers
— Then implicit port connections could also have been used to instantiate the
uart_rx and uart_rx_ctl modules into the top module, as follows
Interface Example: Implicit Port Connections
1
-
9
To specify the direction of the signal that uses an interface instead
of a port list
— modports are used
To restrict interface access within a module, modport lists the
directions declared within the interface
Modports
1
-
1
0
 Overview
 Interfaces
 Program Block
 Clocking Block
 fork-join
 Packages
 Summary
Program Block
1
-
1
1
Usually a testbench contains the following functionality
— Interconnect instances
— Drives clocks, resets, and other control signals with some of them tied to
constant values
— Controls test duration
— Drives DUT test
 Drives design inputs
 Checks design outputs
 Collects test statistics
All these cause the testbench to be a huge text file, containing
hundreds or thousands of lines of code
Testbenches
1
-
1
2
Programs are intended to be instantiated or nested within a
testbench, encapsulating all design verification functionality
Testbench can include one or more programs
— Each program is a design verification (or sub-environment) entry-point
— Each program can call the $exit() method
 When the $exit() method is called, all the threads opened within the program are
terminated
— When all the programs are done (either by calling the $exit() method or by
finishing all the threads), the $finish() system task is called automatically
Programs cannot instantiate modules, but they may have input,
output, and inout ports and interfaces like modules
Programs
1
-
1
3
Program block construct is provided for modeling the testbench
environment
The program construct serves as a clear separator between
design and testbench
A program block can contain
— Data declarations, class definitions, subroutines, and one or more initial and
final procedures
A program block cannot contain
— always procedures, primitive instances, module instances, interface
instances, or other program instances
Program Syntax
1
-
1
4
Programs’ Instances
1
-
1
5
Programs within Modules and Interfaces
1
-
1
6
 Overview
 Interfaces
 Program Block
 Clocking Block
 fork-join
 Packages
 Summary
Clocking Block
1
-
1
7
A clocking block is a synchronization part within a module's
interconnection (interfaces) or signal drivers (programs and
modules)
It is intended to make sequenced signals driving/sampling easier
Provides immediate ability to specify sampling signal and its input
and output skew (timing spec)
— Input skew specifies how long before a "real" clock-edge signal is sampled
— Output skew specifies how long after a "real" clock-edge signal is driven
Clocking Block
1
-
1
8
Clocking Block Syntax (1)
1
-
1
9
Any signal in a clocking block can be associated with an arbitrary
hierarchical expression. A hierarchical expression is introduced
by appending an equal sign (=) followed by the hierarchical
expression
Hierarchical expressions are not limited to simple names or
signals in other scopes
Clocking Block Syntax (2)
1
-
2
0
One clocking block can be specified as the default for all cycle
operations
A default is valid only within the scope of the default clocking
specification
Only one default clocking can be specified in a module, interface,
program, or checker
The ## operator can be used to delay execution by a specified by
number of clock cycles or clocking events
Default Clocking and ## Cycle Delay
1
-
2
1
Default Clocking and ## Cycle Delay Example
1
-
2
2
Clocking block within interface is used to specify both signal direction
(input, output or inout) and timing spec of signal sampling
Clocking block is true hierarchical construct. To access clocked signal
use hierarchical path including clocking itself
Clocking Block within Interfaces
1
-
2
3
A bind operator is intended to insert a module, program, or
interface to another module or module instance
It allows the verification engineer to add design verification
utilities to design with no real RTL code changes
Bind Operator (1)
1
-
2
4
Bind Operator (2)
1
-
2
5
 Overview
 Interfaces
 Program Block
 Clocking Block
 fork-join
 Packages
 Summary
fork-join
1
-
2
6
fork-join
1
-
2
7
fork-join any
1
-
2
8
fork-join_none (1)
1
-
2
9
fork-join_none starts a new thread but it does not use any delays
It allows calling a task from a function
fork-join_none (2)
1
-
3
0
wait fork
1
-
3
1
 Overview
 Interfaces
 Program Block
 Clocking Block
 fork-join
 Packages
 Summary
Packages
1
-
3
2
Identifiers declared within a module, interface, program, or checker are
local to that scope
— Do not affect or conflict with declarations in other building blocks
SystemVerilog packages provide an additional mechanism to share with
other building blocks
Packages
1
-
3
3
 Overview
 Interfaces
 Program Block
 Clocking Block
 fork-join
 Packages
 Summary
Summary
1
-
3
4
1.What is the purpose of using a program block?
2.What is the need for SystemVerilog interface construct?
3.What is the purpose of clocking block?
Answer the following questions
1
-
3
5
SystemVerilog verification building blocks are the program block,
interfaces, clocking block, and packages
SystemVerilog introduces the program block to separate the
testbench and to avoid the race conditions between the design
and testbench
The interface construct encapsulates the interconnection and
communication between blocks
To restrict the interface access within a module, modport lists the
directions declared within the interface
Clocking block is a synchronization part within a module's
interconnection (interface) or signal drivers (programs and
modules)
Summary
1
-
3
6

Contenu connexe

Tendances

Session 8 assertion_based_verification_and_interfaces
Session 8 assertion_based_verification_and_interfacesSession 8 assertion_based_verification_and_interfaces
Session 8 assertion_based_verification_and_interfaces
Nirav Desai
 
Session 6 sv_randomization
Session 6 sv_randomizationSession 6 sv_randomization
Session 6 sv_randomization
Nirav Desai
 
Uvm cookbook-systemverilog-guidelines-verification-academy
Uvm cookbook-systemverilog-guidelines-verification-academyUvm cookbook-systemverilog-guidelines-verification-academy
Uvm cookbook-systemverilog-guidelines-verification-academy
Raghavendra Kamath
 
Session 7 code_functional_coverage
Session 7 code_functional_coverageSession 7 code_functional_coverage
Session 7 code_functional_coverage
Nirav Desai
 
Session 9 advance_verification_features
Session 9 advance_verification_featuresSession 9 advance_verification_features
Session 9 advance_verification_features
Nirav Desai
 

Tendances (20)

Session 8 assertion_based_verification_and_interfaces
Session 8 assertion_based_verification_and_interfacesSession 8 assertion_based_verification_and_interfaces
Session 8 assertion_based_verification_and_interfaces
 
SOC Verification using SystemVerilog
SOC Verification using SystemVerilog SOC Verification using SystemVerilog
SOC Verification using SystemVerilog
 
axi protocol
axi protocolaxi protocol
axi protocol
 
Session 6 sv_randomization
Session 6 sv_randomizationSession 6 sv_randomization
Session 6 sv_randomization
 
Amba axi 29 3_2015
Amba axi 29 3_2015Amba axi 29 3_2015
Amba axi 29 3_2015
 
CPU Verification
CPU VerificationCPU Verification
CPU Verification
 
2019 2 testing and verification of vlsi design_verification
2019 2 testing and verification of vlsi design_verification2019 2 testing and verification of vlsi design_verification
2019 2 testing and verification of vlsi design_verification
 
AXI Protocol.pptx
AXI Protocol.pptxAXI Protocol.pptx
AXI Protocol.pptx
 
Axi protocol
Axi protocolAxi protocol
Axi protocol
 
UVM TUTORIAL;
UVM TUTORIAL;UVM TUTORIAL;
UVM TUTORIAL;
 
APB protocol v1.0
APB protocol v1.0APB protocol v1.0
APB protocol v1.0
 
System Verilog Tutorial - VHDL
System Verilog Tutorial - VHDLSystem Verilog Tutorial - VHDL
System Verilog Tutorial - VHDL
 
Verification challenges and methodologies - SoC and ASICs
Verification challenges and methodologies - SoC and ASICsVerification challenges and methodologies - SoC and ASICs
Verification challenges and methodologies - SoC and ASICs
 
SystemVerilog OOP Ovm Features Summary
SystemVerilog OOP Ovm Features SummarySystemVerilog OOP Ovm Features Summary
SystemVerilog OOP Ovm Features Summary
 
Uvm cookbook-systemverilog-guidelines-verification-academy
Uvm cookbook-systemverilog-guidelines-verification-academyUvm cookbook-systemverilog-guidelines-verification-academy
Uvm cookbook-systemverilog-guidelines-verification-academy
 
Session 7 code_functional_coverage
Session 7 code_functional_coverageSession 7 code_functional_coverage
Session 7 code_functional_coverage
 
Session 9 advance_verification_features
Session 9 advance_verification_featuresSession 9 advance_verification_features
Session 9 advance_verification_features
 
Axi protocol
Axi protocolAxi protocol
Axi protocol
 
UVM: Basic Sequences
UVM: Basic SequencesUVM: Basic Sequences
UVM: Basic Sequences
 
Axi
AxiAxi
Axi
 

Similaire à System verilog verification building blocks

Michael_Joshua_Validation
Michael_Joshua_ValidationMichael_Joshua_Validation
Michael_Joshua_Validation
MichaelJoshua
 

Similaire à System verilog verification building blocks (20)

UVM BASED REUSABLE VERIFICATION IP FOR WISHBONE COMPLIANT SPI MASTER CORE
UVM BASED REUSABLE VERIFICATION IP FOR WISHBONE COMPLIANT SPI MASTER COREUVM BASED REUSABLE VERIFICATION IP FOR WISHBONE COMPLIANT SPI MASTER CORE
UVM BASED REUSABLE VERIFICATION IP FOR WISHBONE COMPLIANT SPI MASTER CORE
 
UVM BASED REUSABLE VERIFICATION IP FOR WISHBONE COMPLIANT SPI MASTER CORE
UVM BASED REUSABLE VERIFICATION IP FOR WISHBONE COMPLIANT SPI MASTER COREUVM BASED REUSABLE VERIFICATION IP FOR WISHBONE COMPLIANT SPI MASTER CORE
UVM BASED REUSABLE VERIFICATION IP FOR WISHBONE COMPLIANT SPI MASTER CORE
 
UVM BASED REUSABLE VERIFICATION IP FOR WISHBONE COMPLIANT SPI MASTER CORE
UVM BASED REUSABLE VERIFICATION IP FOR WISHBONE COMPLIANT SPI MASTER COREUVM BASED REUSABLE VERIFICATION IP FOR WISHBONE COMPLIANT SPI MASTER CORE
UVM BASED REUSABLE VERIFICATION IP FOR WISHBONE COMPLIANT SPI MASTER CORE
 
4213ijsea06
4213ijsea064213ijsea06
4213ijsea06
 
SIMULATION-BASED APPLICATION SOFTWARE DEVELOPMENT IN TIME-TRIGGERED COMMUNICA...
SIMULATION-BASED APPLICATION SOFTWARE DEVELOPMENT IN TIME-TRIGGERED COMMUNICA...SIMULATION-BASED APPLICATION SOFTWARE DEVELOPMENT IN TIME-TRIGGERED COMMUNICA...
SIMULATION-BASED APPLICATION SOFTWARE DEVELOPMENT IN TIME-TRIGGERED COMMUNICA...
 
siemens-eda_technical-paper_the-missing-link-the-testbench-to-dut-connection.pdf
siemens-eda_technical-paper_the-missing-link-the-testbench-to-dut-connection.pdfsiemens-eda_technical-paper_the-missing-link-the-testbench-to-dut-connection.pdf
siemens-eda_technical-paper_the-missing-link-the-testbench-to-dut-connection.pdf
 
14-IntegrationTesting_in_software_testing .pdf
14-IntegrationTesting_in_software_testing .pdf14-IntegrationTesting_in_software_testing .pdf
14-IntegrationTesting_in_software_testing .pdf
 
VLSI
VLSIVLSI
VLSI
 
[ENGLISH] TDC 2015 - PHP Trail - Tests and PHP Continuous Integration Enviro...
[ENGLISH] TDC 2015 - PHP  Trail - Tests and PHP Continuous Integration Enviro...[ENGLISH] TDC 2015 - PHP  Trail - Tests and PHP Continuous Integration Enviro...
[ENGLISH] TDC 2015 - PHP Trail - Tests and PHP Continuous Integration Enviro...
 
SystemVerilog_veriflcation and UVM for IC design.ppt
SystemVerilog_veriflcation and UVM for IC design.pptSystemVerilog_veriflcation and UVM for IC design.ppt
SystemVerilog_veriflcation and UVM for IC design.ppt
 
safety assurence in process control
safety assurence in process controlsafety assurence in process control
safety assurence in process control
 
 Test system architectures using advanced standardized test languages
 Test system architectures using advanced standardized test languages Test system architectures using advanced standardized test languages
 Test system architectures using advanced standardized test languages
 
Troubleshooting and Best Practices with WSO2 Enterprise Integrator
Troubleshooting and Best Practices with WSO2 Enterprise IntegratorTroubleshooting and Best Practices with WSO2 Enterprise Integrator
Troubleshooting and Best Practices with WSO2 Enterprise Integrator
 
White paper: Software-Defined Networking Matrix Switching
White paper: Software-Defined Networking Matrix SwitchingWhite paper: Software-Defined Networking Matrix Switching
White paper: Software-Defined Networking Matrix Switching
 
VLSI
VLSIVLSI
VLSI
 
Troubleshooting and Best Practices with WSO2 Enterprise Integrator
Troubleshooting and Best Practices with WSO2 Enterprise IntegratorTroubleshooting and Best Practices with WSO2 Enterprise Integrator
Troubleshooting and Best Practices with WSO2 Enterprise Integrator
 
Testing
TestingTesting
Testing
 
Ia rm001 -en-p
Ia rm001 -en-pIa rm001 -en-p
Ia rm001 -en-p
 
Test System Architectures using Advanced Standardized Test Languages
Test System Architectures using Advanced Standardized Test LanguagesTest System Architectures using Advanced Standardized Test Languages
Test System Architectures using Advanced Standardized Test Languages
 
Michael_Joshua_Validation
Michael_Joshua_ValidationMichael_Joshua_Validation
Michael_Joshua_Validation
 

Plus de Nirav Desai

“Optimized AES Algorithm Core Using FeedBack Architecture”
“Optimized AES Algorithm Core Using FeedBack Architecture” “Optimized AES Algorithm Core Using FeedBack Architecture”
“Optimized AES Algorithm Core Using FeedBack Architecture”
Nirav Desai
 
List of vlsi companies in bangalore
List of vlsi companies in bangaloreList of vlsi companies in bangalore
List of vlsi companies in bangalore
Nirav Desai
 
Xilinx design flow -By BhargavTarpara
Xilinx design flow -By BhargavTarparaXilinx design flow -By BhargavTarpara
Xilinx design flow -By BhargavTarpara
Nirav Desai
 

Plus de Nirav Desai (6)

SATA Protocol
SATA ProtocolSATA Protocol
SATA Protocol
 
AMBA 2.0 PPT
AMBA 2.0 PPTAMBA 2.0 PPT
AMBA 2.0 PPT
 
AMBA 2.0 REPORT
AMBA 2.0 REPORTAMBA 2.0 REPORT
AMBA 2.0 REPORT
 
“Optimized AES Algorithm Core Using FeedBack Architecture”
“Optimized AES Algorithm Core Using FeedBack Architecture” “Optimized AES Algorithm Core Using FeedBack Architecture”
“Optimized AES Algorithm Core Using FeedBack Architecture”
 
List of vlsi companies in bangalore
List of vlsi companies in bangaloreList of vlsi companies in bangalore
List of vlsi companies in bangalore
 
Xilinx design flow -By BhargavTarpara
Xilinx design flow -By BhargavTarparaXilinx design flow -By BhargavTarpara
Xilinx design flow -By BhargavTarpara
 

Dernier

Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Christo Ananth
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
dollysharma2066
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
rknatarajan
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Dr.Costas Sachpazis
 

Dernier (20)

NFPA 5000 2024 standard .
NFPA 5000 2024 standard                                  .NFPA 5000 2024 standard                                  .
NFPA 5000 2024 standard .
 
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
 
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdf
 
UNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICS
UNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICSUNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICS
UNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICS
 
Call for Papers - International Journal of Intelligent Systems and Applicatio...
Call for Papers - International Journal of Intelligent Systems and Applicatio...Call for Papers - International Journal of Intelligent Systems and Applicatio...
Call for Papers - International Journal of Intelligent Systems and Applicatio...
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
 
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
Vivazz, Mieres Social Housing Design Spain
Vivazz, Mieres Social Housing Design SpainVivazz, Mieres Social Housing Design Spain
Vivazz, Mieres Social Housing Design Spain
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdf
 

System verilog verification building blocks

  • 1. 1SystemVerilog Verification Building Blocks (Program blocks, Clocking blocks,Interfaces and Packages) 1 - 1
  • 2.  Overview  Interfaces  Program Block  Clocking Block  fork-join  Packages  Summary Overview 1 - 2
  • 3. In Verilog, testbench code and design code are in a separate module — Much effort is required to set the environment to be properly initialized and synchronized  To avoid race conditions between the design and testbench SystemVerilog introduces the program block to separate the testbench Connections between the blocks increases as the design grows — Any wrong connection stops the design from working SystemVerilog also introduces the interface construct to encapsulate the communication between design and verification blocks SystemVerilog Verification Building Blocks 1 - 3
  • 4.  Overview  Interfaces  Program Block  Clocking Block  fork-join  Packages  Summary Interfaces 1 - 4
  • 5. The communication between blocks of a digital system is a critical — Manually connecting many ports can lead to errors — Port declaration in many modules — Change in the design makes it difficult to change SystemVerilog adds a powerful feature called interface Interface encapsulates the interconnection and communication between blocks Interface 1 - 5
  • 6. An interface port declaration syntax is the same as that of modules An interface can contain subroutines An interface can also contain processes (i.e., initial or always procedures) and continuous assignments This allows the interface to include a verifier such as its own protocol checker that automatically verifies all modules connected via the interface to conform to the specified protocol Interface Syntax 1 - 6
  • 9. In the previous example, if the same identifier u_if had been used to name the uart_if interface in the uart_rx and uart_rx_ctl module headers — Then implicit port connections could also have been used to instantiate the uart_rx and uart_rx_ctl modules into the top module, as follows Interface Example: Implicit Port Connections 1 - 9
  • 10. To specify the direction of the signal that uses an interface instead of a port list — modports are used To restrict interface access within a module, modport lists the directions declared within the interface Modports 1 - 1 0
  • 11.  Overview  Interfaces  Program Block  Clocking Block  fork-join  Packages  Summary Program Block 1 - 1 1
  • 12. Usually a testbench contains the following functionality — Interconnect instances — Drives clocks, resets, and other control signals with some of them tied to constant values — Controls test duration — Drives DUT test  Drives design inputs  Checks design outputs  Collects test statistics All these cause the testbench to be a huge text file, containing hundreds or thousands of lines of code Testbenches 1 - 1 2
  • 13. Programs are intended to be instantiated or nested within a testbench, encapsulating all design verification functionality Testbench can include one or more programs — Each program is a design verification (or sub-environment) entry-point — Each program can call the $exit() method  When the $exit() method is called, all the threads opened within the program are terminated — When all the programs are done (either by calling the $exit() method or by finishing all the threads), the $finish() system task is called automatically Programs cannot instantiate modules, but they may have input, output, and inout ports and interfaces like modules Programs 1 - 1 3
  • 14. Program block construct is provided for modeling the testbench environment The program construct serves as a clear separator between design and testbench A program block can contain — Data declarations, class definitions, subroutines, and one or more initial and final procedures A program block cannot contain — always procedures, primitive instances, module instances, interface instances, or other program instances Program Syntax 1 - 1 4
  • 16. Programs within Modules and Interfaces 1 - 1 6
  • 17.  Overview  Interfaces  Program Block  Clocking Block  fork-join  Packages  Summary Clocking Block 1 - 1 7
  • 18. A clocking block is a synchronization part within a module's interconnection (interfaces) or signal drivers (programs and modules) It is intended to make sequenced signals driving/sampling easier Provides immediate ability to specify sampling signal and its input and output skew (timing spec) — Input skew specifies how long before a "real" clock-edge signal is sampled — Output skew specifies how long after a "real" clock-edge signal is driven Clocking Block 1 - 1 8
  • 19. Clocking Block Syntax (1) 1 - 1 9
  • 20. Any signal in a clocking block can be associated with an arbitrary hierarchical expression. A hierarchical expression is introduced by appending an equal sign (=) followed by the hierarchical expression Hierarchical expressions are not limited to simple names or signals in other scopes Clocking Block Syntax (2) 1 - 2 0
  • 21. One clocking block can be specified as the default for all cycle operations A default is valid only within the scope of the default clocking specification Only one default clocking can be specified in a module, interface, program, or checker The ## operator can be used to delay execution by a specified by number of clock cycles or clocking events Default Clocking and ## Cycle Delay 1 - 2 1
  • 22. Default Clocking and ## Cycle Delay Example 1 - 2 2
  • 23. Clocking block within interface is used to specify both signal direction (input, output or inout) and timing spec of signal sampling Clocking block is true hierarchical construct. To access clocked signal use hierarchical path including clocking itself Clocking Block within Interfaces 1 - 2 3
  • 24. A bind operator is intended to insert a module, program, or interface to another module or module instance It allows the verification engineer to add design verification utilities to design with no real RTL code changes Bind Operator (1) 1 - 2 4
  • 26.  Overview  Interfaces  Program Block  Clocking Block  fork-join  Packages  Summary fork-join 1 - 2 6
  • 30. fork-join_none starts a new thread but it does not use any delays It allows calling a task from a function fork-join_none (2) 1 - 3 0
  • 32.  Overview  Interfaces  Program Block  Clocking Block  fork-join  Packages  Summary Packages 1 - 3 2
  • 33. Identifiers declared within a module, interface, program, or checker are local to that scope — Do not affect or conflict with declarations in other building blocks SystemVerilog packages provide an additional mechanism to share with other building blocks Packages 1 - 3 3
  • 34.  Overview  Interfaces  Program Block  Clocking Block  fork-join  Packages  Summary Summary 1 - 3 4
  • 35. 1.What is the purpose of using a program block? 2.What is the need for SystemVerilog interface construct? 3.What is the purpose of clocking block? Answer the following questions 1 - 3 5
  • 36. SystemVerilog verification building blocks are the program block, interfaces, clocking block, and packages SystemVerilog introduces the program block to separate the testbench and to avoid the race conditions between the design and testbench The interface construct encapsulates the interconnection and communication between blocks To restrict the interface access within a module, modport lists the directions declared within the interface Clocking block is a synchronization part within a module's interconnection (interface) or signal drivers (programs and modules) Summary 1 - 3 6