|HOME |ABOUT |ARTICLES |ACK |FEEDBACK |TOC |LINKS |BLOG |JOBS |


Tutorials



NAMING


Global Name



Every task or function imported to SystemVerilog must eventually resolve to a global symbol. Similarly, every task or function exported from SystemVerilog defines a global symbol. Global names of imported and exported tasks and functions must be unique (no overloading is allowed ) and shall follow C conventions for naming; specifically, such names must start with a letter or underscore, and they can be followed by alphanumeric characters or underscores.



EXAMPLE
export "DPI-C" foo_plus = function \foo+ ; // "foo+" exported as "foo_plus"
import "DPI-C" init_1 = function void \init[1] (); // "init_1" is a linkage name

Local Name



If a global name is not explicitly given, it shall be the same as the SystemVerilog task or function name.


EXAMPLE:
export "DPI-C" function foo;

Sv Keyword As Linkage Name



If a C method is named same as the SystemVerilog Keyword, then use a leading backslash ( \ ) character to create the linkage identifier.


EXAMPLE:
import "DPI-C" \begin = function void \init[2] (); // "begin" is a linkage name

Index
Introductions
Layers
Import
Naming
Export
Pure And Context
Data Types
Arrays
Passing Structs And Unions
Arguments Type
Disablie

Report a Bug or Comment on This section - Your input is what keeps Testbench.in improving with time!





<< PREVIOUS PAGE

TOP

NEXT PAGE >>

copyright © 2007-2017 :: all rights reserved www.testbench.in::Disclaimer