Decode: Fix capability width mode-dependent LR/SC

All of St, Amo, Lr and Sc use the normal 3-bit encoding for the width;
rather than add Lr and Sc to the list, switch it just to exclude Ld as
the special case that's handled by the other half of the expression.

Previously LR.C and SC.C were decoded as LR.BU and SC.BU.
This commit is contained in:
Jessica Clarke
2021-10-27 15:44:23 +01:00
committed by GitHub
parent 1930025e1f
commit fb1a629e07

View File

@@ -92,7 +92,7 @@ function Maybe#(MemInst) decodeMemInst(Instruction inst, Bool cap_mode);
illegalInst = True;
end
Bool capWidth = ((mem_func == St || mem_func == Amo) && funct3 == f3_SQ)
Bool capWidth = (mem_func != Ld && funct3 == f3_SQ)
|| (opcode == opcMiscMem && funct3 == f3_LQ);
if (capWidth && amo_func != None && amo_func != Swap) begin