sim: smp: make option available again
authorMike Frysinger <vapier@gentoo.org>
Sun, 25 Dec 2022 04:28:19 +0000 (23:28 -0500)
committerMike Frysinger <vapier@gentoo.org>
Sun, 25 Dec 2022 07:13:30 +0000 (02:13 -0500)
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.

sim/Makefile.in
sim/aclocal.m4
sim/config.h.in
sim/configure
sim/configure.ac
sim/m4/sim_ac_option_smp.m4

index 7cd86b5b4928fe2f8d590e30bcc83aee3d8f2028..0693572987e54d063dba33f4db5ab5e779f09d91 100644 (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 \
index f220c82af75b52d3fd8cf12cabbbd5430a1dbc9b..d7db9e46b5871733aa59874bf5ba7734609131d5 100644 (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])
index 71f17fb926bb81fdc27cd28dd53ce2092f14ccec..fc4f3988d5a475c43cc98bb1426607f864560ccb 100644 (file)
 /* Sim cache szie */
 #undef WITH_SCACHE
 
+/* Sim SMP settings */
+#undef WITH_SMP
+
 /* How to route I/O */
 #undef WITH_STDIO
 
index 3a57189d610b0722c1c7e417be0c6e274a51441d..6329dfd6797ef5ffa9d2b26ab2dad2e953bc5542 100755 (executable)
@@ -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"
index bfcd9e59d10e6a0470f9e09b0201e348421a6a88..af7e6e752ca1f16a1d3a2ce0fa00a5e4683bfb8c 100644 (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
index b59d7e6e7600f7c91b8e7fa8e137a76951474b41..5c2b35f9d846bddde0700a2ef67777ad1f0d59cc 100644 (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)
 ])