+2021-06-09 Mike Frysinger <vapier@gentoo.org>
+
+ * sim-if.c (sim_open): Delete cgen_init call.
+
2021-05-17 Mike Frysinger <vapier@gentoo.org>
* sim-main.h (struct sim_state): Delete.
bpf_cgen_init_dis (cd);
}
- /* Initialize various cgen things not done by common framework.
- Must be done after bpf_cgen_cpu_open. */
- cgen_init (sd);
-
/* XXX do eBPF sim specific initializations. */
return sd;
+2021-06-09 Mike Frysinger <vapier@gentoo.org>
+
+ * cgen-defs.h (STATE_RUN_FAST_P, CGEN_STATE, cgen_init): Delete.
+ * cgen-run.c (cgen_get_fast_p): New function.
+ (sim_resume): Move fast_p up and call cgen_get_fast_p.
+ * cgen-utils.c (cgen_init): Delete.
+ * sim-base.h: Delete cgen-sim.h include.
+ (struct sim_state): Delete cgen_state and STATE_CGEN_STATE.
+
2021-06-08 Mike Frysinger <vapier@gentoo.org>
* Make-common.in (IGEN_RUN): New variable.
#define ENDSWITCH(N)
#endif
\f
-/* Simulator state. */
-
-/* CGEN_STATE contains additional state information not present in
- sim_state_base. */
-
-typedef struct cgen_state {
- /* Non-zero if no tracing or profiling is selected. */
- int run_fast_p;
-#define STATE_RUN_FAST_P(sd) (STATE_CGEN_STATE (sd).run_fast_p)
-} CGEN_STATE;
-\f
/* Various utilities. */
-/* Called after sim_post_argv_init to do any cgen initialization. */
-extern void cgen_init (SIM_DESC);
-
/* Return the name of an insn. */
extern CPU_INSN_NAME_FN cgen_insn_name;
static void engine_run_1 (SIM_DESC, int, int);
static void engine_run_n (SIM_DESC, int, int, int, int);
+/* If no profiling or tracing has been enabled, run in fast mode. */
+static int
+cgen_get_fast_p (SIM_DESC sd)
+{
+ int i, c;
+ int run_fast_p = 1;
+
+ for (c = 0; c < MAX_NR_PROCESSORS; ++c)
+ {
+ SIM_CPU *cpu = STATE_CPU (sd, c);
+
+ if (PROFILE_ANY_P (cpu) || TRACE_ANY_P (cpu))
+ return 0;
+ }
+
+ return 1;
+}
+
/* sim_resume for cgen */
void
sim_engine *engine = STATE_ENGINE (sd);
jmp_buf buf;
int jmpval;
+ static int fast_p = -1;
ASSERT (STATE_MAGIC (sd) == SIM_MAGIC_NUMBER);
+ if (fast_p == -1)
+ fast_p = cgen_get_fast_p (sd);
+
/* we only want to be single stepping the simulator once */
if (engine->stepper != NULL)
{
&& STATE_OPEN_KIND (sd) == SIM_OPEN_STANDALONE)
? 0
: 8); /*FIXME: magic number*/
- int fast_p = STATE_RUN_FAST_P (sd);
sim_events_preprocess (sd, last_cpu_nr >= nr_cpus, next_cpu_nr >= nr_cpus);
if (next_cpu_nr >= nr_cpus)
{ & virtual_insn_entries[5] }
};
-/* Initialize cgen things.
- This is called after sim_post_argv_init. */
-
-void
-cgen_init (SIM_DESC sd)
-{
- int i, c;
-
- /* If no profiling or tracing has been enabled, run in fast mode. */
- {
- int run_fast_p = 1;
-
- for (c = 0; c < MAX_NR_PROCESSORS; ++c)
- {
- SIM_CPU *cpu = STATE_CPU (sd, c);
-
- for (i = 0; i < MAX_PROFILE_VALUES; ++i)
- if (CPU_PROFILE_FLAGS (cpu) [i])
- {
- run_fast_p = 0;
- break;
- }
- for (i = 0; i < MAX_TRACE_VALUES; ++i)
- if (CPU_TRACE_FLAGS (cpu) [i])
- {
- run_fast_p = 0;
- break;
- }
- if (! run_fast_p)
- break;
- }
- STATE_RUN_FAST_P (sd) = run_fast_p;
- }
-}
-
/* Return the name of insn number I. */
const char *
#include "sim-cpu.h"
#include "sim-assert.h"
-#ifdef CGEN_ARCH
-# include "cgen-sim.h"
-#endif
-
struct sim_state {
/* All the cpus for this instance. */
sim_cpu *cpu[MAX_NR_PROCESSORS];
void *arch_data;
#define STATE_ARCH_DATA(sd) ((sd)->arch_data)
-#ifdef CGEN_ARCH
- /* Various cgen runtime state. */
- CGEN_STATE cgen_state;
-#endif
-#define STATE_CGEN_STATE(sd) ((sd)->cgen_state)
-
/* Marker for those wanting to do sanity checks.
This should remain the last member of this struct to help catch
miscompilation errors. */
+2021-06-09 Mike Frysinger <vapier@gentoo.org>
+
+ * sim-if.c (sim_open): Delete cgen_init call.
+
2021-05-24 Mike Frysinger <vapier@gentoo.org>
* cris-desc.c, cris-desc.h, cris-opc.h: Moved to opcodes/.
#endif
}
- /* Initialize various cgen things not done by common framework.
- Must be done after cris_cgen_cpu_open. */
- cgen_init (sd);
-
cris_set_callbacks (callback);
return sd;
+2021-06-09 Mike Frysinger <vapier@gentoo.org>
+
+ * sim-if.c (sim_open): Delete cgen_init call.
+
2021-05-29 Mike Frysinger <vapier@gentoo.org>
* cache.h (frv_cache_unlock): New prototype.
frv_cgen_init_dis (cd);
}
- /* Initialize various cgen things not done by common framework.
- Must be done after frv_cgen_cpu_open. */
- cgen_init (sd);
-
/* CPU specific initialization. */
for (i = 0; i < MAX_NR_PROCESSORS; ++i)
{
+2021-06-09 Mike Frysinger <vapier@gentoo.org>
+
+ * sim-if.c (sim_open): Delete cgen_init call.
+
2021-05-17 Mike Frysinger <vapier@gentoo.org>
* sim-main.h (struct sim_state): Delete.
iq2000_cgen_init_dis (cd);
}
- /* Initialize various cgen things not done by common framework.
- Must be done after iq2000_cgen_cpu_open. */
- cgen_init (sd);
-
return sd;
}
\f
+2021-06-09 Mike Frysinger <vapier@gentoo.org>
+
+ * sim-if.c (sim_open): Delete cgen_init call.
+
2021-05-17 Mike Frysinger <vapier@gentoo.org>
* sim-main.h (struct sim_state): Delete.
lm32_cgen_init_dis (cd);
}
- /* Initialize various cgen things not done by common framework.
- Must be done after lm32_cgen_cpu_open. */
- cgen_init (sd);
-
return sd;
}
\f
+2021-06-09 Mike Frysinger <vapier@gentoo.org>
+
+ * sim-if.c (sim_open): Delete cgen_init call.
+
2021-05-17 Mike Frysinger <vapier@gentoo.org>
* sim-main.h (struct sim_state): Delete.
m32r_cgen_init_dis (cd);
}
- /* Initialize various cgen things not done by common framework.
- Must be done after m32r_cgen_cpu_open. */
- cgen_init (sd);
-
for (c = 0; c < MAX_NR_PROCESSORS; ++c)
{
/* Only needed for profiling, but the structure member is small. */
+2021-06-09 Mike Frysinger <vapier@gentoo.org>
+
+ * sim-if.c (sim_open): Delete cgen_init call.
+ * traps.c (or1k32bf_fpu_error): Replace STATE_RUN_FAST_P with
+ PROFILE_ANY_P and TRACE_ANY_P.
+
2021-05-17 Mike Frysinger <vapier@gentoo.org>
* sim-main.h: Move or1k-opc.h include.
or1k_cgen_init_dis (cd);
}
- /* Initialize various cgen things not done by common framework.
- Must be done after or1k_cgen_cpu_open. */
- cgen_init (sd);
-
/* Do some final OpenRISC sim specific initializations. */
for (c = 0; c < MAX_NR_PROCESSORS; ++c)
{
per-instruction callbacks are not triggered which would allow
us to track the PC. This means we cannot track which
instruction caused the FPU error. */
- if (STATE_RUN_FAST_P (sd) == 1)
+ if (!PROFILE_ANY_P (current_cpu) && !TRACE_ANY_P (current_cpu))
sim_io_eprintf
(sd, "WARNING: ignoring fpu error caught in fast mode.\n");
else