Verilog has been the backbone of digital design for decades, but as ASICs and SoCs grew more complex, it simply wasn’t enough. That’s when VLSI industry experts came together and created something revolutionary—SystemVerilog!
More than just an HDL, SystemVerilog is a powerful Hardware Description AND Verification Language (HDVL)! To bridge the gap from Verilog to SystemVerilog, concepts were borrowed from languages like C, C++, Java, and Python—but don’t be fooled! While the names may sound familiar, their application in hardware verification is a whole new world! We’ve got an exciting Verilog Series for you, and if you love fast-paced learning, there’s also a Marathon Episode covering everything in one go! But that’s not all… This time, we’re taking things to the next level—introducing a SystemVerilog Transition Series that will guide you step by step through this powerful language! You’ll learn by comparison, exploring how SystemVerilog improves upon Verilog and how it connects to concepts from software programming languages!
Expected Verilog Knowledge Before Learning SV:
1. Module Basics:
- Syntax (`module`, `endmodule`).
- Ports (`input`, `output`, `inout`).
2. Data Types:
- `wire` and `reg` usage.
- Bit vectors and bus declarations (`[n:0]`).
3. Assignments:
- Continuous assignment (`assign`).
- Procedural assignments (`=` for blocking, `<=` for non-blocking).
4. Procedural Blocks:
- `always` for sequential and combinational logic.
- Sensitivity lists (`@(*)`, `@(posedge clk)`).
5. Control Flow:
- `if-else`, `case`, and loops (`for`, `repeat`, `while`).
6. Hierarchy:
- Module instantiation and port connection (positional and named).
7. Testbenches:
- Stimulus generation using `initial` and `always`.
- Simulation constructs like `$monitor`, `$display`, delays (`#`).
8. Basic Operators:
- Arithmetic (`+`, `-`), bitwise (`&`, `|`, `^`), logical (`&&`, `||`).
Verilog vs SV : Fundamental Difference
1. VERILOG:
• Introduction: Verilog was created in 1984 as a Hardware Description Language (HDL) to help describe how electronic circuits work, kind of like writing a blueprint for a building but for digital systems.
• IEEE standard : In 1995, Verilog was officially recognized as a global standard by the IEEE (IEEE 1364) , ensuring everyone could use it in the same way without confusion.
• Widely Used : Even though newer tools exist, Verilog is still popular for designing older systems and straightforward circuits because it’s reliable and familiar. Verilog is widely used for basic design tasks, especially in legacy systems and simpler digital circuits.
• Primary Usage : Primarily used for structuring, modeling, simulating, and verifying electronic systems at the RTL (Register Transfer Level). Verilog is mostly used to create and test digital designs at a level that focuses on how data moves and gets processed within a system.
2. SYSTEM VERILOG (SV):
• Introduction: Developed in the early 2000s as both a Hardware Description Language (HDL) and Hardware Design & Verification Language (HDVL). SV not only describe how circuits work (likeVerilog) but also to test and verify them. It combines design and testing in one language.
• IEEE standard : Became an IEEE standard in 2005 (IEEE 1800). In 2005, SystemVerilog was officially recognized as a global standard, making it consistent and widely accepted for use.
• Industry Standard : SV is now the industry standard for designing, simulating, and verifying complex digital systems, especially in large-scale ASIC and FPGA projects. Today, System Verilog is the go-to choice for creating and testing large and complicated digital systems, such as those used in advanced SoC chips and programmable hardware.
• Significance: Essential for advanced modeling, comprehensive verification, and supporting the full electronic system development life-cycle. System Verilog is crucial for detailed designs, thorough testing, and managing every stage of building an electronic system, from start to finish.
Verilog to System Verilog Transition
VERILOG GENERATIONS:
• Verilog 1.0 (1995): Initial IEEE standard (IEEE Std. 1364-1995) is the first official version of Verilog was standardized in 1995, setting the rules and format for using it globally.
• Verilog 2.0 (2001): Enhanced IEEE standard (IEEE Std. 1364-2001) with significant updates to Verilog, marking the first major improvements since its 1990 public release In 2001, Verilog got a big update with many new features, making it more powerful and easier to use for designing and testing circuits. This was the first big change since it became public in 90's era.
SYSTEM VERILOG GENERATIONS:
• SystemVerilog 3.0 (2002): Added features for high-level architectural modeling. In 2002, System Verilog introduced tools to help design circuits at a high level, focusing on the overall structure of a system.
• SystemVerilog 3.1 (2003): Introduced advanced verification features and C language integration in 2003. SystemVerilog added powerful tools for testing circuits and made it easier to work with the C programming language interface , bridging software and hardware design.
• SystemVerilog 3.1a (2004): Provided corrections, clarifications, and further enhancements, including VCD and PLI specifications, in 2004, this version fixed issues, clarified previous features, and added more improvements, like better support for tracking signal changes (VCD) and extending functionality (PLI).
New Data Types in SV:
• Extended Data Types (for Improved encapsulation and code compactness): New types were added to make code more organized and easier to write by grouping multiple related data together. vb
• C Data Types (int, typedef, struct, union, enum): System Verilog includes types similar to those in the C programming language, like integers, grouped data (struct), shared memory (union), and predefined sets of values (enum).
• Other Data Types: (Bounded queues, logic (0, 1, X, Z), bit (0, 1), tagged unions): Additional types like queues with limits, signals with more digital states (0, 1, unknown X, high- impedance Z), and unions with labels for easy identification were introduced.
• Dynamic Data Types (string, classes, dynamic queues, dynamic arrays, associative arrays) : Flexible types like text strings, reusable objects (classes), and various adjustable or searchable data collections were added for advanced verification.
• Dynamic Casting & Bit-Stream Casting (Added for flexibility ) : These features allow converting one type of data to another and rearranging bits easily for different uses.
• Automatic/Static Specification (Per variable instance): You can now decide for each variable whether its memory is dynamically managed or fixed from beginning in place, giving more control over how it’s used.
Operators & Procedural Statements :
1. Operators:
• Extended Operators (Wild equality/inequality, streaming operators, set membership):
In Sv, new operators were added, like those to check approximate matches (wild equality), process data streams, or see if something belongs to a group (set membership).
• Built-In Methods (Extend language capabilities):
SystemVerilog includes built-in functions to make certain tasks easier, like manipulating data or arrays.
• Operator Overloading (Customizable operators):
In SV, you can define how certain operators (like + or *) behave when used with specific types of data, making them more flexible.
2. Procedural Statements :
• Extended Statements(Enhanced loops, foreach, pattern matching, C-like jump statements):
SV has loops which were improved with options like foreach for simpler iteration, regular expressions for matching patterns in data, and familiar jump commands like break and continue for precise control of loops.
• Final Blocks(Executed at the end of simulation):
SV has special sections of code, called final blocks, run automatically when the simulation finishes, useful for clean-up tasks or final reports.
• Extended Event Control (Sequence events and control):
SV has better tools to manage and synchronize events during simulations, making complex behaviors easier to handle.
Process Control :
1.Enhanced Control( Extensions to always blocks for synthesis consistency):
SV made improvements to always blocks ensure they work better for creating hardware designs that match the intended behavior during simulations and synthesis. SV has multiple always blocks for various usage.
2. Fork…Join Extensions (Modeling pipelines and improved control)
In SV, new avatar in fork…join make it easier to run multiple tasks at the same time, such as simulating data pipelines and managing processes more efficiently.
3. Fine-Grain Control (Detailed task and function management):
In SV, mechanisms were added to give precise control over how tasks and functions operate, helping manage complex processes better.
Tasks and Functions:
1. C-Like Functions (Void functions, pass by reference, default/optional arguments):
System Verilog functions adopted C functions, supporting features like void (no return value), passing variables directly by reference, and using optional/default values for arguments.
2. DPI Functions( Import/export capabilities for the Direct Programming Interface):
IN SV, The Direct Programming Interface (DPI) allows easy interaction between SystemVerilog and other programming languages like C, making it simpler to integrate external code and enhance verification capabilities.
Objct Oriented Programming (OOP):
SV has introduced OOP which was not there in Verilog.
1. OOP Classes ( Abstraction, encapsulation, and safe pointers):
Classes help organize code by grouping related data and functions, hiding unnecessary details (encapsulation), and safely managing object references (pointers).
2. Interfaces ( Encapsulation: Facilitates communication-oriented design):
Interfaces make it easier to manage communication between different parts of a design by grouping related signals and ensuring clean, organized connections. These are more compact and easy to use as compared to its Verilog counterpart and less error prone.
Testbench Support:
1. Automated Testbench (Random constraints, synchronization via semaphores/mailboxes):
SV Testbenches can now automate testing with random value inputs that follow specific rules and restrictions (constraints) and manage communication between parts using semaphores and mailboxes which are also new features in SV..
2. Event Extensions(Event variables and sequencing):
In SV, New features were added to handle events more flexibly, like storing events in variables and setting up sequences of events for testing.
3. Scheduling Semantics(Clarifications and extensions):
IN SV, improved rules and features introduced for how tasks are scheduled during simulations, ensuring more accurate and predictable testing.
Assertions and Coverage :
These are new features in SV.
1. Assertion Mechanism ( Verifying design and functional coverage):
SV assertions check if a design behaves as expected, while functional coverage measures how thoroughly the design has been tested.
2. Property/Sequence Declarations ( Assertion and coverage statements with action blocks):
In SV, you can define specific behaviors or conditions (properties/sequences) for checking correctness and include actions to take when these conditions are met or fail.
Hierarchy and Modular Design:
1. Extended Hierarchy ( Packages, nested modules, external modules):
System Verilog allows better organization of code with reusable packages, modules within modules (nested), and external modules that can be defined separately. Hence you can get a lot of flexibility.
2. Port Declarations( Support for interfaces, events, variables):
Ports, which connect different parts of a design, now support interfaces (grouped connections), events, and variables for more flexible communication. Such easy to use feature reduces complicated process of verification.
3. $root (Clear hierarchical references):
$root provides a top-level reference for organizing and accessing design elements, making it easier to navigate complex designs. Please don't confuse this with LINUX superuser 'root'. In later episode we will discuss in detail.
Cycle-Based Functionality:
1. Clocking Blocks (Cycle-based signal drives and samples, synchronous samples):
In SV, clocking blocks help manage signals based on clock cycles, ensuring proper timing for driving and sampling data in synchronous designs.
2. Race-Free Context (Safe program execution):
Features were added to prevent timing conflicts (races) during program execution, ensuring accurate and reliable behavior in simulations.
Enhanced APIs & Formal Semantics :
1. APIs:
In general API's are plug and play parts of software or language.
i) DPI (Efficient inter-operation with other languages (e.g., C):
In SV, the Direct Programming Interface (DPI) allows SystemVerilog code to interact smoothly with external or other programming languages like C, making it easier to integrate external code.
ii) Assertion, Coverage, Data Read APIs (Tools for verification and data handling):
These SV APIs provide functions to help verify the correctness of designs, check how well they’re tested (coverage), and manage data during simulation.
iii) VPI Extensions (For SystemVerilog constructs):
VPI (Verilog Programming Interface) extensions allow better interaction with SystemVerilog constructs, helping developers work with designs more effectively. These are very popular in recent times.
2. Concurrent Assertion Formal Semantics :
Enhanced support for concurrent assertions in verification:
In SV, there’s improved support for checking multiple conditions at the same time (concurrent assertions) during the verification process, making it easier to detect issues in complex systems.
Watch the Video here:
Courtesy : Image by www.pngegg.com