-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dmac_flock: Test AXI DMAC Framelock feature
Verify the framelock when the writer is faster than the reader and vice-versa. Test with delay and in AutoRun mode. Signed-off-by: Jorge Marques <[email protected]>
- Loading branch information
Showing
18 changed files
with
1,802 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
#################################################################################### | ||
#################################################################################### | ||
## Copyright (C) 2024 Analog Devices, Inc. | ||
#################################################################################### | ||
#################################################################################### | ||
|
||
# All test-bench dependencies except test programs | ||
SV_DEPS += ../../../library/utilities/utils.svh | ||
SV_DEPS += ../../../library/drivers/dmac/dma_trans.sv | ||
SV_DEPS += ../../../library/utilities/logger_pkg.sv | ||
SV_DEPS += ../../../library/regmaps/reg_accessor.sv | ||
SV_DEPS += ../../../library/vip/amd/m_axis_sequencer.sv | ||
SV_DEPS += ../../../library/vip/amd/s_axis_sequencer.sv | ||
SV_DEPS += ../../../library/vip/amd/m_axi_sequencer.sv | ||
SV_DEPS += ../../../library/vip/amd/s_axi_sequencer.sv | ||
SV_DEPS += ../../../library/drivers/dmac/dmac_api.sv | ||
SV_DEPS += ../../../library/regmaps/adi_regmap_pkg.sv | ||
SV_DEPS += ../../../library/regmaps/adi_regmap_dmac_pkg.sv | ||
SV_DEPS += ../../../library/drivers/dmac/dma_trans.sv | ||
SV_DEPS += ../../../library/utilities/test_harness_env.sv | ||
SV_DEPS += ../../../library/regmaps/adi_peripheral_pkg.sv | ||
SV_DEPS += environment.sv | ||
SV_DEPS += scoreboard.sv | ||
SV_DEPS += system_tb.sv | ||
|
||
ENV_DEPS += system_project.tcl | ||
ENV_DEPS += system_bd.tcl | ||
ENV_DEPS +=../../../scripts/adi_sim.tcl | ||
ENV_DEPS +=../../../scripts/run_sim.tcl | ||
|
||
LIB_DEPS := axi_dmac | ||
SIM_LIB_DEPS := io_vip | ||
|
||
# default test program | ||
TP := test_program | ||
|
||
# config files should have the following format | ||
# cfg_<param1>_<param2>.tcl | ||
CFG_FILES := $(notdir $(wildcard cfgs/cfg*.tcl)) | ||
#$(warning $(CFG_FILES)) | ||
|
||
# List of tests and configuration combinations that has to be run | ||
# Format is: <configuration>:<test name> | ||
#TESTS := $(foreach cfg, $(basename $(CFG_FILES)), $(cfg):$(TP)) | ||
TESTS += cfg1:test_program | ||
TESTS += cfg2_fsync:test_program | ||
TESTS += cfg2_fsync:test_program_frame_delay | ||
TESTS += cfg3_fsync_autorun:test_program_frame_delay | ||
|
||
include ../../../scripts/project-sim.mk | ||
|
||
# usage : | ||
# | ||
# run specific test on a specific configuration in gui mode | ||
# make CFG=cfg2_fsync TST=test_program_frame_delay MODE=gui | ||
# | ||
# run all test from a configuration | ||
# make cfg1_mm2mm_default | ||
|
||
|
||
|
||
#################################################################################### | ||
#################################################################################### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
set MAX_NUM_FRAMES_WIDTH 4 | ||
set AUTORUN 0 | ||
set USE_EXT_SYNC 0 | ||
set TDATA_NUM_BYTES 8 | ||
|
||
set ad_project_params(M_DMA_CFG_MAX_NUM_FRAMES) $MAX_NUM_FRAMES_WIDTH | ||
set ad_project_params(M_DMA_CFG_AUTORUN) $AUTORUN | ||
set ad_project_params(S_DMA_CFG_AUTORUN) $AUTORUN | ||
set ad_project_params(M_DMA_CFG_USE_EXT_SYNC) $USE_EXT_SYNC | ||
set ad_project_params(S_DMA_CFG_USE_EXT_SYNC) $USE_EXT_SYNC | ||
set ad_project_params(SRC_AXIS_VIP_CFG_TDATA_NUM_BYTES) $TDATA_NUM_BYTES | ||
set ad_project_params(DST_AXIS_VIP_CFG_TDATA_NUM_BYTES) $TDATA_NUM_BYTES | ||
|
||
set m_dma_cfg [list \ | ||
DMA_TYPE_SRC 1 \ | ||
DMA_TYPE_DEST 0 \ | ||
DMA_2D_TRANSFER 1 \ | ||
SYNC_TRANSFER_START 0 \ | ||
AXIS_TUSER_SYNC 0 \ | ||
CYCLIC 1 \ | ||
FRAMELOCK 1 \ | ||
MAX_NUM_FRAMES_WIDTH $MAX_NUM_FRAMES_WIDTH \ | ||
USE_EXT_SYNC $USE_EXT_SYNC \ | ||
DMA_2D_TLAST_MODE 1 \ | ||
] | ||
|
||
set s_dma_cfg [list \ | ||
DMA_TYPE_SRC 0 \ | ||
DMA_TYPE_DEST 1 \ | ||
DMA_2D_TRANSFER 1 \ | ||
SYNC_TRANSFER_START 0 \ | ||
AXIS_TUSER_SYNC 0 \ | ||
CYCLIC 1 \ | ||
FRAMELOCK 1 \ | ||
MAX_NUM_FRAMES_WIDTH $MAX_NUM_FRAMES_WIDTH \ | ||
USE_EXT_SYNC $USE_EXT_SYNC \ | ||
DMA_2D_TLAST_MODE 1 \ | ||
] | ||
|
||
# VDMA config | ||
set vdma_cfg [list \ | ||
c_m_axis_mm2s_tdata_width {64} \ | ||
c_num_fstores {3} \ | ||
c_use_mm2s_fsync {0} \ | ||
c_use_s2mm_fsync {0} \ | ||
c_enable_vert_flip {0} \ | ||
c_mm2s_genlock_mode {3} \ | ||
c_s2mm_genlock_mode {2} \ | ||
c_mm2s_linebuffer_depth {8192} \ | ||
c_s2mm_linebuffer_depth {8192} \ | ||
] | ||
|
||
# SRC AXIS | ||
set src_axis_vip_cfg [list \ | ||
INTERFACE_MODE {MASTER} \ | ||
HAS_TLAST {1} \ | ||
TDATA_NUM_BYTES $TDATA_NUM_BYTES \ | ||
] | ||
|
||
# DST AXIS | ||
set dst_axis_vip_cfg [list \ | ||
INTERFACE_MODE {SLAVE} \ | ||
HAS_TLAST {1} \ | ||
TDATA_NUM_BYTES $TDATA_NUM_BYTES \ | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
set MAX_NUM_FRAMES_WIDTH 4 | ||
set AUTORUN 0 | ||
set M_USE_EXT_SYNC 0 | ||
set S_USE_EXT_SYNC 1 | ||
set TDATA_NUM_BYTES 8 | ||
|
||
set ad_project_params(M_DMA_CFG_MAX_NUM_FRAMES) $MAX_NUM_FRAMES_WIDTH | ||
set ad_project_params(M_DMA_CFG_AUTORUN) $AUTORUN | ||
set ad_project_params(S_DMA_CFG_AUTORUN) $AUTORUN | ||
set ad_project_params(M_DMA_CFG_USE_EXT_SYNC) $M_USE_EXT_SYNC | ||
set ad_project_params(S_DMA_CFG_USE_EXT_SYNC) $S_USE_EXT_SYNC | ||
set ad_project_params(SRC_AXIS_VIP_CFG_TDATA_NUM_BYTES) $TDATA_NUM_BYTES | ||
set ad_project_params(DST_AXIS_VIP_CFG_TDATA_NUM_BYTES) $TDATA_NUM_BYTES | ||
|
||
set m_dma_cfg [list \ | ||
DMA_TYPE_SRC 1 \ | ||
DMA_TYPE_DEST 0 \ | ||
DMA_2D_TRANSFER 1 \ | ||
SYNC_TRANSFER_START 0 \ | ||
AXIS_TUSER_SYNC 0 \ | ||
CYCLIC 1 \ | ||
FRAMELOCK 1 \ | ||
MAX_NUM_FRAMES_WIDTH $MAX_NUM_FRAMES_WIDTH \ | ||
USE_EXT_SYNC $M_USE_EXT_SYNC \ | ||
SYNC_TRANSFER_START 1 \ | ||
DMA_2D_TLAST_MODE 1 \ | ||
] | ||
|
||
set s_dma_cfg [list \ | ||
DMA_TYPE_SRC {0} \ | ||
DMA_TYPE_DEST {1} \ | ||
DMA_2D_TRANSFER 1 \ | ||
SYNC_TRANSFER_START 0 \ | ||
AXIS_TUSER_SYNC 0 \ | ||
CYCLIC 1 \ | ||
FRAMELOCK 1 \ | ||
MAX_NUM_FRAMES_WIDTH $MAX_NUM_FRAMES_WIDTH \ | ||
USE_EXT_SYNC $S_USE_EXT_SYNC \ | ||
DMA_2D_TLAST_MODE 1 \ | ||
] | ||
|
||
# VDMA config | ||
set vdma_cfg [list \ | ||
c_m_axis_mm2s_tdata_width {64} \ | ||
c_num_fstores {8} \ | ||
c_use_mm2s_fsync {1} \ | ||
c_use_s2mm_fsync {2} \ | ||
c_enable_vert_flip {0} \ | ||
c_mm2s_genlock_mode {1} \ | ||
c_s2mm_genlock_mode {0} \ | ||
] | ||
|
||
# SRC AXIS | ||
set src_axis_vip_cfg [list \ | ||
INTERFACE_MODE {MASTER} \ | ||
HAS_TLAST {1} \ | ||
TUSER_WIDTH {1} \ | ||
TDATA_NUM_BYTES $TDATA_NUM_BYTES \ | ||
] | ||
|
||
# DST AXIS | ||
set dst_axis_vip_cfg [list \ | ||
INTERFACE_MODE {SLAVE} \ | ||
HAS_TLAST {1} \ | ||
TDATA_NUM_BYTES $TDATA_NUM_BYTES \ | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
set MAX_NUM_FRAMES_WIDTH 4 | ||
set AUTORUN 1 | ||
set M_USE_EXT_SYNC 0 | ||
set S_USE_EXT_SYNC 1 | ||
set TDATA_NUM_BYTES 8 | ||
|
||
set ad_project_params(M_DMA_CFG_MAX_NUM_FRAMES) $MAX_NUM_FRAMES_WIDTH | ||
set ad_project_params(M_DMA_CFG_AUTORUN) $AUTORUN | ||
set ad_project_params(S_DMA_CFG_AUTORUN) $AUTORUN | ||
set ad_project_params(M_DMA_CFG_USE_EXT_SYNC) $M_USE_EXT_SYNC | ||
set ad_project_params(S_DMA_CFG_USE_EXT_SYNC) $S_USE_EXT_SYNC | ||
set ad_project_params(SRC_AXIS_VIP_CFG_TDATA_NUM_BYTES) $TDATA_NUM_BYTES | ||
set ad_project_params(DST_AXIS_VIP_CFG_TDATA_NUM_BYTES) $TDATA_NUM_BYTES | ||
|
||
set m_dma_cfg [list \ | ||
DMA_TYPE_SRC 1 \ | ||
DMA_TYPE_DEST 0 \ | ||
DMA_2D_TRANSFER 1 \ | ||
SYNC_TRANSFER_START 0 \ | ||
AXIS_TUSER_SYNC 0 \ | ||
CYCLIC 1 \ | ||
FRAMELOCK 1 \ | ||
MAX_NUM_FRAMES_WIDTH $MAX_NUM_FRAMES_WIDTH \ | ||
USE_EXT_SYNC $M_USE_EXT_SYNC \ | ||
SYNC_TRANSFER_START 1 \ | ||
DMA_2D_TLAST_MODE {1} \ | ||
\ | ||
AUTORUN $AUTORUN \ | ||
AUTORUN_FLAGS {0x13} \ | ||
AUTORUN_SRC_ADDR {0x00000000} \ | ||
AUTORUN_DEST_ADDR {0x00001000} \ | ||
AUTORUN_X_LENGTH {0x3FF} \ | ||
AUTORUN_Y_LENGTH {0x7} \ | ||
AUTORUN_SRC_STRIDE {0x000} \ | ||
AUTORUN_DEST_STRIDE {0x400} \ | ||
AUTORUN_FRAMELOCK_CONFIG {0x00303} \ | ||
AUTORUN_FRAMELOCK_STRIDE {0x2000} \ | ||
] | ||
|
||
set s_dma_cfg [list \ | ||
DMA_TYPE_SRC {0} \ | ||
DMA_TYPE_DEST {1} \ | ||
DMA_2D_TRANSFER 1 \ | ||
SYNC_TRANSFER_START 0 \ | ||
AXIS_TUSER_SYNC 0 \ | ||
CYCLIC 1 \ | ||
FRAMELOCK 1 \ | ||
MAX_NUM_FRAMES_WIDTH $MAX_NUM_FRAMES_WIDTH \ | ||
USE_EXT_SYNC $S_USE_EXT_SYNC \ | ||
DMA_2D_TLAST_MODE {1} \ | ||
\ | ||
AUTORUN $AUTORUN \ | ||
AUTORUN_FLAGS {0x13} \ | ||
AUTORUN_SRC_ADDR {0x00001000} \ | ||
AUTORUN_DEST_ADDR {0x00000000} \ | ||
AUTORUN_X_LENGTH {0x3FF} \ | ||
AUTORUN_Y_LENGTH {0x7} \ | ||
AUTORUN_SRC_STRIDE {0x000} \ | ||
AUTORUN_DEST_STRIDE {0x400} \ | ||
AUTORUN_FRAMELOCK_CONFIG {0x00303} \ | ||
AUTORUN_FRAMELOCK_STRIDE {0x2000} \ | ||
] | ||
|
||
|
||
# VDMA config | ||
set vdma_cfg [list \ | ||
c_m_axis_mm2s_tdata_width {64} \ | ||
c_num_fstores {8} \ | ||
c_use_mm2s_fsync {1} \ | ||
c_use_s2mm_fsync {2} \ | ||
c_enable_vert_flip {0} \ | ||
c_mm2s_genlock_mode {1} \ | ||
c_s2mm_genlock_mode {0} \ | ||
] | ||
|
||
# SRC AXIS | ||
set src_axis_vip_cfg [list \ | ||
INTERFACE_MODE {MASTER} \ | ||
HAS_TLAST {1} \ | ||
TUSER_WIDTH {1} \ | ||
TDATA_NUM_BYTES $TDATA_NUM_BYTES \ | ||
] | ||
|
||
# DST AXIS | ||
set dst_axis_vip_cfg [list \ | ||
INTERFACE_MODE {SLAVE} \ | ||
HAS_TLAST {1} \ | ||
TDATA_NUM_BYTES $TDATA_NUM_BYTES \ | ||
] |
Oops, something went wrong.