• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..--

README.mdD18-Mar-20252.8 KiB6044

README.md

1
2# matrix_multiply
3This readme is about the OpenAMP matrix_multiply demo.
4The matrix_multiply is about one processor generates two matrices, and send them to the one, and the other one calculate the matrix multiplicaiton and return the result matrix.
5
6For now, it implements Linux generates the matrices, and the baremetal calculate the matrix mulitplication and send back the result.
7
8## Compilation
9
10### Baremetal Compilation
11Option `WITH_MATRIX_MULTIPLY` is to control if the application will be built.
12By default this option is `ON` when `WITH_APPS` is on.
13
14Here is an example:
15
16```
17$ cmake ../open-amp -DCMAKE_TOOLCHAIN_FILE=zynqmp_r5_generic -DWITH_OBSOLETE=on -DWITH_APPS=ON
18```
19
20### Linux Compilation
21
22#### Linux Kernel Compilation
23You will need to manually compile the following kernel modules with your Linux kernel (Please refer to Linux kernel documents for how to add kernel module):
24
25* Your machine's remoteproc kernel driver
26* `obsolete/system/linux/kernelspace/rpmsg_user_dev_driver` if you want to run the matrix_multiply app in Linux user space.
27* `obsolete/apps/matrix_multiply/system/linux/kernelspace/rpmsg_mat_mul_kern_app` if you want to run the matrix_multiply app in Linux kernel space.
28
29#### Linux Userspace Compliation
30* Compile `obsolete/apps/matrix_multiply/system/linux/userspace/mat_mul_demo` into your Linux OS.
31* If you are running generic(baremetal) system as remoteproc remote, and Linux as remoteproc host, please also add the built generic `matrix_multiply` executable to the firmware of your Linux OS.
32
33## Run the Demo
34
35### Load the Demo
36After Linux boots,
37* Load the machine remoteproc. If Linux runs as remoteproc host, you will need to pass the other processor's matrix_multiply binary as firmware argument to the remoteproc module.
38* If you run the Linux kernel application demo, load the `rpmsg_mat_mul_kern_app` module, you will see the kernel app will generate two matrices to the other processor, and output the result matrix returned by the other processor.
39* If you run the userspace application demo, load the `rpmsg_user_dev_driver` module.
40* If you run the userspace application demo `mat_mul_demo`, you will see the similar output on the console:
41```
42****************************************
43Please enter command and press enter key
44****************************************
451 - Generates random 6x6 matrices and transmits them to remote core over rpmsg
46..
472 - Quit this application ..
48CMD>
49```
50* Input `1` to run the matrix multiplication.
51* Input `2` to exit the application.
52
53After you run the demo, you will need to unload the kernel modules.
54
55### Unload the Demo
56* If you run the userspace application demo, unload the `rpmsg_user_dev_driver` module.
57* If you run the kernelspace application demo, unload the `rpmsg_mat_mul_kern_app` module.
58* Unload the machine remoteproc driver.
59
60