Monday, April 18, 2011

SystemVerilog DPI (Dpi-C) Tutorial

"The SystemVerilog standard defines a new DPI (direct programming interface) for user C/C++ applications to interact with Verilog or SystemVerilog HDL. This interface eliminates the complexity of the earlier PLI (programming language interface) that required users to access HDL objects through a set of API and setup-explicit callback methods."


INTRODUCTIONS
What Is Dpi-C ?

LAYERS
Two Layers Of Dpi-C
Dpi-C Systemverilog Layer
Dpi-C Foreign Language Layer

IMPORT
Import Methods
Steps To Write Import Methods
Standard C Functions

NAMING
Global Name
Local Name
Sv Keyword As Linkage Name

EXPORT
Export Methods
Steps To Write Export Methods
Blocking Export Dpi Task

PURE AND CONTEXT
Pure Function
Context Function

DATA TYPES
Passing Logic Datatype

ARRAYS
Open Arrays
Packed Arrays
Linearized And Normalized
Array Querying Functions

PASSING STRUCTS AND UNIONS
Passing Structure Example
Passing Openarray Structs
Passing Union Example

ARGUMENTS TYPE
What You Specify Is What You Get
Pass By Ref
Pass By Value
Passing String
Example Passing String From Sv To C
Example Passing String From C To Sv

DISABLIE
Disable Dpi-C Tasks And Functions
Include Files



Most simulation tools support DPI well. For example, Modelsim as shown in


And Cadence's IUS tool including NC Verlilog


No comments:

Followers

Blog Archive

About Me

My photo
HD Multimedia Technology player