chipyard icon indicating copy to clipboard operation
chipyard copied to clipboard

Chipyard TLFIFOFixer documentation confusion

Open DecodeTheEncoded opened this issue 4 years ago • 1 comments

The documentation of TLFIFOFixer is as below: TileLink managers that declare a FIFO domain must ensure that all requests to that domain from clients which have requested FIFO ordering see responses in order. However, they can only control the ordering of their own responses, and do not have control over how those responses interleave with responses from other managers in the same FIFO domain. Responsibility for ensuring FIFO order across managers goes to the TLFIFOFixer. IMHO, managers in the same FIFO domain means they share the same fifoid. I felt like this is wrong, the implmentation of TLFIFOFixer in rocketchip generator has the following locs:

      val stalls = edgeIn.client.clients.filter(c => c.requestFifo && c.sourceId.size > 1).map { c =>
        val a_sel = c.sourceId.contains(in.a.bits.source)
        val id    = RegEnable(a_id, in.a.fire() && a_sel && !a_notFIFO)
        val track = flight.slice(c.sourceId.start, c.sourceId.end)

        a_sel && a_first && track.reduce(_ || _) && (a_noDomain || id =/= a_id)
      }

Note the id =/= a_id part, for one specific client, if it sends two request to managers which share the same fifoid(id === a_id), the stalls signal could be false, the FIFOFixer believes that two downstream managers sharing same fifoid will return their response in FIFO order, consequently it doesn't have to handle that situation. However, the chipyard documentation implies the FIFOFixer is responsible for fifo order response of different managers sharing same fifoid.

I felt like there is a doc-code mismatch here. Can anyone clarify this if my understanding is right? @jerryz123 @terpstra @hcook

DecodeTheEncoded avatar Jun 16 '21 10:06 DecodeTheEncoded

Or do you make a hypothesis that each downstream receiving client has their own fifo identifier(not unique)? @jerryz123

DecodeTheEncoded avatar Jul 25 '21 03:07 DecodeTheEncoded