I'm using a beta version of 6.01 and find that printf in a DPI'd C function no longer prints to the ncverilog log file, it only prints to the screen. (In 5.83 it printed to both.)Does anyone know how to get printf to print to the log file in 6.01?Thanks,Dave F.LSI Logic
use io_printf, which is a VPI function. io_printf prints to the ncsim.log/ncverilog.log file.
Isn't VPI a PLI and therefore slow? If printf doesn't work after 5.83 are there plans to make a DPI equivalent that will?
Any print function requires a call to the operating system, which is by its very nature slow. So I would expect that the difference between printf, io_printf and vpi_printf would be miniscule if there is any difference at all. Of course, buffering the output helps, but even so, as soon as you put any kind of printf in your code, pure speed is no longer an option.I don't know for sure, but I would suspect that io_printf and vpi_printf (and any potential dpi_printf) all use the same underlying code. If the 6.1 beta code was printing to the log file, it must have been using that code too. After all, it's the only way it would even know about the existence of the log file.
True, in general VPI/PLI calls are slower. BUT - printf has no knowledge of any simulator, but io_printf does. In general io_printf is fairly fast and I'd doubt if you'd really notice much performance hit other than writing to the external screen and the simulator's screen/log. Don't hold your breath for any dpi_printf (that's not an official statement).
That the only way I know to get the DPI output to be incorporated into the ncsim.log file, since io_printf() understands a simulator and printf() does not.