![]() |
A system project includes PS, PL, and AI Engine development and additionally a system wide configuration that requires to be configured correctly. Hardware emulator supports the system project debug needs and is capable of debug PS and AI Engine domains. PL domain debug is not supported currently.
The following showcase features of the hardware emulator:
Hardware Emulation Source Code Debug
Command-Line Project Source Code Debug with Hardware Emulator
Select the build configuration to be Emulation-HW.
Highlight beamformer system project and right-click to select build project. It takes over 60 minutes to complete the build.
Note: It takes a couple of minutes to launch the emulator and boot up Petalinux.
 that generates stop requests for the AI Engine cores, so that they stop at the reset vector. This option is required to add debug capabilities. Issue command make package_dbg
with this tutorial's Makefile.emu
to package binaries that can be debugged.
Note: The packaged binaries that have debug capabilities require to run with debugger. Run without debugger will see execution hang due to wait for debugger invocation. Run command make package
to package back regular binaries.
cp Makefile.emu Makefile
make
make package_dbg
From terminal 1, setup tool path properly and issue this command to launch hardware emulator and boot up Petalinux.
./launch_hw_emu.sh -add-env ENABLE_RDWR_DEBUG=true -add-env RDWR_DEBUG_PORT=10100 -pid-file emulation.pid -no-reboot -forward-port 1440 1534
Command option explanation:
-add-env RDWR_DEBUG_PORT=${aie_mem_sock_port}
: Defines the port for communicating with the AI Engine domain. In the previous example, it is 10100.-forward-port ${linux_tcf_agent_port} 1534
: Defines the port for the Linux TCF agent. In the previous example, it is 1440, which is the default.
Note:
launch_hw_emu.sh
is generated properly when the project under debug is built and packaged with hardware emulator correctly. Update repository's Makefile line 3 from "TARGET = hw" to "TARGET = hw_emu".- Previous command takes a few minutes to complete due to both hardware emulator and Petalinux are required to boot up properly.
- Wait until both hardware server and Petalinux boot up BEFORE moving to next steps.
From terminal 2, setup tool path properly and issue this command to launch XRT server and Vitis IDE.
vitis -debug -flow embedded_accel -target hw_emu -exe ./host.exe -program-args ./a.xclbin -port 1440
xrt_server -I30000 -S -s tcp::4352
Command option explanation:
vitis -debug
: Launches the Vitis IDE in stand-alone debug mode.-flow embedded_accel
: Specifies the embedded processor application acceleration flow.-target hw_emu
: Indicates the target build being debugged.-exe ./ps_app
: Indicates the PS application to run and debug.-program-args ${xcl_bin_dir}/binary_container_1.xclbin
: Refers to the location of the xclbin file to be loaded as an argument to the executable.-port 1440
: Specifies the ${linux_tcf_agent_port} as discussed previously.-I30000
: Defines an idle timeout in seconds, in which the server will quit if there is no response.-S
: Specifies print server properties in JSON format to stdout.-s tcp::${xrt_server_port}
: Defines the agent listening protocol and port. it is 4352 in example, but can be any free port.
Expected result ; you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
XD005 | © Copyright 2022 Xilinx, Inc.