* sky->devo merge, final part of sim merge
authorFrank Ch. Eigler <fche@redhat.com>
Tue, 8 Dec 1998 12:23:26 +0000 (12:23 +0000)
committerFrank Ch. Eigler <fche@redhat.com>
Tue, 8 Dec 1998 12:23:26 +0000 (12:23 +0000)
[ChangeLog.sky]
1998-12-08  Frank Ch. Eigler  <fche@cygnus.com>
* sim-main.h (sim_state): Add multi-phase load tracking fields.
* sky-gdb.c (sky_option_handler): Add --load-next option handling.
* mips.igen (BREAK): Add multi-phase load and printf code handling.

sim/mips/mips.igen
sim/mips/sim-main.h

index 1757acbdab3286eaf3a4680c98d25e6b7a3ec0eb..21e822ea61587df313668117664c42e58329313c 100644 (file)
@@ -1,5 +1,9 @@
 // -*- C -*-
 //
+// In mips.igen, the semantics for many of the instructions were created
+// using code generated by gencode.  Those semantic segments could be
+// greatly simplified.
+//
 //    <insn> ::=
 //        <insn-word> { "+" <insn-word> }
 //        ":" <format-name>
 
 :function:::int:check_mt_hilo:hilo_history *history
 *mipsI,mipsII,mipsIII,mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 000000,5.RS,5.RT,5.RD,00000,100000:SPECIAL:32::ADD
 "add r<RD>, r<RS>, r<RT>"
 *mipsI,mipsII,mipsIII,mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 001000,5.RS,5.RT,16.IMMEDIATE:NORMAL:32::ADDI
 "addi r<RT>, r<RS>, IMMEDIATE"
 *mipsI,mipsII,mipsIII,mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 001001,5.RS,5.RT,16.IMMEDIATE:NORMAL:32::ADDIU
 "addiu r<RT>, r<RS>, <IMMEDIATE>"
 *mipsI,mipsII,mipsIII,mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 000000,5.RS,5.RT,5.RD,00000,100001:SPECIAL:32::ADDU
 "addu r<RD>, r<RS>, r<RT>"
 *mipsI,mipsII,mipsIII,mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 000000,5.RS,5.RT,5.RD,00000,100100:SPECIAL:32::AND
 "and r<RD>, r<RS>, r<RT>"
 *mipsI,mipsII,mipsIII,mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 001100,5.RS,5.RT,16.IMMEDIATE:NORMAL:32::ANDI
 "and r<RT>, r<RS>, <IMMEDIATE>"
 *mipsI,mipsII,mipsIII,mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 000100,5.RS,5.RT,16.OFFSET:NORMAL:32::BEQ
 "beq r<RS>, r<RT>, <OFFSET>"
 *mipsI,mipsII,mipsIII,mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 *mipsII:
 *mipsIII:
 *mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 000001,5.RS,00001,16.OFFSET:REGIMM:32::BGEZ
 "bgez r<RS>, <OFFSET>"
 *mipsI,mipsII,mipsIII,mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 000001,5.RS!31,10001,16.OFFSET:REGIMM:32::BGEZAL
 "bgezal r<RS>, <OFFSET>"
 *mipsI,mipsII,mipsIII,mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 *mipsII:
 *mipsIII:
 *mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 *mipsII:
 *mipsIII:
 *mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 000111,5.RS,00000,16.OFFSET:NORMAL:32::BGTZ
 "bgtz r<RS>, <OFFSET>"
 *mipsI,mipsII,mipsIII,mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 *mipsII:
 *mipsIII:
 *mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 000110,5.RS,00000,16.OFFSET:NORMAL:32::BLEZ
 "blez r<RS>, <OFFSET>"
 *mipsI,mipsII,mipsIII,mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 *mipsII:
 *mipsIII:
 *mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 000001,5.RS,00000,16.OFFSET:REGIMM:32::BLTZ
 "bltz r<RS>, <OFFSET>"
 *mipsI,mipsII,mipsIII,mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 000001,5.RS!31,10000,16.OFFSET:REGIMM:32::BLTZAL
 "bltzal r<RS>, <OFFSET>"
 *mipsI,mipsII,mipsIII,mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 *mipsII:
 *mipsIII:
 *mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 *mipsII:
 *mipsIII:
 *mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 000101,5.RS,5.RT,16.OFFSET:NORMAL:32::BNE
 "bne r<RS>, r<RT>, <OFFSET>"
 *mipsI,mipsII,mipsIII,mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 *mipsII:
 *mipsIII:
 *mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 000000,20.CODE,001101:SPECIAL:32::BREAK
 "break"
 *mipsI,mipsII,mipsIII,mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
       sim_engine_halt (SD, CPU, NULL, cia, sim_stopped, SIM_SIGTRAP);
     }
 // start-sanitize-sky
