C-based design reduces overall turn-around time, deals well with design complexity, supports optimization based on various objective functions (e.g., area, power consumption), and improves HW/SW co-design. C-based design also facilitates the creation of re-usable behavioral IP in contrast to RTL design where re-use of traditional RTL IPs has been poor. Mentor Graphics has several tools that help you realize the full potential of C-based design. We will focus on the SystemC capabilities of ModelSim in this section. A design is first modeled in SystemC and because you are working at a higher level of abstraction, the description is less complex and easier to modify and understand. It also simulates much faster.
The SystemVerilog Direct Programming Interface (DPI) was included in the standard to provide seamless communication between HDL and C code. Although the Verilog Programming language Interface (PLI), was initially developed to allow third-party tools access to the simulation data structures to support waveform viewers and other applications, users have long employed the PLI to hook C code into the simulation. The SystemVerilog DPI provides similar but more powerful capabilities via a considerably simpler mechanism.
Using the DPI, functions can be written in C and called from Verilog directly, without the “red tape” of data conversion and error checking associated with PLI. In addition, HDL tasks and functions can also be called directly from C, with the simulator controlling scheduling and allowing the C code to “block” waiting for a simulation event to occur, a capability that required an extremely complex multi-threaded environment to accomplish with PLI.