I handle the tags and timeout functionality centrally: All blocks/entities that can issue non-posted (read) requests have to ask for a tag from my tag management block.
Upon issuing a non-posted request, the tag management block remembers (roughly) when you issued the request, and every now and then – i.e. with low priority – I check the table for requests that timed out. In my tables, I store two bits per pending request:
00 → Issued between 0 and 12.5 ms,
01 → Issued between 12.5 and 25 ms,
10 → Issued between 25 and 37.5 ms,
11 → Issued between 37.5 and 50 ms.
Say, you have a request issued with timeout group “10”, you would drop it in the next round when the current timeout counter is at “01”. This means that the request is at least more than 25 ms old and at most less than 50 ms.
The blocks that issue read requests surely read the AST RX port to see read data completions, but with respect to the timeout functionality, they now need a separate port that receives timeout events of such requests.
A different approach might be beneficial if the blocks that issue read requests handle the used tags on their own, like done for handling the descriptor table in the SGDMA example which uses a specific, constant reserved tag for all non-posted requests. In this case, all the tag management is handled in a distributed manner, so one could have a central trigger that goes high once per 12.5 milliseconds, and each block could simply count these ticks and drop the request when it has received three such strike ticks.
This was the technical way of detecting and distributing a timeout event properly. The second step is to design your application in such a way that these timeout events can be handled gracefully in terms of your application, like re-issuing the requests, indicating errors or just dropping higher-level transactions. This is very application-dependent, and sometimes it’s the harder part to design properly, e.g. flushing a queue that already received part of the full read request response when a timeout is detected.
– Matthias