SlideShare ist ein Scribd-Unternehmen logo
1 von 37
SystemVerilog For Verification
How to create a testbench
SystemVerilog Environment ?
Sameh El-Ashry
Senior Digital Verification Engineer
S. ElAshry © 2020
PHASES OF VERIFICATION
Analyze Coverage
Extract Code Coverage
Writing Tests
Building Testbench
Verification Plan
S. ElAshry © 2020
Building Testbench
▪ In this phase, the verification environment is
developed.
▪ Each verification component can be developed one
by one or if more than one engineer is working it
can be developed parallel.
▪ Writing the coverage module can be done at any
time. It is preferred to write down the coverage
module first as it gives some idea of the
verification progress.
S. ElAshry © 2020
Writing Tests
▪ After the TestBench is built and integrated to DUT, it's time
for validating the DUT.
▪ Initially in Constrained Driven Verification, the test are ran
randomly till some 70 % of coverage is reached or no
improvement in the coverage for 1 day simulation.
▪ By analyzing the coverage reports, new tests are written to
cover the holes. In these tests, randomization is directed to
cover the holes.
▪ Then finally, the hard to reach scenarios, called as corner
cases have to be written in directed verification fashion. Of
course, debugging is done in parallel and DUT fixes are
done.
S. ElAshry © 2020
Analyze Code Coverage
▪ Once you have achieved certain level of functional coverage,
then start for the code coverage.
▪ For doing code coverage, the code coverage tools have
option to switch it on. And then do the simulation, the tool
will provide the report.
▪ Finally analyze both functional coverage and code coverage
reports and take necessary steps to achieve coverage goals.
▪ Run simulation again with a different seed, all the while
collecting functional coverage information.
S. ElAshry © 2020
Case Study_1: ALU Block Diagram → Extracting testplan
(start point)
S. ElAshry © 2020
Specifications Extraction (Design Requirements)
S. ElAshry © 2020
Specifications Extraction (Verification Requirements)
S. ElAshry © 2020
Verilog Environment For ALU (Modules)
S. ElAshry © 2020
SystemVerilog Environment For ALU (OOP)
DUT
SystemVerilog Interface
Scoreboard
stimulus Driver Monitor
Coverage
Environment
Test Base
Top
Mailbox
Mailbox
S. ElAshry © 2020
Case Study_2: ONES COUNTER EXAMPLE
▪ Following example is TestBench for ones counter.
▪ It has some verification components which are
required.
▪ The intention of showing this example is to make
you familiar with some steps required while
building verification environment and to help you to
understand the flow of System Verilog
environment.
S. ElAshry © 2020
Specification of ones counter (start point)
▪ Ones Counter is a Counter which counts the number of one's coming in
serial stream.
▪ The Minimum value of the count is "0" and count starts by incriminating
one till "15". After "15" the counter rolls back to "0".
▪ Reset is also provided to reset the counter value to "0". Reset signal is
active negedge.
▪ Input is 1 bit port for which the serial stream enters. Out bit is 4 bit port
from where the count values can be taken.
▪ Reset and clock pins also provided.
S. ElAshry © 2020
4 bit counter using four D flip-flops
Count[0]
Count[1]
din
S. ElAshry © 2020
The following is the RTL code of ones
counter with bugs
module dff(clk,reset,din,dout);
input clk,reset,din;
output dout;
logic dout;
always@(posedge clk,negedge reset)
if(!reset)
dout <= 0;
else
dout <= din;
endmodule
module ones_counter(clk,reset,data,count);
input clk,reset,data;
output [0:3] count;
dff d1(clk,reset,data,count[0]);
dff d2(count[0],reset,~count[1],count[1]);
dff d3(count[1],reset,~count[2],count[2]);
dff d4(count[2],reset,~count[3],count[3]);
endmodule
S. ElAshry © 2020
Verification Test Plan Template
Testcase
Name
Description Section # in
standard
Type
(positive/ne
gative)
Status
(pass/fail/
hang)
S. ElAshry © 2020
Test Plan For Ones Counter
Testcase
Name
Description Section # in
standard
Type
(positive/nega
tive)
Status
(pass/fail/
hang)
test1.v Count should
increment from "0"
to "15".
( Coverage item)
test2.v Count should
roolover to "0" after
"15".
(Coverage
transition)
test3.v Reset should
make the output
count to "0", when
the count values is
non "0".
( Assertion
coverage)
S. ElAshry © 2020
Verification Environment Hierarchy
▪ TOP
|-- Clock generator
|-- Dut Instance
|-- Interface
|-- Assertion block instance
|-- Testcase instance
|-- Environment
|-- Driver
| |-- Stimulus
| |-- Covergroup
|-- Monitor
|-- Scoreboard
S. ElAshry © 2020
SystemVerilog Environment For Ones Counter (OOP)
DUT
SystemVerilog Interface
Scoreboard
stimulus Driver Monitor
Assertion
monitor
Env
Test case
Top
reset Data Count
Count
S. ElAshry © 2020
COVERAGE DRIVEN CONSTRAINT RANDOM VERIFICATION ARCHITECTURE
(CDRV)
▪ Input side of DUT :
• Generating traffic streams.
• Driving traffic into the design (stimuli).
▪ Output side of DUT:
• Checking these data streams
• Checking protocols and timing
▪ Collecting both the functional coverage and code coverage
information.
▪ Writing deterministic tests and random tests to achieve
100% coverage.
S. ElAshry © 2020
Stimulus
▪ When building a verification environment, the verification engineer
often starts by modeling the device input stimulus.
▪ In Verilog, the verification engineer is limited in how to model this
stimulus because of the lack of high-level data structures.
▪ Typically, the verification engineer will create an array/memory to store
the stimulis.
▪ SystemVerilog provides high-level data structures and dynamic data
types for modeling stimulus.
▪ Using SystemVerilog randomization, stimulus is generated
automatically.
▪ Stimulus is also processed in other verification components.
▪ SystemVerilog high-level data structures helps in storing and processing
of stimulus in an efficient way.
S. ElAshry © 2020
Stimulus Generator
▪ The generator component generates stimulus which are sent to DUT by
driver.
▪ Stimulus generation is modeled to generate the stimulus based on the
specification.
▪ For simple memory stimulus generator generates read, write
operations, address and data to be stored in the address if its write
operation.
▪ Scenarios like generate alternate read/write operations are specified in
scenario generator.
▪ SystemVerilog provided construct to control the random generation
distribution and order.
▪ Generally, generator should be able to generate every possible scenario
and the user should be able to control the generation from directed and
directed random testcases.
S. ElAshry © 2020
Driver
▪ The drivers translate the operations produced by the generator into the
actual inputs for the design under verification.
▪ Generators create inputs at a high level of abstraction as transactions
like read write operation.
▪ The drivers convert this input into actual design inputs, as defined in the
specification of the designs interface.
▪ If the generator generates read operation, then read task is called.
S. ElAshry © 2020
Monitor
▪ Monitor reports the protocol violation and identifies all the transactions.
▪ Monitors are two types, Passive and active.
▪ Passive monitors do not drive any signals.
▪ Active monitors can drive the DUT signals.
▪ Sometimes this is also referred as receiver. Monitor converts the state
of the design and its outputs to a transaction abstraction level so it can
be stored in a 'score-boards' database to be checked later on.
▪ Monitor converts the pin level activities in to high level.
S. ElAshry © 2020
Assertion Based Monitor
▪ Assertions are used to check time based protocols, also known as
temporal checks.
▪ Assertions are a necessary compliment to transaction based testing as
they describe the pin level, cycle by cycle, protocols of the design.
▪ Assertions are also used for functional coverage.
S. ElAshry © 2020
Scoreboard
▪ Scoreboard stores the expected DUT output.
▪ The stimulus generator generated the random vectors and is sent to the
DUT using drivers.
▪ These stimuli are stored in scoreboard until the output comes out of the
DUT.
▪ When a write operation is done on a memory with address 101 and data
202, after some cycles, if a read is done at address 101, what should be
the data?.
▪ The scoreboard recorded the address and data when write operation is
done. Get the data stored at address of 101 in scoreboard and compare
with the output of the DUT in checker module.
▪ Scoreboard also has expected logic if needed.
S. ElAshry © 2020
Coverage
▪ This component has all the coverage related to the functional coverage
groups.
Environment
▪ Environment contains the instances of all the verification component
and Component connectivity is also done.
▪ Steps required for execution of each component is done in this.
S. ElAshry © 2020
Tests
▪ Tests contain the code to control the TestBench features.
▪ Tests can communicate with all the TestBench components.
▪ Once the TestBench is in place, the verification engineer now needs to
focus on writing tests to verify that the device behaves according to
specification.
S. ElAshry © 2020
Regression Concept
▪ Regression is re-running previously run tests and checking whether
previously fixed faults have re-emerged.
▪ New bugs may come out due to new changes in RTL or DUT to
unmasking of previously hidden bugs due to new changes.
▪ Each time, when design is changed, regression is done. One more
important aspect of regression is testing by generation new vectors.
▪ Usually the seed to generate stimulus is the system time.
▪ Whenever a regression is done, it will take the current system time and
generate new vectors than earlier tested.
▪ This way testbench can reach corners of DUT.
S. ElAshry © 2020
How much regression testing?
S. ElAshry © 2020
Coverage Model
▪ Code coverage + Functional coverage
Example of Functional Coverage Result
S. ElAshry © 2020
Example of Code Coverage Result
S. ElAshry © 2020
Code Coverage
▪ To check whether theTestbench has satisfactory exercised the design or
not? Coverage is used.
▪ It will measure the efficiency of your verification implementation.
▪ Code coverage answers the questions like
• Have all the lines of the DUT has been exercised?
• Have all the states in the FSM has been entered?
• Have all the paths within a block have been exercised?
• Have all the branches in Case have been entered?
• Have all the conditions in an if statement is simulated?
S. ElAshry © 2020
Functional Coverage
▪ Functional coverage answers questions like
• Have all the packets length between 64 to 1518 are used?
• Did the DUT got exercised with alternate packets with good and bad crc?
• Did the monitor observe that the result comes with 4 clock cycles after read
operation?
• Did the fifos are filled completely?
▪ Summary of functional coverage advantages:
• Functional coverage helps determine how much of your specification was
covered.
• Functional coverage qualifies the testbenchs.
• Considered as stopping criteria for unit level verification.
• Gives feedback about the untested features.
• Gives the information about the redundant tests which consume valuable
cycle.
• Guides to reach the goals earlier based on grading.
S. ElAshry © 2020
SystemVerilog Interface Vs BFM
▪ SystemVerilog Interface.
▪ BFM (Bus Functional Model)
DUT
SV
Interface
Testbench
DUT
BFM
AXI
AHB
APB
Testbench
S. ElAshry © 2020
Example for a Job Requirements
S. ElAshry © 2020
References
▪ http://www.testbench.in/
▪ http://www.asic-
world.com/systemverilog/index.html
▪ https://verificationguide.com/systemverilog-
examples/systemverilog-testbench-example-with-
scb/
Thank You !
SystemVerilog Session
Presented by Sameh El-Ashry
samehelashry@ieee.org
https://www.linkedin.com/in/sameh-elashry-22b5603b/

