For this exercise you start with the source used in lab3, modify the source to usemalloc()
instead ofsds_alloc()
, and observe how the data mover changes from Simple DMA to Scatter-Gather DMA.
- Double-click the
main.cpp
in the Project Explorer view, under src folder, to bring up the source editor view.
- Find all the lines to where buffers are allocated with
sds_alloc()
, and replacesds_alloc()
withmalloc()
everywhere. Also remember to replace all calls tosds_free()
withfree()
.
- Save your file.
- Right-click the top-level folder for the project and clickClean Projectin the menu.
- Right-click the top-level folder for the project and clickBuild Projectin the menu.
Important:The build process can take approximately 5 to 10 minutes to complete.
- When the build completes, in the Project Explorer view, double-click to openRelease/_sds/reports/data_motion.html.
- The right-most column (Connection) shows the type of DMA assigned to each input/output array of the matrix multiplier (
AXIDMA_SG
= scatter gather DMA), and which Processing System 7 IP port is used (S_AXI_ACP
). You can also see on the Accelerator Call sites table whether the allocation of the memory that is used on each transfer is contiguous or paged.
- Undo all the changes made in step 2 and save the file.