Hi @John,
Saw your comments about the Cyclone V SoC setup and the missing “read from SDRAM” block—here’s a quick summary and clarification.You’re already on the right path with
hRD.addAXI4MasterInterface( ... 'InterfaceConnection','hps_0.f2h_sdram0_data', ... 'InterfaceID','f2h_sdram0', ... 'AddrWidth',32);
but remember, that line only declares the AXI4 Master interface in the reference design. HDL Coder doesn’t automatically create read logic or a block for you; the actual handshake must live inside your DUT subsystem.
Here’s how to wire it up:
1. Inside `plugin_rd()` Add the master interface with read capability enabled:
hRD.addAXI4MasterInterface( ... 'InterfaceConnection','hps_0.f2h_sdram0_data', ... 'InterfaceID','f2h_sdram0', ... 'ReadSupport','true', ... 'WriteSupport','false', ... 'AddrWidth',32, ... 'MaxDataWidth',32, ... 'HasMemoryConnection',true, ... 'DefaultReadBaseAddr',hex2dec('80000000'), ... 'ProcessorAccessibleMemoryRegion',[hex2dec('80000000') hex2dec('00200000')]);
2. In the DUT subsystem Expose ports for the simplified AXI4 Master handshake:
rd_addr – byte address rd_len – number of words rd_avalid – request valid rd_aready – slave ready rd_data – read data rd_dvalid – data valid
Implement a small FSM that asserts `rd_avalid` when `rd_aready` is high, issues the address and length, then waits for `rd_dvalid` and samples `rd_data`.
3. For simulation Connect those ports to an AXI4 Random Access Memory block from the SoC Blockset. This acts as a stand-in for SDRAM and lets you verify timing and data flow before generating HDL.
Once the FSM is working, map your `rd_*` signals to the `f2h_sdram0` interface in the IP Core Editor (Target Interface tab). The generated IP will then access HPS SDRAM directly at runtime—no extra Simulink memory block needed.
References
Simplified AXI4 Master Interface
This page shows exactly which rd_* / wr_* signals you model in your DUT, what their handshaking semantics are, and how HDL Coder translates them into real AXI4 master logic.
Model Design for AXI4 Master Interface Generation
This covers how to design your DUT ports to map to AXI4 master, how the simplified protocol is used in IP Core Generation, and more.
Design a Model for AXI4 Interfaces
<https://www.mathworks.com/help/hdlcoder/modeling-for-deployment.html%E2%80%A8>
This gives a broader view: how to approach modeling algorithms in Simulink/HDL Coder for AXI4-Stream, AXI4 master, etc.
Generate HDL IP Core with Multiple AXI4-Stream and AXI4 Master Interfaces
https://www.mathworks.com/help/hdlcoder/ug/map-dut-ports-to-multiple-axi-interfaces.html%E2%80%A8
Useful when your design has more than one interface; explains how to map ports to multiple AXI interfaces.
Hope this helps.