This source file includes following definitions.
- doAppendCycleABSA
 
   1 
   2 
   3 
   4 
   5 
   6 
   7 
   8 
   9 
  10 
  11 
  12 
  13 
  14 
  15 
  16 
  17 
  18 
  19 
  20 
  21 #undef thisCycle
  22 #define thisCycle ABSA_CYCLE
  23 word24 doAppendCycleABSA (word36 * data, uint nWords) {
     
  24   DCDstruct * i = & cpu.currentInstruction;
  25   DBGAPP ("doAppendCycleABSA(Entry) thisCycle=ABSA_CYCLE\n");
  26   DBGAPP ("doAppendCycleABSA(Entry) lastCycle=%s\n", str_pct (cpu.apu.lastCycle));
  27   DBGAPP ("doAppendCycleABSA(Entry) CA %06o\n", cpu.TPR.CA);
  28   DBGAPP ("doAppendCycleABSA(Entry) n=%2u\n", nWords);
  29   DBGAPP ("doAppendCycleABSA(Entry) PPR.PRR=%o PPR.PSR=%05o\n", cpu.PPR.PRR, cpu.PPR.PSR);
  30   DBGAPP ("doAppendCycleABSA(Entry) TPR.TRR=%o TPR.TSR=%05o\n", cpu.TPR.TRR, cpu.TPR.TSR);
  31 
  32   if (i->b29) {
  33     DBGAPP ("doAppendCycleABSA(Entry) isb29 PRNO %o\n", GET_PRN (IWB_IRODD));
  34   }
  35 
  36   bool nomatch = true;
  37   if (cpu.tweaks.enable_wam) {
  38     
  39     
  40     
  41     
  42     
  43     nomatch = ((i->opcode == 0232 || i->opcode == 0254 ||
  44                 i->opcode == 0154 || i->opcode == 0173) &&
  45                 i->opcodeX ) ||
  46               ((i->opcode == 0557 || i->opcode == 0257) &&
  47                 ! i->opcodeX);
  48   }
  49 
  50   processor_cycle_type lastCycle = cpu.apu.lastCycle;
  51   cpu.apu.lastCycle = ABSA_CYCLE;
  52 
  53   DBGAPP ("doAppendCycleABSA(Entry) XSF %o\n", cpu.cu.XSF);
  54 
  55   PNL (L68_ (cpu.apu.state = 0;))
  56 
  57   cpu.RSDWH_R1 = 0;
  58 
  59   cpu.acvFaults = 0;
  60 
  61 
  62 #define FMSG(x)
  63   FMSG (char * acvFaultsMsg = "<unknown>";)
  64 
  65   word24 finalAddress = (word24) -1;  
  66                                       
  67 
  68 
  69 
  70 
  71 
  72   PNL (cpu.APUMemAddr = cpu.TPR.CA;)
  73 
  74   DBGAPP ("doAppendCycleABSA(A)\n");
  75 
  76   
  77   if (nomatch || ! fetch_sdw_from_sdwam (cpu.TPR.TSR)) {
  78     
  79     DBGAPP ("doAppendCycleABSA(A):SDW for segment %05o not in SDWAM\n", cpu.TPR.TSR);
  80 
  81     DBGAPP ("doAppendCycleABSA(A):DSBR.U=%o\n", cpu.DSBR.U);
  82 
  83     if (cpu.DSBR.U == 0) {
  84       fetch_dsptw (cpu.TPR.TSR);
  85 
  86       if (! cpu.PTW0.DF)
  87         doFault (FAULT_DF0 + cpu.PTW0.FC, fst_zero, "doAppendCycleABSA(A): PTW0.F == 0");
  88 
  89       if (! cpu.PTW0.U)
  90         modify_dsptw (cpu.TPR.TSR);
  91 
  92       fetch_psdw (cpu.TPR.TSR);
  93     } else
  94       fetch_nsdw (cpu.TPR.TSR); 
  95 
  96     
  97     load_sdwam (cpu.TPR.TSR, nomatch);
  98   }
  99   DBGAPP ("doAppendCycleABSA(A) R1 %o R2 %o R3 %o E %o\n", cpu.SDW->R1, cpu.SDW->R2, cpu.SDW->R3, cpu.SDW->E);
 100 
 101   
 102   cpu.RSDWH_R1 = cpu.SDW->R1;
 103 
 104 
 105 
 106 
 107 
 108 
 109 
 110 
 111 
 112 
 113 
 114   DBGAPP ("doAppendCycleABSA(B)\n");
 115 
 116   
 117 
 118   
 119   if (! (cpu.SDW->R1 <= cpu.SDW->R2 && cpu.SDW->R2 <= cpu.SDW->R3)) {
 120     
 121     cpu.acvFaults |= ACV0;
 122     PNL (L68_ (cpu.apu.state |= apu_FLT;))
 123     FMSG (acvFaultsMsg = "acvFaults(B) C(SDW.R1) <= C(SDW.R2) <= " "C(SDW .R3)";)
 124   }
 125 
 126   
 127   
 128   
 129   
 130   
 131   
 132   if (lastCycle == RTCD_OPERAND_FETCH)
 133     sim_warn ("%s: lastCycle == RTCD_OPERAND_FETCH opcode %0#o\n", __func__, i->opcode);
 134 
 135   
 136   
 137   
 138 
 139   DBGAPP ("doAppendCycleABSA(B):!STR-OP\n");
 140 
 141   
 142   
 143   if (cpu.TPR.TRR > cpu.SDW->R2) {
 144     DBGAPP ("ACV3\n");
 145     DBGAPP ("doAppendCycleABSA(B) ACV3\n");
 146     
 147     cpu.acvFaults |= ACV3;
 148     PNL (L68_ (cpu.apu.state |= apu_FLT;))
 149     FMSG (acvFaultsMsg = "acvFaults(B) C(TPR.TRR) > C(SDW .R2)";)
 150   }
 151 
 152   if (cpu.SDW->R == 0) {
 153     
 154     cpu.TPR.TRR = cpu.PPR.PRR;
 155 
 156     
 157     if (cpu.PPR.PSR != cpu.TPR.TSR) {
 158       DBGAPP ("ACV4\n");
 159       DBGAPP ("doAppendCycleABSA(B) ACV4\n");
 160       
 161       cpu.acvFaults |= ACV4;
 162       PNL (L68_ (cpu.apu.state |= apu_FLT;))
 163       FMSG (acvFaultsMsg = "acvFaults(B) C(PPR.PSR) = C(TPR.TSR)";)
 164     
 165       
 166     }
 167   }
 168 
 169 
 170 
 171 
 172 
 173 
 174 
 175   DBGAPP ("doAppendCycleABSA(G)\n");
 176 
 177   
 178   if (((cpu.TPR.CA >> 4) & 037777) > cpu.SDW->BOUND) {
 179     DBGAPP ("ACV15\n");
 180     DBGAPP ("doAppendCycleABSA(G) ACV15\n");
 181     cpu.acvFaults |= ACV15;
 182     PNL (L68_ (cpu.apu.state |= apu_FLT;))
 183     FMSG (acvFaultsMsg = "acvFaults(G) C(TPR.CA)0,13 > SDW.BOUND";)
 184     DBGAPP ("acvFaults(G) C(TPR.CA)0,13 > SDW.BOUND\n"
 185             "   CA %06o CA>>4 & 037777 %06o SDW->BOUND %06o",
 186             cpu.TPR.CA, ((cpu.TPR.CA >> 4) & 037777), cpu.SDW->BOUND);
 187   }
 188 
 189   if (cpu.acvFaults) {
 190     DBGAPP ("doAppendCycleABSA(G) acvFaults\n");
 191     PNL (L68_ (cpu.apu.state |= apu_FLT;))
 192     
 193     doFault (FAULT_ACV, (_fault_subtype) {.fault_acv_subtype=cpu.acvFaults}, "ACV fault");
 194   }
 195 
 196   
 197   if (cpu.SDW->U)
 198     goto H; 
 199 
 200   
 201   
 202 
 203   DBGAPP ("doAppendCycleABSA(G) CA %06o\n", cpu.TPR.CA);
 204   if (nomatch || ! fetch_ptw_from_ptwam (cpu.SDW->POINTER, cpu.TPR.CA)) { 
 205     fetch_ptw (cpu.SDW, cpu.TPR.CA);
 206     loadPTWAM (cpu.SDW->POINTER, cpu.TPR.CA, nomatch); 
 207   }
 208 
 209   
 210   
 211   
 212   
 213   
 214   if (i->opcodeX && ((i->opcode & 0770)== 0200|| (i->opcode & 0770) == 0220 || (i->opcode & 0770)== 020|| (i->opcode & 0770) == 0300)) {
 215     do_ptw2 (cpu.SDW, cpu.TPR.CA);
 216   }
 217   goto I;
 218 
 219 
 220 
 221 
 222 
 223 
 224 
 225 H:;
 226   DBGAPP ("doAppendCycleABSA(H): FANP\n");
 227 
 228   PNL (L68_ (cpu.apu.state |= apu_FANP;))
 229 
 230 
 231 
 232 
 233 
 234 
 235 
 236   set_apu_status (apuStatus_FANP);
 237 
 238   DBGAPP ("doAppendCycleABSA(H): SDW->ADDR=%08o CA=%06o \n", cpu.SDW->ADDR, cpu.TPR.CA);
 239 
 240   finalAddress = (cpu.SDW->ADDR & 077777760) + cpu.TPR.CA;
 241   finalAddress &= 0xffffff;
 242   PNL (cpu.APUMemAddr = finalAddress;)
 243 
 244   DBGAPP ("doAppendCycleABSA(H:FANP): (%05o:%06o) finalAddress=%08o\n", cpu.TPR.TSR, cpu.TPR.CA, finalAddress);
 245 
 246   goto HI;
 247 
 248 I:;
 249 
 250   
 251   set_apu_status (apuStatus_FAP);
 252   PNL (L68_ (cpu.apu.state |= apu_FAP;))
 253 
 254   word24 y2 = cpu.TPR.CA % 1024;
 255 
 256   
 257   
 258   finalAddress = (((word24)cpu.PTW->ADDR & 0777760) << 6) + y2;
 259   finalAddress &= 0xffffff;
 260   PNL (cpu.APUMemAddr = finalAddress;)
 261 
 262 #ifdef L68
 263   if (cpu.MR_cache.emr && cpu.MR_cache.ihr)
 264     add_APU_history (APUH_FAP);
 265 #endif
 266   DBGAPP ("doAppendCycleABSA(H:FAP): (%05o:%06o) finalAddress=%08o\n", cpu.TPR.TSR, cpu.TPR.CA, finalAddress);
 267 
 268   goto HI;
 269 
 270 HI:
 271   DBGAPP ("doAppendCycleABSA(HI)\n");
 272 
 273   goto Exit;
 274 
 275 Exit:;
 276 
 277   PNL (cpu.APUDataBusOffset = cpu.TPR.CA;)
 278   PNL (cpu.APUDataBusAddr = finalAddress;)
 279 
 280   PNL (L68_ (cpu.apu.state |= apu_FA;))
 281 
 282   DBGAPP ("doAppendCycleABSA (Exit) PRR %o PSR %05o P %o IC %06o\n", cpu.PPR.PRR, cpu.PPR.PSR, cpu.PPR.P, cpu.PPR.IC);
 283   DBGAPP ("doAppendCycleABSA (Exit) TRR %o TSR %05o TBR %02o CA %06o\n", cpu.TPR.TRR, cpu.TPR.TSR, cpu.TPR.TBR, cpu.TPR.CA);
 284 
 285   return finalAddress;    
 286 }