+#ifdef TARGET_SKY
   else if (break_code == (HALT_INSTRUCTION_PASS & HALT_INSTRUCTION_MASK))
     {
       sim_engine_halt (SD, CPU, NULL, cia, sim_exited, 0);
     {
       sim_engine_halt (SD, CPU, NULL, cia, sim_exited, 15);
     }
+  else if (break_code == (PRINTF_INSTRUCTION & HALT_INSTRUCTION_MASK))
+    {
+      sim_monitor(SD, CPU, cia, 316);  /* Magic number for idt printf routine. */
+    }
+  else if (break_code == (LOAD_INSTRUCTION & HALT_INSTRUCTION_MASK))
+    {
+      /* This is a multi-phase load instruction.  Load next configured
+        executable and return its starting PC in A0 ($4). */
+      
+      if (STATE_MLOAD_INDEX (SD) == STATE_MLOAD_COUNT (SD))
+       {
+         sim_io_eprintf (SD, "Cannot load program %d.  Not enough load-next options.\n",
+                         STATE_MLOAD_COUNT (SD));
+         A0 = 0;
+       }
+      else
+       {
+         char* next = STATE_MLOAD_NAME (SD) [STATE_MLOAD_INDEX (SD)];
+         SIM_RC rc;
+         
+         STATE_MLOAD_INDEX (SD) ++;
+         
+         /* call sim_load_file, preserving most previous state */
+         rc = sim_load (SD, next, NULL, 0);
+         if(rc != SIM_RC_OK)
+           {
+             sim_io_eprintf (SD, "Error during multi-phase load #%d.\n",
+                             STATE_MLOAD_INDEX (SD));
+             A0 = 0;
+           }
+         else
+           A0 = STATE_START_ADDR (SD);
+       }
+    }
+#endif TARGET_SKY
 // end-sanitize-sky
 
-  /* If we get this far, we're not an instruction reserved by the sim.  Raise 
-     the exception. */
-  SignalException(BreakPoint, instruction_0);
+  else
+    {
+      /* If we get this far, we're not an instruction reserved by the sim.  Raise 
+        the exception. */
+      SignalException(BreakPoint, instruction_0);
+    }
 }
 
 
 "dadd r<RD>, r<RS>, r<RT>"
 *mipsIII:
 *mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 "daddi r<RT>, r<RS>, <IMMEDIATE>"
 *mipsIII:
 *mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 "daddu r<RT>, r<RS>, <IMMEDIATE>"
 *mipsIII:
 *mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 "daddu r<RD>, r<RS>, r<RT>"
 *mipsIII:
 *mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 "ddiv r<RS>, r<RT>"
 *mipsIII:
 *mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 "ddivu r<RS>, r<RT>"
 *mipsIII:
 *mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 000000,5.RS,5.RT,0000000000011010:SPECIAL:32::DIV
 "div r<RS>, r<RT>"
 *mipsI,mipsII,mipsIII,mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 000000,5.RS,5.RT,0000000000011011:SPECIAL:32::DIVU
 "divu r<RS>, r<RT>"
 *mipsI,mipsII,mipsIII,mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 000000,5.RS,5.RT,0000000000011100:SPECIAL:64::DMULT
 "dmult r<RS>, r<RT>"
 *mipsIII,mipsIV:
