SlideShare a Scribd company logo
System Verilog
Pushpa Yakkala
Introduction:
 What is system Verilog?
 Why we go for System Verilog?
 What is verification?
 How to verify Design?
 Why system Verilog for verification?
 Evolution of System Verilog
 System Verilog Features
 Data Types
What is System Verilog?
 System Verilog is a hardware description and hardware verification language.
 System Verilog is used to model, design, simulate, test and implement electronic
systems.
 System Verilog is based on Verilog and some extensions.
What is Hardware Description Language?
Hardware description language (HDL) is a specialized computer language used to
describe the structure and behavior of electronic circuits, and most commonly, digital
logic circuits.
What is Hardware Verification Language?
Hardware verification language(HVL) is a programming language used to verify the
designs of electronic circuits written in a HDL.
Why we go for System Verilog?
 Verilog was the primary language to verify functionality of designs that
were small, not very complex and had less features.
 As design complexity increase, so does the requirement of better tools to
design and verify it.
 System Verilog is far superior to Verilog because of its ability to perform
constraint random stimulus, use oops features in testbench construction,
functional coverage, assertions among many others.
What is verification?
 Verification is the process of ensuring that a given hardware design works as
expected.
 Make sure design is bug free by verifying it in all aspects. All possible
scenarios.
Example:
How to verify DUT?
Why system Verilog for verification?
 Verilog was initially used for writing testbench.
 But, writing complex testbench is much more of programming task than
describing hardware.
 No need to synthesize testbench.
 Now UVM is replacing SV based verification in industry.
 Still, UVM = Structured SV. knowing SV based verification helps understanding
UVM based verification, else UVM feels like set of magic macros.
Evaluation of SV:
System Verilog language components are:
• Concepts of Verilog HDL.
• Testbench constructs based on Vera.
• Open Vera assertions.
• Synopsys’ VCS DirectC simulation interface to C and C++.
• A coverage application programming interface that
provides links to coverage metrics.
System Verilog Features:
Data Types:
What is data type?
• In programming, data type is a classification that specifies which type of value a
variable has.
• For example, A string, is a data type that is used to classify text.
• An integer is a data type used to classify whole numbers.
Data Types:
 SystemVerilog added lot of new data types and improved the existing data
types to improve run time memory utilization of simulators.
 In System Verilog data types can be classified into 2-state types and 4-state
types.
 2-state types can take only 0, 1, where as 4-state types can take 0,1,X,Z.
 2-state types consume less (50%) memory and simulate faster when compared
to 4-state types.
 SV introduces a new 4-state data type called logic that can be driven in both
procedural blocks and continuous assign statements.
 But, a signal with more than one driver needs to be declared a net-type such
as wire so that System Verilog can resolve the final value.
Data Types:
Data Types:
Void Data Type:
 void is used in functions to return no value.
 Void data type represents non-existent data.
 This type can be specified as the return type of function, including no return
value.
Syntax:
function void display ();
$display ("Am not going to return any value");
endfunction
Arrays:
 An array is a collection of variables, all of the same type, and accessed using the
same name plus one or more indices.
 There are different types of arrays:
Examples:
int array1 [6]; //fixed size single dimension array
int array2 [5:0]; //fixed size single dimension array
int array3 [3:0][2:0]; //fixed size multi dimension array
bit [7:0] array4[2:0]; //unpacked array declaration
bit [2:0][7:0] array5; //packed array declaration
bit [2:0][7:0] array6 [3]; //mixed packed and unpacked array
Fixed array:
 In fixed size array, array size will be constant throughout the simulation,
 Once the array is declared no need to create it.
 By default, the array will be initialized with value ‘0’.
Single Dimension array:
int array1 [6]; //Compact declaration
int array2 [5:0]; // Verbose declaration
Two Dimension array:
int arr[2][3];
Three Dimension array:
int arr[2][2][2];
Array assignment:
array = '{ '{0,1,2,3},'{4,5,6,7},'{8,9,10,11}};
Packed Array:
 The term packed array is used to refer to the dimensions declared before the