Weitere ähnliche Inhalte

Was ist angesagt?

Uvm presentation dac2011_final
Uvm presentation dac2011_finalUvm presentation dac2011_final
Uvm presentation dac2011_finalsean chen
 
System verilog coverage
System verilog coverageSystem verilog coverage
System verilog coveragePushpa Yakkala
 
System verilog important
System verilog importantSystem verilog important
System verilog importantelumalai7
 
System verilog assertions
System verilog assertionsSystem verilog assertions
System verilog assertionsHARINATH REDDY
 
System verilog verification building blocks
System verilog verification building blocksSystem verilog verification building blocks
System verilog verification building blocksNirav Desai
 
Session 6 sv_randomization
Session 6 sv_randomizationSession 6 sv_randomization
Session 6 sv_randomizationNirav Desai
 
Efficient Methodology of Sampling UVM RAL During Simulation for SoC Functiona...
Efficient Methodology of Sampling UVM RAL During Simulation for SoC Functiona...Efficient Methodology of Sampling UVM RAL During Simulation for SoC Functiona...
Efficient Methodology of Sampling UVM RAL During Simulation for SoC Functiona...Sameh El-Ashry
 
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_verificationUsha Mehta
 
Functional verification techniques EW16 session
Functional verification techniques  EW16 sessionFunctional verification techniques  EW16 session
Functional verification techniques EW16 sessionSameh El-Ashry
 

