for ( byte_index = 0; byte_index <= (C_S_AXI_DATA_WIDTH/8)-1; byte_index = byte_index+1 )
if ( S_AXI_WSTRB[byte_index] == 1 ) begin
// Respective byte enables are asserted as per write strobes
// Slave register 0
slv_reg0[(byte_index*8) +: 8] <= S_AXI_WDATA[(byte_index*8) +: 8];
end
AXI Slave中接收数据端官方代码:
其中(byte_index*8) +: 8解释:
如果byte_index = 0,那么以上可计算为0*8+:8 = 0+:8 , A+:B的意思是A向上增加B位,0+:8代表[7:0] 数据段