微型封面如何使用Axi流?

发布于 2025-02-13 22:39:28 字数 84 浏览 1 评论 0 原文

我有一个微型封面,该微衬线通过16个流界面进行了实例化,并带有一个自定义IP。在vitis中的这些接口(而非HLS)上进行交流的正确标头文件或功能是什么?

I have a microblaze instantiated with 16 stream interfaces with a custom IP attached to two. What is the correct header file or function to communicate over these interfaces in Vitis (Not HLS)?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

陈独秀 2025-02-20 22:39:28

基于完整的示例,您可以找到在这里,我将提供一个一般的想法:

  • 在您的C源中添加 mb_interface.h
  • 使用putfsl和getfsl宏来写和阅读溪流。

这样的宏是围绕特殊汇编指令的包装器,该指令将通过在AXI流界面上写入数据来执行微封面。 `d 是流ID。 在这里您可以探索ISA。

#define putfsl(val, id)         asm volatile ("put\t%0,rfsl" stringify(id) :: "d" (val))

基本问题是

#include "mb_interface.h"

/*
 * Write 4 32-bit words.
 */
static void inline write_axis(volatile unsigned int *a)
{
    register int a0,  a1,  a2,  a3;

    a3  = a[3];  a1  = a[1];  a2  = a[2];  a0  = a[0];

    putfsl(a0,  0); putfsl(a1,  0); putfsl(a2,  0); putfsl(a3,  0);
}


int main()
{
    volatile unsigned int outbuffer[BUFFER_SIZE] = { 0x0, 0x1, 0x2, 0x3 }
    };

    /* Perform transfers */
    write_axis(outbuffer);

    return 0;
}

Based on the full example that you can find here, I am going to provide a general idea:

  • Include the mb_interface.h in your C source
  • Use the putfsl and getfsl macros to write and read from the stream.

Such macros are wrapper around special assembly instructions that the microblaze will execute by writing the data on the axi stream interface. The ìd is the stream id. Here you can find all the possible functions and here you can explore the ISA.

#define putfsl(val, id)         asm volatile ("put\t%0,rfsl" stringify(id) :: "d" (val))

The fundamental issue is that

#include "mb_interface.h"

/*
 * Write 4 32-bit words.
 */
static void inline write_axis(volatile unsigned int *a)
{
    register int a0,  a1,  a2,  a3;

    a3  = a[3];  a1  = a[1];  a2  = a[2];  a0  = a[0];

    putfsl(a0,  0); putfsl(a1,  0); putfsl(a2,  0); putfsl(a3,  0);
}


int main()
{
    volatile unsigned int outbuffer[BUFFER_SIZE] = { 0x0, 0x1, 0x2, 0x3 }
    };

    /* Perform transfers */
    write_axis(outbuffer);

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