void xsi_put_value(xsiHandle design_handle, XSI_INT32 port_number, void* value);
void Xsi::Loader::put_value(int port_number, const void* value);
This function deposits the value stored in value onto the port specified by port ID port_number. See xsi_get_port_number for information on obtaining an ID for a port. value is a pointer to a memory buffer that your program must allocate and fill. See the Vivado Simulator VHDL Data Format and Vivado Simulator Verilog Data Format for information on the proper format of value.
CAUTION:
For maximum performance,
Vivado simulator performs no check on the size or type of the
value you pass to
xsi_put_value. Passing a value to xsi_put_value that mismatches the size and type of the port can cause the
program and Vivado simulator to behave unpredictably.Example code:
#include "xsi.h"
#include "xsi_loader.h"
...
// Hard-coded Buffer for a 1-bit "1" Verilog 4-state value
const s_xsi_vlog_logicval one_val = {0X00000001, 0X00000000};
Xsi::Loader loader("xsim.dir/mySnapshot/xsimk.so","libxv_simulator_kernel.so");
...
int clk = loader.get_port_number("clk");
loader.put_value(clk, &one_val); // set clk to 1