summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Bryan <wilbryan@us.ibm.com>2015-08-26 17:01:40 -0500
committerWilliam A. Bryan <wilbryan@us.ibm.com>2015-08-27 14:19:53 -0500
commit4103221248508ac1aa16a07e5ae7cac8b9860d57 (patch)
tree42457488d44dbaaaf153e446d4930843f6a077e6
parent0f26c7e693a059bc77529c03e2bec44486131e4a (diff)
downloadtalos-occ-4103221248508ac1aa16a07e5ae7cac8b9860d57.tar.gz
talos-occ-4103221248508ac1aa16a07e5ae7cac8b9860d57.zip
Enable tracing
I've reverted the way we trace from SSX_TRACE to the P8 way More useful way of compiling for Simics vs HW RTC: 133155 Change-Id: I7ac3ce9ad71e36de0cf0050f14ff3d2423c9f75f Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/20113 Tested-by: William A. Bryan <wilbryan@us.ibm.com> Reviewed-by: Wael Elessawy <welessa@us.ibm.com> Reviewed-by: Martha Broyles <mbroyles@us.ibm.com> Reviewed-by: William A. Bryan <wilbryan@us.ibm.com>
-rwxr-xr-xsrc/occ_405/Makefile3
-rw-r--r--src/occ_405/img_defs.mk9
-rwxr-xr-xsrc/occ_405/main.c10
-rw-r--r--src/occ_405/occ_defs.mk28
-rwxr-xr-xsrc/occ_405/ssx_app_cfg.h4
-rwxr-xr-xsrc/occ_405/trac/trac.h26
-rwxr-xr-xsrc/occ_405/trac/trac_interface.c15
-rwxr-xr-xsrc/occ_405/trac/trac_interface.h7
-rw-r--r--src/occ_gpe0/img_defs.mk4
-rw-r--r--src/occ_gpe0/pk_app_cfg.h5
10 files changed, 78 insertions, 33 deletions
diff --git a/src/occ_405/Makefile b/src/occ_405/Makefile
index 1d173dc..26e5169 100755
--- a/src/occ_405/Makefile
+++ b/src/occ_405/Makefile
@@ -28,6 +28,9 @@
#Pull in the definitions that affect all makefiles for this image
include img_defs.mk
+#Use tracepp instead of ppetracepp for 405 code
+include occ_defs.mk
+
#Pull in object file names for the top directory
include topfiles.mk
diff --git a/src/occ_405/img_defs.mk b/src/occ_405/img_defs.mk
index de8aec6..4695d51 100644
--- a/src/occ_405/img_defs.mk
+++ b/src/occ_405/img_defs.mk
@@ -113,8 +113,13 @@ ifndef PPETRACEPP_DIR
export PPETRACEPP_DIR = $(abspath ../ppe/tools/ppetracepp)
endif
+ifndef TRACEPP_DIR
+export TRACEPP_DIR = $(abspath ../tracepp)
+endif
+
CC_ASM = $(GCC-TOOL-PREFIX)gcc
TCC = $(PPETRACEPP_DIR)/ppetracepp $(GCC-TOOL-PREFIX)gcc
+THCC = $(TRACEPP_DIR)/tracepp $(GCC-TOOL-PREFIX)gcc
CC = $(GCC-TOOL-PREFIX)gcc
AS = $(GCC-TOOL-PREFIX)as
AR = $(GCC-TOOL-PREFIX)ar
@@ -204,11 +209,11 @@ INCLUDES += $(IMG_INCLUDES) $(GLOBAL_INCLUDES) $(APP_INCLUDES) \
PIPE-CFLAGS = -pipe -Wa,-m405
GCC-CFLAGS += -g -Wall -fsigned-char -msoft-float \
- -mcpu=405 -mmultiple -mstring -m32 \
+ -m32 -mbig-endian -mcpu=405 -mmultiple -mstring \
-meabi -msdata=eabi -ffreestanding -fno-common \
-fno-inline-functions-called-once
-CFLAGS = -c $(GCC-CFLAGS) $(PIPE-CFLAGS) $(GCC-O-LEVEL) $(INCLUDES)
+CFLAGS = -c $(GCC-CFLAGS) $(PIPE-CFLAGS) $(GCC-O-LEVEL) $(INCLUDES)
############################################################################
diff --git a/src/occ_405/main.c b/src/occ_405/main.c
index bf0d653..d795eef 100755
--- a/src/occ_405/main.c
+++ b/src/occ_405/main.c
@@ -1278,10 +1278,12 @@ int main(int argc, char **argv)
// enable and register additional interrupt handlers
CHECKPOINT(INITIALIZING_IRQS);
-// TODO: Uncomment when this is resolved. Causes SSX panic currently.
-// Not needed until we want to be able to catch hardware OCC or
-// PMC (or equivalent) errors.
-// occ_irq_setup();
+// TODO: Uncomment when this is resolved in Simics. Causes SSX panic
+// currently. Not needed until we want to be able to catch
+// hardware OCC or PMC (or equivalent) errors.
+#if !SIMICS_ENVIRONMENT
+ occ_irq_setup();
+#endif
CHECKPOINT(IRQS_INITIALIZED);
diff --git a/src/occ_405/occ_defs.mk b/src/occ_405/occ_defs.mk
new file mode 100644
index 0000000..4c276e0
--- /dev/null
+++ b/src/occ_405/occ_defs.mk
@@ -0,0 +1,28 @@
+# IBM_PROLOG_BEGIN_TAG
+# This is an automatically generated prolog.
+#
+# $Source: src/occ_405/occ_defs.mk $
+#
+# OpenPOWER OnChipController Project
+#
+# Contributors Listed Below - COPYRIGHT 2015
+# [+] International Business Machines Corp.
+#
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+# implied. See the License for the specific language governing
+# permissions and limitations under the License.
+#
+# IBM_PROLOG_END_TAG
+%.o: %.c
+$(OBJDIR)/%.o: %.c
+ $(THCC) $(CFLAGS) $(DEFS) -o $@ $<
+
diff --git a/src/occ_405/ssx_app_cfg.h b/src/occ_405/ssx_app_cfg.h
index d9a9b3b..9ab733a 100755
--- a/src/occ_405/ssx_app_cfg.h
+++ b/src/occ_405/ssx_app_cfg.h
@@ -162,6 +162,7 @@ do { \
#ifndef SIMICS_ENVIRONMENT
#define SIMICS_ENVIRONMENT 1
+#warning Building for Simics!
#endif
#ifndef USE_SIMICS_IO
@@ -180,6 +181,9 @@ do { \
#define USE_EPM_IO 0
#endif
+#if SIMICS_ENVIRONMENT
+#define PPC405_MMU_SUPPORT 0
+#endif
/// The buffer used for 'ssxout' in VBU and lab applications
///
diff --git a/src/occ_405/trac/trac.h b/src/occ_405/trac/trac.h
index ea9961c..d5154d4 100755
--- a/src/occ_405/trac/trac.h
+++ b/src/occ_405/trac/trac.h
@@ -25,21 +25,21 @@
#ifndef _trac_h
#define _trac_h
-//*************************************************************************
+//*************************************************************************/
// Includes
-//*************************************************************************
+//*************************************************************************/
#include <trac_interface.h>
-//*************************************************************************
+//*************************************************************************/
// Externs
-//*************************************************************************
+//*************************************************************************/
-//*************************************************************************
+//*************************************************************************/
// Macros
-//*************************************************************************
+//*************************************************************************/
-//*************************************************************************
+//*************************************************************************/
// Defines/Enums
-//*************************************************************************
+//*************************************************************************/
#ifndef NO_TRAC_STRINGS
#define ERR_MRK "ERR: "
@@ -75,7 +75,7 @@ extern void dumpHexString(const void *i_data, const unsigned int len, const char
#else //TRAC_TO_SIMICS
-/*
+
#define TRAC_ERR(frmt,args...) \
TRACE(g_trac_err,ERR_MRK frmt,##args)
#define TRAC_INFO(frmt,args...) \
@@ -86,14 +86,8 @@ extern void dumpHexString(const void *i_data, const unsigned int len, const char
TRACE(g_trac_inf,DBG_MRK fmt,##args)
#define DEBUG_HEXDUMP(data, len, string) \
TRACEBIN(g_trac_inf, string, data,len)
-*/
-#define TRAC_ERR SSX_TRACE
-#define TRAC_INFO SSX_TRACE
-#define TRAC_IMP SSX_TRACE
-#define DBG_PRINT SSX_TRACE
-#define DEBUG_HEXDUMP SSX_TRACE_BIN
-#endif //TRAC_TO_SIMICS
+#endif //TRAC_TO_SIMICS
#ifdef MAIN_DEBUG
#define MAIN_DBG(frmt,args...) \
diff --git a/src/occ_405/trac/trac_interface.c b/src/occ_405/trac/trac_interface.c
index c524d79..a49cbba 100755
--- a/src/occ_405/trac/trac_interface.c
+++ b/src/occ_405/trac/trac_interface.c
@@ -56,13 +56,13 @@
#define TRAC_TIME_200MHZ 2
#define TRAC_TIME_167MHZ 3 // 166666667Hz
-//*************************************************************************
+//*************************************************************************/
// Structures
-//*************************************************************************
+//*************************************************************************/
-//*************************************************************************
+//*************************************************************************/
// Globals
-//*************************************************************************
+//*************************************************************************/
/// Instantiate the buffers for the traces.
///
@@ -74,6 +74,13 @@ uint8_t g_trac_inf_buffer[TRACE_BUFFER_SIZE];
uint8_t g_trac_err_buffer[TRACE_BUFFER_SIZE];
uint8_t g_trac_imp_buffer[TRACE_BUFFER_SIZE];
+#if SIMICS_ENVIRONMENT
+// Necessary for use in Simics (to get address)
+uint8_t* g_trac_inf_buffer_ptr = g_trac_inf_buffer;
+uint8_t* g_trac_err_buffer_ptr = g_trac_err_buffer;
+uint8_t* g_trac_imp_buffer_ptr = g_trac_imp_buffer;
+#endif
+
// Need to modify the addTraceToErrl() function in errl.c when new trace buffer is added/removed
tracDesc_t g_trac_inf = (tracDesc_t) &g_trac_inf_buffer;
tracDesc_t g_trac_err = (tracDesc_t) &g_trac_err_buffer;
diff --git a/src/occ_405/trac/trac_interface.h b/src/occ_405/trac/trac_interface.h
index f573899..c5f21bd 100755
--- a/src/occ_405/trac/trac_interface.h
+++ b/src/occ_405/trac/trac_interface.h
@@ -43,13 +43,10 @@
#define TRACE(i_td,i_string,args...) \
- SSX_TRACE(i_string, args...)
-// trace_adal_write_all(i_td,trace_adal_hash(i_string,-1),__LINE__,0,##args)
+ trace_adal_write_all(i_td,trace_adal_hash(i_string,-1),__LINE__,0,##args)
#define TRACEBIN(i_td,i_string,i_ptr,i_size) \
- SSX_TRACE_BIN(i_string, i_ptr, i_size)
-// trac_write_bin(i_td,trace_adal_hash(i_string,0),__LINE__,i_ptr,i_size)
-
+ trac_write_bin(i_td,trace_adal_hash(i_string,0),__LINE__,i_ptr,i_size)
#ifndef NO_TRAC_STRINGS
diff --git a/src/occ_gpe0/img_defs.mk b/src/occ_gpe0/img_defs.mk
index 3282b0e..674765d 100644
--- a/src/occ_gpe0/img_defs.mk
+++ b/src/occ_gpe0/img_defs.mk
@@ -183,7 +183,7 @@ PIPE-CFLAGS = -pipe -Wa,-m405
GCC-CFLAGS += -Wall -fsigned-char -msoft-float \
-mcpu=405 -mmulhw -mmultiple \
- -meabi -msdata=eabi -ffreestanding -fno-common -Werror \
+ -meabi -msdata=eabi -ffreestanding -fno-common \
-fno-inline-functions-called-once \
-ffixed-r11 -ffixed-r12 \
-ffixed-r14 -ffixed-r15 -ffixed-r16 -ffixed-r17 \
@@ -193,7 +193,7 @@ GCC-CFLAGS += -Wall -fsigned-char -msoft-float \
-ffixed-cr1 -ffixed-cr2 -ffixed-cr3 -ffixed-cr4 \
-ffixed-cr5 -ffixed-cr6 -ffixed-cr7
-CFLAGS = -c $(GCC-CFLAGS) $(PIPE-CFLAGS) $(GCC-O-LEVEL) $(INCLUDES)
+CFLAGS = -c $(GCC-CFLAGS) $(PIPE-CFLAGS) $(GCC-O-LEVEL) $(INCLUDES)
CPPFLAGS = -E
diff --git a/src/occ_gpe0/pk_app_cfg.h b/src/occ_gpe0/pk_app_cfg.h
index 7d01008..e022118 100644
--- a/src/occ_gpe0/pk_app_cfg.h
+++ b/src/occ_gpe0/pk_app_cfg.h
@@ -36,6 +36,11 @@
#include "global_app_cfg.h"
+#ifndef SIMICS_ENVIRONMENT
+#define SIMICS_ENVIRONMENT 1
+#warning Building for Simics!
+#endif
+
/// Static configuration data for external interrupts:
///
/// IRQ#, TYPE, POLARITY, ENABLE
OpenPOWER on IntegriCloud