Was ist angesagt? (20)

ASIC design verification
ASIC design verificationASIC design verification
ASIC design verification
 
Uvm presentation dac2011_final
Uvm presentation dac2011_finalUvm presentation dac2011_final
Uvm presentation dac2011_final
 
System verilog coverage
System verilog coverageSystem verilog coverage
System verilog coverage
 
AXI Protocol.pptx
AXI Protocol.pptxAXI Protocol.pptx
AXI Protocol.pptx
 
System verilog important
System verilog importantSystem verilog important
System verilog important
 
Ral by pushpa
Ral by pushpa Ral by pushpa
Ral by pushpa
 
System verilog assertions
System verilog assertionsSystem verilog assertions
System verilog assertions
 
system verilog
system verilogsystem verilog
system verilog
 
Coverage and Introduction to UVM
Coverage and Introduction to UVMCoverage and Introduction to UVM
Coverage and Introduction to UVM
 
System verilog verification building blocks
System verilog verification building blocksSystem verilog verification building blocks
System verilog verification building blocks
 
CPU Verification
CPU VerificationCPU Verification
CPU Verification
 
Session 6 sv_randomization
Session 6 sv_randomizationSession 6 sv_randomization
Session 6 sv_randomization
 
AMBA Ahb 2.0
AMBA Ahb 2.0AMBA Ahb 2.0
AMBA Ahb 2.0
 
