Xilinx Microblaze C 和汇编
我有一个用 C 编写的应用程序 Xilinx Microblaze 核心。然而,性能并不完全是我想要的,所以我正在考虑重写汇编中的一些核心函数。我无法弄清楚如何让 Xilinx Platform Studio 将两者编译为单个 ELF文件虽然。
我该怎么做呢?
I have an application written in C for a Xilinx Microblaze core. However, the performance isn't quite what I want so I was considering rewriting some of the core functions in assembly. I'm having trouble figuring out how to get Xilinx Platform Studio to compile both into a single ELF file though.
How can I do it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
正如 Yann 所建议的,您可以使用内联汇编。具体方法如下:
AR# 18561. 11.1 EDK - 如何包含内联汇编在我的 C 源文件中?
不过,请尝试分析您的代码以确定性能瓶颈在哪里。 Xilinx 的 SDK 允许进行侵入式分析。您还可以使用 GPIO 和示波器(或具有快速触发时钟的逻辑分析仪)自行分析您的函数/代码部分。
As suggested by Yann, you can use inline assembly. Here is how:
AR# 18561. 11.1 EDK - How do I include inline assembly within my C source files?
Though, try to profile your code to determine where your performance bottleneck is. Xilinx's SDK allows for intrusive profiling. You could also use GPIOs and an oscilloscope (or logic analyser with a fast triggering clock) to profile your functions/code sections yourself.
您是否分析过绩效不佳的具体根源?根据我的经验,核心函数非常快,因此您的代码可能是问题的根源。尝试使用优化(-O3)进行编译或更改缓存大小(如果您使用缓存)。
Did you profile where exactly the poor performance comes from? From my experience, core functions are quite fast, so your code is probably the source of the problem. Try compiling with optimization (-O3) or changing the cache size (if you use a cache).
我不知道您要重写哪个 Microblaze 函数,但您可以随时转到 Xilinx 安装目录(例如 C:\Xilinx\13.4\ISE_DS\EDK\sw\lib\bsp\standalone_v3_00_a\src\microblaze)修改函数,甚至在特定的软件库中包含您自己的汇编语言文件。
I don't know which Microblaze function you want to rewrite, but you can always go to Xilinx install directory (for example, C:\Xilinx\13.4\ISE_DS\EDK\sw\lib\bsp\standalone_v3_00_a\src\microblaze) to modify functions or even include your own assembly language file in the specific software library.