writeMemoryOffset
Write data to memory regions on FPGA or SoC hardware by using the offset address
Since R2023b
Description
writeMemoryOffset(
writes all words in hFPGA
,interfaceID
,addrOffset
,data
)data
to the FPGA,
hFPGA
, to the offset specified by addrOffset
using
the interface specified by interfaceID
.
Examples
Write Scalar Data to Memory by Using Offset Addresses
Write scalar data to FPGA-accessible memory regions by using the offset address and interface ID.
Create an fpga
object, hFPGA
, for a Intel® target.
hFPGA = fpga("Intel")
hFPGA = fpga with properties: Vendor: "Intel" Interfaces: [0×0 fpgaio.interface.InterfaceBase]
Add the AXI4 slave interface to the
hFPGA
object by using the addAXI4SlaveInterface
function.
addAXI4SlaveInterface(hFPGA,InterfaceID = "Registers",... BaseAddress = 0x400D0000,... AddressRange = 0x10000);
Write data to a memory location.
writeMemoryOffset(hFPGA,"Registers",0x100,uint32(5));
Write Vector Data to Memory by Using Offset Addresses
Write vector data to FPGA-accessible memory regions by using the offset address and interface ID.
Create an fpga
object, hFPGA
, for an Intel target.
hFPGA = fpga("Intel")
hFPGA = fpga with properties: Vendor: "Intel" Interfaces: [0×0 fpgaio.interface.InterfaceBase]
Add the AXI4 slave interface to the
hFPGA
object by using the addAXI4SlaveInterface
function.
addAXI4SlaveInterface(hFPGA,InterfaceID = "Registers",... BaseAddress = 0x400D0000,... AddressRange = 0x10000);
Write data to a memory location.
writeMemoryOffset(hFPGA,"Registers",0x100,uint32(1:5));
Input Arguments
hFPGA
— Target FPGA object
fpga object
Target FPGA object, specified as an fpga
object.
interfaceID
— Name of FPGA interface
""
| string
| character vector
Name of FPGA interface, specified as a string or character vector.
addrOffset
— Memory offset address
nonnegative integer | nonnegative hexadecimal value
Memory offset address, specified as a nonnegative integer that is a multiple of 4 or
hexadecimal value that is a multiple of 4. The function casts the address to the
uint32
or uint64
data type, depending on the
memory interface address width. The address offset must be in the range of the interface
addresses added to the hFPGA
object.
Example: 0x100
specifies an offset address of
0x100
.
Data Types: uint32
| uint64
data
— Data words to write
scalar | vector
Data words to write, specified as a uint32
scalar or vector. By
default, the function writes the data to a contiguous address block and increments the
address for each operation.
When you specify a large operation size, such as when you write a block of DDR memory, the function automatically breaks the operation into multiple bursts, using the maximum supported burst size of 256 words.
Example: [1:100]
specifies 100 contiguous memory
locations.
Data Types: uint32
Version History
Introduced in R2023b
See Also
Objects
Functions
MATLAB コマンド
次の MATLAB コマンドに対応するリンクがクリックされました。
コマンドを MATLAB コマンド ウィンドウに入力して実行してください。Web ブラウザーは MATLAB コマンドをサポートしていません。
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)