SystemVerilog Veriflcation
SystemVerilog Veriflcation
Define what is SystemVerilog Provide an overview of the major features in SystemVerilog How its different from other languages
References
Websources:
1.
www.systemverilog.org
2. www.asic-world.com/systemverilog/index.html
3. http://svug.org/
Books :
1. Writing Testbenches using SystemVerilog - Janick Bergeron 2. Verification Methodology Manual - Janick Bergeron 3. SystemVerilog For Verification - Chris Spear
What is SystemVerilog?
What is SystemVerilog?
SystemVerilog is a hardware description and Verification language(HDVL)
What is SystemVerilog?
System verilog is the superset of verilog
Why SystemVerilog ?
Why SystemVerilog?
System Verilog
Assertions
Coverage support
SystemVerilog Intent
Verilog Design entry System Verilog
Module level design
Module level verification Gate level simulations System level verification Unified language to span almost the entire SoC design flow
Strict about usage of wire Logic data type can be used so no need to worry about reg & wire & reg data type
Variable types are 4 state 2 state data type added 0, 1 state 0,1,X,Z
2 state variable can be used in test benches,where X,Z are not required
2 state variable in RTL model may enable simulators to be more efficient
Memory Management
Verilog Memories in verilog are static in nature Example :-reg[7:0] X[0:127]; 128 bytes of memory System Verilog Memories are dynamic in nature Allocated at runtime Better memory management ie,queues Example:Logic[3:0] length[$]; an empty queue with an unbounded size of logic data type
Complexity
Verilog
For
complex designs large number of RTL code is required Increase in verification code to test these designs
Extra time
Sequential logic
Combinational logic Latched logic
Port connections
Verilog System Verilog
Design DUT(.*);which means connect all port to variables or nets with the same name as the ports
Synthesis support
Verilog System Verilog
This is a major drawback which is restricting people to accept SystemVerilog as a Design language
SystemVerilog Concepts
logic is has single driver (procedural assignments or a continuous assignment), can replace reg and single driver wire. (Equivalent to std_ulogic in VHDL)
#5 a = 0;
#10 b = 0;
join
Join
Clk= 1;
end
#5 a = 0;
#10 b = 0;
Join_any
Join_any
Clk= 1;
end
#5 a = 0;
#10 b = 0;
Join_none
Join_none
Clk= 1;
end
DPIs are used to call C, C++, System C functions System verilog has a built in C interface Simple to used as compared to PLIs Values can be passed directly
Program
Virtual interface Clocking Block
modports
Verification environment
Checks correctness Creates stimulus Executes transactions Testbench
Test Transactor
Driver
File I/o
Random number generation Fork/join Initial block Task & functions
PLI
OOP Concepts
What is OOP?
classes
encapsulation
OOP
polymorphism
inheritance
What is OOP?
What is OOP?
OOP breaks a testbench into blocks that work together to accomplish the verification goal Why OOP Highly abstract system level modelling
Inheritance
New Methods
Inheritance is to share code between classes
Inheritance
Advantages Common code can be grouped into one class No need to modify the existing classes Add new features to existing class by means of new derived classes Easy debug & easy to maintain the code base
Randomization
Randomization
Why Randomization ?
Randomization
Shift from directed to random Directed Detect the expected bugs Time consuming Random Detects unexpected bugs (corner cases) Tremendously reduce the efforts
Randomization
Constrained Randomization
Improves the result Speed-up the bug finding process
Assertions
Assertion
Used primarily to validate the behaviour of a design An assertion is a statement about a designs intended behaviour In-line assertions are best added by design engineers Interface assertions are best added by verification engineers
An assertions sole purpose is to ensure consistency between the designers intention and design implementation
It increases the bug detection possibility during RTL design phase
Crux
Crux
SystemVerilog
Is a unified language (HDVL)
Reduce the design cycle Verify that designs are functionally correct Greatly increase the ability to model huge designs Incorporates the capability of assertion constructs Vera & powerful
Bridges the gap between Hardware design engineer and verification engineer
This Presentation is
References
Websources:
1.
www.systemverilog.org
3. http://svug.org/
Books :
1. Writing Testbenches using SystemVerilog - Janick Bergeron 2. Verification Methodology Manual - Janick Bergeron 3. SystemVerilog For Verification - Chris Spear
We will discuss
Top SystemVerilog Testbench Constructs Queue Mailbox Fork/join Semaphore Constraint Covergroup
Program
Interface Clocking Block
modports
mailbox
get()
Mailbox
mailbox mbx;
mbx = new();
mbx.put(data);
// allocate mailbox
// Put data object into mailbox // Non-blocking version
mbx.get(data); // data will be updated with data from FIFO success = mbx.try_get(ref data); mbx.peek(data); count = mbx.num(); // Look but dont remove // Number of elements in mailbox
Fork/join
Fork/join
Initial Begin
fork
#5 a = 0;
#10 b = 0;
join
Join
Clk= 1;
end
Fork/join
Fork/join_any
Initial Begin
fork
#5 a = 0;
#10 b = 0;
Join_any
Join_any
Clk= 1;
end
Fork/join
Fork/join_none
Initial Begin
fork
#5 a = 0;
#10 b = 0;
Join_none
Join_none
Clk= 1;
end
transitions
Covergroup check @(posedge top.valid );
coverpoint global;
coverpoint top.test; endgroup:check check chk = new();
Functionality:
Can be instantiated in any hierarchical location Typically at the top level Ports can be connected in the same manner as any other module
Executes in the SV reactive region
Program Block The testbench (program) runs separately from design (module)
Triggered by clock Samples just before clock edge, drives just after clock
clock
Design Testbench
Sample inputs Drive outputs
device1
interface
device2
Interface bus_a (input clock); logic [7:0] bit bit address; ; ; ; valid rd_wr logic [31:0] data
Endinterface: bus_a
Clocking Block Specify synchronization characteristics of the design Offer a clean way to drive and sample signals Features
Clock specification Input skew,output skew Cycle delay (##)
Clocking Block
Module M1(ck, enin, din, enout, dout);
input
input output
ck,enin;
[31:0] din enout ; ; ;
clocking sd @(posedge ck); input #2ns ein,din ; output #3ns enout, dout;
endclocking:sd
reg [7:0] sab ; initial begin
sab = sd.din[7:0];
end endmodule:M1
Interface bus_b (input clock); logic [7:0] logic [1:0] addr,data; mode ;
bit
modport slave
ready
modport master (input ready,output addr,data,mode) (input addr,data,mode,output ready) endinterface: bus_b
Conclusion
Thank you