OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [insight/] [gdb/] [remote-or1k.c] - Diff between revs 375 and 379

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 375 Rev 379
Line 771... Line 771...
      or1k_write_spr_reg (DMR1_SPRNUM, dmr1);
      or1k_write_spr_reg (DMR1_SPRNUM, dmr1);
      dmr1 &= ~DMR1_ST;
      dmr1 &= ~DMR1_ST;
 
 
      if (new_pc_set)
      if (new_pc_set)
        {
        {
 
          debug("resume: 1\n");
          or1k_write_spr_reg (PC_SPRNUM, pc);
          or1k_write_spr_reg (PC_SPRNUM, pc);
          new_pc_set = 0;
          new_pc_set = 0;
        }
        }
      else if (insn_has_delay_slot (ppc_insn) && (ppc != pc))
      else if (insn_has_delay_slot (ppc_insn) && (ppc != pc))
        {
        {
          /* Steping across delay slot insn - we have to reexcute branch insn */
          /* Steping across delay slot insn - we have to reexcute branch insn */
 
          debug("resume: 2\n");
 
 
          if(breakpoint_here_p (ppc))
          if(breakpoint_here_p (ppc))
              or1k_write_mem(ppc, ppc_insn);
              or1k_write_mem(ppc, ppc_insn);
 
 
          or1k_write_spr_reg (PC_SPRNUM, ppc);
          or1k_write_spr_reg (PC_SPRNUM, ppc);
Line 790... Line 792...
          or1k_set_chain (SC_REGISTER);
          or1k_set_chain (SC_REGISTER);
          val = or1k_read_reg (JTAG_RISCOP);
          val = or1k_read_reg (JTAG_RISCOP);
          do {
          do {
            val = or1k_read_reg (JTAG_RISCOP);
            val = or1k_read_reg (JTAG_RISCOP);
          } while ((val & 1) == 0);
          } while ((val & 1) == 0);
 
 
 
          new_pc_set = 0;
        }
        }
      else if (hit_breakpoint && ((ppc + 4) != npc))
      else if (hit_breakpoint && ((ppc + 4) != npc))
       {
       {
 
          debug("resume: 3\n");
          /* Trapped on delay slot instruction. */
          /* Trapped on delay slot instruction. */
          /* Set PC to branch insn preceding delay slot. */
          /* Set PC to branch insn preceding delay slot. */
          or1k_write_spr_reg (PC_SPRNUM, ppc - 4);
          or1k_write_spr_reg (PC_SPRNUM, ppc - 4);
 
 
          or1k_unstall ();
          or1k_unstall ();
Line 804... Line 809...
          or1k_set_chain (SC_REGISTER);
          or1k_set_chain (SC_REGISTER);
          val = or1k_read_reg (JTAG_RISCOP);
          val = or1k_read_reg (JTAG_RISCOP);
          do {
          do {
            val = or1k_read_reg (JTAG_RISCOP);
            val = or1k_read_reg (JTAG_RISCOP);
          } while ((val & 1) == 0);
          } while ((val & 1) == 0);
 
 
 
          new_pc_set = 0;
        }
        }
      else
      else
 
        {
 
          debug("resume: 4\n");
        or1k_write_spr_reg (PC_SPRNUM, pc);
        or1k_write_spr_reg (PC_SPRNUM, pc);
 
 
 
          new_pc_set = 0;
 
        }
    }
    }
  else
  else
    {
    {
      dmr1 &= ~DMR1_ST;
      dmr1 &= ~DMR1_ST;
      or1k_write_spr_reg (DMR1_SPRNUM, dmr1);
      or1k_write_spr_reg (DMR1_SPRNUM, dmr1);
 
 
      if (new_pc_set)
      if (new_pc_set)
        {
        {
 
          debug("resume: 5\n");
          or1k_write_spr_reg (PC_SPRNUM, pc);
          or1k_write_spr_reg (PC_SPRNUM, pc);
 
 
          new_pc_set = 0;
          new_pc_set = 0;
        }
        }
      else if (insn_has_delay_slot (ppc_insn) && !breakpoint_here_p (ppc))
      else if (insn_has_delay_slot (ppc_insn) && !breakpoint_here_p (ppc))
 
        {
 
          debug("resume: 6\n");
          or1k_write_spr_reg (PC_SPRNUM, ppc);
          or1k_write_spr_reg (PC_SPRNUM, ppc);
 
 
 
          new_pc_set = 0;
 
        }
      else if (insn_has_delay_slot (ppc_insn) && breakpoint_here_p (ppc))
      else if (insn_has_delay_slot (ppc_insn) && breakpoint_here_p (ppc))
        {
        {
 
          debug("resume: 7\n");
          or1k_write_mem(ppc, ppc_insn);
          or1k_write_mem(ppc, ppc_insn);
 
 
          dmr1 |= DMR1_ST;
          dmr1 |= DMR1_ST;
          or1k_write_spr_reg (DMR1_SPRNUM, dmr1);
          or1k_write_spr_reg (DMR1_SPRNUM, dmr1);
          dmr1 &= ~DMR1_ST;
          dmr1 &= ~DMR1_ST;
Line 842... Line 861...
          } while ((val & 1) == 0);
          } while ((val & 1) == 0);
 
 
          or1k_write_mem(ppc, 0x21000001);
          or1k_write_mem(ppc, 0x21000001);
 
 
          or1k_write_spr_reg (DMR1_SPRNUM, dmr1);
          or1k_write_spr_reg (DMR1_SPRNUM, dmr1);
 
 
 
          new_pc_set = 0;
        }
        }
      else
      else
 
        {
 
          debug("resume: 8\n");
        or1k_write_spr_reg (PC_SPRNUM, pc);
        or1k_write_spr_reg (PC_SPRNUM, pc);
 
 
 
          new_pc_set = 0;
 
        }
    }
    }
 
 
  /* We can now continue normally, independent of step */
  /* We can now continue normally, independent of step */
  or1k_unstall ();
  or1k_unstall ();
  or1k_status = TARGET_RUNNING;
  or1k_status = TARGET_RUNNING;

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.