data identifier name.
 Packed arrays can be of single bit data types (reg, logic, bit), enumerated
types.
 A packed array is guaranteed to be represented as a contiguous set of bits.
Example:
Unpacked array:
 The term unpacked array is used to refer to the dimensions declared after the
data identifier name.
 Unpacked arrays can be of any data type.
 An unpacked array may or may not be so represented as a contiguous set of bits.
Example:
Dynamic array:
 A dynamic array is one dimension of an unpacked array whose size can be set or
changed at run-time.
 Dynamic array is Declared using an empty word subscript [ ].
 The space for a dynamic array doesn’t exist until the array is explicitly created at
run-time, space is allocated when new[number] is called.
 The number indicates the number of space/elements to be allocated.
 Dynamic arrays are useful for contiguous collections of variables whose number
changes dynamically.
Syntax:
Data_type array_name[];
Methods:
new[ ] –> allocates the storage.
size( ) –> returns the current size of a dynamic array.
delete( ) –> empties the array, resulting in a zero-sized array.
Dynamic array:
Associative Array:
 Associative array Stores entries in a sparse matrix.
 Associative arrays allocate the storage only when it is used, unless like in the
dynamic array we need to allocate memory before using it.
 In associative array index expression is not restricted to integral expressions,
but can be of any type.
 When the size of the collection is unknown or the data space is sparse, an
associative array is a better option.
Syntax:
data_type array_name [ index_type ];
Associative array:
Examples:
int a_array1[*] ; // associative array of integer (unspecified index)
bit [31:0] a_array2[string]; // associative array of 32-bit, indexed by string
ev_array [myClass]; //associative array of event, indexed by class
Associative array:
Methods:
Queue:
 A queue is a variable-size, ordered collection of homogeneous elements.
 Like a dynamic array, queues can grow and shrink.
 Queue supports adding and removing elements anywhere.
 Queues are declared using the same syntax as unpacked arrays, but specifying
$ as the array size. In queue 0 represents the first, and $ representing the last
entries.
Syntax:
Data_type queue_name[$];
Example:
bit queue_1[$]; // queue of bits (unbound queue)
int queue_2[$]; // queue of int
byte queue_3[$:255]; // queue of byte (bounded queue with 256 entries)
string queue_4[$]; // queue of strings
Queue:
 A queue can be bounded or unbounded.
bounded queue – queue with the number of entries limited or queue size
specified.
Queue:
unbounded queue – queue with unlimited entries or queue size not specified.
Queue:
Queue:
Events:
 Events are static objects useful for synchronization between the process.
 Events operations are of two staged processes in which one process will trigger
the event, and the other processes will wait for an event to be triggered.
 Events are triggered using -> operator or ->> operator
 wait for an event to be triggered using @ operator or wait() construct
 System Verilog events act as handles to synchronization queues. thus, they can
be passed as arguments to tasks, and they can be assigned to one another or
compared.
Syntax:
->event_name;
@(event_name.triggered);
Structure & Union:
 A structure is a user-defined data type. that allows to combining data items
of different kinds. Structures are used to represent a record.
 Like Structures, union is a user defined data type. In union, all members
share the same memory location.
Example:
Classes:
 A class is a user-defined data type.
 Classes consist of data (called properties) and tasks and functions to access the
data (called methods).
 Classes are used in object-oriented programming.
 In SystemVerilog, classes support the following aspects of object-orientation –
encapsulation, data hiding, inheritance and polymorphism.
Example:
class c;
int x;
task set (int i);
x=1;
endtask;
endmodule;
..

More Related Content

PPTX
SOC Verification using SystemVerilog
PPTX
System verilog assertions
PDF
Data types in verilog
PDF
System verilog important
PDF
Session 6 sv_randomization
PDF
UVM Methodology Tutorial
ODP
axi protocol
PPTX
DUAL AXIS SOLAR TRACKER USING ARDUINO
SOC Verification using SystemVerilog
System verilog assertions
Data types in verilog
System verilog important
Session 6 sv_randomization
UVM Methodology Tutorial
axi protocol
DUAL AXIS SOLAR TRACKER USING ARDUINO

