I have a doubt regarding the AXI3/4 protocol. Assume a hypothetical scenario where a single master issues a valid Read and Write transaction to the same address simultaneously.
-
From the AXI specification, I understand that there is no interdependence between reads and writes and each has a channel of its own. With this in mind, is the above scenario valid?
-
In case the above scenario is valid, is there a specific order in which these requests are served? (so that there is determinism in the type of response to expect from the master, since there are two ways this could end)
I am aware that (2) can depend on a lot of factors related to the master (posted writes, wait for response read, instruction execution for read after write etc.) and that AXI offers semaphore mechanisms through Exclusive Accesses. But these aside, what should be the expected behaviour?
Best Answer
If the transaction is indicated as "non-modifiable," and both the Read and Write commands use the same ARID/AWID, the order must be preserved. This doesn't cover the case of simultaneous Read and Write commands, which is certainly possible for AXI.
Here's some additional info I found in section A4.3.2 of the AXI Spec (ARM document IHI 0022F.b). My answer is an interpretation of this excerpt:
If both transactions arrive at the AXI slave simultaneously, the behavior depends on the slave. For a dual-port RAM, you could conceivably read while writing to the same address. The Read result would then depend on the dual-port RAM controller. For something like DDR3 which can't have simultaneous R/W, the ordering behavior depends on the R/W priority in the controller, again.
Later in section A6.1, this is confirmed even more explicitly: