Skip to content

Commit

Permalink
V3: Update MAX_NUM_FRAMES to MAX_NUM_FRAMES_WIDTH
Browse files Browse the repository at this point in the history
To match requested changed from HDL review.

Signed-off-by: Jorge Marques <[email protected]>
  • Loading branch information
gastmaier committed Nov 5, 2024
1 parent e11aa04 commit d394c0a
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 29 deletions.
4 changes: 2 additions & 2 deletions library/drivers/dmac/dma_trans.sv
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ package dma_trans_pkg;
int DMA_LENGTH_ALIGN;
int MAX_BYTES_PER_BURST;
int FRAMELOCK;
int MAX_NUM_FRAMES;
int MAX_NUM_FRAMES_WIDTH;
int USE_EXT_SYNC;
int HAS_AUTORUN;
} axi_dmac_params_t;
Expand Down Expand Up @@ -430,7 +430,7 @@ package dma_trans_pkg;
ds.flock_wait_writer = flock_wait_writer;
endfunction

constraint c_buf_num {flock_framenum < p.MAX_NUM_FRAMES;};
constraint c_buf_num {flock_framenum < (p.MAX_NUM_FRAMES_WIDTH-1)**2;};
constraint c_frm_dist {flock_distance < flock_framenum;};

virtual function void print();
Expand Down
4 changes: 2 additions & 2 deletions library/drivers/dmac/dmac_api.sv
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ package dmac_api_pkg;
bpb_width_log2 = `GET_DMAC_INTERFACE_DESCRIPTION_1_BYTES_PER_BURST_WIDTH(val);
p.MAX_BYTES_PER_BURST = 2**bpb_width_log2;
p.DMA_2D_TLAST_MODE = `GET_DMAC_INTERFACE_DESCRIPTION_1_DMA_2D_TLAST_MODE(val);
p.MAX_NUM_FRAMES = `GET_DMAC_INTERFACE_DESCRIPTION_1_MAX_NUM_FRAMES(val);
p.MAX_NUM_FRAMES_WIDTH = $clog2(`GET_DMAC_INTERFACE_DESCRIPTION_1_MAX_NUM_FRAMES(val))+1;
p.USE_EXT_SYNC = `GET_DMAC_INTERFACE_DESCRIPTION_1_USE_EXT_SYNC(val);
p.HAS_AUTORUN = `GET_DMAC_INTERFACE_DESCRIPTION_1_HAS_AUTORUN(val);
if (!p.HAS_AUTORUN) begin
Expand Down Expand Up @@ -344,7 +344,7 @@ package dmac_api_pkg;
`SET_DMAC_FRAMELOCK_CONFIG_MODE(t_fl_2d.flock_mode) |
`SET_DMAC_FRAMELOCK_CONFIG_WAIT_WRITER(t_fl_2d.flock_wait_writer ) |
`SET_DMAC_FRAMELOCK_CONFIG_FRAMENUM(t_fl_2d.flock_framenum) |
`SET_DMAC_FRAMELOCK_CONFIG_DISTANCE(t_fl_2d.flock_distance-1));
`SET_DMAC_FRAMELOCK_CONFIG_DISTANCE(t_fl_2d.flock_distance));
this.axi_write(GetAddrs(DMAC_FRAMELOCK_STRIDE),
`SET_DMAC_FRAMELOCK_STRIDE_STRIDE(t_fl_2d.flock_stride));
end
Expand Down
2 changes: 1 addition & 1 deletion library/utilities/utils.svh
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
th``_``vip``_0_DISABLE_DEBUG_REGISTERS, \
th``_``vip``_0_ENABLE_DIAGNOSTICS_IF, \
th``_``vip``_0_ENABLE_FRAME_LOCK, \
th``_``vip``_0_MAX_NUM_FRAMES, \
th``_``vip``_0_MAX_NUM_FRAMES_WIDTH, \
th``_``vip``_0_USE_EXT_SYNC, \
th``_``vip``_0_HAS_AUTORUN

