axi
axi copied to clipboard
Replace assignments between AXI structs with calls to macros
Assignments between two struct variables, in the style of
assign req_a = req_b;
// or
always_comb begin
req_a = req_b;
end
are problematic when the struct types of the two variables are defined differently: Because both sides of such an assignment are simply seen as a packed vector, the individual fields are not assigned correctly in this case. For request and response structs, this even includes handshaking signals, which might mess up the protocol.
While our modules are not designed for having structs with different widths at their slave and master ports (unless they are converting widths, of course), we should safeguard against such problems by always using macros to assign or set one struct to another.