From 7eebfc6296f0830a435a21be0ab37a076c8566bd Mon Sep 17 00:00:00 2001 From: Michael Meissner Date: Wed, 4 Sep 1996 17:42:51 +0000 Subject: More debug support; Enable -t/-v to work correctly; Add --enable-sim-cflags configure switch --- sim/d10v/d10v_sim.h | 53 +++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 43 insertions(+), 10 deletions(-) (limited to 'sim/d10v/d10v_sim.h') diff --git a/sim/d10v/d10v_sim.h b/sim/d10v/d10v_sim.h index 64fa4a9..4913fa8 100644 --- a/sim/d10v/d10v_sim.h +++ b/sim/d10v/d10v_sim.h @@ -1,26 +1,55 @@ #include #include +#include #include "ansidecl.h" #include "callback.h" #include "opcode/d10v.h" -#define DEBUG_TRACE 0x00000001 -#define DEBUG_VALUES 0x00000002 -#define DEBUG_MEMSIZE 0x00000004 +#define DEBUG_TRACE 0x00000001 +#define DEBUG_VALUES 0x00000002 +#define DEBUG_MEMSIZE 0x00000004 +#define DEBUG_INSTRUCTION 0x00000008 -#ifndef DEBUG -#define DEBUG 0 -#endif +extern int d10v_debug; -/* FIXME: host defines */ +#if UCHAR_MAX == 255 typedef unsigned char uint8; -typedef unsigned short uint16; -typedef unsigned int uint32; typedef signed char int8; +#else +#error "Char is not an 8-bit type" +#endif + +#if SHRT_MAX == 32767 +typedef unsigned short uint16; typedef signed short int16; +#else +#error "Short is not a 16-bit type" +#endif + +#if INT_MAX == 2147483647 +typedef unsigned int uint32; typedef signed int int32; + +#elif LONG_MAX == 2147483647 +typedef unsigned long uint32; +typedef signed long int32; + +#else +#error "Neither int nor long is a 32-bit type" +#endif + +#if LONG_MAX > 2147483647 +typedef unsigned long uint64; +typedef signed long int64; + +#elif __GNUC__ +typedef unsigned long long uint64; typedef signed long long int64; +#else +#error "Can't find an appropriate 64-bit type" +#endif + /* FIXME: D10V defines */ typedef uint16 reg_t; @@ -44,9 +73,13 @@ enum _ins_type INS_RIGHT, INS_LEFT_PARALLEL, INS_RIGHT_PARALLEL, - INS_LONG + INS_LONG, + INS_MAX }; +extern long ins_type_counters[ (int)INS_MAX ]; +extern long left_nops, right_nops; + struct _state { reg_t regs[16]; /* general-purpose registers */ -- cgit v1.1