sail-riscv icon indicating copy to clipboard operation
sail-riscv copied to clipboard

Store Conditional can retire successfully even if atomics are disabled

Open Timmmm opened this issue 1 year ago • 0 comments

/* NOTE: Currently, we only EA if address translation is successful. This may need revisiting. */
function clause execute (STORECON(aq, rl, rs2, rs1, width, rd)) = {
  if speculate_conditional () == false then {
    /* should only happen in rmem
     * rmem: allow SC to fail very early
     */
    X(rd) = zero_extend(0b1); RETIRE_SUCCESS
  } else {
    if haveAtomics() then {
      /* normal non-rmem case
       * rmem: SC is allowed to succeed (but might fail later)
       */

Surely speculate_conditional() should be inside if haveAtomics()?

Timmmm avatar Feb 29 '24 08:02 Timmmm