Minres / SystemC-Components

A SystemC productivity library: https://minres.github.io/SystemC-Components/
https://www.minres.com/#opensource
Apache License 2.0
81 stars 21 forks source link

w_strb incorrect read #37

Closed mslijepc closed 1 year ago

mslijepc commented 1 year ago

Hi,

I think there is a bug in this part of the code

https://github.com/Minres/SystemC-Components/blob/e2dea44610e04bc4f7189ce9aacc424f4d15e011/src/bus_interfaces/axi/pin/axi4_target.h#L392

strb[i] is checked only in the lowest part of the strb signal. It can be the case that strb is active on the upper parts of the signal.

e.g.

size = 8
w_strb = 0xFF00 
eyck commented 1 year ago

Indeed it does not take the offset within a beat into account

mslijepc commented 1 year ago

Either that, or just set the beginning of copy as the first non-zero strb signal (blindly following the spec)