Purpose of Map Table Remap Handling

25 views
Skip to first unread message

Amund Kvalsvik

unread,
Jul 18, 2023, 6:58:17 AM7/18/23
to riscv-boom
Hello,

Perhaps there is something I am missing here, but part of the code in the maptable logic appears redundant. Specifically the handling of remap requests appears to be unecessary as the logic is duplicated elsewhere. The code in question:

for (i <- 0 until plWidth) {
    io.map_resps(i).prs1       := (0 until i).foldLeft(map_table(io.map_reqs(i).lrs1)) ((p,k) =>
      Mux(bypass.B && io.remap_reqs(k).valid && io.remap_reqs(k).ldst === io.map_reqs(i).lrs1, io.remap_reqs(k).pdst, p))

Specifically, this creates says that for k = 0 until i, where i goes from 0 until plWidth, check to see if a remap requests logical destination matches one of the source operands of this operation. However, the check only checks the i-1 inputs for remap requests, which is strange, as this comes from the previous cycle and all of them should be checked.

The reason why rename still works is because at the end of the ren1_uop, the register r_uop (the intermediary register step in the 2-cycle rename) receives input through
    r_uop := GetNewUopAndBrMask(BypassAllocations(next_uop, ren2_uops, ren2_alloc_reqs), io.brupdate)
This results in the incoming uop explicitly handling all dependencies from the second cycle renames that have not yet appeared in the map table, and therefore ensures remapping correctness.

My question is, have I misunderstood something or is this just an unfortunate case of leftover code?

Kind regards,
Amund

Jerry Zhao

unread,
Jul 18, 2023, 2:36:35 PM7/18/23
to Amund Kvalsvik, riscv-boom
You are right, that code does appear to be vestigial.
Note that the "bypass" parameter of the map table generator is disabled, so the first case in that Mux is never taken anyways.

-Jerry Zhao


--
You received this message because you are subscribed to the Google Groups "riscv-boom" group.
To unsubscribe from this group and stop receiving emails from it, send an email to riscv-boom+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/riscv-boom/3d2ffd1c-61c5-40ad-8540-a56cdefda04en%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages