sim: move default model to the runtime sim state

This kills off another compile-time option by moving the setting to
the individual arch runtimes.  This will allow dynamic selection by
the arch when doing a single build with multiple arches.

The sim_model_init rework is a little funky.  In the past it was
disabled entirely if no default model was set.  We maintain the
spirit of the logic by gating the fallback logic on whether the
port has defined any models.
This commit is contained in:
Mike Frysinger 2021-06-28 22:07:44 -04:00
parent 1c636da093
commit d414eb3e7f
62 changed files with 120 additions and 298 deletions

View file

@ -1,3 +1,10 @@
2021-06-30 Mike Frysinger <vapier@gentoo.org>
* configure.ac: Delete SIM_AC_OPTION_DEFAULT_MODEL call.
* sim-if.c (sim_open): Set STATE_MODEL_NAME.
* aclocal.m4: Regenerate.
* configure: Regenerate.
2021-06-30 Mike Frysinger <vapier@gentoo.org>
* arch.c (sim_machs): Rename to ...

1
sim/lm32/aclocal.m4 vendored
View file

@ -12,6 +12,5 @@
# PARTICULAR PURPOSE.
m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
m4_include([../m4/sim_ac_option_default_model.m4])
m4_include([../m4/sim_ac_option_scache.m4])
m4_include([../m4/sim_ac_output.m4])

23
sim/lm32/configure vendored
View file

@ -628,13 +628,11 @@ PACKAGE_TARNAME
PACKAGE_NAME
PATH_SEPARATOR
SHELL
sim_scache
sim_default_model'
sim_scache'
ac_subst_files=''
ac_user_opts='
enable_option_checking
enable_sim_scache
enable_sim_default_model
'
ac_precious_vars='build_alias
host_alias
@ -1248,8 +1246,6 @@ Optional Features:
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
--enable-sim-scache=size
Specify simulator execution cache size
--enable-sim-default-model=model
Specify default model to simulate
Report bugs to the package provider.
_ACEOF
@ -1701,22 +1697,6 @@ fi
default_sim_default_model="lm32"
# Check whether --enable-sim-default-model was given.
if test "${enable_sim_default_model+set}" = set; then :
enableval=$enable_sim_default_model; case "${enableval}" in
yes|no) as_fn_error $? "\"Missing argument to --enable-sim-default-model\"" "$LINENO" 5;;
*) sim_default_model="-DWITH_DEFAULT_MODEL='\"${enableval}\"'";;
esac
if test x"$silent" != x"yes" && test x"$sim_default_model" != x""; then
echo "Setting default model = $sim_default_model" 6>&1
fi
else
sim_default_model="-DWITH_DEFAULT_MODEL='\"${default_sim_default_model}\"'"
fi
cgen_breaks=""
if grep CGEN_MAINT $srcdir/Makefile.in >/dev/null; then
cgen_breaks="break cgen_rtx_error";
@ -1738,7 +1718,6 @@ ac_config_commands="$ac_config_commands stamp-h"
SIM_COMMON_BUILD_TRUE='#'
SIM_COMMON_BUILD_FALSE=

View file

@ -3,6 +3,5 @@ AC_INIT(Makefile.in)
AC_CONFIG_MACRO_DIRS([../m4 ../.. ../../config])
SIM_AC_OPTION_SCACHE(16384)
SIM_AC_OPTION_DEFAULT_MODEL(lm32)
SIM_AC_OUTPUT

View file

@ -95,6 +95,7 @@ sim_open (SIM_OPEN_KIND kind, host_callback *callback, struct bfd *abfd,
/* Set default options before parsing user options. */
STATE_MACHS (sd) = lm32_sim_machs;
STATE_MODEL_NAME (sd) = "lm32";
current_alignment = STRICT_ALIGNMENT;
current_target_byte_order = BFD_ENDIAN_BIG;