+2015-12-25 Mike Frysinger <vapier@gentoo.org>
+
+ * Makefile.in (SIM_OBJS): Delete sim-model.o.
+ * tconfig.h (SIM_HAVE_MODEL): Delete.
+
2015-12-25 Mike Frysinger <vapier@gentoo.org>
* machs.c: Rename MACH to SIM_MACH, MACH_IMP_PROPERTIES to
interp.o \
machs.o \
sim-hload.o \
- sim-model.o \
sim-resume.o
INCLUDE = bfin-sim.h
/* We use this so that we are passed the requesting CPU for HW acesses.
Common sim core by default sets hw_system_cpu to NULL for WITH_HW. */
#define WITH_DEVICES 1
-
-/* ??? Temporary hack until model support unified. */
-#define SIM_HAVE_MODEL
+2015-12-25 Mike Frysinger <vapier@gentoo.org>
+
+ * Make-common.in (SIM_NEW_COMMON_OBJS): Add sim-model.o.
+ * cgen-types.h (SIM_HAVE_MODEL): Delete.
+ * sim-base.h: Always include sim-model.h.
+ * sim-config.h (WITH_DEFAULT_MODEL): Delete.
+ * sim-cpu.h (sim_cpu_base): Always declare mach/model members.
+ * sim-model.c (sim_model_init): Return when !WITH_MODEL_P.
+ [!WITH_MODEL_P] (sim_machs): Define.
+ * sim-model.h: Add some developer docs.
+ [!WITH_DEFAULT_MODEL] (mach_attr, WITH_DEFAULT_MODEL): Define.
+ (WITH_MODEL_P): Define.
+ * sim-module.c (modules): Always include sim_model_install.
+ * sim-profile.h (WITH_PROFILE_MODEL_P): Delete.
+
2015-12-25 Mike Frysinger <vapier@gentoo.org>
* sim-cpu.h: Rename MACH to SIM_MACH and MODEL to SIM_MODEL.
sim-info.o \
sim-load.o \
sim-memopt.o \
+ sim-model.o \
sim-module.o \
sim-options.o \
sim-profile.o \
/* Miscellaneous cgen configury defined here as this file gets
included soon enough. */
-/* Indicate we support --profile-model. */
-#undef SIM_HAVE_MODEL
-#define SIM_HAVE_MODEL
-
/* Indicate we support --{profile,trace}-{range,function}. */
#undef SIM_HAVE_ADDR_RANGE
#define SIM_HAVE_ADDR_RANGE
#include "sim-core.h"
#include "sim-events.h"
#include "sim-profile.h"
-#ifdef SIM_HAVE_MODEL
#include "sim-model.h"
-#endif
#include "sim-io.h"
#include "sim-engine.h"
#include "sim-watch.h"
? WITH_MODEL \
: current_model)
-#ifndef WITH_DEFAULT_MODEL
-#define WITH_DEFAULT_MODEL DEFAULT_MODEL
-#endif
-
#define MODEL_ISSUE_IGNORE (-1)
#define MODEL_ISSUE_PROCESS 1
PROFILE_DATA profile_data;
#define CPU_PROFILE_DATA(cpu) (& (cpu)->base.profile_data)
-#ifdef SIM_HAVE_MODEL
/* Machine tables for this cpu. See sim-model.h. */
const SIM_MACH *mach;
#define CPU_MACH(cpu) ((cpu)->base.mach)
/* Model data (profiling state, etc.). */
void *model_data;
#define CPU_MODEL_DATA(cpu) ((cpu)->base.model_data)
-#endif
/* Routines to fetch/store registers. */
CPUREG_FETCH_FN *reg_fetch;
{
SIM_CPU *cpu;
+ if (!WITH_MODEL_P)
+ return SIM_RC_OK;
+
/* If both cpu model and state architecture are set, ensure they're
compatible. If only one is set, set the other. If neither are set,
use the default model. STATE_ARCHITECTURE is the bfd_arch_info data
return SIM_RC_OK;
}
+\f
+#if !WITH_MODEL_P
+/* Set up basic model support. This is a stub for ports that do not define
+ models. See sim-model.h for more details. */
+const SIM_MACH *sim_machs[] =
+{
+ NULL
+};
+#endif
architecture = one of sparc, mips, sh, etc.
in the sparc architecture, mach = one of v6, v7, v8, sparclite, etc.
in the v8 mach, model = one of supersparc, etc.
+
+ To use the model framework, your arch needs to do a few things:
+ (1) Call SIM_AC_OPTION_DEFAULT_MODEL() in configure.ac.
+ (2) Define enum mach_attr in sim-main.h.
+ (3) Define sim_machs array (and all the callbacks it uses).
*/
/* This file is intended to be included by sim-basics.h. */
#define MAX_UNITS 1
#endif
+#ifndef WITH_DEFAULT_MODEL
+/* Just a stub for ports that do not define models. */
+enum mach_attr { _MACH_NONE };
+# define WITH_DEFAULT_MODEL NULL
+# define WITH_MODEL_P 0
+#else
+# define WITH_MODEL_P 1
+#endif
+
typedef int (MODEL_FN) (sim_cpu *, void *);
typedef struct {
static MODULE_INSTALL_FN * const modules[] = {
standard_install,
sim_events_install,
-#ifdef SIM_HAVE_MODEL
sim_model_install,
-#endif
#if WITH_ENGINE
sim_engine_install,
#endif
#define WITH_PROFILE_MEMORY_P 0
#endif
-/* Only build MODEL code when the target simulator has support for it */
-#ifndef SIM_HAVE_MODEL
-#undef WITH_PROFILE_MODEL_P
-#define WITH_PROFILE_MODEL_P 0
-#endif
-
/* Profiling install handler. */
MODULE_INSTALL_FN profile_install;
+2015-12-25 Mike Frysinger <vapier@gentoo.org>
+
+ * Makefile.in (SIM_OBJS): Delete sim-model.o.
+ * tconfig.h (SIM_HAVE_MODEL): Delete.
+
2015-12-25 Mike Frysinger <vapier@gentoo.org>
* arch.c: Rename MACH to SIM_MACH.
SIM_OBJS = \
$(SIM_NEW_COMMON_OBJS) \
- sim-model.o \
cgen-utils.o cgen-trace.o cgen-scache.o \
cgen-run.o \
sim-if.o arch.o \
/* For MSPR support. FIXME: revisit. */
#define WITH_DEVICES 1
-#define SIM_HAVE_MODEL
-
#endif /* CRIS_TCONFIG_H */
+2015-12-25 Mike Frysinger <vapier@gentoo.org>
+
+ * Makefile.in (SIM_OBJS): Delete sim-model.o.
+ * tconfig.h (SIM_HAVE_MODEL): Delete.
+
2015-12-25 Mike Frysinger <vapier@gentoo.org>
* arch.c: Rename MACH to SIM_MACH.
SIM_OBJS = \
$(SIM_NEW_COMMON_OBJS) \
sim-hload.o \
- sim-model.o \
cgen-utils.o cgen-trace.o cgen-scache.o cgen-fpu.o cgen-accfp.o \
cgen-run.o \
sim-if.o arch.o \
/* For MSPR support. FIXME: revisit. */
#define WITH_DEVICES 1
-
-/* ??? Temporary hack until model support unified. */
-#define SIM_HAVE_MODEL
+2015-12-25 Mike Frysinger <vapier@gentoo.org>
+
+ * Makefile.in (SIM_OBJS): Delete sim-model.o.
+ * tconfig.h: Delete file.
+
2015-12-25 Mike Frysinger <vapier@gentoo.org>
* arch.c: Rename MACH to SIM_MACH.
SIM_OBJS = \
$(SIM_NEW_COMMON_OBJS) \
sim-hload.o \
- sim-model.o \
cgen-utils.o cgen-trace.o cgen-scache.o \
cgen-run.o \
sim-if.o arch.o \
+++ /dev/null
-/* IQ2000 target configuration file. -*- C -*- */
-
-/* For MSPR support. FIXME: revisit. */
-#define WITH_DEVICES 0
-
-/* ??? Temporary hack until model support unified. */
-#define SIM_HAVE_MODEL
+2015-12-25 Mike Frysinger <vapier@gentoo.org>
+
+ * Makefile.in (SIM_OBJS): Delete sim-model.o.
+
2015-12-25 Mike Frysinger <vapier@gentoo.org>
* arch.c: Rename MACH to SIM_MACH.
SIM_OBJS = \
$(SIM_NEW_COMMON_OBJS) \
sim-hload.o \
- sim-model.o \
cgen-utils.o cgen-trace.o cgen-scache.o \
cgen-run.o \
sim-if.o arch.o \
+2015-12-25 Mike Frysinger <vapier@gentoo.org>
+
+ * Makefile.in (SIM_OBJS): Delete sim-model.o.
+
2015-12-25 Mike Frysinger <vapier@gentoo.org>
* arch.c: Rename MACH to SIM_MACH.
SIM_OBJS = \
$(SIM_NEW_COMMON_OBJS) \
sim-hload.o \
- sim-model.o \
cgen-utils.o cgen-trace.o cgen-scache.o \
cgen-run.o \
sim-if.o arch.o \
+2015-12-25 Mike Frysinger <vapier@gentoo.org>
+
+ * Makefile.in (SIM_OBJS): Delete sim-model.o.
+ * tconfig.h: Delete file.
+
2015-12-25 Mike Frysinger <vapier@gentoo.org>
* arch.c: Rename MACH to SIM_MACH.
SIM_OBJS = \
$(SIM_NEW_COMMON_OBJS) \
sim-hload.o \
- sim-model.o \
cgen-utils.o cgen-trace.o cgen-scache.o \
cgen-run.o \
sim-if.o arch.o \
+++ /dev/null
-/* SH64 target configuration file. -*- C -*- */
-
-/* For MSPR support. FIXME: revisit. */
-#define WITH_DEVICES 0
-
-/* ??? Temporary hack until model support unified. */
-#define SIM_HAVE_MODEL