CAC 2018-02-20

XSF review

I believe that the tst880 regression is caused be XSF being set too soon. The test sequence is a 'call6 pr1|0' that does a directed fault 1 when fetching the operand at
pr1|0'. The fault handler patches up the DF1 and sets the PSR in the CU save data to 6. On restart after the fault, the XSF flag is set, which results in the APU not recalculating the TSR; this causes the ring alarm not to fire and the test failing.

set:
  doAppendCycle ()
    // Sheet 1: "START APPEND"
    if (i->b29)
      cpu.cu.XSF = 1;

  doComputedAddressFormation()
    RI_MOD:
       do_ITS_ITP ();
         cpu.cu.XSF = 1;
    IR_MOD:
       do_ITS_ITP ();
         cpu.cu.XSF = 1;

  set_temporary_absolute_mode()
    cpu.cu.XSF = false;

            case FETCH_cycle:
             if not XEX or RPx
               cpu.cu.XSF = 0;

clear:

test:

  doAppendCycle ()
    // Sheet 1: "START APPEND"
    if (lastCycle == INDIRECT_WORD_FETCH || cpu.cu.XSF)
      goto A;
    if (thisCycle == RTCD_OPERAND_FETCH &&
        get_addr_mode() == ABSOLUTE_mode &&
        ! cpu.cu.XSF /*get_went_appending()*/)
      {
        cpu.TPR.TSR = 0;
    H:; // FANP
    if (thisCycle == RTCD_OPERAND_FETCH &&
        get_addr_mode () == ABSOLUTE_mode &&
        ! cpu.cu.XSF /*get_went_appending ()*/)
      {
        finalAddress = cpu.TPR.CA;
      }

            case EXEC_cycle:
            case FAULT_EXEC_cycle:
            case INTERRUPT_EXEC_cycle:
                if (ret == CONT_TRA)
                    if (cpu.cycle != EXEC_cycle) // fault or interrupt
                        if (!clear_temporary_absolute_mode ())
                            set_addr_mode (ABSOLUTE_mode);

  clear_temporary_absolute_mode()
    return cpu.cu.XSF;

  Read ()
  Read2 ()
  Read8 ()
  ReadPage ()
  Write()
  Write2()
  Write1()
  Write8()
  WritePage()
        if (cpu.cu.XSF ||
        (cyctyp == APU_DATA_READ && cpu.cu.TSN_VALID [0]))
      {
        goto B29;
      }

  ReadTraOp()
    Read (cpu.TPR.CA, &cpu.CY, OPERAND_READ);
    if (! (get_addr_mode () == APPEND_mode || cpu.cu.TSN_VALID [0] ||
           cpu.cu.XSF 

executeInstruction()
// not restart
    cpu.cu.XSF = 0;

/// executeInstruction: non-EIS operand processing
        if (ci->b29)   // if A bit set set-up TPR stuff ...
            if (!restart)
                cpu.cu.XSF = 1;
        else
                cpu.cu.XSF = 0;

doABSA()
    if (get_addr_mode () == ABSOLUTE_mode && ! cpu.cu.XSF) // ISOLTS-860

Not setting XSF in executeInstruction causes early boot fail; I suspect that the transition to append mode is failing; there is some piece of code that is checking XSF and should be looking at b29 instead.
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License