A C/C++ test bench using XSI typically uses the following steps:
- Open the design.
- Fetch the IDs of each top-level port.
- Repeat the following until the simulation is finished:
- Set values on top-level input ports.
- Run the simulation for a specific amount of time.
- Fetch the values of top-level output ports.
- Close the design.
The following table lists the XSI functions and their Xsi::Loader
member function equivalents to use for each step. You can
find the usage details for each XSI function in the XSI Function Reference.
Activity | XSI Function |
Xsi::Loader Member Function |
---|---|---|
Open the design |
xsi_open
|
open
|
Fetch a port ID |
xsi_get_port_number
|
get_port_number
|
Set an input port value |
xsi_put_value
|
put_value
|
Run the simulation |
xsi_run
|
run
|
Fetch an output port value |
xsi_get_value
|
get_value
|
Close the design |
xsi_close
|
close
|
You can find the example C++ programs that use XSI in your Vivado simulator installation at the following location:
<Vivado Installation Root>/examples/xsim/<HDL language>/xsi