What's hot (20)

PPT
Verilog tutorial
PPTX
Verilog HDL
PPTX
Verilog
PDF
Verilog Tasks & Functions
DOCX
Intellectual property in vlsi
PPT
PPTX
I2C Protocol
PPTX
Verilog Tutorial - Verilog HDL Tutorial with Examples
PPTX
Axi protocol
PPT
system verilog
PPT
Axi protocol
PDF
UVM TUTORIAL;
PDF
System verilog verification building blocks
PDF
Concepts of Behavioral modelling in Verilog HDL
PDF
Overview of digital design with Verilog HDL
PPT
PDF
Basic concepts in Verilog HDL
PPTX
Verilog data types -For beginners
PDF
Cracking Digital VLSI Verification Interview: Interview Success
PDF
vlsi design flow
Verilog tutorial
Verilog HDL
Verilog
Verilog Tasks & Functions
Intellectual property in vlsi
I2C Protocol
Verilog Tutorial - Verilog HDL Tutorial with Examples
Axi protocol
system verilog
Axi protocol
UVM TUTORIAL;
System verilog verification building blocks
Concepts of Behavioral modelling in Verilog HDL
Overview of digital design with Verilog HDL
Basic concepts in Verilog HDL
Verilog data types -For beginners
Cracking Digital VLSI Verification Interview: Interview Success
vlsi design flow
Ad

Similar to Introduction to System verilog (20)

DOCX
Java R20 - UNIT-3.docx
PDF
Arrays
PDF
PPT
VB.net
PPTX
DOC-20240812-WA0000 array string and.pptx
PPTX
Java platform
PPTX
unit 1 (1).pptx
PDF
MuleSoft Nashik Virtual Meetup#3 - Deep Dive Into DataWeave and its Module
PPTX
Identifiers, keywords and types
PDF
Sv data types and sv interface usage in uvm
PPT
SystemVerilog-20041201165354.ppt
PPTX
UNIT – 2 Features of java- (Shilpa R).pptx
PPT
VB_ERROR CONTROL_FILE HANDLING.ppt
PPTX
Introduction to JcjfjfjfkuutyuyrsdterdfbvAVA.pptx
PPT
Generics Collections
PPT
Generics collections
PPTX
Variable and constants in Vb.NET
PDF
Java arrays (1)
DOCX
Array andfunction
Java R20 - UNIT-3.docx
Arrays
VB.net
DOC-20240812-WA0000 array string and.pptx
Java platform
unit 1 (1).pptx
MuleSoft Nashik Virtual Meetup#3 - Deep Dive Into DataWeave and its Module
Identifiers, keywords and types
Sv data types and sv interface usage in uvm
SystemVerilog-20041201165354.ppt
UNIT – 2 Features of java- (Shilpa R).pptx
VB_ERROR CONTROL_FILE HANDLING.ppt
Introduction to JcjfjfjfkuutyuyrsdterdfbvAVA.pptx
Generics Collections
Generics collections
Variable and constants in Vb.NET
Java arrays (1)
Array andfunction
Ad

Recently uploaded (20)