Efficient Methodology of Sampling UVM RAL During Simulation for SoC Functiona...
Efficient Methodology of Sampling UVM RAL During Simulation for SoC Functiona...Efficient Methodology of Sampling UVM RAL During Simulation for SoC Functiona...
Efficient Methodology of Sampling UVM RAL During Simulation for SoC Functiona...
 
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
Axi protocolAxi protocol
Axi protocol
 
Advance Peripheral Bus
Advance Peripheral Bus Advance Peripheral Bus
Advance Peripheral Bus
 
Functional verification techniques EW16 session
Functional verification techniques  EW16 sessionFunctional verification techniques  EW16 session
Functional verification techniques EW16 session
 
Pcie basic
Pcie basicPcie basic
Pcie basic
 
UVM TUTORIAL;
UVM TUTORIAL;UVM TUTORIAL;
UVM TUTORIAL;
 

Ähnlich wie How to create SystemVerilog verification environment?

Tips Tricks and Little known features in SAP ASE
Tips Tricks and Little known features in SAP ASETips Tricks and Little known features in SAP ASE
Tips Tricks and Little known features in SAP ASESAP Technology
 
Presentation v mware roi tco calculator
Presentation   v mware roi tco calculatorPresentation   v mware roi tco calculator
Presentation v mware roi tco calculatorsolarisyourep
 
GlobalLogic Test Automation Online TechTalk “Test Driven Development as a Per...
GlobalLogic Test Automation Online TechTalk “Test Driven Development as a Per...GlobalLogic Test Automation Online TechTalk “Test Driven Development as a Per...
GlobalLogic Test Automation Online TechTalk “Test Driven Development as a Per...GlobalLogic Ukraine
 
Getting started with RISC-V verification what's next after compliance testing
Getting started with RISC-V verification what's next after compliance testingGetting started with RISC-V verification what's next after compliance testing
Getting started with RISC-V verification what's next after compliance testingRISC-V International
 
Andreas Grabner - Performance as Code, Let's Make It a Standard
Andreas Grabner - Performance as Code, Let's Make It a StandardAndreas Grabner - Performance as Code, Let's Make It a Standard
Andreas Grabner - Performance as Code, Let's Make It a StandardNeotys_Partner
 
Writing more complex models (continued)
Writing more complex models (continued)Writing more complex models (continued)
Writing more complex models (continued)Mohamed Samy
 
Dev ops presentation
Dev ops presentationDev ops presentation
Dev ops presentationAhmed Kamel
 
Alley vsu functional_coverage_1f
Alley vsu functional_coverage_1fAlley vsu functional_coverage_1f
Alley vsu functional_coverage_1fObsidian Software
 
Chicago DevOps Meetup Nov2019
Chicago DevOps Meetup Nov2019Chicago DevOps Meetup Nov2019
Chicago DevOps Meetup Nov2019Mike Villiger
 
Tech Days 2015: Model Based Development with QGen
Tech Days 2015: Model Based Development with QGenTech Days 2015: Model Based Development with QGen
Tech Days 2015: Model Based Development with QGenAdaCore
 
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_interfacesNirav Desai
 
