Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some question about AIE+PL #2

Open
kkenshin1 opened this issue Aug 10, 2023 · 1 comment
Open

Some question about AIE+PL #2

kkenshin1 opened this issue Aug 10, 2023 · 1 comment

Comments

@kkenshin1
Copy link

Hi,

I notice your repo about controlling AIE through PL side rather than PS

From your code, I understand that the data_mover_mm2mm could choose different operating mode, it could not only transfer the data from ddr to bram, but also transfer the aie configuration through setting the ADDR_INT_OFFSET address

And I understand that when aie want to transfer configuration to aie, it will call PL_Write32 function, is it correct?

But I don't know when and where the function PL_Write32 in common.cpp would be called?

I also want to implement this function, to control the AIE without PS, and have so many questions, is there any docs to describe this working flow?

Thanks!

@nqdtan
Copy link
Owner

nqdtan commented Sep 10, 2023

Hi @kkenshin1

Sorry for the late response. I missed the issue notification. Yes, your understanding is correct. PL_XXX functions defined in common.c are called under methods defined in XAie Debug Backend

https://github.com/nqdtan/embeddedsw/blob/aiev2_custom/XilinxProcessorIPLib/drivers/aienginev2/src/io_backend/ext/xaie_debug.c

Those IO methods are invoked by higher-level, more abstract XAie methods. The XAie API defines several IO backends to support different target platforms (e.g., bare-metal on ARM, linux on ARM, etc.), and you need to select your target backend when you compile libxaiengine. See here:

https://github.com/nqdtan/embeddedsw/blob/2203d9057b67b75719d2b26308af85278a2926e3/XilinxProcessorIPLib/drivers/aienginev2/src/io_backend/xaie_io.c#L32-L46

This corresponds to the flag EXTRA_CFLAGS += -D__AIE$(AIEBACKEND)__ in embeddedsw/XilinxProcessorIPLib/drivers/aienginev2/src/Makefile. If you follow Step 1 in General Setup, it will generate a libxaiengine with Debug as IO Backend, because we use Makefile.Linux in this case (Makefile compiles with Baremetal backend). Hence, the methods in xaie_debug will be called under the hood of the high-level XAie calls (DMA, Stream Switch configs, etc.). I modified xaie_debug a bit to invoke the PL_XXX methods for reading/writing AIE config data via the PL module data_mover, instead of printing out configuration data as it is originally intended. This is just a quick hack to make things work. A more proper way is to define a new backend for these new methods (e.g., PL backend).

I'm not sure if I will write more documentation for this repository in the near future, but feel free to let me know or follow up if you have any questions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants