addAXI4SlaveInterface
Write data to IP core or read data from IP core using AXI4 or AXI4-Lite interface
Since R2020b
Description
addAXI4SlaveInterface(
adds an AXI4 slave interface that you can use to control the DUT
ports mapped to AXI4 or AXI4-Lite interfaces in the HDL Coder™ generated IP core from MATLAB®.hFPGA
)
addAXI4SlaveInterface(
adds an AXI4 slave interface that you can use to control the DUT
ports mapped to AXI4 or AXI4-Lite interfaces in the HDL Coder generated IP core from MATLAB, with one or more properties specified as name-value pair arguments. Enclose
each property and value pair in single quotes.hFPGA
, Name,Value
)
Examples
Add AXI4 Slave Interface for Xilinx Target
Add an AXI4 slave interface for a Xilinx® target.
Create a target object, hFPGA
, for the target device.
hFPGA = fpga("Xilinx")
hFPGA = fpga with properties: Vendor: "Xilinx" Interfaces: [0x0 fpgaio.interface.InterfaceBase]
Add the AXI4 slave interface to the
hFPGA
object by using the
addAXI4SlaveInterface
function.
%% AXI4-Lite addAXI4SlaveInterface(hFPGA, ... ... % Interface properties "InterfaceID", "AXI4-Lite", ... "BaseAddress", 0xA0000000, ... "AddressRange", 0x10000, ... ... % Driver properties "WriteDeviceName", "mwipcore0:mmwr0", ... "ReadDeviceName", "mwipcore0:mmrd0");
After you have added the interfaces, use the mapPort
function to map the ports to that interface, and then read and write data. See Map DUT Ports in HDL IP Core to AXI4 Slave Interfaces.
Add AXI4 Slave Interface for Intel Target
Add an AXI4 slave interface for an Intel® target.
Create a target object, hFPGA
, for an Intel target.
hFPGA = fpga("Intel")
hFPGA = fpga with properties: Vendor: "Intel" Interfaces: [0x0 fpgaio.interface.InterfaceBase]
Add the AXI4 slave interface to the
hFPGA
object by using the
addAXI4SlaveInterface
function.
%% AXI4 addAXI4SlaveInterface(hFPGA, ... ... % Interface properties "InterfaceID", "AXI4", ... "BaseAddress", 0xA0000000, ... "AddressRange", 0x10000, ... ... % Driver properties "WriteDeviceName", "mwipcore0:mmwr0", ... "ReadDeviceName", "mwipcore0:mmrd0");
After you have added the interfaces, use the mapPort
function to map the ports to that interface, and then read and write data. See Map DUT Ports in HDL IP Core to AXI4 Slave Interfaces.
Add AXI4 Slave Interface for Standalone FPGA Boards
Add an AXI4 slave interface for a standalone Xilinx target.
Create a target object, hFPGA
, for the target device.
hFPGA = fpga("Xilinx")
hFPGA = fpga with properties: Vendor: "Xilinx" Interfaces: [0x0 fpgaio.interface.InterfaceBase]
As standalone FPGA boards do not have an embedded ARM® processor, you can use the AXI Manager driver. Use the
aximanager
object to specify the AXI Manager driver and then add this
information to the
addAXI4SlaveInterface
function.
% Create an "aximanager" object hAXIMDriver = aximanager("Xilinx"); % Pass it into the addInterface command addAXI4SlaveInterface(hFPGA, ... ... % Interface properties "InterfaceID", "AXI4-Lite", ... "BaseAddress", 0xB0000000, ... "AddressRange", 0x10000, ... ... % Driver properties "WriteDriver", hAXIMDriver, ... "ReadDriver", hAXIMDriver, ... "DriverAddressMode", "Full");
After you have added the interfaces, use the mapPort
function to map the ports to that interface, and then read and write data. See Map DUT Ports in HDL IP Core to AXI4 Slave Interfaces.
Input Arguments
hFPGA
— Target FPGA object
fpga object
fpga
object for the target vendor, specified as an fpga
object.
Name-Value Arguments
Specify optional pairs of arguments as
Name1=Value1,...,NameN=ValueN
, where Name
is
the argument name and Value
is the corresponding value.
Name-value arguments must appear after other arguments, but the order of the
pairs does not matter.
Before R2021a, use commas to separate each name and value, and enclose
Name
in quotes.
Example: addAXI4SlaveInterface(hFPGA, "InterfaceID",
"AXI4-Lite")
creates an AXI4 slave interface with
InterfaceID
as AXI4-Lite
.
InterfaceID
— Name of AXI4 slave interface
"AXI4-Lite"
| "AXI4"
| string
Name of AXI4-Lite or AXI4 interface that you want to map the DUT ports to, specified as a string.
BaseAddress
— Base address
0x0
(default) | numeric value
Base address for AXI4 or AXI4-Lite slave interface, specified as a numeric value.
Example: 0x40010000
AddressRange
— Address range
numeric value
Address range for AXI4 or AXI4-Lite interface, specified as a numeric value.
Example: 0x10000
WriteDeviceName
— IIO device name to write data
"mwipcore0:mmwr0"
(default) | string array
Name and path of the IIO device that you want to write to. When you generate the
IP core by using the IP Core Generation
workflow, the default name
is mwipcore0:mmwr0
.
Example: "mwipcore0:mmwr0"
ReadDeviceName
— IIO device name to read data
"mwipcore0:mmrd0"
(default) | string array
Name and path of the IIO device that you want to read from. When you generate the
IP core by using the IP Core Generation
workflow, the default name
is mwipcore0:mmrd0
.
Example: "mwipcore0:mmrd0"
WriteDriver
— AXI driver to perform write operation
driver object
Name of the AXI driver that you use to write data into. You can specify this
property as the HDL Verifier™
aximanager
object for standalone FPGA boards. For SoC platforms,
HDL Coder creates the drivers automatically.
Example: "aximanager('Xilinx')"
ReadDriver
— AXI driver to perform read operation
driver object
Name of the AXI driver that you use to read data from. You can specify this
property as the HDL Verifier
aximanager
object for standalone FPGA boards that do not have an
embedded ARM processor. For SoC platforms, HDL Coder creates the drivers automatically.
Example: "aximanager('Xilinx')"
DriverAddressMode
— AXI driver to perform read operation
"Offset"
(default) | "Full"
Specify whether the AXI driver expects a full address that includes the base address and the offset address, or whether it expects only an offset address.
Example: "Offset"
Version History
Introduced in R2020b
See Also
Objects
Functions
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)