Can System verilog & C code work in parallel while using DPI

Hi,

Can parallelism be achieved between software & hardware language while using DPI as an interface.
Normally a task call from System verilog to ‘c’ blocks simulation & it proceeds only when the call is returned.
Also in case of a driver integration there is requirement for asynchronous events from hardware as well as data being driven from the driver. Can anyone share info on how these implementation can be done ?

Thanks
jv

Yes, it’s possible to use the DPI to achieve parallelism in C calling exported tasks to SystemVerilog. However, the notion of time is very different in the HDL and C worlds. See my DVCon paper Easy Steps Towards Virtual Prototyping using the SystemVerilog DPI which discusses some of the issues of tracking time between the two domains.

In reply to dave_59:

Hi Dave,

Thanks for the reply. The document was very useful in understanding the DPI usage.
How do we take a call on whether software or hardware acts as master ?
In case of using IPC channel software acts as a master, but can you elaborate on how IPC channel be used with DPI ?

Thanks
jv

In reply to j_vin:

Hi Jv,

Hand shaking between hardware and c code is possible using DPI-C.
Suppose you are launching a task from systemverilog which is a C subroutine.
Now from that C subroutine if you are calling some exported task from system verilog then again control will go back to system verilog and hardware will be running until there is a next call for again some C subroutine.

In that way both processes will be running alternatively.