MATLAB 도움말 센터
Maps a DUT port to specified AXI4 interface in HDL IP core
mapPort(hFPGA, hDUTPorts)
mapPort(hFPGA, hDUTPorts) maps the DUT port or ports in the generated HDL IP core to the AXI4 interface. You create the DUT port objects as an object array by using the hdlcoder.DUTPort object.
hFPGA
hDUTPorts
hdlcoder.DUTPort
example
collapse all
This example shows how to map the DUT ports in the HDL IP core to AXI4 slave interfaces.
Create an fpga object with Xilinx as Vendor.
fpga
Xilinx
Vendor
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.
addAXI4SlaveInterface
%% AXI4 Slave addAXI4SlaveInterface(hFPGA, ... "InterfaceID", "AXI4-Lite", ... "BaseAddress", 0xA0000000, ... "AddressRange", 0x10000);
Specify the DUT ports in the HDL IP core as an hdlcoder.DUTPort object array and then map the port to the AXI4 slave interface.
hPort_h_in1 = hdlcoder.DUTPort("h_in1", ... "Direction", "IN", ... "DataType", numerictype(1,16,10), ... "Dimension", [1 1], ... "IOInterface", "AXI4-Lite", ... "IOInterfaceMapping", "0x100");
Map the DUT port objects to the AXI4 slave interface. This information is saved as a property on the hFPGA object.
mapPort(hFPGA, hPort_h_in1) hFPGA.Interfaces
ans = AXI4Slave with properties: InterfaceID: "AXI4-Lite" BaseAddress: "0xA0000000" AddressRange: "0x10000" WriteDriver: [1×1 fpgaio.driver.AXIMemoryMappedIIOWrite] ReadDriver: [1×1 fpgaio.driver.AXIMemoryMappedIIORead] InputPorts: "h_in1" OutputPorts: [0×0 string]
This example shows how to map the DUT ports in the generated HDL IP core to AXI4-Stream interfaces.
Create an object for the target device.
Add the AXI4-Stream interface to the hFPGA object by using the addAXI4StreamInterface function.
addAXI4StreamInterface
%% AXI4-Stream addAXI4StreamInterface(hFPGA, ... "InterfaceID", "AXI4-Stream", ... "WriteEnable", true, ... "ReadEnable", true, ... "WriteFrameLength", 1024, ... "ReadFrameLength", 1024);
Specify the DUT port as an hdlcoder.DUTPort object array and then map the port to the AXI4-Stream interface.
hPort_x_in_data = hdlcoder.DUTPort("x_in_data", ... "Direction", "IN", ... "DataType", numerictype(1,16,10), ... "Dimension", [1 1], ... "IOInterface", "AXI4-Stream"); hPort_y_out_data = hdlcoder.DUTPort("y_out_data", ... "Direction", "OUT", ... "DataType", numerictype(1,32,20), ... "Dimension", [1 1], ... "IOInterface", "AXI4-Stream");
Map the DUT port objects to the AXI4-Stream interface. This information is saved as a property on the hFPGA object.
%% Map DUT port to AXI4 Slave driver mapPort(hFPGA, [hPort_x_in_data, hPort_y_out_data]); hFPGA.Interfaces
ans = AXI4Stream with properties: InterfaceID: "AXI4-Stream" WriteEnable: 1 ReadEnable: 1 WriteFrameLength: 1024 ReadFrameLength: 1024 WriteDriver: [1×1 fpgaio.driver.AXIStreamIIOWrite] ReadDriver: [1×1 fpgaio.driver.AXIStreamIIORead] InputPorts: "x_in_data" OutputPorts: "y_out_data"
fpga object for the target vendor, specified as an fpga object.
DUT port or ports that you want to map to an IP core interface. Each port is an object array that you create by using the hdlcoder.DUTPort function.
Introduced in R2020b
writePort
readPort
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.
웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
유럽
아시아 태평양
지역별 지사에 문의