My INSURER PTE LTD - Insurtech Innovation Award 2024
Design Verification Using SystemC
1. DV Club, Boston
Experiences with SystemC
Design Verification Using
SystemC
Greg Tierney
Presented to
DV Club, Boston
March 5, 2007
2. DV Club, Boston
Experiences with SystemC
About Avid
Invented digital video editing
Headquartered in Tewksbury
– http://www.avid.com/company/
Products
– Film/Video Editing and
Finishing
– Audio
– Broadcast
– Animation
– Storage & Workgroups
– Digital Asset and Production
Management
Services
– Support
– Training
– Consulting
3. DV Club, Boston
Experiences with SystemC
Agenda
What is SystemC?
Why did Avid choose to use SystemC?
DV problems solved by SystemC.
Summary
4. DV Club, Boston
Experiences with SystemC
What is SystemC?
Provides hardware constructs and a simulation kernel
for C++
It is a class library
– And it is a language standard (IEEE 1666TM 2005)
It has utilities and constructs
– Data types, ports, channels, processes
Adopted by different disciplines
– Architectural Modeling (SoC, performance)
– DV (RTL simulation, HW/SW co-verification)
– Synthesis
It is open source (OSCI)
– http://www.systemc.org
5. DV Club, Boston
Experiences with SystemC
Why Avid Chose SystemC
Enhanced existing C++ DV code
– Replaced an unreliable in-house framework
• Signal encapsulation
• Thread management
• Random seed management
– Smooth transition from C++ to SystemC
Tool availability
– Single kernel multi-language simulator
Industry acceptance
Low cost
Came with built-in verification capabilities
6. DV Club, Boston
Experiences with SystemC
Agenda
What is SystemC?
Why did Avid choose to use SystemC?
DV problems solved by SystemC.
Summary
7. DV Club, Boston
Experiences with SystemC
Crossing Language Boundaries
Connect an entire HDL module to the
testbench.
– Wrap the module with a SystemC class
(sc_foreign_module).
– Provide a string mapping for each port.
Connect a foreign signal anywhere in the
hierarchy.
– Bind a sc_signal (observe_foreign_signal).
– Provide a string of hierarchical path to wire or reg.
9. DV Club, Boston
Experiences with SystemC
Issues with Binding
No clear standard for language boundary
resolution.
– Each vendor has its own implementation.
– Implementation we use doesn’t map arrays or
records (yet).
Supporting foreign interface requires two
pass compilation.
– First pass creates object files.
– Second pass builds a symbol library used in
design elaboration.
10. DV Club, Boston
Experiences with SystemC
SystemC Connections
Call a public method
via pointer to object
Connect sc_port to a
sc_export
Connect sc_port to a
channel
start()start()
outp inp
p
p
write() read()
12. DV Club, Boston
Experiences with SystemC
Issues with Connections
Construction and binding are separate steps.
– Ports must be public.
– Ports bound after modules and channels are constructed.
Binding uses “strict type checking”.
– Compilation will fail if type mismatch in the connection.
– Splitting a vector across multiple ports is complicated.
Binding errors detected at elaboration.
– Simulation should abort at runtime if a port is not bound.
– Need to assign attributes to port (e.g. # of connections).
13. DV Club, Boston
Experiences with SystemC
Randomization
Separate library dedicated to verification
constructs (SCV).
Robust, rich feature set for
randomization.
– Simple constraints (ranges and lists).
– Complex constraint solver.
– Thread-safe seeding.
– Extendible to custom object types.
14. DV Club, Boston
Experiences with SystemC
Randomization at Avid
SCV more than we needed.
– So, we use a subset of the features.
Provide a Tcl interface to apply constraints.
– Wrap scv_smart_ptr.
– Define string representations for simple
constraints.
– Recompilation not required to change constraints.
– Reapply constraints over course of simulation.
15. DV Club, Boston
Experiences with SystemC
Processes
Hardware is inherently parallel.
DV must be multi-threaded.
SystemC solves this with processes.
– Macros: SC_THREAD and SC_METHOD.
– Events, mutexes, semaphores.
– Dynamic processes (sc_spawn).
16. DV Club, Boston
Experiences with SystemC
Hierarchy
SystemC defines an object hierarchy.
– Relates objects (parent/child).
– Familiar to HDL design.
Avid DV defines a layer hierarchy.
– Relates connections.
– Familiar to communication stacks.
Issue: SystemC is not a methodology.
17. DV Club, Boston
Experiences with SystemC
Example Hierarchy
VTOP
VTEST
VTB
DUT
Snooper_BFM
Monitor Monitor
Commander_BFM
Driver Monitor
TX_BFM
Driver
RX_BFM
Monitor
TLM Agent
STIMGEN
Translator Reference Model
Analysis Agent
Scoreboard
Analysis Agent
Test
18. DV Club, Boston
Experiences with SystemC
Agenda
What is SystemC?
Why did Avid choose to use SystemC?
DV problems solved by SystemC.
Summary
19. DV Club, Boston
Experiences with SystemC
Additional Issues
Compile and link performance is disappointing.
– Overuse of C++ templates in library.
– Partially attributed to vendor implementation.
Libraries are huge.
Being a language standard has tool implications.
C++ learning curve.
– C++ code debug very different than HDL.
• Segmentation faults, stack traces, code stepping
Think like a HW engineer, code like a SW engineer.
20. DV Club, Boston
Experiences with SystemC
Avid’s Experience
Used reliably for nearly 3 years.
Runtime performance very satisfactory.
Provides opportunity to assist product
development beyond DV.
– Evaluate architectures and predict
performance.
– Create programmer’s view models for
emulation and HW/SW co-verification.