+*vr4100:
 // start-sanitize-tx19
 *tx19:
 // end-sanitize-tx19
 000000,5.RS,5.RT,0000000000011101:SPECIAL:64::DMULTU
 "dmultu r<RS>, r<RT>"
 *mipsIII,mipsIV:
+*vr4100:
 // start-sanitize-tx19
 *tx19:
 // end-sanitize-tx19
 "dsll r<RD>, r<RT>, <SHIFT>"
 *mipsIII:
 *mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 "dsll32 r<RD>, r<RT>, <SHIFT>"
 *mipsIII:
 *mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 "dsllv r<RD>, r<RT>, r<RS>"
 *mipsIII:
 *mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 "dsra r<RD>, r<RT>, <SHIFT>"
 *mipsIII:
 *mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 "dsra32 r<RT>, r<RD>, <SHIFT>"
 *mipsIII:
 *mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 "dsra32 r<RT>, r<RD>, r<RS>"
 *mipsIII:
 *mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 "dsrl r<RD>, r<RT>, <SHIFT>"
 *mipsIII:
 *mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 "dsrl32 r<RD>, r<RT>, <SHIFT>"
 *mipsIII:
 *mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 "dsrl32 r<RD>, r<RT>, r<RS>"
 *mipsIII:
 *mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 "dsub r<RD>, r<RS>, r<RT>"
 *mipsIII:
 *mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 "dsubu r<RD>, r<RS>, r<RT>"
 *mipsIII:
 *mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 000010,26.INSTR_INDEX:NORMAL:32::J
 "j <INSTR_INDEX>"
 *mipsI,mipsII,mipsIII,mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 000011,26.INSTR_INDEX:NORMAL:32::JAL
 "jal <INSTR_INDEX>"
 *mipsI,mipsII,mipsIII,mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 "jalr r<RS>":RD == 31
 "jalr r<RD>, r<RS>"
 *mipsI,mipsII,mipsIII,mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 000000,5.RS,000000000000000001000:SPECIAL:32::JR
 "jr r<RS>"
 *mipsI,mipsII,mipsIII,mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 100000,5.BASE,5.RT,16.OFFSET:NORMAL:32::LB
 "lb r<RT>, <OFFSET>(r<BASE>)"
 *mipsI,mipsII,mipsIII,mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 100100,5.BASE,5.RT,16.OFFSET:NORMAL:32::LBU
 "lbu r<RT>, <OFFSET>(r<BASE>)"
 *mipsI,mipsII,mipsIII,mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 "ld r<RT>, <OFFSET>(r<BASE>)"
 *mipsIII:
 *mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 *mipsII:
 *mipsIII:
 *mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 "ldl r<RT>, <OFFSET>(r<BASE>)"
 *mipsIII:
 *mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 "ldr r<RT>, <OFFSET>(r<BASE>)"
 *mipsIII:
 *mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 100001,5.BASE,5.RT,16.OFFSET:NORMAL:32::LH
 "lh r<RT>, <OFFSET>(r<BASE>)"
 *mipsI,mipsII,mipsIII,mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 100101,5.BASE,5.RT,16.OFFSET:NORMAL:32::LHU
 "lhu r<RT>, <OFFSET>(r<BASE>)"
 *mipsI,mipsII,mipsIII,mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 *mipsII:
 *mipsIII:
 *mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 "lld r<RT>, <OFFSET>(r<BASE>)"
 *mipsIII:
 *mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 001111,00000,5.RT,16.IMMEDIATE:NORMAL:32::LUI
 "lui r<RT>, <IMMEDIATE>"
 *mipsI,mipsII,mipsIII,mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 100011,5.BASE,5.RT,16.OFFSET:NORMAL:32::LW
 "lw r<RT>, <OFFSET>(r<BASE>)"
 *mipsI,mipsII,mipsIII,mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 1100,ZZ!0!1!3,5.BASE,5.RT,16.OFFSET:NORMAL:32::LWCz
 "lwc<ZZ> r<RT>, <OFFSET>(r<BASE>)"
 *mipsI,mipsII,mipsIII,mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 100010,5.BASE,5.RT,16.OFFSET:NORMAL:32::LWL
 "lwl r<RT>, <OFFSET>(r<BASE>)"
 *mipsI,mipsII,mipsIII,mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 100110,5.BASE,5.RT,16.OFFSET:NORMAL:32::LWR
 "lwr r<RT>, <OFFSET>(r<BASE>)"
 *mipsI,mipsII,mipsIII,mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 "lwu r<RT>, <OFFSET>(r<BASE>)"
 *mipsIII:
 *mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 000000,0000000000,5.RD,00000,010000:SPECIAL:32::MFHI
 "mfhi r<RD>"
 *mipsI,mipsII,mipsIII,mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 000000,0000000000,5.RD,00000,010010:SPECIAL:32::MFLO
 "mflo r<RD>"
 *mipsI,mipsII,mipsIII,mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 000000,5.RS,000000000000000,010001:SPECIAL:32::MTHI
 "mthi r<RS>"
 *mipsI,mipsII,mipsIII,mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 000000,5.RS,000000000000000010011:SPECIAL:32::MTLO
 "mtlo r<RS>"
 *mipsI,mipsII,mipsIII,mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 000000,5.RS,5.RT,00000,00000011000:SPECIAL:32::MULT
 "mult r<RS>, r<RT>"
 *mipsI,mipsII,mipsIII,mipsIV:
+*vr4100:
 // start-sanitize-vr4320
 *vr4320:
 // end-sanitize-vr4320
 000000,5.RS,5.RT,00000,00000011001:SPECIAL:32::MULTU
 "multu r<RS>, r<RT>"
 *mipsI,mipsII,mipsIII,mipsIV:
+*vr4100:
 // start-sanitize-vr4320
 *vr4320:
 // end-sanitize-vr4320
 000000,5.RS,5.RT,5.RD,00000,100111:SPECIAL:32::NOR
 "nor r<RD>, r<RS>, r<RT>"
 *mipsI,mipsII,mipsIII,mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 000000,5.RS,5.RT,5.RD,00000,100101:SPECIAL:32::OR
 "or r<RD>, r<RS>, r<RT>"
 *mipsI,mipsII,mipsIII,mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 001101,5.RS,5.RT,16.IMMEDIATE:NORMAL:32::ORI
 "ori r<RT>, r<RS>, <IMMEDIATE>"
 *mipsI,mipsII,mipsIII,mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 101000,5.BASE,5.RT,16.OFFSET:NORMAL:32::SB
 "sb r<RT>, <OFFSET>(r<BASE>)"
 *mipsI,mipsII,mipsIII,mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 *mipsII:
 *mipsIII:
 *mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 "scd r<RT>, <OFFSET>(r<BASE>)"
 *mipsIII:
 *mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 "sd r<RT>, <OFFSET>(r<BASE>)"
 *mipsIII:
 *mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 *mipsII:
 *mipsIII:
 *mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 "sdl r<RT>, <OFFSET>(r<BASE>)"
 *mipsIII:
 *mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 "sdr r<RT>, <OFFSET>(r<BASE>)"
 *mipsIII:
 *mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 101001,5.BASE,5.RT,16.OFFSET:NORMAL:32::SH
 "sh r<RT>, <OFFSET>(r<BASE>)"
 *mipsI,mipsII,mipsIII,mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 00000000000,5.RT,5.RD,5.SHIFT,000000:SPECIAL:32::SLL
 "sll r<RD>, r<RT>, <SHIFT>"
 *mipsI,mipsII,mipsIII,mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 000000,5.RS,5.RT,5.RD,00000000100:SPECIAL:32::SLLV
 "sllv r<RD>, r<RT>, r<RS>"
 *mipsI,mipsII,mipsIII,mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 000000,5.RS,5.RT,5.RD,00000101010:SPECIAL:32::SLT
 "slt r<RD>, r<RS>, r<RT>"
 *mipsI,mipsII,mipsIII,mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 001010,5.RS,5.RT,16.IMMEDIATE:NORMAL:32::SLTI
 "slti r<RT>, r<RS>, <IMMEDIATE>"
 *mipsI,mipsII,mipsIII,mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 001011,5.RS,5.RT,16.IMMEDIATE:NORMAL:32::SLTIU
 "sltiu r<RT>, r<RS>, <IMMEDIATE>"
 *mipsI,mipsII,mipsIII,mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 000000,5.RS,5.RT,5.RD,00000101011:SPECIAL:32::SLTU
 "sltu r<RD>, r<RS>, r<RT>"
 *mipsI,mipsII,mipsIII,mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 000000,00000,5.RT,5.RD,5.SHIFT,000011:SPECIAL:32::SRA
 "sra r<RD>, r<RT>, <SHIFT>"
 *mipsI,mipsII,mipsIII,mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 000000,5.RS,5.RT,5.RD,00000000111:SPECIAL:32::SRAV
 "srav r<RD>, r<RT>, r<RS>"
 *mipsI,mipsII,mipsIII,mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 000000,00000,5.RT,5.RD,5.SHIFT,000010:SPECIAL:32::SRL
 "srl r<RD>, r<RT>, <SHIFT>"
 *mipsI,mipsII,mipsIII,mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 000000,5.RS,5.RT,5.RD,00000000110:SPECIAL:32::SRLV
 "srlv r<RD>, r<RT>, r<RS>"
 *mipsI,mipsII,mipsIII,mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 000000,5.RS,5.RT,5.RD,00000100010:SPECIAL:32::SUB
 "sub r<RD>, r<RS>, r<RT>"
 *mipsI,mipsII,mipsIII,mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 000000,5.RS,5.RT,5.RD,00000100011:SPECIAL:32::SUBU
 "subu r<RD>, r<RS>, r<RT>"
 *mipsI,mipsII,mipsIII,mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 101011,5.BASE,5.RT,16.OFFSET:NORMAL:32::SW
 "sw r<RT>, <OFFSET>(r<BASE>)"
 *mipsI,mipsII,mipsIII,mipsIV:
+*vr4100:
 // start-sanitize-tx19
 *tx19:
 // end-sanitize-tx19
 1110,ZZ!0!1!3,5.BASE,5.RT,16.OFFSET:NORMAL:32::SWCz
 "swc<ZZ> r<RT>, <OFFSET>(r<BASE>)"
 *mipsI,mipsII,mipsIII,mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 101010,5.BASE,5.RT,16.OFFSET:NORMAL:32::SWL
 "swl r<RT>, <OFFSET>(r<BASE>)"
 *mipsI,mipsII,mipsIII,mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 101110,5.BASE,5.RT,16.OFFSET:NORMAL:32::SWR
 "swr r<RT>, <OFFSET>(r<BASE>)"
 *mipsI,mipsII,mipsIII,mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 *mipsII:
 *mipsIII:
 *mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 000000,20.CODE,001100:SPECIAL:32::SYSCALL
 "syscall <CODE>"
 *mipsI,mipsII,mipsIII,mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 *mipsII:
 *mipsIII:
 *mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 *mipsII:
 *mipsIII:
 *mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 *mipsII:
 *mipsIII:
 *mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 *mipsII:
 *mipsIII:
 *mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 *mipsII:
 *mipsIII:
 *mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 *mipsII:
 *mipsIII:
 *mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 *mipsII:
 *mipsIII:
 *mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 *mipsII:
 *mipsIII:
 *mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 *mipsII:
 *mipsIII:
 *mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 *mipsII:
 *mipsIII:
 *mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 *mipsII:
 *mipsIII:
 *mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 *mipsII:
 *mipsIII:
 *mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 000000,5.RS,5.RT,5.RD,00000100110:SPECIAL:32::XOR
 "xor r<RD>, r<RS>, r<RT>"
 *mipsI,mipsII,mipsIII,mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 001110,5.RS,5.RT,16.IMMEDIATE:NORMAL:32::XORI
 "xori r<RT>, r<RS>, <IMMEDIATE>"
 *mipsI,mipsII,mipsIII,mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 010001,10,3.FMT,00000,5.FS,5.FD,000101:COP1:32,f::ABS.fmt
 "abs.%s<FMT> f<FD>, f<FS>"
 *mipsI,mipsII,mipsIII,mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 010001,10,3.FMT,5.FT,5.FS,5.FD,000000:COP1:32,f::ADD.fmt
 "add.%s<FMT> f<FD>, f<FS>, f<FT>"
 *mipsI,mipsII,mipsIII,mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 010001,01000,3.0,1.ND,1.TF,16.OFFSET:COP1S:32,f::BC1
 "bc1%s<TF>%s<ND> <OFFSET>"
 *mipsI,mipsII,mipsIII:
