xsi_put_value - 2023.2 English

Vivado Design Suite User Guide: Logic Simulation (UG900)

Document ID
UG900
Release Date
2023-10-18
Version
2023.2 English
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, the Vivado simulator performs no checking on the size or type of the value you pass to xsi_put_value. Passing a value to xsi_put_value, which does not match the size and type of the port might result in unpredictable behavior of your program and the Vivado simulator.

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","librdi_simulator_kernel.so");
...
int clk = loader.get_port_number("clk");
loader.put_value(clk, &one_val); // set clk to 1