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

Subversion Repositories adv_debug_sys

[/] [adv_debug_sys/] [trunk/] [Software/] [adv_jtag_bridge/] [adv_dbg_commands.c] - Diff between revs 51 and 55

Show entire file | Details | Blame | View Log

Rev 51 Rev 55
Line 354... Line 354...
 
 
  // Silence GCC
  // Silence GCC
  (void)in_data;
  (void)in_data;
  (void)out_data;
  (void)out_data;
 
 
    debug("Doing burst read, word size %d, word count %d, start address 0x%lX", word_size_bytes, word_count, start_address);
    debug("Doing burst read, word size %d, word count %d, start address 0x%lX\n", word_size_bytes, word_count, start_address);
 
 
    if(word_count <= 0) {
    if(word_count <= 0) {
      debug("Ignoring illegal read burst length (%d)\n", word_count);
      debug("Ignoring illegal read burst length (%d)\n", word_count);
      return 0;
      return 0;
    }
    }
Line 371... Line 371...
    case DC_WISHBONE:
    case DC_WISHBONE:
      if (word_size_bytes == 1) opcode = DBG_WB_CMD_BREAD8;
      if (word_size_bytes == 1) opcode = DBG_WB_CMD_BREAD8;
      else if(word_size_bytes == 2) opcode = DBG_WB_CMD_BREAD16;
      else if(word_size_bytes == 2) opcode = DBG_WB_CMD_BREAD16;
      else if(word_size_bytes == 4) opcode = DBG_WB_CMD_BREAD32;
      else if(word_size_bytes == 4) opcode = DBG_WB_CMD_BREAD32;
      else {
      else {
        printf("Tried burst read with invalid word size (%0x), defaulting to 4-byte words", word_size_bytes);
        printf("Tried burst read with invalid word size (%0x), defaulting to 4-byte words\n", word_size_bytes);
        opcode = DBG_WB_CMD_BREAD32;
        opcode = DBG_WB_CMD_BREAD32;
      }
      }
      break;
      break;
    case DC_CPU0:
    case DC_CPU0:
      if(word_size_bytes == 4) opcode = DBG_CPU0_CMD_BREAD32;
      if(word_size_bytes == 4) opcode = DBG_CPU0_CMD_BREAD32;
      else {
      else {
        printf("Tried burst read with invalid word size (%0x), defaulting to 4-byte words", word_size_bytes);
        printf("Tried burst read with invalid word size (%0x), defaulting to 4-byte words\n", word_size_bytes);
        opcode = DBG_CPU0_CMD_BREAD32;
        opcode = DBG_CPU0_CMD_BREAD32;
      }
      }
      break;
      break;
    case DC_CPU1:
    case DC_CPU1:
      if(word_size_bytes == 4) opcode = DBG_CPU1_CMD_BREAD32;
      if(word_size_bytes == 4) opcode = DBG_CPU1_CMD_BREAD32;
      else {
      else {
        printf("Tried burst read with invalid word size (%0x), defaulting to 4-byte words", word_size_bytes);
        printf("Tried burst read with invalid word size (%0x), defaulting to 4-byte words\n", word_size_bytes);
        opcode = DBG_CPU0_CMD_BREAD32;
        opcode = DBG_CPU0_CMD_BREAD32;
      }
      }
      break;
      break;
    default:
    default:
      printf("ERROR! Illegal debug chain selected while doing burst read!\n");
      printf("ERROR! Illegal debug chain selected while doing burst read!\n");
Line 523... Line 523...
       printf("Retry count exceeded!  Abort!\n\n");
       printf("Retry count exceeded!  Abort!\n\n");
       return err|APP_ERR_CRC;
       return err|APP_ERR_CRC;
     }
     }
     goto  wb_burst_read_retry_full;
     goto  wb_burst_read_retry_full;
   }
   }
   else debug("CRC OK!");
   else debug("CRC OK!\n");
 
 
 
 
   // Now, read the error register, and retry/recompute as necessary.
   // Now, read the error register, and retry/recompute as necessary.
   if(current_chain == DC_WISHBONE)
   if(current_chain == DC_WISHBONE)
     {
     {
Line 736... Line 736...
   if(!crc_match) {
   if(!crc_match) {
     printf("CRC ERROR! match bit after write is %i (computed CRC 0x%x)", crc_match, crc_calc);
     printf("CRC ERROR! match bit after write is %i (computed CRC 0x%x)", crc_match, crc_calc);
     if(!retry_do()) { printf("Retry count exceeded!  Abort!\n\n"); exit(1);}
     if(!retry_do()) { printf("Retry count exceeded!  Abort!\n\n"); exit(1);}
     goto  wb_burst_write_retry_full;
     goto  wb_burst_write_retry_full;
   }
   }
   else debug("CRC OK!");
   else debug("CRC OK!\n");
 
 
 
 
   // Now, read the error register and retry/recompute as needed
   // Now, read the error register and retry/recompute as needed
   if (current_chain == DC_WISHBONE)
   if (current_chain == DC_WISHBONE)
     {
     {

powered by: WebSVN 2.1.0

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