Demo: matrix multiply
This example demonstrate interprocessor communication using rpmsg framework
in the Linux kernelspace. Host (this) application generates two random matrices and send
them to remote processor using rpmsg framework in the Linux kernelspace and waits for
the response. Remote processor firmware receives both matrices and
multiplies them and sends result back to host processor.
Host processor prints the result on console after receiveing it.
Platform: Xilinx Zynq UltraScale+ MPSoC(a.k.a ZynqMP)
Board: ZynqMP Zcu102
Remote Processor firmware (image_matrix_multiply)
Remote processor firmware for Xilinx ZynqMP cortex-r5 platform based on: matrix_multiply.c
Instructions to compile: ZynqMP r5f generic baremetal
RPU firmware elf file is expected in sdk at path: /lib/firmware/
Xilinx Vendor specific SDK is required to build RPU firmware: Xilinx Petalinux
More information is provided here: Xilinx Wiki page for OpenAMP
Run the demo
Assume all the binaries are board specific.
# Specify remote processor firmware to be loaded. echo image_matrix_multiply > /sys/class/remoteproc/remoteproc0/firmware # Load and start target Firmware onto remote processor echo start > /sys/class/remoteproc/remoteproc0/state # check remote processor state cat /sys/class/remoteproc/remoteproc0/state # load rpmsg_char driver modprobe rpmsg_char # load rpmsg_ctrl driver modprobe rpmsg_ctrl # Run Matrix multiplication application on host processor mat_mul_demo # unload rpmsg_ctrl driver modprobe -r rpmsg_ctrl #unload rpmsg_char driver modprobe -r rpmsg_char # Stop remote processor echo stop > /sys/class/remoteproc/remoteproc0/state