|
Message
From: =?unknown-8bit?Q?Gy=F6rgy?= 'nog' Jeney<nog@s...>
Date: Wed Jun 29 16:55:10 CEST 2005
Subject: [openrisc] [or1ksim #114] Remove #define DEBUG_JTAG
Hi,This removes #define DEBUG_JTAG infavour of useing the debug channel code. ChangeLog: * Use the new debug channel code instead of a compile time macro.
nog. -------------- next part -------------- diff -upr --unidirectional-new-file ./debug/debug_unit.c /home/nog/or1ksim-ac/debug/debug_unit.c --- ./debug/debug_unit.c 2005-06-28 13:01:05.000000000 +0200 +++ /home/nog/or1ksim-ac/debug/debug_unit.c 2005-06-18 18:56:01.000000000 +0200 @@ -27,8 +27,6 @@ Foundation, Inc., 675 Mass Ave, Cambridg limitations at this time. */ -//#define DEBUG_JTAG 0 - #include <stdlib.h> #include <stdio.h> #include <string.h> @@ -54,6 +52,8 @@ Foundation, Inc., 675 Mass Ave, Cambridg #include "sprs.h" #include "debug.h" +DECLARE_DEBUG_CHANNEL(jtag); + DevelopmentInterface development; /* External STALL signal to debug interface */ @@ -223,15 +238,12 @@ static DebugScanChainIDs current_scan_ch int DebugGetRegister(unsigned int address, unsigned long* data) { int err=0; -#ifdef DEBUG_JTAG - PRINTF("Debug get register %x\n",address); - fflush(stdout); -#endif + TRACE_(jtag)("Debug get register %x\n",address); switch(current_scan_chain) { case JTAG_CHAIN_DEBUG_UNIT: - *data = mfspr (address); - debug (2, "READ (%08x) = %08x\n", address, *data); + *data = mfspr(address); + TRACE_(jtag)("READ (%08lx) = %08lx\n", address, *data); if (runtime.sim.fspr_log) { fprintf(runtime.sim.fspr_log, "Read from SPR : [%08X] -> [%08lX]\n", address, *data); @@ -247,24 +259,18 @@ int DebugGetRegister(unsigned int addres err = debug_get_mem(address,data); break; } -#ifdef DEBUG_JTAG - PRINTF("!get reg %x\n", *data); - fflush(stdout); -#endif + TRACE_(jtag)("!get reg %lx\n", *data); return err; } int DebugSetRegister(unsigned int address,unsigned long data) { int err=0; -#ifdef DEBUG_JTAG - PRINTF("Debug set register %x <- %x\n", address, data); - fflush(stdout); -#endif + TRACE_(jtag)("Debug set register %x <- %lx\n", address, data); switch(current_scan_chain) { case JTAG_CHAIN_DEBUG_UNIT: - debug (2, "WRITE (%08x) = %08lx\n", address, data); + TRACE_(jtag)("WRITE (%08x) = %08lx\n", address, data); if (runtime.sim.fspr_log) { fprintf(runtime.sim.fspr_log, "Write to SPR : [%08X] <- [%08lX]\n", address, data); @@ -281,19 +287,13 @@ int DebugSetRegister(unsigned int addres err = debug_set_mem (address, data); break; } -#ifdef DEBUG_JTAG - PRINTF("!set reg\n"); - fflush(stdout); -#endif + TRACE_(jtag)("!set reg\n"); return err; } int DebugSetChain(int chain) { -#ifdef DEBUG_JTAG - PRINTF("Debug set chain %x\n",chain); - fflush(stdout); -#endif + TRACE_(jtag)("Debug set chain %x\n",chain); switch(chain) { case JTAG_CHAIN_DEBUG_UNIT: @@ -306,10 +306,6 @@ int DebugSetChain(int chain) return JTAG_PROXY_INVALID_CHAIN; } -#ifdef DEBUG_JTAG - PRINTF("!set chain\n");
- fflush(stdout);
-#endif
return 0;
}
@@ -352,10 +348,7 @@ int set_devint_reg(unsigned int address,
err = JTAG_PROXY_INVALID_ADDRESS;
break;
}
-#ifdef DEBUG_JTAG
- PRINTF("set_devint_reg %08x = %08x\n", address, data);
- fflush(stdout);
-#endif
+ TRACE_(jtag)("set_devint_reg %08x = %08lx\n", address, data);
return err;
}
@@ -386,10 +379,7 @@ int get_devint_reg(unsigned int address,
default: err = JTAG_PROXY_INVALID_ADDRESS; break;
}
-#ifdef DEBUG_JTAG
- PRINTF("get_devint_reg %08x = %08x\n", address, value);
- fflush(stdout);
-#endif
+ TRACE_(jtag)("get_devint_reg %08x = %08lx\n", address, value);
*data = value;
return err;
}
@@ -398,7 +388,7 @@ int get_devint_reg(unsigned int address,
int debug_set_mem (unsigned int address,unsigned long data)
{
int err = 0;
- debug (2, "MEMWRITE (%08x) = %08lx\n", address, data);
+ TRACE_(jtag)("MEMWRITE (%08x) = %08lx\n", address, data);
if(!verify_memoryarea(address))
@@ -421,21 +411,17 @@ int debug_get_mem(unsigned int address,u
{
*data=eval_direct32(address, 0, 0);
}
- debug (2, "MEMREAD (%08x) = %08lx\n", address, *data);
+ TRACE_(jtag)("MEMREAD (%08x) = %08lx\n", address, *data);
return err;
}
/* debug_ignore_exception returns 1 if the exception should be ignored. */
int debug_ignore_exception (unsigned long except)
{
int result = 0;
unsigned long dsr = cpu_state.sprs[SPR_DSR];
unsigned long drr = cpu_state.sprs[SPR_DRR];
-#if DEBUG_JTAG
- PRINTF ("dsr 0x%08x drr 0x%08x \n", dsr, drr);
-#endif
-
switch(except) {
case EXCEPT_RESET: drr |= result = dsr & SPR_DSR_RSTE; break;
case EXCEPT_BUSERR: drr |= result = dsr & SPR_DSR_BUSEE; break;
@@ -453,9 +439,6 @@ int debug_ignore_exception (unsigned lon
default:
break;
}
-#if DEBUG_JTAG
- PRINTF ("dsr 0x%08x drr 0x%08x result %i\n", dsr, drr, result);
-#endif
cpu_state.sprs[SPR_DRR] = drr;
set_stall_state (result != 0);
diff -upr --unidirectional-new-file ./support/dbchs.h /home/nog/or1ksim-ac/support/dbchs.h
--- ./support/dbchs.h 2005-06-28 15:15:51.000000000 +0200
+++ /home/nog/or1ksim-ac/support/dbchs.h 2005-06-28 11:54:59.000000000 +0200
@@ -34,3 +37,4 @@ DECLARE_DEBUG_CHANNEL(mc)
DECLARE_DEBUG_CHANNEL(dma)
DECLARE_DEBUG_CHANNEL(vapi)
DECLARE_DEBUG_CHANNEL(simprintf)
+DECLARE_DEBUG_CHANNEL(jtag)
|
 |