anchor.diff:              Vector#(LdStQSize, Integer) idxVec = genVector;
               joinActions(map(correctSpec, idxVec));
               // clear spec bits for issueQ and killQ
  -            issueQ.specUpdate.correctSpeculation(mask);
  -            killQ.specUpdate.correctSpeculation(mask);
  +            issueLdQ.specUpdate.correctSpeculation(mask);
  +            killByLdStQ.specUpdate.correctSpeculation(mask);
  +`ifdef TSO_MM
  +            killByCacheQ.specUpdate.correctSpeculation(mask);
  +`endif
           endmethod
   
  -        method Action incorrectSpeculation(SpecTag st);
  +        method Action incorrectSpeculation(SpecTag specTag);
               // idx vec
  -            Vector#(LdStQSize, LdStQTag) idxVec = genWith(fromInteger);
  -
  -            // clear wrong path LSQ entries & set wrong path load filter
  -            function Action incorrectSpec(LdStQTag i);
  +
  +            // clear wrong path LQ entries & set wrong path load filter. NOTE
  +            // that olderSt and olderStVerified fields are not affected by the
  +            // kill
  +            function Action killLdQ(LdQTag i);
               action
  -                if(specBits[i][sb_wrongSpec_port][st] == 1) begin
  -                    valid[i][valid_wrongSpec_port] <= False;
  +                if(ld_specBits_wrongSpec[i][specTag] == 1) begin
  +                    ld_valid_wrongSpec[i] <= False;
                       // set wrong path load resp filter
  -                    if(valid[i][valid_wrongSpec_port] && state[i][state_wrongSpec_port] == Executing) begin
  -                        waitWPResp[i] <= True;
  -                        doAssert(memInst[i].mem_func == Ld, "only load resp can be wrong path");
  +                    if (ld_valid_wrongSpec[i] &&
  +                        ld_executing_wrongSpec[i] &&
  +                        !ld_done_wrongSpec[i]) begin
  +                        ld_waitWPResp_wrongSpec[i] <= True;
  +                        doAssert(memInst[i].mem_func == Ld,
  +                                 "only load resp can be wrong path");
                       end
                   end
               endaction
               endfunction
  -            joinActions(map(incorrectSpec, idxVec));
  +            Vector#(LdQSize, LdQTag) ldIdxVec = genWith(fromInteger);
  +            joinActions(map(killLdQ, ldIdxVec));
  +
  +            // clear wrong path SQ entries
  +            function Action killStQ(StQTag i);
  +                if(st_specBits_wrongSpec[i][specTag] == 1) begin
  +                    st_valid_wrongSpec[i] <= False;
  +                end
  +            endfunction
  +            Vector#(StQSize, StQTag) stIdxVec = genWith(fromInteger);
  +            joinActions(map(killStQ, stIdxVec));
   
               // kill entries in issueQ and killQ
  -            issueQ.specUpdate.incorrectSpeculation(st);
  -            killQ.specUpdate.incorrectSpeculation(st);
  -
  -            // change enqP: make valid entries always consecutive
  -            // search for the oldest **VALID** entry being killed
  -            function Bool killValid(LdStQTag i);
  -                return valid[i][valid_wrongSpec_port] && specBits[i][sb_wrongSpec_port][st] == 1;
  +            issueLdQ.specUpdate.incorrectSpeculation(st);
  +            killByLdStQ.specUpdate.incorrectSpeculation(st);
  +`ifdef TSO_MM
  +            killByCacheQ.specUpdate.incorrectSpeculation(st);
  +`endif
  +
  +            // change enqP: make valid entries always consecutive: new enqP is
  +            // the oldest **VALID** entry that gets killed. If such entry does
  +            // not exists, then enqP remains the same.
  +            // LdQ enqP
  +            function Bool isValidLdKilled(LdQTag i);
  +                return ld_valid_wrongSpec[i] &&
  +                       ld_specBits_wrongSpec[i][specTag] == 1;
               endfunction
  -            Vector#(LdStQSize, Bool) isKillValid = map(killValid, idxVec);
  -            // start finding the oldest valid entry being killed
  -            Maybe#(LdStQTag) killTag; 
  -`ifdef LSQ_VTAG
  -            // use virtual tag: find the oldest (note that we search for valid entry)
  -            killTag = findOldest(isKillValid);
  -`else
  -            // normal search, do two rounds
  -            // first search smallest tag among entries >= deqP
  -            LdStQTag curDeqP = deqP[deqP_wrongSpec_port];
  -            function Bool killValidFirst(LdStQTag i);
  -                return i >= curDeqP && isKillValid[i];
  +            Vector#(LdQSize, Bool) killedValidLds = map(isValidLdKilled,
  +                                                        ldIdxVec);
  +            if(findOldestLd(killValidLds) matches tagged Valid .t) begin
  +                ld_enqP <= t;
  +            end
  +            // StQ enqP
  +            function Bool isValidStKilled(StQTag i);
  +                return st_valid_wrongSpec[i] &&
  +                       st_specBits_wrongSpec[i][specTag] == 1;
               endfunction
  -            Maybe#(LdStQTag) killFirst = find(killValidFirst, idxVec);
  -            // next search smallest tag among all entries
  -            function Bool killValidNext(LdStQTag i) = isKillValid[i];
  -            Maybe#(LdStQTag) killNext = find(killValidNext, idxVec);
  -            // merge
  -            killTag = isValid(killFirst) ? killFirst : killNext;
  -`endif
  -            // new enqP should be the oldest killing entry, otherwise remain the same (no entry killed)
  -            if(killTag matches tagged Valid .t) begin
  -                enqP <= t;
  +            Vector#(StQSize, Bool) killedValidSts = map(isValidStKilled,
  +                                                        stIdxVec);
  +            StQTag new_st_enqP = st_enqP;
  +            if(findOldestSt(killValidSts) matches tagged Valid .t) begin
  +                new_st_enqP = t;
  +            end
  +            st_enqP <= new_st_enqP;
  +
  +            // change SQ verifyP: new verifyP is the oldest entry that is
  +            // neither killed nor verified. If such entry does not exists, then
  +            // verifyP should be the same as new enqP.
  +            function Bool unkilledUnverified(StQTag i);
  +                return st_valid_wrongSpec[i] &&
  +                       st_specBits_wrongSpec[i][specTag] != 1 &&
  +                       !st_verified_wrongSpec[i];
  +            endfunction
  +            Vector#(StQSize, Bool) unverifiedSts = map(unkilledUnverified,
  +                                                       stIdxVec);
  +            if(findOldestSt(unverifiedSts) matches tagged Valid .t) begin
  +                st_verifyP_wrongSpec <= t;
  +            end
  +            else begin
  +                st_verifyP_wrongSpec <= new_st_enqP;
               end
   
               // make conflict with others
  
positive.code:             ld_valid_getKill[tag] &&
              ld_computed_getKill[tag] &&
              ld_killed_getKill[tag] &&
              (ld_executing_getKill[tag] || ld_done_getKill[tag]) &&
              ld_memFunc[tag] == Ld,
              "killed load must be valid, computed, killed and done/executing"
          );
          return LSQKillLdInfo {
              instTag: ld_instTag[tag],
              specTag: ld_specTag_getKill[tag]
          };
      endmethod
  
      method ActionValue#(LSQRespLdResult) respLd(LdQTag t, Data alignedData);
          let res = LSQRespLdResult {
  
negative.code:             wrongSpec_update_conflict.wset(?);
              wrongSpec_issue_conflict.wset(?);
              wrongSpec_respLd_conflict.wset(?);
              wrongSpec_deqLd_conflict.wset(?);
              wrongSpec_deqSt_conflict.wset(?);
              wrongSpec_verify_conflict.wset(?);
              wrongSpec_cacheEvict_conflict.wset(?);
              wrongSpec_wakeBySB_conflict.wset(?);
          endmethod
      endinterface
  