+*vr4100:
 // start-sanitize-r5900
 *r5900:
 // end-sanitize-r5900
 "c.%s<COND>.%s<FMT> f<FS>, f<FT>":CC == 0
 "c.%s<COND>.%s<FMT> <CC>, f<FS>, f<FT>"
 *mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 "ceil.l.%s<FMT> f<FD>, f<FS>"
 *mipsIII:
 *mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 *mipsII:
 *mipsIII:
 *mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 010001,00,X,10,5.RT,5.FS,00000000000:COP1S:32::CxC1
 "c%s<X>c1 r<RT>, f<FS>"
 *mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 010001,10,3.FMT,00000,5.FS,5.FD,100001:COP1:32::CVT.D.fmt
 "cvt.d.%s<FMT> f<FD>, f<FS>"
 *mipsI,mipsII,mipsIII,mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 "cvt.l.%s<FMT> f<FD>, f<FS>"
 *mipsIII:
 *mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 010001,10,3.FMT,00000,5.FS,5.FD,100000:COP1:32::CVT.S.fmt
 "cvt.s.%s<FMT> f<FD>, f<FS>"
 *mipsI,mipsII,mipsIII,mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 010001,10,3.FMT,00000,5.FS,5.FD,100100:COP1:32::CVT.W.fmt
 "cvt.w.%s<FMT> f<FD>, f<FS>"
 *mipsI,mipsII,mipsIII,mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 010001,10,3.FMT,5.FT,5.FS,5.FD,000011:COP1:32::DIV.fmt
 "div.%s<FMT> f<FD>, f<FS>, f<FT>"
 *mipsI,mipsII,mipsIII,mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 010001,00,X,01,5.RT,5.FS,00000000000:COP1S:64::DMxC1
 "dm%s<X>c1 r<RT>, f<FS>"
 *mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 "floor.l.%s<FMT> f<FD>, f<FS>"
 *mipsIII:
 *mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 *mipsII:
 *mipsIII:
 *mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 *mipsII:
 *mipsIII:
 *mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 110001,5.BASE,5.FT,16.OFFSET:COP1:32::LWC1 
 "lwc1 f<FT>, <OFFSET>(r<BASE>)"
 *mipsI,mipsII,mipsIII,mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 010001,00,X,00,5.RT,5.FS,00000000000:COP1S:32::MxC1
 "m%s<X>c1 r<RT>, f<FS>"
 *mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 010001,10,3.FMT,00000,5.FS,5.FD,000110:COP1:32::MOV.fmt
 "mov.%s<FMT> f<FD>, f<FS>"
 *mipsI,mipsII,mipsIII,mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 010001,10,3.FMT,5.FT,5.FS,5.FD,000010:COP1:32::MUL.fmt
 "mul.%s<FMT> f<FD>, f<FS>, f<FT>"
 *mipsI,mipsII,mipsIII,mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 010001,10,3.FMT,00000,5.FS,5.FD,000111:COP1:32::NEG.fmt
 "neg.%s<FMT> f<FD>, f<FS>"
 *mipsI,mipsII,mipsIII,mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 "round.l.%s<FMT> f<FD>, f<FS>"
 *mipsIII:
 *mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 *mipsII:
 *mipsIII:
 *mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 *mipsII:
 *mipsIII:
 *mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 *mipsII:
 *mipsIII:
 *mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 010001,10,3.FMT,5.FT,5.FS,5.FD,000001:COP1:32::SUB.fmt
 "sub.%s<FMT> f<FD>, f<FS>, f<FT>"
 *mipsI,mipsII,mipsIII,mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 111001,5.BASE,5.FT,16.OFFSET:COP1:32::SWC1
 "swc1 f<FT>, <OFFSET>(r<BASE>)"
 *mipsI,mipsII,mipsIII,mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 "trunc.l.%s<FMT> f<FD>, f<FS>"
 *mipsIII:
 *mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 *mipsII:
 *mipsIII:
 *mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 010000,01000,00000,16.OFFSET:COP0:32::BC0F
 "bc0f <OFFSET>"
 *mipsI,mipsII,mipsIII,mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 010000,01000,00010,16.OFFSET:COP0:32::BC0FL
 "bc0fl <OFFSET>"
 *mipsI,mipsII,mipsIII,mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 010000,01000,00001,16.OFFSET:COP0:32::BC0T
 "bc0t <OFFSET>"
 *mipsI,mipsII,mipsIII,mipsIV:
