aboutsummaryrefslogtreecommitdiff
path: root/sim/or1k
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2021-06-05 10:21:46 -0400
committerMike Frysinger <vapier@gentoo.org>2021-06-09 18:21:28 -0400
commit906192d7859f9e768fc73f330e10d3b3a4ddaba3 (patch)
treef55e6c1aad3a8083932ffd01027856078a0d6a28 /sim/or1k
parentc70fdc45f60845852f98eae3b8035de1a2df78de (diff)
downloadfsf-binutils-gdb-906192d7859f9e768fc73f330e10d3b3a4ddaba3.zip
fsf-binutils-gdb-906192d7859f9e768fc73f330e10d3b3a4ddaba3.tar.gz
fsf-binutils-gdb-906192d7859f9e768fc73f330e10d3b3a4ddaba3.tar.bz2
sim: cgen: inline cgen_init logic
This function has done only one thing: post-process command line settings to see if profiling or tracing has been enabled, and if so, set the run_fast_p flag in the simulator state. That flag is only used in one place: to select the fast or slow cgen engine. By inlining the run_fast_p logic to the one place it's used, we can delete a good amount of logic specific to cgen ports: both the call to cgen_init and the conditional simulator state. This in turn allows us to have a single simulator state struct across all ports so we can share objects more between them, and makes the sim_open calls look more consistent.
Diffstat (limited to 'sim/or1k')
-rw-r--r--sim/or1k/ChangeLog6
-rw-r--r--sim/or1k/sim-if.c4
-rw-r--r--sim/or1k/traps.c2
3 files changed, 7 insertions, 5 deletions
diff --git a/sim/or1k/ChangeLog b/sim/or1k/ChangeLog
index 3484c07..689f038 100644
--- a/sim/or1k/ChangeLog
+++ b/sim/or1k/ChangeLog
@@ -1,3 +1,9 @@
+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.
diff --git a/sim/or1k/sim-if.c b/sim/or1k/sim-if.c
index 005124b..e6342ee 100644
--- a/sim/or1k/sim-if.c
+++ b/sim/or1k/sim-if.c
@@ -238,10 +238,6 @@ sim_open (SIM_OPEN_KIND kind, host_callback *callback, struct bfd *abfd,
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)
{
diff --git a/sim/or1k/traps.c b/sim/or1k/traps.c
index 7f5a38f..bb428fa 100644
--- a/sim/or1k/traps.c
+++ b/sim/or1k/traps.c
@@ -104,7 +104,7 @@ or1k32bf_fpu_error (CGEN_FPU* fpu, int status)
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