SystemC UVM Library
SystemC UVM Library
UVM
Verification in SystemC Perspective
Puneet Goel
Coverify Systems Technology
April 2012
Co v e r i f y
Introduction
I
Co v e r i f y
2 / 22
Introduction
I
Co v e r i f y
2 / 22
Introduction
I
Co v e r i f y
2 / 22
Introduction
I
Co v e r i f y
2 / 22
Introduction
I
Co v e r i f y
2 / 22
Introduction
I
Co v e r i f y
2 / 22
Introduction
I
Co v e r i f y
2 / 22
Sequencer
Checker
Transactor
Monitor
Driver
Collector
Assertions
Functional
Coverage
Testcase
Signal
Layer
Test
Layer
UVM Testbench
Collector
Design
Under Test
Co v e r i f y
Getting Started with SystemC UVM
3 / 22
Sequencer
Checker
Transactor
Monitor
Driver
Collector
Assertions
Functional
Coverage
Testcase
Signal
Layer
Test
Layer
Collector
Design
Under Test
Co v e r i f y
Getting Started with SystemC UVM
4 / 22
Testcase
Constrained
Randomization
Checker
Transactor
Driver
Functional
Coverage
Sequencer
Signal
Layer
Test
Layer
Monitor
Collector
Assertions
Collector
Design
Under Test
Co v e r i f y
Getting Started with SystemC UVM
4 / 22
Register
Abstraction Layer
Sequencer
Checker
Transactor
Monitor
Driver
Collector
Assertions
Functional
Coverage
Testcase
Signal
Layer
Test
Layer
Collector
Design
Under Test
Co v e r i f y
Getting Started with SystemC UVM
4 / 22
In this section . . .
SystemC Perspective
Why SystemC for Verification
UVM for SystemC
Co v e r i f y
Getting Started with SystemC UVM
SystemC Perspective
5 / 22
Why SystemC?
Co v e r i f y
Getting Started with SystemC UVM
SystemC Perspective
6 / 22
Why SystemC?
Co v e r i f y
Getting Started with SystemC UVM
SystemC Perspective
6 / 22
Why SystemC?
Co v e r i f y
Getting Started with SystemC UVM
SystemC Perspective
6 / 22
Testcase
Sequencer
Checker
Transactor
Monitor
Driver
Collector
Functional
Coverage
Signal
Layer
Test
Layer
Collector
Assertions
Design
Under Test
Co v e r i f y
Getting Started with SystemC UVM
SystemC Perspective
7 / 22
Testcase
Sequencer
Checker
Transactor
Monitor
Driver
Collector
Functional
Coverage
Signal
Layer
Test
Layer
Collector
Assertions
Design
Under Test
Co v e r i f y
Getting Started with SystemC UVM
SystemC Perspective
7 / 22
Testcase
Sequencer
Checker
Transactor
Monitor
Driver
Collector
Functional
Coverage
Signal
Layer
Test
Layer
Collector
Assertions
Design
Under Test
Co v e r i f y
Getting Started with SystemC UVM
SystemC Perspective
7 / 22
Often your DUT (or a part of it) would be coded using verilog
Coding reference model in the same language as the language in which
your design has been coded is often a bad idea
Co v e r i f y
Getting Started with SystemC UVM
SystemC Perspective
8 / 22
Often your DUT (or a part of it) would be coded using verilog
Coding reference model in the same language as the language in which
your design has been coded is often a bad idea
Co v e r i f y
Getting Started with SystemC UVM
SystemC Perspective
8 / 22
Often your DUT (or a part of it) would be coded using verilog
Coding reference model in the same language as the language in which
your design has been coded is often a bad idea
Co v e r i f y
Getting Started with SystemC UVM
SystemC Perspective
8 / 22
Often your DUT (or a part of it) would be coded using verilog
Coding reference model in the same language as the language in which
your design has been coded is often a bad idea
Co v e r i f y
Getting Started with SystemC UVM
SystemC Perspective
8 / 22
Often your DUT (or a part of it) would be coded using verilog
Coding reference model in the same language as the language in which
your design has been coded is often a bad idea
Co v e r i f y
Getting Started with SystemC UVM
SystemC Perspective
8 / 22
Generic Library
I
I
For example if you develop a sort function in systemverilog that works for
builtin number types, you can not generalize this function to work on
user-defined data types
These libraries come in handy when you are modeling at behavioral level
Also since C++ has a much bigger user-base, these libraries are well-tested
and therefor are ideal for creating reference models
Co v e r i f y
Getting Started with SystemC UVM
SystemC Perspective
9 / 22
Generic Library
I
I
For example if you develop a sort function in systemverilog that works for
builtin number types, you can not generalize this function to work on
user-defined data types
These libraries come in handy when you are modeling at behavioral level
Also since C++ has a much bigger user-base, these libraries are well-tested
and therefor are ideal for creating reference models
Co v e r i f y
Getting Started with SystemC UVM
SystemC Perspective
9 / 22
Generic Library
I
I
For example if you develop a sort function in systemverilog that works for
builtin number types, you can not generalize this function to work on
user-defined data types
These libraries come in handy when you are modeling at behavioral level
Also since C++ has a much bigger user-base, these libraries are well-tested
and therefor are ideal for creating reference models
Co v e r i f y
Getting Started with SystemC UVM
SystemC Perspective
9 / 22
Generic Library
I
I
For example if you develop a sort function in systemverilog that works for
builtin number types, you can not generalize this function to work on
user-defined data types
These libraries come in handy when you are modeling at behavioral level
Also since C++ has a much bigger user-base, these libraries are well-tested
and therefor are ideal for creating reference models
Co v e r i f y
Getting Started with SystemC UVM
SystemC Perspective
9 / 22
Generic Library
I
I
For example if you develop a sort function in systemverilog that works for
builtin number types, you can not generalize this function to work on
user-defined data types
These libraries come in handy when you are modeling at behavioral level
Also since C++ has a much bigger user-base, these libraries are well-tested
and therefor are ideal for creating reference models
Co v e r i f y
Getting Started with SystemC UVM
SystemC Perspective
9 / 22
Generic Library
I
I
For example if you develop a sort function in systemverilog that works for
builtin number types, you can not generalize this function to work on
user-defined data types
These libraries come in handy when you are modeling at behavioral level
Also since C++ has a much bigger user-base, these libraries are well-tested
and therefor are ideal for creating reference models
Co v e r i f y
Getting Started with SystemC UVM
SystemC Perspective
9 / 22
In this section . . .
SystemC Perspective
UVM for SystemC
UVM Constructs
Co v e r i f y
Getting Started with SystemC UVM
10 / 22
Co v e r i f y
Getting Started with SystemC UVM
11 / 22
Co v e r i f y
Getting Started with SystemC UVM
11 / 22
Co v e r i f y
Getting Started with SystemC UVM
11 / 22
Co v e r i f y
Getting Started with SystemC UVM
11 / 22
Co v e r i f y
Getting Started with SystemC UVM
11 / 22
Co v e r i f y
Getting Started with SystemC UVM
11 / 22
I
I
A change in one module, disturbs all the modules that are bound to this
module
Co v e r i f y
Getting Started with SystemC UVM
12 / 22
I
I
A change in one module, disturbs all the modules that are bound to this
module
Co v e r i f y
Getting Started with SystemC UVM
12 / 22
I
I
A change in one module, disturbs all the modules that are bound to this
module
Co v e r i f y
Getting Started with SystemC UVM
12 / 22
I
I
A change in one module, disturbs all the modules that are bound to this
module
Co v e r i f y
Getting Started with SystemC UVM
12 / 22
I
I
A change in one module, disturbs all the modules that are bound to this
module
Co v e r i f y
Getting Started with SystemC UVM
12 / 22
I
I
A change in one module, disturbs all the modules that are bound to this
module
Co v e r i f y
Getting Started with SystemC UVM
12 / 22
untimed
loosely time
cycle accurate
a combination
Co v e r i f y
Getting Started with SystemC UVM
13 / 22
untimed
loosely time
cycle accurate
a combination
Co v e r i f y
Getting Started with SystemC UVM
13 / 22
untimed
loosely time
cycle accurate
a combination
component
A
component
B
component
C
Co v e r i f y
Getting Started with SystemC UVM
13 / 22
untimed
loosely time
cycle accurate
a combination
component
A
component
B
component
C
Co v e r i f y
Getting Started with SystemC UVM
13 / 22
untimed
loosely time
cycle accurate
a combination
component
A
component
B
component
C
Co v e r i f y
Getting Started with SystemC UVM
13 / 22
untimed
loosely time
cycle accurate
a combination
component
A
component
B
component
C
Co v e r i f y
Getting Started with SystemC UVM
13 / 22
Co v e r i f y
Getting Started with SystemC UVM
14 / 22
UVM
component A
component A
service
Component B Package
UVM
UVM
UVM
component
B
component
B
component
B
component B
service
Component C Package
UVM
UVM
UVM
component
C
component
B
component
B
Co v e r i f y
Getting Started with SystemC UVM
14 / 22
UVM
component A
component A
service
Component B Package
UVM
UVM
UVM
component
B
component
B
component
B
component B
service
Component C Package
UVM
UVM
UVM
component
C
component
B
component
B
Co v e r i f y
Getting Started with SystemC UVM
14 / 22
Polymorphism ROCKS, but whoa, does it really work all the time:
I
Co v e r i f y
Getting Started with SystemC UVM
15 / 22
Polymorphism ROCKS, but whoa, does it really work all the time:
I
Co v e r i f y
Getting Started with SystemC UVM
15 / 22
Polymorphism ROCKS, but whoa, does it really work all the time:
I
Co v e r i f y
Getting Started with SystemC UVM
15 / 22
Polymorphism ROCKS, but whoa, does it really work all the time:
I
Co v e r i f y
Getting Started with SystemC UVM
15 / 22
Polymorphism ROCKS, but whoa, does it really work all the time:
I
Co v e r i f y
Getting Started with SystemC UVM
15 / 22
Polymorphism ROCKS, but whoa, does it really work all the time:
<<creates>>
Comp B
Cycle Accurate
Comp B
Comp A
<<interface>>
Comp B
Loosely Timed
Co v e r i f y
Getting Started with SystemC UVM
15 / 22
Polymorphism ROCKS, but whoa, does it really work all the time:
<<creates>>
Comp B
Cycle Accurate
Comp B
Comp A
<<interface>>
Comp B
Loosely Timed
Co v e r i f y
Getting Started with SystemC UVM
15 / 22
Polymorphism ROCKS, but whoa, does it really work all the time:
<<creates>>
Comp B
Cycle Accurate
Comp B
Comp A
<<interface>>
Comp B
Loosely Timed
Co v e r i f y
Getting Started with SystemC UVM
15 / 22
Co v e r i f y
Getting Started with SystemC UVM
16 / 22
Co v e r i f y
Getting Started with SystemC UVM
16 / 22
Comp A
<<interface>>
UVM Factory
+ create()
UVM Factory
<<interface>>
Comp B
Comp B
Comp B
Loosely Timed
Cycle Accurate
Co v e r i f y
Getting Started with SystemC UVM
16 / 22
Comp A
<<interface>>
UVM Factory
+ create()
UVM Factory
<<interface>>
Comp B
Comp B
Comp B
Loosely Timed
Cycle Accurate
Co v e r i f y
Getting Started with SystemC UVM
16 / 22
Comp A
<<interface>>
UVM Factory
+ create()
UVM Factory
<<interface>>
Comp B
Comp B
Comp B
Loosely Timed
Cycle Accurate
Co v e r i f y
Getting Started with SystemC UVM
16 / 22
UVM Phases
SystemC has only a few phases. In contrast, UVM has a very elaborate phase
sequence.
VerilogElaboration
End of Elaboration
Start of Simulation
UVM Build Phase
UVM Connect Phase
SystemC
Elaboration
End of Elaboration
Start of Simulation
Simulation Run
End of Simulation
Co v e r i f y
Getting Started with SystemC UVM
17 / 22
UVM Phases
SystemC has only a few phases. In contrast, UVM has a very elaborate phase
sequence.
VerilogElaboration
End of Elaboration
Start of Simulation
UVM Build Phase
UVM Connect Phase
SystemC
Elaboration
End of Elaboration
Start of Simulation
Simulation Run
End of Simulation
Co v e r i f y
Getting Started with SystemC UVM
17 / 22
Configuring a Build
Processor
Master
Processor
Master
Routing
Node
Processor
Master
Processor
Master
Routing
Node
Processor
Master
Routing
Node
Processor
Master
Global
Memory
Routing
Node
Global
IO
Routing
Node
Global
IO
Processor
Master
Routing
Node
Processor
Master
Routing
Node
Routing
Node
Processor
Master
Routing
Node
Co v e r i f y
Getting Started with SystemC UVM
18 / 22
Configuring a Build
Processor
Master
Processor
Master
Routing
Node
Processor
Master
Processor
Master
Routing
Node
Processor
Master
Routing
Node
Processor
Master
Global
Memory
Routing
Node
Global
IO
Routing
Node
Global
IO
Processor
Master
Routing
Node
Processor
Master
Routing
Node
Routing
Node
Processor
Master
Routing
Node
Co v e r i f y
Getting Started with SystemC UVM
18 / 22
Configuring a Build
Processor
Master
Processor
Master
Routing
Node
Processor
Master
Processor
Master
Routing
Node
Processor
Master
Routing
Node
Processor
Master
Global
Memory
Routing
Node
Global
IO
Routing
Node
Global
IO
Processor
Master
Routing
Node
Processor
Master
Routing
Node
Routing
Node
Processor
Master
Routing
Node
Co v e r i f y
Getting Started with SystemC UVM
18 / 22
19 / 22
19 / 22
19 / 22
19 / 22
19 / 22
19 / 22
UVM Transactions
I
I
I
A user must make sure that pack/unpack methods for the transaction
class in SystemC and SystemVerilog remain in sync
Caveat When you pack data in SystemVerilog or in SystemC, you loose
the control bits for any 4-valued logic data.
Co v e r i f y
Getting Started with SystemC UVM
20 / 22
UVM Transactions
I
I
I
A user must make sure that pack/unpack methods for the transaction
class in SystemC and SystemVerilog remain in sync
Caveat When you pack data in SystemVerilog or in SystemC, you loose
the control bits for any 4-valued logic data.
Co v e r i f y
Getting Started with SystemC UVM
20 / 22
UVM Transactions
I
I
I
A user must make sure that pack/unpack methods for the transaction
class in SystemC and SystemVerilog remain in sync
Caveat When you pack data in SystemVerilog or in SystemC, you loose
the control bits for any 4-valued logic data.
Co v e r i f y
Getting Started with SystemC UVM
20 / 22
UVM Transactions
I
I
I
A user must make sure that pack/unpack methods for the transaction
class in SystemC and SystemVerilog remain in sync
Caveat When you pack data in SystemVerilog or in SystemC, you loose
the control bits for any 4-valued logic data.
Co v e r i f y
Getting Started with SystemC UVM
20 / 22
UVM Transactions
I
I
I
A user must make sure that pack/unpack methods for the transaction
class in SystemC and SystemVerilog remain in sync
Caveat When you pack data in SystemVerilog or in SystemC, you loose
the control bits for any 4-valued logic data.
Co v e r i f y
Getting Started with SystemC UVM
20 / 22
UVM Transactions
I
I
I
A user must make sure that pack/unpack methods for the transaction
class in SystemC and SystemVerilog remain in sync
Caveat When you pack data in SystemVerilog or in SystemC, you loose
the control bits for any 4-valued logic data.
Co v e r i f y
Getting Started with SystemC UVM
20 / 22
UVM Transactions
I
I
I
A user must make sure that pack/unpack methods for the transaction
class in SystemC and SystemVerilog remain in sync
Caveat When you pack data in SystemVerilog or in SystemC, you loose
the control bits for any 4-valued logic data.
Co v e r i f y
Getting Started with SystemC UVM
20 / 22
Co v e r i f y
Getting Started with SystemC UVM
21 / 22
Co v e r i f y
Getting Started with SystemC UVM
21 / 22
Co v e r i f y
Getting Started with SystemC UVM
21 / 22
Co v e r i f y
Getting Started with SystemC UVM
21 / 22
Co v e r i f y
Getting Started with SystemC UVM
21 / 22
Co v e r i f y
Getting Started with SystemC UVM
21 / 22
Thank You!
Co v e r i f y