Read AXI4 address locations from Simulink

4 次查看(过去 30 天)
How can I read a particular address location from the AXI4 interface within Simulink HDL coder? For example, if I have a reference design that includes the Altera System ID Peripheral Core and it is located at base address 0x0000_0080, how could I read the system ID (offset 0) into my Simulink model? Normally, in my C program I would use mmap() to map physical addressses in the Linux virtual memory space and create a pointer to the base address of the IP core. I don't know if MATLAB has an equivalent function or how can I map something from /dev/mem to the matlab program's address space?

采纳的回答

Sahas
Sahas 2025-4-10
Hi @John,
To read AXI4 address location from Simulink, you can use a MATLAB Function Block to write a function to capture the data at the required address. MATLAB's "readmemory" function reads the data from AXI4 memory-mapped locations.
For more information and steps, refer to the following MathWorks documentation links:
I hope this is beneficial!
  1 个评论
John
John 2025-4-10
I wasn't necessarily trying to access RAM but instead accessing a custom IP core from the processor's address space. I was able to solve this problem by editing the device tree on the cyclone V to allocate a region of address space for my IP core and load the Mathworks mwipcore driver for this device. I was then able to use the AXI4 Read block in Simulink https://www.mathworks.com/help/ecoder/alterasoc/ref/axi4read.html except I changed the device name parameter from /dev/mwipcore to where my device was located. I found this link helpful for understanding how to edit the device tree using HDL Coder: https://www.mathworks.com/help/hdlcoder/ug/generate-devicetree-for-ip-core.html . I'll accept your answer anyway in case someone else finds it helpful.

请先登录,再进行评论。

更多回答(0 个)

标签

产品


版本

R2024b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by