PDF
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
PDF
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
PPTX
Sustainable Sites - Green Building Construction
PPTX
CH1 Production IntroductoryConcepts.pptx
DOCX
573137875-Attendance-Management-System-original
PDF
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
PPTX
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
PDF
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
PPTX
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
PPTX
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
PDF
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
PPT
Mechanical Engineering MATERIALS Selection
PPTX
Foundation to blockchain - A guide to Blockchain Tech
PPTX
Current and future trends in Computer Vision.pptx
PDF
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
PDF
Digital Logic Computer Design lecture notes
PPTX
web development for engineering and engineering
PPTX
bas. eng. economics group 4 presentation 1.pptx
PPTX
Lecture Notes Electrical Wiring System Components
PDF
Operating System & Kernel Study Guide-1 - converted.pdf
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
Sustainable Sites - Green Building Construction
CH1 Production IntroductoryConcepts.pptx
573137875-Attendance-Management-System-original
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
Mechanical Engineering MATERIALS Selection
Foundation to blockchain - A guide to Blockchain Tech
Current and future trends in Computer Vision.pptx
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
Digital Logic Computer Design lecture notes
web development for engineering and engineering
bas. eng. economics group 4 presentation 1.pptx
Lecture Notes Electrical Wiring System Components
Operating System & Kernel Study Guide-1 - converted.pdf