Expand Down
8 changes: 4 additions & 4 deletions testbenches/ip/dma_flock/cfgs/cfg1.tcl
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
set MAX_NUM_FRAMES 8
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
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
Expand All @@ -19,7 +19,7 @@ set m_dma_cfg [list \
AXIS_TUSER_SYNC 0 \
CYCLIC 1 \
FRAMELOCK 1 \
MAX_NUM_FRAMES $MAX_NUM_FRAMES \
MAX_NUM_FRAMES_WIDTH $MAX_NUM_FRAMES_WIDTH \
USE_EXT_SYNC $USE_EXT_SYNC \
DMA_2D_TLAST_MODE 1 \
]
Expand All @@ -32,7 +32,7 @@ set s_dma_cfg [list \
AXIS_TUSER_SYNC 0 \
CYCLIC 1 \
FRAMELOCK 1 \
MAX_NUM_FRAMES $MAX_NUM_FRAMES \
MAX_NUM_FRAMES_WIDTH $MAX_NUM_FRAMES_WIDTH \
USE_EXT_SYNC $USE_EXT_SYNC \
DMA_2D_TLAST_MODE 1 \
]
Expand Down
8 changes: 4 additions & 4 deletions testbenches/ip/dma_flock/cfgs/cfg2_fsync.tcl
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
set MAX_NUM_FRAMES 8
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
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
Expand All @@ -20,7 +20,7 @@ set m_dma_cfg [list \
AXIS_TUSER_SYNC 0 \
CYCLIC 1 \
FRAMELOCK 1 \
MAX_NUM_FRAMES $MAX_NUM_FRAMES \
MAX_NUM_FRAMES_WIDTH $MAX_NUM_FRAMES_WIDTH \
USE_EXT_SYNC $M_USE_EXT_SYNC \
SYNC_TRANSFER_START 1 \
DMA_2D_TLAST_MODE 1 \
Expand All @@ -34,7 +34,7 @@ set s_dma_cfg [list \
AXIS_TUSER_SYNC 0 \
CYCLIC 1 \
FRAMELOCK 1 \
MAX_NUM_FRAMES $MAX_NUM_FRAMES \
MAX_NUM_FRAMES_WIDTH $MAX_NUM_FRAMES_WIDTH \
USE_EXT_SYNC $S_USE_EXT_SYNC \
DMA_2D_TLAST_MODE 1 \
]
Expand Down
8 changes: 4 additions & 4 deletions testbenches/ip/dma_flock/cfgs/cfg3_fsync_autorun.tcl
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
set MAX_NUM_FRAMES 8
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
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
Expand All @@ -20,7 +20,7 @@ set m_dma_cfg [list \
AXIS_TUSER_SYNC 0 \
CYCLIC 1 \
FRAMELOCK 1 \
MAX_NUM_FRAMES $MAX_NUM_FRAMES \
MAX_NUM_FRAMES_WIDTH $MAX_NUM_FRAMES_WIDTH \
USE_EXT_SYNC $M_USE_EXT_SYNC \
SYNC_TRANSFER_START 1 \
DMA_2D_TLAST_MODE {1} \
Expand All @@ -45,7 +45,7 @@ set s_dma_cfg [list \
AXIS_TUSER_SYNC 0 \
CYCLIC 1 \
FRAMELOCK 1 \
MAX_NUM_FRAMES $MAX_NUM_FRAMES \
MAX_NUM_FRAMES_WIDTH $MAX_NUM_FRAMES_WIDTH \
USE_EXT_SYNC $S_USE_EXT_SYNC \
DMA_2D_TLAST_MODE {1} \
\
Expand Down
8 changes: 3 additions & 5 deletions testbenches/ip/dma_flock/tests/test_program.sv
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ program test_program;
dmac_api s_dmac_api;

int frame_count;
int max_frames;
int has_sfsync;
int has_dfsync;
int sync_gen_en;
Expand All @@ -71,7 +70,6 @@ program test_program;

#2ps;

max_frames = `M_DMA_CFG_MAX_NUM_FRAMES;
has_sfsync = `M_DMA_CFG_USE_EXT_SYNC;
has_dfsync = `S_DMA_CFG_USE_EXT_SYNC;

Expand All @@ -93,7 +91,7 @@ program test_program;
singleTest(
.frame_num(10),
.flock_framenum(3),
.flock_distance(1),
.flock_distance(0),
.src_clk(250000000),
.dst_clk(250000000)
);
Expand All @@ -102,7 +100,7 @@ program test_program;
singleTest(
.frame_num(5),
.flock_framenum(3),
.flock_distance(1),
.flock_distance(0),
.src_clk( 50000000),
.dst_clk(250000000)
);
Expand All @@ -111,7 +109,7 @@ program test_program;
singleTest(
.frame_num(10),
.flock_framenum(3),
.flock_distance(1),
.flock_distance(0),
.src_clk(250000000),
.dst_clk( 50000000)
);
Expand Down
12 changes: 5 additions & 7 deletions testbenches/ip/dma_flock/tests/test_program_frame_delay.sv
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ program test_program_frame_delay;
dmac_api s_dmac_api;

int frame_count;
int max_frames;
int has_sfsync;
int has_dfsync;
int has_s_autorun;
Expand All @@ -73,7 +72,6 @@ program test_program_frame_delay;

#2ps;

max_frames = `M_DMA_CFG_MAX_NUM_FRAMES;
has_sfsync = `M_DMA_CFG_USE_EXT_SYNC;
has_dfsync = `S_DMA_CFG_USE_EXT_SYNC;
has_m_autorun = `M_DMA_CFG_AUTORUN;
Expand Down Expand Up @@ -101,23 +99,23 @@ program test_program_frame_delay;
singleTest(
.frame_num(10),
.flock_framenum(3),
.flock_distance(1),
.flock_distance(0),
.src_clk(250000000),
.dst_clk(250000000)
);

singleTest(
.frame_num(10),
.flock_framenum(5),
.flock_distance(3),
.flock_framenum(3),
.flock_distance(0),
.src_clk(250000000),
.dst_clk(250000000)
);

singleTest(
.frame_num(10),
.flock_framenum(8),
.flock_distance(7),
.flock_framenum(3),
.flock_distance(0),
.src_clk(250000000),
.dst_clk(250000000)
);
Expand Down

0 comments on commit d394c0a

Please sign in to comment.