Continuous Delivery: How RightScale Releases Weekly
Continuous Delivery: How RightScale Releases WeeklyContinuous Delivery: How RightScale Releases Weekly
Continuous Delivery: How RightScale Releases WeeklyRightScale
 
Hdl based simulators
Hdl based simulatorsHdl based simulators
Hdl based simulatorsPrachi Pandey
 
MySQL-Performance Schema- What's new in MySQL-5.7 DMRs
MySQL-Performance Schema- What's new in MySQL-5.7 DMRsMySQL-Performance Schema- What's new in MySQL-5.7 DMRs
MySQL-Performance Schema- What's new in MySQL-5.7 DMRsMayank Prasad
 
XPDS16: Xen Live Patching - Updating Xen Without Rebooting - Konrad Wilk, Ora...
XPDS16: Xen Live Patching - Updating Xen Without Rebooting - Konrad Wilk, Ora...XPDS16: Xen Live Patching - Updating Xen Without Rebooting - Konrad Wilk, Ora...
XPDS16: Xen Live Patching - Updating Xen Without Rebooting - Konrad Wilk, Ora...The Linux Foundation
 
SQL Server Performance Tuning with DMVs
SQL Server Performance Tuning with DMVsSQL Server Performance Tuning with DMVs
SQL Server Performance Tuning with DMVsFranklin Yamamoto
 
Test Driven Development with Sql Server
Test Driven Development with Sql ServerTest Driven Development with Sql Server
Test Driven Development with Sql ServerDavid P. Moore
 

Ähnlich wie How to create SystemVerilog verification environment? (20)

Tips Tricks and Little known features in SAP ASE
Tips Tricks and Little known features in SAP ASETips Tricks and Little known features in SAP ASE
Tips Tricks and Little known features in SAP ASE
 
Tutor1
Tutor1Tutor1
Tutor1
 
Presentation v mware roi tco calculator
Presentation   v mware roi tco calculatorPresentation   v mware roi tco calculator
Presentation v mware roi tco calculator
 
GlobalLogic Test Automation Online TechTalk “Test Driven Development as a Per...
GlobalLogic Test Automation Online TechTalk “Test Driven Development as a Per...GlobalLogic Test Automation Online TechTalk “Test Driven Development as a Per...
GlobalLogic Test Automation Online TechTalk “Test Driven Development as a Per...
 
Getting started with RISC-V verification what's next after compliance testing
Getting started with RISC-V verification what's next after compliance testingGetting started with RISC-V verification what's next after compliance testing
Getting started with RISC-V verification what's next after compliance testing
 
Andreas Grabner - Performance as Code, Let's Make It a Standard
Andreas Grabner - Performance as Code, Let's Make It a StandardAndreas Grabner - Performance as Code, Let's Make It a Standard
Andreas Grabner - Performance as Code, Let's Make It a Standard
 
Coding style for good synthesis
Coding style for good synthesisCoding style for good synthesis
Coding style for good synthesis
 
Writing more complex models (continued)
Writing more complex models (continued)Writing more complex models (continued)
Writing more complex models (continued)
 
Dev ops presentation
Dev ops presentationDev ops presentation
Dev ops presentation
 
Alley vsu functional_coverage_1f
Alley vsu functional_coverage_1fAlley vsu functional_coverage_1f
Alley vsu functional_coverage_1f
 
Chicago DevOps Meetup Nov2019
Chicago DevOps Meetup Nov2019Chicago DevOps Meetup Nov2019
Chicago DevOps Meetup Nov2019
 
Tech Days 2015: Model Based Development with QGen
Tech Days 2015: Model Based Development with QGenTech Days 2015: Model Based Development with QGen
Tech Days 2015: Model Based Development with QGen
 
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
 
Continuous Delivery: How RightScale Releases Weekly
Continuous Delivery: How RightScale Releases WeeklyContinuous Delivery: How RightScale Releases Weekly
Continuous Delivery: How RightScale Releases Weekly
 
Hdl based simulators
Hdl based simulatorsHdl based simulators
Hdl based simulators
 
MySQL-Performance Schema- What's new in MySQL-5.7 DMRs
MySQL-Performance Schema- What's new in MySQL-5.7 DMRsMySQL-Performance Schema- What's new in MySQL-5.7 DMRs
MySQL-Performance Schema- What's new in MySQL-5.7 DMRs
 
