二级缓存示例
二级缓存的例子演示了如何使用软件定义的二级缓存。
备注
本例中用于两个矩阵相乘的函数仅作说明之用。它并不是进行矩阵乘法的最有效方法。XMOS有专门用于此目的的优化库。
构建固件
在xcore_sdk根目录下运行以下命令来构建固件:
- Windows
- Linux and Mac
cmake -G "NMake Makefiles" -B build -DCMAKE_TOOLCHAIN_FILE=xmos_cmake_toolchain/xs3a.cmake
cd build
nmake example_freertos_l2_cache
cmake -B build -DCMAKE_TOOLCHAIN_FILE=xmos_cmake_toolchain/xs3a.cmake
cd build
make example_freertos_l2_cache
设置硬件
在运行固件之前,必须对swmem进行刷新:
- Windows
- Linux and Mac
nmake flash_example_freertos_l2_cache_swmem
make flash_example_freertos_l2_cache_swmem
运行固件
从xcore_sdk构建文件夹执行:
- Windows
- Linux and Mac
nmake run_example_freertos_l2_cache
make run_example_freertos_l2_cache