Introduction to System verilog

  • 2. Introduction:  What is system Verilog?  Why we go for System Verilog?  What is verification?  How to verify Design?  Why system Verilog for verification?  Evolution of System Verilog  System Verilog Features  Data Types
  • 3. What is System Verilog?  System Verilog is a hardware description and hardware verification language.  System Verilog is used to model, design, simulate, test and implement electronic systems.  System Verilog is based on Verilog and some extensions. What is Hardware Description Language? Hardware description language (HDL) is a specialized computer language used to describe the structure and behavior of electronic circuits, and most commonly, digital logic circuits. What is Hardware Verification Language? Hardware verification language(HVL) is a programming language used to verify the designs of electronic circuits written in a HDL.
  • 4. Why we go for System Verilog?  Verilog was the primary language to verify functionality of designs that were small, not very complex and had less features.  As design complexity increase, so does the requirement of better tools to design and verify it.  System Verilog is far superior to Verilog because of its ability to perform constraint random stimulus, use oops features in testbench construction, functional coverage, assertions among many others.
  • 5. What is verification?  Verification is the process of ensuring that a given hardware design works as expected.  Make sure design is bug free by verifying it in all aspects. All possible scenarios. Example:
  • 7. Why system Verilog for verification?  Verilog was initially used for writing testbench.  But, writing complex testbench is much more of programming task than describing hardware.  No need to synthesize testbench.  Now UVM is replacing SV based verification in industry.  Still, UVM = Structured SV. knowing SV based verification helps understanding UVM based verification, else UVM feels like set of magic macros.
  • 8. Evaluation of SV: System Verilog language components are: • Concepts of Verilog HDL. • Testbench constructs based on Vera. • Open Vera assertions. • Synopsys’ VCS DirectC simulation interface to C and C++. • A coverage application programming interface that provides links to coverage metrics.
  • 10. Data Types: What is data type? • In programming, data type is a classification that specifies which type of value a variable has. • For example, A string, is a data type that is used to classify text. • An integer is a data type used to classify whole numbers.
  • 11. Data Types:  SystemVerilog added lot of new data types and improved the existing data types to improve run time memory utilization of simulators.  In System Verilog data types can be classified into 2-state types and 4-state types.  2-state types can take only 0, 1, where as 4-state types can take 0,1,X,Z.  2-state types consume less (50%) memory and simulate faster when compared to 4-state types.  SV introduces a new 4-state data type called logic that can be driven in both procedural blocks and continuous assign statements.  But, a signal with more than one driver needs to be declared a net-type such as wire so that System Verilog can resolve the final value.
  • 14. Void Data Type:  void is used in functions to return no value.  Void data type represents non-existent data.  This type can be specified as the return type of function, including no return value. Syntax: function void display (); $display ("Am not going to return any value"); endfunction
  • 15. Arrays:  An array is a collection of variables, all of the same type, and accessed using the same name plus one or more indices.  There are different types of arrays: Examples: int array1 [6]; //fixed size single dimension array int array2 [5:0]; //fixed size single dimension array int array3 [3:0][2:0]; //fixed size multi dimension array bit [7:0] array4[2:0]; //unpacked array declaration bit [2:0][7:0] array5; //packed array declaration bit [2:0][7:0] array6 [3]; //mixed packed and unpacked array
  • 16. Fixed array:  In fixed size array, array size will be constant throughout the simulation,  Once the array is declared no need to create it.  By default, the array will be initialized with value ‘0’. Single Dimension array: int array1 [6]; //Compact declaration int array2 [5:0]; // Verbose declaration Two Dimension array: int arr[2][3]; Three Dimension array: int arr[2][2][2]; Array assignment: array = '{ '{0,1,2,3},'{4,5,6,7},'{8,9,10,11}};
  • 17. Packed Array:  The term packed array is used to refer to the dimensions declared before the data identifier name.  Packed arrays can be of single bit data types (reg, logic, bit), enumerated types.  A packed array is guaranteed to be represented as a contiguous set of bits. Example:
  • 18. Unpacked array:  The term unpacked array is used to refer to the dimensions declared after the data identifier name.  Unpacked arrays can be of any data type.  An unpacked array may or may not be so represented as a contiguous set of bits. Example:
  • 19. Dynamic array:  A dynamic array is one dimension of an unpacked array whose size can be set or changed at run-time.  Dynamic array is Declared using an empty word subscript [ ].  The space for a dynamic array doesn’t exist until the array is explicitly created at run-time, space is allocated when new[number] is called.  The number indicates the number of space/elements to be allocated.  Dynamic arrays are useful for contiguous collections of variables whose number changes dynamically. Syntax: Data_type array_name[]; Methods: new[ ] –> allocates the storage. size( ) –> returns the current size of a dynamic array. delete( ) –> empties the array, resulting in a zero-sized array.
  • 21. Associative Array:  Associative array Stores entries in a sparse matrix.  Associative arrays allocate the storage only when it is used, unless like in the dynamic array we need to allocate memory before using it.  In associative array index expression is not restricted to integral expressions, but can be of any type.  When the size of the collection is unknown or the data space is sparse, an associative array is a better option. Syntax: data_type array_name [ index_type ];
  • 22. Associative array: Examples: int a_array1[*] ; // associative array of integer (unspecified index) bit [31:0] a_array2[string]; // associative array of 32-bit, indexed by string ev_array [myClass]; //associative array of event, indexed by class
  • 24. Queue:  A queue is a variable-size, ordered collection of homogeneous elements.  Like a dynamic array, queues can grow and shrink.  Queue supports adding and removing elements anywhere.  Queues are declared using the same syntax as unpacked arrays, but specifying $ as the array size. In queue 0 represents the first, and $ representing the last entries. Syntax: Data_type queue_name[$]; Example: bit queue_1[$]; // queue of bits (unbound queue) int queue_2[$]; // queue of int byte queue_3[$:255]; // queue of byte (bounded queue with 256 entries) string queue_4[$]; // queue of strings
  • 25. Queue:  A queue can be bounded or unbounded. bounded queue – queue with the number of entries limited or queue size specified.
  • 26. Queue: unbounded queue – queue with unlimited entries or queue size not specified.
  • 29. Events:  Events are static objects useful for synchronization between the process.  Events operations are of two staged processes in which one process will trigger the event, and the other processes will wait for an event to be triggered.  Events are triggered using -> operator or ->> operator  wait for an event to be triggered using @ operator or wait() construct  System Verilog events act as handles to synchronization queues. thus, they can be passed as arguments to tasks, and they can be assigned to one another or compared. Syntax: ->event_name; @(event_name.triggered);
  • 30. Structure & Union:  A structure is a user-defined data type. that allows to combining data items of different kinds. Structures are used to represent a record.  Like Structures, union is a user defined data type. In union, all members share the same memory location. Example:
  • 31. Classes:  A class is a user-defined data type.  Classes consist of data (called properties) and tasks and functions to access the data (called methods).  Classes are used in object-oriented programming.  In SystemVerilog, classes support the following aspects of object-orientation – encapsulation, data hiding, inheritance and polymorphism. Example: class c; int x; task set (int i); x=1; endtask; endmodule;
  • 32. ..