XPDS16: Xen Live Patching - Updating Xen Without Rebooting - Konrad Wilk, Ora...
XPDS16: Xen Live Patching - Updating Xen Without Rebooting - Konrad Wilk, Ora...XPDS16: Xen Live Patching - Updating Xen Without Rebooting - Konrad Wilk, Ora...
XPDS16: Xen Live Patching - Updating Xen Without Rebooting - Konrad Wilk, Ora...
 
Sherlock holmes for dba’s
Sherlock holmes for dba’sSherlock holmes for dba’s
Sherlock holmes for dba’s
 
SQL Server Performance Tuning with DMVs
SQL Server Performance Tuning with DMVsSQL Server Performance Tuning with DMVs
SQL Server Performance Tuning with DMVs
 
Test Driven Development with Sql Server
Test Driven Development with Sql ServerTest Driven Development with Sql Server
Test Driven Development with Sql Server
 

Kürzlich hochgeladen

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 PPTbhaskargani46
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Call Girls in Nagpur High Profile
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performancesivaprakash250
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfJiananWang21
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSISrknatarajan
 
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 RecordAsst.prof M.Gokilavani
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduitsrknatarajan
 
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)simmis5
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Christo Ananth
 
Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01KreezheaRecto
 
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
 
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELLPVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELLManishPatel169454
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations120cr0395
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...Call Girls in Nagpur High Profile
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdfankushspencer015
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlysanyuktamishra911
 

Kürzlich hochgeladen (20)

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
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
 
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
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduits
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
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)
 
NFPA 5000 2024 standard .
NFPA 5000 2024 standard                                  .NFPA 5000 2024 standard                                  .
NFPA 5000 2024 standard .
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01
 
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...
 
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELLPVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
 
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
 
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 

