Xilinx Microblaze C 和汇编

发布于 2024-08-17 04:18:14 字数 402 浏览 15 评论 0原文

我有一个用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

往昔成烟 2024-08-24 04:18:14

正如 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.

海未深 2024-08-24 04:18:14
  1. 检查编译器是否实现内联汇编。尝试使用 asm()“函数”。检查它是否支持变量引用。如果您的编译器是基于 GCC 的,这很容易。
  2. 您始终可以编写原始汇编程序,对其进行汇编,然后将其链接到您的应用程序中。您需要了解编译器的 ABI 才能生成兼容的函数。
  1. Check if the compiler implements inline assembly. Try the asm() "function". Check that it supports variable referencing. If your compiler is GCC based, this is easy.
  2. You can always write raw assembler, assemble it, and link it into your application. You need to understand the ABI of your compiler to make compatible functions.
若水微香 2024-08-24 04:18:14

您是否分析过绩效不佳的具体根源?根据我的经验,核心函数非常快,因此您的代码可能是问题的根源。尝试使用优化(-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).

べ映画 2024-08-24 04:18:14

我不知道您要重写哪个 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文