Skip to content

Commit 9cdcb70

Browse files
committed
into JingJerYen-main
1 parent 95f6f72 commit 9cdcb70

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/interfaces/axi/pin/axi4_target.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -437,10 +437,12 @@ template <typename CFG> inline void axi::pin::axi4_target<CFG>::wdata_t() {
437437
// TODO: assuming consecutive write (not scattered)
438438
auto strobe = strb.to_uint();
439439
if(last) {
440-
auto act_data_len = CFG::IS_LITE ? util::bit_count(strobe) : (beat_count + 1) * size;
440+
// If it is axi lite, number of strobes define the size, for axi4 aligned accesses, axsize & axburst determine size,
441+
// for unaligned accesses strobe count determines size
442+
auto act_data_len = CFG::IS_LITE ? util::bit_count(strobe) : offset == 0 ? (beat_count + 1) * size : fsm_hndl->aux.i32.i0;
441443
gp->set_data_length(act_data_len);
442444
gp->set_streaming_width(act_data_len);
443-
if (fsm_hndl->aux.i32.i0 == act_data_len) {
445+
if(fsm_hndl->aux.i32.i0 == act_data_len) {
444446
gp->set_byte_enable_length(0);
445447
} else {
446448
gp->set_byte_enable_length(act_data_len);

0 commit comments

Comments
 (0)