How to create SystemVerilog verification environment?

  • 1. SystemVerilog For Verification How to create a testbench SystemVerilog Environment ? Sameh El-Ashry Senior Digital Verification Engineer
  • 2. S. ElAshry © 2020 PHASES OF VERIFICATION Analyze Coverage Extract Code Coverage Writing Tests Building Testbench Verification Plan
  • 3. S. ElAshry © 2020 Building Testbench ▪ In this phase, the verification environment is developed. ▪ Each verification component can be developed one by one or if more than one engineer is working it can be developed parallel. ▪ Writing the coverage module can be done at any time. It is preferred to write down the coverage module first as it gives some idea of the verification progress.
  • 4. S. ElAshry © 2020 Writing Tests ▪ After the TestBench is built and integrated to DUT, it's time for validating the DUT. ▪ Initially in Constrained Driven Verification, the test are ran randomly till some 70 % of coverage is reached or no improvement in the coverage for 1 day simulation. ▪ By analyzing the coverage reports, new tests are written to cover the holes. In these tests, randomization is directed to cover the holes. ▪ Then finally, the hard to reach scenarios, called as corner cases have to be written in directed verification fashion. Of course, debugging is done in parallel and DUT fixes are done.
  • 5. S. ElAshry © 2020 Analyze Code Coverage ▪ Once you have achieved certain level of functional coverage, then start for the code coverage. ▪ For doing code coverage, the code coverage tools have option to switch it on. And then do the simulation, the tool will provide the report. ▪ Finally analyze both functional coverage and code coverage reports and take necessary steps to achieve coverage goals. ▪ Run simulation again with a different seed, all the while collecting functional coverage information.
  • 6. S. ElAshry © 2020 Case Study_1: ALU Block Diagram → Extracting testplan (start point)
  • 7. S. ElAshry © 2020 Specifications Extraction (Design Requirements)
  • 8. S. ElAshry © 2020 Specifications Extraction (Verification Requirements)
  • 9. S. ElAshry © 2020 Verilog Environment For ALU (Modules)
  • 10. S. ElAshry © 2020 SystemVerilog Environment For ALU (OOP) DUT SystemVerilog Interface Scoreboard stimulus Driver Monitor Coverage Environment Test Base Top Mailbox Mailbox
  • 11. S. ElAshry © 2020 Case Study_2: ONES COUNTER EXAMPLE ▪ Following example is TestBench for ones counter. ▪ It has some verification components which are required. ▪ The intention of showing this example is to make you familiar with some steps required while building verification environment and to help you to understand the flow of System Verilog environment.
  • 12. S. ElAshry © 2020 Specification of ones counter (start point) ▪ Ones Counter is a Counter which counts the number of one's coming in serial stream. ▪ The Minimum value of the count is "0" and count starts by incriminating one till "15". After "15" the counter rolls back to "0". ▪ Reset is also provided to reset the counter value to "0". Reset signal is active negedge. ▪ Input is 1 bit port for which the serial stream enters. Out bit is 4 bit port from where the count values can be taken. ▪ Reset and clock pins also provided.
  • 13. S. ElAshry © 2020 4 bit counter using four D flip-flops Count[0] Count[1] din
  • 14. S. ElAshry © 2020 The following is the RTL code of ones counter with bugs module dff(clk,reset,din,dout); input clk,reset,din; output dout; logic dout; always@(posedge clk,negedge reset) if(!reset) dout <= 0; else dout <= din; endmodule module ones_counter(clk,reset,data,count); input clk,reset,data; output [0:3] count; dff d1(clk,reset,data,count[0]); dff d2(count[0],reset,~count[1],count[1]); dff d3(count[1],reset,~count[2],count[2]); dff d4(count[2],reset,~count[3],count[3]); endmodule
  • 15. S. ElAshry © 2020 Verification Test Plan Template Testcase Name Description Section # in standard Type (positive/ne gative) Status (pass/fail/ hang)
  • 16. S. ElAshry © 2020 Test Plan For Ones Counter Testcase Name Description Section # in standard Type (positive/nega tive) Status (pass/fail/ hang) test1.v Count should increment from "0" to "15". ( Coverage item) test2.v Count should roolover to "0" after "15". (Coverage transition) test3.v Reset should make the output count to "0", when the count values is non "0". ( Assertion coverage)
  • 17. S. ElAshry © 2020 Verification Environment Hierarchy ▪ TOP |-- Clock generator |-- Dut Instance |-- Interface |-- Assertion block instance |-- Testcase instance |-- Environment |-- Driver | |-- Stimulus | |-- Covergroup |-- Monitor |-- Scoreboard
  • 18. S. ElAshry © 2020 SystemVerilog Environment For Ones Counter (OOP) DUT SystemVerilog Interface Scoreboard stimulus Driver Monitor Assertion monitor Env Test case Top reset Data Count Count
  • 19. S. ElAshry © 2020 COVERAGE DRIVEN CONSTRAINT RANDOM VERIFICATION ARCHITECTURE (CDRV) ▪ Input side of DUT : • Generating traffic streams. • Driving traffic into the design (stimuli). ▪ Output side of DUT: • Checking these data streams • Checking protocols and timing ▪ Collecting both the functional coverage and code coverage information. ▪ Writing deterministic tests and random tests to achieve 100% coverage.
  • 20. S. ElAshry © 2020 Stimulus ▪ When building a verification environment, the verification engineer often starts by modeling the device input stimulus. ▪ In Verilog, the verification engineer is limited in how to model this stimulus because of the lack of high-level data structures. ▪ Typically, the verification engineer will create an array/memory to store the stimulis. ▪ SystemVerilog provides high-level data structures and dynamic data types for modeling stimulus. ▪ Using SystemVerilog randomization, stimulus is generated automatically. ▪ Stimulus is also processed in other verification components. ▪ SystemVerilog high-level data structures helps in storing and processing of stimulus in an efficient way.
  • 21. S. ElAshry © 2020 Stimulus Generator ▪ The generator component generates stimulus which are sent to DUT by driver. ▪ Stimulus generation is modeled to generate the stimulus based on the specification. ▪ For simple memory stimulus generator generates read, write operations, address and data to be stored in the address if its write operation. ▪ Scenarios like generate alternate read/write operations are specified in scenario generator. ▪ SystemVerilog provided construct to control the random generation distribution and order. ▪ Generally, generator should be able to generate every possible scenario and the user should be able to control the generation from directed and directed random testcases.
  • 22. S. ElAshry © 2020 Driver ▪ The drivers translate the operations produced by the generator into the actual inputs for the design under verification. ▪ Generators create inputs at a high level of abstraction as transactions like read write operation. ▪ The drivers convert this input into actual design inputs, as defined in the specification of the designs interface. ▪ If the generator generates read operation, then read task is called.
  • 23. S. ElAshry © 2020 Monitor ▪ Monitor reports the protocol violation and identifies all the transactions. ▪ Monitors are two types, Passive and active. ▪ Passive monitors do not drive any signals. ▪ Active monitors can drive the DUT signals. ▪ Sometimes this is also referred as receiver. Monitor converts the state of the design and its outputs to a transaction abstraction level so it can be stored in a 'score-boards' database to be checked later on. ▪ Monitor converts the pin level activities in to high level.
  • 24. S. ElAshry © 2020 Assertion Based Monitor ▪ Assertions are used to check time based protocols, also known as temporal checks. ▪ Assertions are a necessary compliment to transaction based testing as they describe the pin level, cycle by cycle, protocols of the design. ▪ Assertions are also used for functional coverage.
  • 25. S. ElAshry © 2020 Scoreboard ▪ Scoreboard stores the expected DUT output. ▪ The stimulus generator generated the random vectors and is sent to the DUT using drivers. ▪ These stimuli are stored in scoreboard until the output comes out of the DUT. ▪ When a write operation is done on a memory with address 101 and data 202, after some cycles, if a read is done at address 101, what should be the data?. ▪ The scoreboard recorded the address and data when write operation is done. Get the data stored at address of 101 in scoreboard and compare with the output of the DUT in checker module. ▪ Scoreboard also has expected logic if needed.
  • 26. S. ElAshry © 2020 Coverage ▪ This component has all the coverage related to the functional coverage groups. Environment ▪ Environment contains the instances of all the verification component and Component connectivity is also done. ▪ Steps required for execution of each component is done in this.
  • 27. S. ElAshry © 2020 Tests ▪ Tests contain the code to control the TestBench features. ▪ Tests can communicate with all the TestBench components. ▪ Once the TestBench is in place, the verification engineer now needs to focus on writing tests to verify that the device behaves according to specification.
  • 28. S. ElAshry © 2020 Regression Concept ▪ Regression is re-running previously run tests and checking whether previously fixed faults have re-emerged. ▪ New bugs may come out due to new changes in RTL or DUT to unmasking of previously hidden bugs due to new changes. ▪ Each time, when design is changed, regression is done. One more important aspect of regression is testing by generation new vectors. ▪ Usually the seed to generate stimulus is the system time. ▪ Whenever a regression is done, it will take the current system time and generate new vectors than earlier tested. ▪ This way testbench can reach corners of DUT.
  • 29. S. ElAshry © 2020 How much regression testing?
  • 30. S. ElAshry © 2020 Coverage Model ▪ Code coverage + Functional coverage Example of Functional Coverage Result
  • 31. S. ElAshry © 2020 Example of Code Coverage Result
  • 32. S. ElAshry © 2020 Code Coverage ▪ To check whether theTestbench has satisfactory exercised the design or not? Coverage is used. ▪ It will measure the efficiency of your verification implementation. ▪ Code coverage answers the questions like • Have all the lines of the DUT has been exercised? • Have all the states in the FSM has been entered? • Have all the paths within a block have been exercised? • Have all the branches in Case have been entered? • Have all the conditions in an if statement is simulated?
  • 33. S. ElAshry © 2020 Functional Coverage ▪ Functional coverage answers questions like • Have all the packets length between 64 to 1518 are used? • Did the DUT got exercised with alternate packets with good and bad crc? • Did the monitor observe that the result comes with 4 clock cycles after read operation? • Did the fifos are filled completely? ▪ Summary of functional coverage advantages: • Functional coverage helps determine how much of your specification was covered. • Functional coverage qualifies the testbenchs. • Considered as stopping criteria for unit level verification. • Gives feedback about the untested features. • Gives the information about the redundant tests which consume valuable cycle. • Guides to reach the goals earlier based on grading.
  • 34. S. ElAshry © 2020 SystemVerilog Interface Vs BFM ▪ SystemVerilog Interface. ▪ BFM (Bus Functional Model) DUT SV Interface Testbench DUT BFM AXI AHB APB Testbench
  • 35. S. ElAshry © 2020 Example for a Job Requirements
  • 36. S. ElAshry © 2020 References ▪ http://www.testbench.in/ ▪ http://www.asic- world.com/systemverilog/index.html ▪ https://verificationguide.com/systemverilog- examples/systemverilog-testbench-example-with- scb/
  • 37. Thank You ! SystemVerilog Session Presented by Sameh El-Ashry samehelashry@ieee.org https://www.linkedin.com/in/sameh-elashry-22b5603b/