sim: smp: make option available again

At some point we want this to work, but it's not easy to test if
the configure option isn't available.  Restore it, but keep the
default off.
This commit is contained in:
Mike Frysinger 2022-12-24 23:28:19 -05:00
parent 883be19774
commit 20b579bac5
6 changed files with 48 additions and 8 deletions

View File

@ -241,6 +241,7 @@ am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \
$(top_srcdir)/m4/sim_ac_option_profile.m4 \
$(top_srcdir)/m4/sim_ac_option_reserved_bits.m4 \
$(top_srcdir)/m4/sim_ac_option_scache.m4 \
$(top_srcdir)/m4/sim_ac_option_smp.m4 \
$(top_srcdir)/m4/sim_ac_option_stdio.m4 \
$(top_srcdir)/m4/sim_ac_option_trace.m4 \
$(top_srcdir)/m4/sim_ac_option_warnings.m4 \

1
sim/aclocal.m4 vendored
View File

@ -1188,6 +1188,7 @@ m4_include([m4/sim_ac_option_inline.m4])
m4_include([m4/sim_ac_option_profile.m4])
m4_include([m4/sim_ac_option_reserved_bits.m4])
m4_include([m4/sim_ac_option_scache.m4])
m4_include([m4/sim_ac_option_smp.m4])
m4_include([m4/sim_ac_option_stdio.m4])
m4_include([m4/sim_ac_option_trace.m4])
m4_include([m4/sim_ac_option_warnings.m4])

View File

@ -468,6 +468,9 @@
/* Sim cache szie */
#undef WITH_SCACHE
/* Sim SMP settings */
#undef WITH_SMP
/* How to route I/O */
#undef WITH_STDIO

32
sim/configure vendored
View File

@ -1004,6 +1004,7 @@ enable_sim_inline
enable_sim_profile
enable_sim_reserved_bits
enable_sim_scache
enable_sim_smp
enable_sim_stdio
enable_sim_trace
enable_werror
@ -1780,6 +1781,8 @@ Optional Features:
instruction
--enable-sim-scache=size
Specify simulator execution cache size
--enable-sim-smp=n Specify number of processors to configure for
(default 1)
--enable-sim-stdio Specify whether to use stdio for console
input/output
--enable-sim-trace=opts Enable tracing of simulated programs
@ -12442,7 +12445,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
#line 12445 "configure"
#line 12448 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@ -12548,7 +12551,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
#line 12551 "configure"
#line 12554 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@ -16080,6 +16083,31 @@ _ACEOF
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $sim_scache" >&5
$as_echo "$sim_scache" >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking number of sim cpus to support" >&5
$as_echo_n "checking number of sim cpus to support... " >&6; }
default_sim_smp="0"
sim_smp="$default_sim_smp"
# Check whether --enable-sim-smp was given.
if test "${enable_sim_smp+set}" = set; then :
enableval=$enable_sim_smp; case "${enableval}" in
yes) sim_smp="5";;
no) sim_smp="0";;
*) sim_smp="$enableval";;
esac
fi
sim_igen_smp="-N ${sim_smp}"
if test "x$sim_smp" = x0; then :
else
cat >>confdefs.h <<_ACEOF
#define WITH_SMP $sim_smp
_ACEOF
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $sim_smp" >&5
$as_echo "$sim_smp" >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sim stdio debug behavior" >&5
$as_echo_n "checking for sim stdio debug behavior... " >&6; }
sim_stdio="0"

View File

@ -180,6 +180,7 @@ SIM_AC_OPTION_INLINE
SIM_AC_OPTION_PROFILE
SIM_AC_OPTION_RESERVED_BITS
SIM_AC_OPTION_SCACHE
SIM_AC_OPTION_SMP
SIM_AC_OPTION_STDIO
SIM_AC_OPTION_TRACE
SIM_AC_OPTION_WARNINGS

View File

@ -12,20 +12,26 @@ dnl GNU General Public License for more details.
dnl
dnl You should have received a copy of the GNU General Public License
dnl along with this program. If not, see <http://www.gnu.org/licenses/>.
AC_DEFUN([SIM_AC_OPTION_SMP],
[
AC_DEFUN([SIM_AC_OPTION_SMP], [dnl
AC_MSG_CHECKING([number of sim cpus to support])
default_sim_smp="ifelse([$1],,5,[$1])"
sim_smp="$default_sim_smp""
dnl TODO: We should increase the default to use smp at some point. When we do,
dnl the ppc/configure sim-smp option should be merged. See the WITH_SMP check
dnl below for more cleanups too.
default_sim_smp="0"
sim_smp="$default_sim_smp"
AC_ARG_ENABLE(sim-smp,
[AS_HELP_STRING([--enable-sim-smp=n],
[Specify number of processors to configure for (default ${default_sim_smp})])],
[Specify number of processors to configure for (default 1)])],
[case "${enableval}" in
yes) sim_smp="5";;
no) sim_smp="0";;
*) sim_smp="$enableval";;
esac])dnl
sim_igen_smp="-N ${sim_smp}"
AC_DEFINE_UNQUOTED([WITH_SMP], [$sim_smp], [Sim SMP settings])
dnl NB: The ppc code uses a diff default because its smp works. That is why
dnl we don't unconditionally enable WITH_SMP here. Once we unify ppc, we can
dnl make this unconditional.
AS_VAR_IF([sim_smp], [0], [], [dnl
AC_DEFINE_UNQUOTED([WITH_SMP], [$sim_smp], [Sim SMP settings])])
AC_MSG_RESULT($sim_smp)
])