-
+*vr4100:
 
 
 010000,01000,00011,16.OFFSET:COP0:32::BC0TL
 "bc0tl <OFFSET>"
 *mipsI,mipsII,mipsIII,mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 101111,5.BASE,5.OP,16.OFFSET:NORMAL:32::CACHE
 *mipsIII:
 *mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 010000,10000,000000000000000,111001:COP0:32::DI
 "di"
 *mipsI,mipsII,mipsIII,mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 010000,10000,000000000000000,111000:COP0:32::EI
 "ei"
 *mipsI,mipsII,mipsIII,mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 "eret"
 *mipsIII:
 *mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 "mfc0 r<RT>, r<RD> # <REGX>"
 *mipsI,mipsII,mipsIII,mipsIV:
 *r3900:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 *tx19:
 // end-sanitize-tx19
 *r3900:
+*vr4100:
 // start-sanitize-vr4320
 *vr4320:
 // end-sanitize-vr4320
 *tx19:
 // end-sanitize-tx19
 *r3900:
+*vr4100:
 // start-sanitize-vr4320
 *vr4320:
 // end-sanitize-vr4320
 0100,ZZ!0!1!3,5.COP_FUN0!8,5.COP_FUN1,16.COP_FUN2:NORMAL:32::COPz
 "cop<ZZ> <COP_FUN0><COP_FUN1><COP_FUN2>"
 *mipsI,mipsII,mipsIII,mipsIV:
+*vr4100:
 // start-sanitize-r5900
 *r5900:
 // end-sanitize-r5900
 010000,10000,000000000000000,001000:COP0:32::TLBP
 "tlbp"
 *mipsI,mipsII,mipsIII,mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 010000,10000,000000000000000,000001:COP0:32::TLBR
 "tlbr"
 *mipsI,mipsII,mipsIII,mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 010000,10000,000000000000000,000010:COP0:32::TLBWI
 "tlbwi"
 *mipsI,mipsII,mipsIII,mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
 010000,10000,000000000000000,000110:COP0:32::TLBWR
 "tlbwr"
 *mipsI,mipsII,mipsIII,mipsIV:
+*vr4100:
 *vr5000:
 // start-sanitize-vr4320
 *vr4320:
