fix(Fence): upper two bits of VMID must be zero in hardware#5788
fix(Fence): upper two bits of VMID must be zero in hardware#5788good-circle wants to merge 1 commit intokunminghu-v2from
Conversation
a2daf19 to
f54ea04
Compare
f54ea04 to
21c90f0
Compare
fuhuakai
left a comment
There was a problem hiding this comment.
The direction of this fix is correct, but it introduces new timing issues. sfence.bits.id is sampled in the same cycle as io.in.fire via RegEnable, but useVmid comes from the registered func, which is the type of the previous uop rather than the type of the current input instruction, causing a timing misalignment.
Let's assume that at cycle t-1, io.in.bits is a hfence_g instruction, while at cycle t, io.in.bits is not a hfence_g instruction. In this case, useVmid will be incorrectly set to 1 at cycle t, causing sfence.bits.id to erroneously use fenceVmid (when it should actually be fenceAsid).
A very simple fix is to change:
val useVmid = func === FenceOpType.hfence_g
to
val useVmid = io.in.bits.ctrl.fuOpType === FenceOpType.hfence_g
21c90f0 to
d565ef7
Compare
d565ef7 to
7e5694a
Compare
No description provided.