Skip to content

Commit d893fc2

Browse files
committed
Fix AXI4 write strobe handling and optimize byte enable
Commit 4a6c2aa introduced a bug in write strobe handling. This change: - Reverts to the original correct strobe implementation - Disables byte_enable_len when not needed for better efficiency
1 parent 7385e60 commit d893fc2

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/interfaces/axi/pin/axi4_target.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -431,10 +431,14 @@ template <typename CFG> inline void axi::pin::axi4_target<CFG>::wdata_t() {
431431
// TODO: assuming consecutive write (not scattered)
432432
auto strobe = strb.to_uint();
433433
if(last) {
434-
auto act_data_len = CFG::IS_LITE ? util::bit_count(strobe) : fsm_hndl->aux.i32.i0;
434+
auto act_data_len = CFG::IS_LITE ? util::bit_count(strobe) : (beat_count + 1) * size;
435435
gp->set_data_length(act_data_len);
436-
gp->set_byte_enable_length(act_data_len);
437436
gp->set_streaming_width(act_data_len);
437+
if (fsm_hndl->aux.i32.i0 == act_data_len) {
438+
gp->set_byte_enable_length(0);
439+
} else {
440+
gp->set_byte_enable_length(act_data_len);
441+
}
438442
}
439443
auto tp = CFG::IS_LITE || this->w_last->read() ? axi::fsm::protocol_time_point_e::BegReqE
440444
: axi::fsm::protocol_time_point_e::BegPartReqE;

0 commit comments

Comments
 (0)