index 20f13a3c78bfe9acfc4581fdbfe1e314ce54b0f4..b9af271b5b3a29247d5b2a8102ebb950df568e30 100644 (file)
@@ -516,31 +516,8 @@ struct _sim_cpu {
   address_word dspc;  /* delay-slot PC */
 #define DSPC ((CPU)->dspc)
 
-#if !WITH_IGEN
-  /* Issue a delay slot instruction immediatly by re-calling
-     idecode_issue */
-#define DELAY_SLOT(TARGET) \
-  do { \
-    address_word target = (TARGET); \
-    instruction_word delay_insn; \
-    sim_events_slip (SD, 1); \
-    CIA = CIA + 4; /* NOTE not mips16 */ \
-    STATE |= simDELAYSLOT; \
-    delay_insn = IMEM32 (CIA); /* NOTE not mips16 */ \
-    idecode_issue (CPU_, delay_insn, (CIA)); \
-    STATE &= ~simDELAYSLOT; \
-    NIA = target; \
-  } while (0)
-#define NULLIFY_NEXT_INSTRUCTION() \
-  do { \
-    sim_events_slip (SD, 1); \
-    dotrace (SD, CPU, tracefh, 2, NIA, 4, "load instruction"); \
-    NIA = CIA + 8; \
-  } while (0)
-#else
 #define DELAY_SLOT(TARGET) NIA = delayslot32 (SD_, (TARGET))
 #define NULLIFY_NEXT_INSTRUCTION() NIA = nullify_next_insn32 (SD_)
-#endif
 
 
   /* State of the simulator */
@@ -807,12 +784,28 @@ struct sim_state {
 
 /* start-sanitize-sky */
 #ifdef TARGET_SKY
+
 #ifdef SKY_FUNIT
   /* Record of option for floating point implementation type. */
   int fp_type_opt;
 #define STATE_FP_TYPE_OPT(sd) ((sd)->fp_type_opt)
 #define STATE_FP_TYPE_OPT_ACCURATE 0x80000000
 #endif
+
+  /* Index of next unused name slot for multi-phase load list. */ 
+  int next_mload_count;
+#define STATE_MLOAD_COUNT(sd) ((sd)->next_mload_count)
+
+#define MAX_MLOAD_COUNT 2 /* limit for next_load_count and load_index */
+
+  /* Program names for multi-phase load. */
+  char *next_mload_name[MAX_MLOAD_COUNT];
+#define STATE_MLOAD_NAME(sd) ((sd)->next_mload_name)
+
+  /* Index of next program for multi-phase load. */ 
+  int mload_index;
+#define STATE_MLOAD_INDEX(sd) ((sd)->mload_index)
+
 #endif
 /* end-sanitize-sky */
 
@@ -1046,6 +1039,8 @@ void decode_coproc PARAMS ((SIM_DESC sd, sim_cpu *cpu, address_word cia, unsigne
 #define DecodeCoproc(instruction) \
 decode_coproc (SD, CPU, cia, (instruction))
 
+void sim_monitor (SIM_DESC sd, sim_cpu *cpu, address_word cia, unsigned int arg);
+  
 
 
 /* Memory accesses */
@@ -1081,12 +1076,10 @@ decode_coproc (SD, CPU, cia, (instruction))
 #define AccessLength_DOUBLEWORD (7)
 #define AccessLength_QUADWORD   (15)
 
-#if (WITH_IGEN)
 #define LOADDRMASK (WITH_TARGET_WORD_BITSIZE == 64 \
                    ? AccessLength_DOUBLEWORD /*7*/ \
                    : AccessLength_WORD /*3*/)
 #define PSIZE (WITH_TARGET_ADDRESS_BITSIZE)
-#endif
 
 
 INLINE_SIM_MAIN (int) address_translation PARAMS ((SIM_DESC sd, sim_cpu *, address_word cia, address_word vAddr, int IorD, int LorS, address_word *pAddr, int *CCA, int raw));
@@ -1149,8 +1142,6 @@ SIM_RC sky_sim_module_install PARAMS ((SIM_DESC sd));
 
 #define MODULE_LIST    sky_sim_module_install,
   
-void sim_monitor (SIM_DESC sd, sim_cpu *cpu, address_word cia, unsigned int arg);
-  
 #ifndef TM_TXVU_H /* In case GDB hasn't been configured yet */
 enum txvu_cpu_context
 {