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

Subversion Repositories or1k

[/] [or1k/] [tags/] [nog_patch_47/] [or1ksim/] [debug/] [debug_unit.c] - Diff between revs 1308 and 1350

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

Rev 1308 Rev 1350
Line 31... Line 31...
 
 
#include <stdlib.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdio.h>
#include <string.h>
#include <string.h>
 
 
 
#include "config.h"
 
 
 
#ifdef HAVE_INTTYPES_H
 
#include <inttypes.h>
 
#endif
 
 
 
#include "port.h"
 
#include "arch.h"
#include "debug_unit.h"
#include "debug_unit.h"
#include "sim-config.h"
#include "sim-config.h"
#include "except.h"
#include "except.h"
#include "arch.h"
 
#include "abstract.h"
#include "abstract.h"
#include "parse.h"
#include "parse.h"
#include "sprs.h"
#include "sprs.h"
#include "gdb.h"
#include "gdb.h"
#include "except.h"
#include "except.h"
Line 80... Line 87...
  /* Do not stop, if we have debug module disabled or during reset */
  /* Do not stop, if we have debug module disabled or during reset */
  if(!config.debug.enabled || in_reset)
  if(!config.debug.enabled || in_reset)
    return 0;
    return 0;
 
 
  /* If we're single stepping, always stop */
  /* If we're single stepping, always stop */
  if(action == DebugInstructionFetch && testsprbits (SPR_DMR1, SPR_DMR1_ST))
  if((action == DebugInstructionFetch) && testsprbits (SPR_DMR1, SPR_DMR1_ST))
    return 1;
    return 1;
 
 
  /* is any watchpoint enabled to generate a break or count? If not, ignore */
  /* is any watchpoint enabled to generate a break or count? If not, ignore */
  if(mfspr(SPR_DMR2) & (SPR_DMR2_WGB|SPR_DMR2_AWTC))
  if(mfspr(SPR_DMR2) & (SPR_DMR2_WGB|SPR_DMR2_AWTC))
          return calculate_watchpoints(action, udata);
          return calculate_watchpoints(action, udata);
Line 244... Line 251...
  fflush(stdout);
  fflush(stdout);
#endif
#endif
  switch(current_scan_chain)
  switch(current_scan_chain)
    {
    {
    case JTAG_CHAIN_DEBUG_UNIT:
    case JTAG_CHAIN_DEBUG_UNIT:
      debug (2, "WRITE (%08x) = %08x\n", address, data);
      debug (2, "WRITE (%08x) = %08lx\n", address, data);
      if (runtime.sim.fspr_log) {
      if (runtime.sim.fspr_log) {
        fprintf(runtime.sim.fspr_log, "Write to SPR  : [%08X] <- [%08lX]\n",
        fprintf(runtime.sim.fspr_log, "Write to SPR  : [%08X] <- [%08lX]\n",
                address, data);
                address, data);
      }
      }
      mtspr(address, data);
      mtspr(address, data);
Line 378... Line 385...
 
 
/* Writes to bus address */
/* Writes to bus address */
int debug_set_mem (unsigned int address,unsigned long data)
int debug_set_mem (unsigned int address,unsigned long data)
{
{
  int err = 0;
  int err = 0;
  debug (2, "MEMWRITE (%08x) = %08x\n", address, data);
  debug (2, "MEMWRITE (%08x) = %08lx\n", address, data);
 
 
 
 
  if(!verify_memoryarea(address))
  if(!verify_memoryarea(address))
    err = JTAG_PROXY_INVALID_ADDRESS;
    err = JTAG_PROXY_INVALID_ADDRESS;
  else {
  else {
Line 401... Line 408...
    err = JTAG_PROXY_INVALID_ADDRESS;
    err = JTAG_PROXY_INVALID_ADDRESS;
  else
  else
  {
  {
          *data=simmem_read_word(address);
          *data=simmem_read_word(address);
  }
  }
  debug (2, "MEMREAD  (%08x) = %08x\n", address, *data);
  debug (2, "MEMREAD  (%08x) = %08lx\n", address, *data);
  return err;
  return err;
}
}
 
 
/* debug_ignore_exception returns 1 if the exception should be ignored. */
/* debug_ignore_exception returns 1 if the exception should be ignored. */
int debug_ignore_exception (unsigned long except)
int debug_ignore_exception (unsigned long except)

powered by: WebSVN 2.1.0

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