User guide

19-35
Using the VCS / SystemC Cosimulation Interface
The return keyword is only allowed once for each task. It becomes
an output argument on the Verilog side to a return value on the
SystemC side. This feature is required because blocking functions in
SystemC may return values, while Verilog tasks do not have a return
value.
There is one special case here. If the methods of the SystemC
interface class use reference parameters, for example
my_method(int& par), then you need to mark this parameter as
inout& parameter in the interface definition file. Note that the &
appendix is only allowed for inout parameters. For input
parameters this special marker is not needed and not supported. Pure
output parameters that should be passed as reference must be
defined as inout in the interface definition file.
Example interface definition file for the simple_bus blocking
interface:
interface simple_bus_blocking_if
direction sv_calls_sc
verilog_adapter simple_bus_blocking_if_adapter
systemc_adapter simple_bus_blocking_if_adapter
#include "simple_bus_blocking_if.h"
task burst_read
input int unsigned priority_
inout int data[32]
input int unsigned start_address
input int unsigned length
input int unsigned lock
return int unsigned status
task burst_write
input int unsigned priority_
inout int data[32]
input int unsigned start_address
input int unsigned length
input int unsigned lock
return int unsigned status