sim: mips: move igen settings to top-level configure
This is the last bit of logic that exists in the mips configure script, so move it to the top-level configure to kill it off. We still have to move the Makefile.in igen logic to local.mk, but this is a required first step for that.
This commit is contained in:
parent
fec5386aef
commit
abc494c65d
@ -269,15 +269,16 @@ CONFIG_CLEAN_FILES = Make-common.sim aarch64/Makefile.sim \
|
||||
lm32/.gdbinit m32c/Makefile.sim m32c/.gdbinit \
|
||||
m32r/Makefile.sim m32r/.gdbinit m68hc11/Makefile.sim \
|
||||
m68hc11/.gdbinit mcore/Makefile.sim mcore/.gdbinit \
|
||||
microblaze/Makefile.sim microblaze/.gdbinit mips/.gdbinit \
|
||||
mn10300/Makefile.sim mn10300/.gdbinit moxie/Makefile.sim \
|
||||
moxie/.gdbinit msp430/Makefile.sim msp430/.gdbinit \
|
||||
or1k/Makefile.sim or1k/.gdbinit ppc/.gdbinit pru/Makefile.sim \
|
||||
pru/.gdbinit riscv/Makefile.sim riscv/.gdbinit \
|
||||
rl78/Makefile.sim rl78/.gdbinit rx/Makefile.sim rx/.gdbinit \
|
||||
sh/Makefile.sim sh/.gdbinit erc32/Makefile.sim erc32/.gdbinit \
|
||||
v850/Makefile.sim v850/.gdbinit example-synacor/Makefile.sim \
|
||||
example-synacor/.gdbinit arch-subdir.mk .gdbinit
|
||||
microblaze/Makefile.sim microblaze/.gdbinit mips/Makefile.sim \
|
||||
mips/.gdbinit mn10300/Makefile.sim mn10300/.gdbinit \
|
||||
moxie/Makefile.sim moxie/.gdbinit msp430/Makefile.sim \
|
||||
msp430/.gdbinit or1k/Makefile.sim or1k/.gdbinit ppc/.gdbinit \
|
||||
pru/Makefile.sim pru/.gdbinit riscv/Makefile.sim \
|
||||
riscv/.gdbinit rl78/Makefile.sim rl78/.gdbinit rx/Makefile.sim \
|
||||
rx/.gdbinit sh/Makefile.sim sh/.gdbinit erc32/Makefile.sim \
|
||||
erc32/.gdbinit v850/Makefile.sim v850/.gdbinit \
|
||||
example-synacor/Makefile.sim example-synacor/.gdbinit \
|
||||
arch-subdir.mk .gdbinit
|
||||
CONFIG_CLEAN_VPATH_FILES =
|
||||
LIBRARIES = $(noinst_LIBRARIES)
|
||||
ARFLAGS = cru
|
||||
@ -1109,6 +1110,15 @@ SIM_HW_SOCKSER = @SIM_HW_SOCKSER@
|
||||
SIM_INLINE = @SIM_INLINE@
|
||||
SIM_MIPS_BITSIZE = @SIM_MIPS_BITSIZE@
|
||||
SIM_MIPS_FPU_BITSIZE = @SIM_MIPS_FPU_BITSIZE@
|
||||
SIM_MIPS_GEN = @SIM_MIPS_GEN@
|
||||
SIM_MIPS_IGEN_FLAGS = @SIM_MIPS_IGEN_FLAGS@
|
||||
SIM_MIPS_M16_FLAGS = @SIM_MIPS_M16_FLAGS@
|
||||
SIM_MIPS_MICROMIPS16_FLAGS = @SIM_MIPS_MICROMIPS16_FLAGS@
|
||||
SIM_MIPS_MICROMIPS_FLAGS = @SIM_MIPS_MICROMIPS_FLAGS@
|
||||
SIM_MIPS_MULTI_FLAGS = @SIM_MIPS_MULTI_FLAGS@
|
||||
SIM_MIPS_MULTI_IGEN_CONFIGS = @SIM_MIPS_MULTI_IGEN_CONFIGS@
|
||||
SIM_MIPS_MULTI_OBJ = @SIM_MIPS_MULTI_OBJ@
|
||||
SIM_MIPS_MULTI_SRC = @SIM_MIPS_MULTI_SRC@
|
||||
SIM_MIPS_SUBTARGET = @SIM_MIPS_SUBTARGET@
|
||||
SIM_PRIMARY_TARGET = @SIM_PRIMARY_TARGET@
|
||||
SIM_RISCV_BITSIZE = @SIM_RISCV_BITSIZE@
|
||||
@ -1840,6 +1850,8 @@ microblaze/Makefile.sim: $(top_builddir)/config.status $(top_srcdir)/microblaze/
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $@
|
||||
microblaze/.gdbinit: $(top_builddir)/config.status $(top_srcdir)/common/gdbinit.in
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $@
|
||||
mips/Makefile.sim: $(top_builddir)/config.status $(top_srcdir)/mips/Makefile.in
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $@
|
||||
mips/.gdbinit: $(top_builddir)/config.status $(top_srcdir)/common/gdbinit.in
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $@
|
||||
mn10300/Makefile.sim: $(top_builddir)/config.status $(top_srcdir)/mn10300/Makefile.in
|
||||
|
268
sim/configure
vendored
268
sim/configure
vendored
@ -641,6 +641,15 @@ LTLIBOBJS
|
||||
include_makefile
|
||||
SIM_RX_CYCLE_ACCURATE_FLAGS
|
||||
SIM_RISCV_BITSIZE
|
||||
SIM_MIPS_MULTI_OBJ
|
||||
SIM_MIPS_MULTI_SRC
|
||||
SIM_MIPS_MULTI_IGEN_CONFIGS
|
||||
SIM_MIPS_MULTI_FLAGS
|
||||
SIM_MIPS_GEN
|
||||
SIM_MIPS_MICROMIPS16_FLAGS
|
||||
SIM_MIPS_MICROMIPS_FLAGS
|
||||
SIM_MIPS_M16_FLAGS
|
||||
SIM_MIPS_IGEN_FLAGS
|
||||
SIM_MIPS_FPU_BITSIZE
|
||||
SIM_MIPS_BITSIZE
|
||||
SIM_MIPS_SUBTARGET
|
||||
@ -704,6 +713,7 @@ SIM_ENABLE_ARCH_ppc_TRUE
|
||||
CC_FOR_TARGET_PPC
|
||||
LD_FOR_TARGET_PPC
|
||||
AS_FOR_TARGET_PPC
|
||||
subdirs
|
||||
SIM_ENABLE_ARCH_or1k_FALSE
|
||||
SIM_ENABLE_ARCH_or1k_TRUE
|
||||
CC_FOR_TARGET_OR1K
|
||||
@ -729,7 +739,6 @@ SIM_ENABLE_ARCH_mips_TRUE
|
||||
CC_FOR_TARGET_MIPS
|
||||
LD_FOR_TARGET_MIPS
|
||||
AS_FOR_TARGET_MIPS
|
||||
subdirs
|
||||
SIM_ENABLE_ARCH_microblaze_FALSE
|
||||
SIM_ENABLE_ARCH_microblaze_TRUE
|
||||
CC_FOR_TARGET_MICROBLAZE
|
||||
@ -1113,8 +1122,7 @@ CC_FOR_TARGET_V850
|
||||
AS_FOR_TARGET_EXAMPLE_SYNACOR
|
||||
LD_FOR_TARGET_EXAMPLE_SYNACOR
|
||||
CC_FOR_TARGET_EXAMPLE_SYNACOR'
|
||||
ac_subdirs_all='mips
|
||||
ppc'
|
||||
ac_subdirs_all='ppc'
|
||||
|
||||
# Initialize some variables set by options.
|
||||
ac_init_help=
|
||||
@ -12434,7 +12442,7 @@ else
|
||||
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
||||
lt_status=$lt_dlunknown
|
||||
cat > conftest.$ac_ext <<_LT_EOF
|
||||
#line 12437 "configure"
|
||||
#line 12445 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
#if HAVE_DLFCN_H
|
||||
@ -12540,7 +12548,7 @@ else
|
||||
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
||||
lt_status=$lt_dlunknown
|
||||
cat > conftest.$ac_ext <<_LT_EOF
|
||||
#line 12543 "configure"
|
||||
#line 12551 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
#if HAVE_DLFCN_H
|
||||
@ -15165,10 +15173,11 @@ fi
|
||||
SIM_PRIMARY_TARGET=mips
|
||||
fi
|
||||
as_fn_append SIM_ENABLED_ARCHES " mips"
|
||||
ac_config_files="$ac_config_files mips/Makefile.sim:mips/Makefile.in"
|
||||
|
||||
ac_config_commands="$ac_config_commands mips/Makefile"
|
||||
|
||||
subdirs="$subdirs mips"
|
||||
|
||||
as_fn_append SIM_SUBDIRS " mips"
|
||||
|
||||
ac_config_files="$ac_config_files mips/.gdbinit:common/gdbinit.in"
|
||||
|
||||
@ -15384,7 +15393,9 @@ fi
|
||||
SIM_PRIMARY_TARGET=ppc
|
||||
fi
|
||||
as_fn_append SIM_ENABLED_ARCHES " ppc"
|
||||
subdirs="$subdirs ppc"
|
||||
|
||||
|
||||
subdirs="$subdirs ppc"
|
||||
|
||||
|
||||
ac_config_files="$ac_config_files ppc/.gdbinit:common/gdbinit.in"
|
||||
@ -16351,6 +16362,233 @@ esac
|
||||
$as_echo "$SIM_MIPS_FPU_BITSIZE" >&6; }
|
||||
|
||||
|
||||
SIM_MIPS_GEN=IGEN
|
||||
sim_mips_igen_machine="-M mipsIV"
|
||||
sim_mips_m16_machine="-M mips16,mipsIII"
|
||||
sim_mips_igen_filter="32,64,f"
|
||||
sim_mips_m16_filter="16"
|
||||
case ${target} in #(
|
||||
mips*tx39*) :
|
||||
SIM_MIPS_GEN=IGEN
|
||||
sim_mips_igen_filter="32,f"
|
||||
sim_mips_igen_machine="-M r3900" ;; #(
|
||||
mips64vr41*) :
|
||||
SIM_MIPS_GEN=M16
|
||||
sim_mips_igen_machine="-M vr4100"
|
||||
sim_mips_m16_machine="-M vr4100" ;; #(
|
||||
mips64*) :
|
||||
SIM_MIPS_GEN=MULTI
|
||||
sim_mips_multi_configs="\
|
||||
vr4100:mipsIII,mips16,vr4100:32,64:mips4100,mips4111\
|
||||
vr4120:mipsIII,mips16,vr4120:32,64:mips4120\
|
||||
vr5000:mipsIV:32,64,f:mips4300,mips5000,mips8000\
|
||||
vr5400:mipsIV,vr5400:32,64,f:mips5400\
|
||||
vr5500:mipsIV,vr5500:32,64,f:mips5500"
|
||||
sim_mips_multi_default=mips5000 ;; #(
|
||||
mips*-sde-elf* | mips*-mti-elf*) :
|
||||
SIM_MIPS_GEN=MULTI
|
||||
sim_mips_multi_configs="\
|
||||
micromips:micromips64,micromipsdsp:32,64,f:mips_micromips\
|
||||
mipsisa64r2:mips64r2,mips16,mips16e,mdmx,dsp,dsp2,mips3d,smartmips:32,64,f:mipsisa32r2,mipsisa64r2,mipsisa32r5,mipsisa64r5\
|
||||
mipsisa64r6:mips64r6:32,64,f:mipsisa32r6,mipsisa64r6"
|
||||
sim_mips_multi_default=mipsisa64r2 ;; #(
|
||||
mips16*) :
|
||||
SIM_MIPS_GEN=M16 ;; #(
|
||||
mipsisa32r2*) :
|
||||
SIM_MIPS_GEN=MULTI
|
||||
sim_mips_multi_configs="\
|
||||
micromips:micromips32,micromipsdsp:32,f:mips_micromips\
|
||||
mips32r2:mips32r2,mips3d,mips16,mips16e,mdmx,dsp,dsp2,smartmips:32,f:mipsisa32r2"
|
||||
sim_mips_multi_default=mipsisa32r2 ;; #(
|
||||
mipsisa32r6*) :
|
||||
SIM_MIPS_GEN=IGEN
|
||||
sim_mips_igen_machine="-M mips32r6"
|
||||
sim_mips_igen_filter="32,f" ;; #(
|
||||
mipsisa32*) :
|
||||
SIM_MIPS_GEN=M16
|
||||
sim_mips_igen_machine="-M mips32,mips16,mips16e,smartmips"
|
||||
sim_mips_m16_machine="-M mips16,mips16e,mips32"
|
||||
sim_mips_igen_filter="32,f" ;; #(
|
||||
mipsisa64r2*) :
|
||||
SIM_MIPS_GEN=M16
|
||||
sim_mips_igen_machine="-M mips64r2,mips3d,mips16,mips16e,mdmx,dsp,dsp2"
|
||||
sim_mips_m16_machine="-M mips16,mips16e,mips64r2" ;; #(
|
||||
mipsisa64r6*) :
|
||||
SIM_MIPS_GEN=IGEN
|
||||
sim_mips_igen_machine="-M mips64r6" ;; #(
|
||||
mipsisa64sb1*) :
|
||||
SIM_MIPS_GEN=IGEN
|
||||
sim_mips_igen_machine="-M mips64,mips3d,sb1" ;; #(
|
||||
mipsisa64*) :
|
||||
SIM_MIPS_GEN=M16
|
||||
sim_mips_igen_machine="-M mips64,mips3d,mips16,mips16e,mdmx"
|
||||
sim_mips_m16_machine="-M mips16,mips16e,mips64" ;; #(
|
||||
mips*lsi*) :
|
||||
SIM_MIPS_GEN=M16
|
||||
sim_mips_igen_machine="-M mipsIII,mips16"
|
||||
sim_mips_m16_machine="-M mips16,mipsIII"
|
||||
sim_mips_igen_filter="32,f" ;; #(
|
||||
mips*) :
|
||||
SIM_MIPS_GEN=IGEN
|
||||
sim_mips_igen_filter="32,f" ;; #(
|
||||
*) :
|
||||
;;
|
||||
esac
|
||||
|
||||
SIM_MIPS_MULTI_FLAGS=
|
||||
SIM_MIPS_MULTI_SRC=
|
||||
SIM_MIPS_MULTI_OBJ=
|
||||
SIM_MIPS_MULTI_IGEN_CONFIGS=
|
||||
if test "x$SIM_MIPS_GEN" = x"MULTI"; then :
|
||||
if test -z "${sim_mips_multi_configs}" || test -z "${sim_mips_multi_default}"; then :
|
||||
as_fn_error $? "Error in configure.ac: MULTI simulator not set up correctly" "$LINENO" 5
|
||||
fi
|
||||
|
||||
as_dir=mips; as_fn_mkdir_p
|
||||
rm -f mips/multi-include.h mips/multi-run.c
|
||||
sim_mips_seen_default=no
|
||||
|
||||
cat << __EOF__ > mips/multi-run.c
|
||||
/* Main entry point for MULTI simulators.
|
||||
Copyright (C) 2003-2022 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
--
|
||||
|
||||
This file was generated by sim/mips/configure. */
|
||||
|
||||
#include "sim-main.h"
|
||||
#include "multi-include.h"
|
||||
#include "elf-bfd.h"
|
||||
#include "elfxx-mips.h"
|
||||
#include "elf/mips.h"
|
||||
|
||||
#define SD sd
|
||||
#define CPU cpu
|
||||
|
||||
void
|
||||
sim_engine_run (SIM_DESC sd,
|
||||
int next_cpu_nr,
|
||||
int nr_cpus,
|
||||
int signal) /* ignore */
|
||||
{
|
||||
int mach;
|
||||
|
||||
if (STATE_ARCHITECTURE (sd) == NULL)
|
||||
mach = bfd_mach_${sim_mips_multi_default};
|
||||
else if (elf_elfheader (STATE_PROG_BFD (sd))->e_flags
|
||||
& EF_MIPS_ARCH_ASE_MICROMIPS)
|
||||
mach = bfd_mach_mips_micromips;
|
||||
else
|
||||
{
|
||||
mach = _bfd_elf_mips_mach (elf_elfheader (STATE_PROG_BFD (sd))->e_flags);
|
||||
if (!mach)
|
||||
mach = STATE_ARCHITECTURE (SD)->mach;
|
||||
}
|
||||
|
||||
switch (mach)
|
||||
{
|
||||
__EOF__
|
||||
|
||||
for fc in ${sim_mips_multi_configs}; do
|
||||
|
||||
c=`echo ${fc} | sed 's/:[^:]*$//'`
|
||||
bfdmachs=`echo ${fc} | sed 's/.*://'`
|
||||
name=`echo ${c} | sed 's/:.*//'`
|
||||
machine=`echo ${c} | sed 's/.*:\(.*\):.*/\1/'`
|
||||
filter=`echo ${c} | sed 's/.*://'`
|
||||
|
||||
as_fn_append SIM_MIPS_MULTI_FLAGS " -F ${filter} -M ${machine}"
|
||||
|
||||
case ${c} in #(
|
||||
*:*mips16*:*) :
|
||||
ws="m32 m16"
|
||||
|
||||
as_fn_append SIM_MIPS_MULTI_SRC " m16${name}_run.c"
|
||||
as_fn_append SIM_MIPS_MULTI_OBJ " m16${name}_run.o"
|
||||
as_fn_append SIM_MIPS_MULTI_FLAGS " -F 16"
|
||||
;; #(
|
||||
*:*micromips32*:*) :
|
||||
ws="micromips_m32 micromips16 micromips32"
|
||||
|
||||
as_fn_append SIM_MIPS_MULTI_SRC " micromips${name}_run.c"
|
||||
as_fn_append SIM_MIPS_MULTI_OBJ " micromips${name}_run.o"
|
||||
as_fn_append SIM_MIPS_MULTI_FLAGS " -F 16,32"
|
||||
;; #(
|
||||
*:*micromips64*:*) :
|
||||
ws="micromips_m64 micromips16 micromips64"
|
||||
|
||||
as_fn_append SIM_MIPS_MULTI_SRC " micromips${name}_run.c"
|
||||
as_fn_append SIM_MIPS_MULTI_OBJ " micromips${name}_run.o"
|
||||
as_fn_append SIM_MIPS_MULTI_FLAGS " -F 16,32,64"
|
||||
;; #(
|
||||
*) :
|
||||
ws=m32 ;;
|
||||
esac
|
||||
|
||||
for w in ${ws}; do
|
||||
for base in engine icache idecode model semantics support; do
|
||||
as_fn_append SIM_MIPS_MULTI_SRC " ${w}${name}_${base}.c"
|
||||
as_fn_append SIM_MIPS_MULTI_SRC " ${w}${name}_${base}.h"
|
||||
as_fn_append SIM_MIPS_MULTI_OBJ " ${w}${name}_${base}.o"
|
||||
done
|
||||
as_fn_append SIM_MIPS_MULTI_IGEN_CONFIGS " ${w}${c}"
|
||||
done
|
||||
|
||||
echo "#include \"${w}${name}_engine.h\"" >> mips/multi-include.h
|
||||
|
||||
for mach in `echo ${bfdmachs} | sed 's/,/ /g'`; do
|
||||
echo " case bfd_mach_${mach}:" >> mips/multi-run.c
|
||||
if test "x$mach" = x"${sim_mips_multi_default}"; then :
|
||||
echo " default:" >> mips/multi-run.c
|
||||
sim_mips_seen_default=yes
|
||||
|
||||
fi
|
||||
done
|
||||
echo " ${w}${name}_engine_run (sd, next_cpu_nr, nr_cpus, signal);" \
|
||||
>> mips/multi-run.c
|
||||
echo " break;" >> mips/multi-run.c
|
||||
done
|
||||
|
||||
if test "x$sim_mips_seen_default" = xno; then :
|
||||
as_fn_error $? "Error in configure.ac: \${sim_mips_multi_configs} doesn't have an entry for \${sim_mips_multi_default}" "$LINENO" 5
|
||||
fi
|
||||
|
||||
cat << __EOF__ >> mips/multi-run.c
|
||||
}
|
||||
}
|
||||
__EOF__
|
||||
|
||||
else
|
||||
SIM_MIPS_MULTI_SRC=doesnt-exist.c
|
||||
|
||||
fi
|
||||
SIM_MIPS_IGEN_FLAGS="-F ${sim_mips_igen_filter} ${sim_mips_igen_machine} ${sim_igen_smp}"
|
||||
SIM_MIPS_M16_FLAGS="-F ${sim_mips_m16_filter} ${sim_mips_m16_machine} ${sim_igen_smp}"
|
||||
SIM_MIPS_MICROMIPS16_FLAGS="-F ${sim_mips_micromips16_filter} ${sim_mips_micromips16_machine} ${sim_igen_smp}"
|
||||
SIM_MIPS_MICROMIPS_FLAGS="-F ${sim_mips_micromips_filter} ${sim_mips_micromips_machine} ${sim_igen_smp}"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking riscv bitsize" >&5
|
||||
$as_echo_n "checking riscv bitsize... " >&6; }
|
||||
SIM_RISCV_BITSIZE=64
|
||||
@ -17629,6 +17867,8 @@ do
|
||||
"microblaze/Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS microblaze/Makefile" ;;
|
||||
"microblaze/.gdbinit") CONFIG_FILES="$CONFIG_FILES microblaze/.gdbinit:common/gdbinit.in" ;;
|
||||
"depdir-microblaze") CONFIG_COMMANDS="$CONFIG_COMMANDS depdir-microblaze" ;;
|
||||
"mips/Makefile.sim") CONFIG_FILES="$CONFIG_FILES mips/Makefile.sim:mips/Makefile.in" ;;
|
||||
"mips/Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS mips/Makefile" ;;
|
||||
"mips/.gdbinit") CONFIG_FILES="$CONFIG_FILES mips/.gdbinit:common/gdbinit.in" ;;
|
||||
"depdir-mips") CONFIG_COMMANDS="$CONFIG_COMMANDS depdir-mips" ;;
|
||||
"mn10300/Makefile.sim") CONFIG_FILES="$CONFIG_FILES mn10300/Makefile.sim:mn10300/Makefile.in" ;;
|
||||
@ -19245,6 +19485,18 @@ $as_echo X"$file" |
|
||||
rm -f microblaze/Makesim1.tmp microblaze/Makesim2.tmp
|
||||
;;
|
||||
"depdir-microblaze":C) $SHELL $ac_aux_dir/mkinstalldirs microblaze/$DEPDIR ;;
|
||||
"mips/Makefile":C) sed -n \
|
||||
-e '/^## COMMON_PRE_/,/^## End COMMON_PRE_/ {
|
||||
/^srcdir = / s:$:/mips:
|
||||
p
|
||||
}' \
|
||||
<Make-common.sim >mips/Makesim1.tmp
|
||||
sed -n -e '/^## COMMON_POST_/,/^## End COMMON_POST_/ p' <Make-common.sim >mips/Makesim2.tmp
|
||||
sed -e '/^## COMMON_PRE_/ r mips/Makesim1.tmp' \
|
||||
-e '/^## COMMON_POST_/ r mips/Makesim2.tmp' \
|
||||
<mips/Makefile.sim >mips/Makefile
|
||||
rm -f mips/Makesim1.tmp mips/Makesim2.tmp
|
||||
;;
|
||||
"depdir-mips":C) $SHELL $ac_aux_dir/mkinstalldirs mips/$DEPDIR ;;
|
||||
"mn10300/Makefile":C) sed -n \
|
||||
-e '/^## COMMON_PRE_/,/^## End COMMON_PRE_/ {
|
||||
|
@ -143,7 +143,7 @@ if test "${enable_sim}" != no; then
|
||||
SIM_TARGET([m68hc11-*-*|m6811-*-*], [m68hc11])
|
||||
SIM_TARGET([mcore-*-*], [mcore])
|
||||
SIM_TARGET([microblaze*-*-*], [microblaze])
|
||||
SIM_TARGET([mips*-*-*], [mips], [true], [sim_igen=yes])
|
||||
SIM_TARGET([mips*-*-*], [mips], [], [sim_igen=yes])
|
||||
SIM_TARGET([mn10300*-*-*], [mn10300], [], [sim_igen=yes])
|
||||
SIM_TARGET([moxie-*-*], [moxie])
|
||||
SIM_TARGET([msp430*-*-*], [msp430])
|
||||
|
@ -59,3 +59,281 @@ AS_CASE([${target}],
|
||||
[mips*-*-*], [SIM_MIPS_FPU_BITSIZE=32])
|
||||
AC_MSG_RESULT([$SIM_MIPS_FPU_BITSIZE])
|
||||
AC_SUBST(SIM_MIPS_FPU_BITSIZE)
|
||||
|
||||
dnl Select the IGEN architecture.
|
||||
SIM_MIPS_GEN=IGEN
|
||||
sim_mips_igen_machine="-M mipsIV"
|
||||
sim_mips_m16_machine="-M mips16,mipsIII"
|
||||
sim_mips_igen_filter="32,64,f"
|
||||
sim_mips_m16_filter="16"
|
||||
AS_CASE([${target}],
|
||||
[mips*tx39*], [dnl
|
||||
SIM_MIPS_GEN=IGEN
|
||||
sim_mips_igen_filter="32,f"
|
||||
sim_mips_igen_machine="-M r3900"],
|
||||
[mips64vr41*], [dnl
|
||||
SIM_MIPS_GEN=M16
|
||||
sim_mips_igen_machine="-M vr4100"
|
||||
sim_mips_m16_machine="-M vr4100"],
|
||||
[mips64*], [dnl
|
||||
SIM_MIPS_GEN=MULTI
|
||||
sim_mips_multi_configs="\
|
||||
vr4100:mipsIII,mips16,vr4100:32,64:mips4100,mips4111\
|
||||
vr4120:mipsIII,mips16,vr4120:32,64:mips4120\
|
||||
vr5000:mipsIV:32,64,f:mips4300,mips5000,mips8000\
|
||||
vr5400:mipsIV,vr5400:32,64,f:mips5400\
|
||||
vr5500:mipsIV,vr5500:32,64,f:mips5500"
|
||||
sim_mips_multi_default=mips5000],
|
||||
[mips*-sde-elf* | mips*-mti-elf*], [dnl
|
||||
SIM_MIPS_GEN=MULTI
|
||||
sim_mips_multi_configs="\
|
||||
micromips:micromips64,micromipsdsp:32,64,f:mips_micromips\
|
||||
mipsisa64r2:mips64r2,mips16,mips16e,mdmx,dsp,dsp2,mips3d,smartmips:32,64,f:mipsisa32r2,mipsisa64r2,mipsisa32r5,mipsisa64r5\
|
||||
mipsisa64r6:mips64r6:32,64,f:mipsisa32r6,mipsisa64r6"
|
||||
sim_mips_multi_default=mipsisa64r2],
|
||||
[mips16*], [dnl
|
||||
SIM_MIPS_GEN=M16],
|
||||
[mipsisa32r2*], [dnl
|
||||
SIM_MIPS_GEN=MULTI
|
||||
sim_mips_multi_configs="\
|
||||
micromips:micromips32,micromipsdsp:32,f:mips_micromips\
|
||||
mips32r2:mips32r2,mips3d,mips16,mips16e,mdmx,dsp,dsp2,smartmips:32,f:mipsisa32r2"
|
||||
sim_mips_multi_default=mipsisa32r2],
|
||||
[mipsisa32r6*], [dnl
|
||||
SIM_MIPS_GEN=IGEN
|
||||
sim_mips_igen_machine="-M mips32r6"
|
||||
sim_mips_igen_filter="32,f"],
|
||||
[mipsisa32*], [dnl
|
||||
SIM_MIPS_GEN=M16
|
||||
sim_mips_igen_machine="-M mips32,mips16,mips16e,smartmips"
|
||||
sim_mips_m16_machine="-M mips16,mips16e,mips32"
|
||||
sim_mips_igen_filter="32,f"],
|
||||
[mipsisa64r2*], [dnl
|
||||
SIM_MIPS_GEN=M16
|
||||
sim_mips_igen_machine="-M mips64r2,mips3d,mips16,mips16e,mdmx,dsp,dsp2"
|
||||
sim_mips_m16_machine="-M mips16,mips16e,mips64r2"],
|
||||
[mipsisa64r6*], [dnl
|
||||
SIM_MIPS_GEN=IGEN
|
||||
sim_mips_igen_machine="-M mips64r6"],
|
||||
[mipsisa64sb1*], [dnl
|
||||
SIM_MIPS_GEN=IGEN
|
||||
sim_mips_igen_machine="-M mips64,mips3d,sb1"],
|
||||
[mipsisa64*], [dnl
|
||||
SIM_MIPS_GEN=M16
|
||||
sim_mips_igen_machine="-M mips64,mips3d,mips16,mips16e,mdmx"
|
||||
sim_mips_m16_machine="-M mips16,mips16e,mips64"],
|
||||
[mips*lsi*], [dnl
|
||||
SIM_MIPS_GEN=M16
|
||||
sim_mips_igen_machine="-M mipsIII,mips16"
|
||||
sim_mips_m16_machine="-M mips16,mipsIII"
|
||||
sim_mips_igen_filter="32,f"],
|
||||
[mips*], [dnl
|
||||
SIM_MIPS_GEN=IGEN
|
||||
sim_mips_igen_filter="32,f"])
|
||||
|
||||
dnl The MULTI generator can combine several simulation engines into one.
|
||||
dnl executable. A configuration which uses the MULTI should set two
|
||||
dnl variables: ${sim_mips_multi_configs} and ${sim_mips_multi_default}.
|
||||
dnl
|
||||
dnl ${sim_mips_multi_configs} is the list of engines to build. Each
|
||||
dnl space-separated entry has the form NAME:MACHINE:FILTER:BFDMACHS,
|
||||
dnl where:
|
||||
dnl
|
||||
dnl - NAME is a C-compatible prefix for the engine,
|
||||
dnl - MACHINE is a -M argument,
|
||||
dnl - FILTER is a -F argument, and
|
||||
dnl - BFDMACHS is a comma-separated list of bfd machines that the
|
||||
dnl simulator can run.
|
||||
dnl
|
||||
dnl Each entry will have a separate simulation engine whose prefix is
|
||||
dnl m32<NAME>. If the machine list includes "mips16", there will also
|
||||
dnl be a mips16 engine, prefix m16<NAME>. The mips16 engine will be
|
||||
dnl generated using the same machine list as the 32-bit version,
|
||||
dnl but the filter will be "16" instead of FILTER.
|
||||
dnl
|
||||
dnl The simulator compares the bfd mach against BFDMACHS to decide
|
||||
dnl which engine to use. Entries in BFDMACHS should be bfd_mach
|
||||
dnl values with "bfd_mach_" removed. ${sim_mips_multi_default} says
|
||||
dnl which entry should be the default.
|
||||
SIM_MIPS_MULTI_FLAGS=
|
||||
SIM_MIPS_MULTI_SRC=
|
||||
SIM_MIPS_MULTI_OBJ=
|
||||
SIM_MIPS_MULTI_IGEN_CONFIGS=
|
||||
AS_VAR_IF([SIM_MIPS_GEN], ["MULTI"], [dnl
|
||||
dnl Verify the AS_CASE logic above is setup correctly.
|
||||
AS_IF([test -z "${sim_mips_multi_configs}" || test -z "${sim_mips_multi_default}"], [dnl
|
||||
AC_MSG_ERROR(Error in configure.ac: MULTI simulator not set up correctly)])
|
||||
|
||||
dnl Start in a known state.
|
||||
AS_MKDIR_P([mips])
|
||||
rm -f mips/multi-include.h mips/multi-run.c
|
||||
sim_mips_seen_default=no
|
||||
|
||||
cat << __EOF__ > mips/multi-run.c
|
||||
/* Main entry point for MULTI simulators.
|
||||
Copyright (C) 2003-2022 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
--
|
||||
|
||||
This file was generated by sim/mips/configure. */
|
||||
|
||||
#include "sim-main.h"
|
||||
#include "multi-include.h"
|
||||
#include "elf-bfd.h"
|
||||
#include "elfxx-mips.h"
|
||||
#include "elf/mips.h"
|
||||
|
||||
#define SD sd
|
||||
#define CPU cpu
|
||||
|
||||
void
|
||||
sim_engine_run (SIM_DESC sd,
|
||||
int next_cpu_nr,
|
||||
int nr_cpus,
|
||||
int signal) /* ignore */
|
||||
{
|
||||
int mach;
|
||||
|
||||
if (STATE_ARCHITECTURE (sd) == NULL)
|
||||
mach = bfd_mach_${sim_mips_multi_default};
|
||||
else if (elf_elfheader (STATE_PROG_BFD (sd))->e_flags
|
||||
& EF_MIPS_ARCH_ASE_MICROMIPS)
|
||||
mach = bfd_mach_mips_micromips;
|
||||
else
|
||||
{
|
||||
mach = _bfd_elf_mips_mach (elf_elfheader (STATE_PROG_BFD (sd))->e_flags);
|
||||
if (!mach)
|
||||
mach = STATE_ARCHITECTURE (SD)->mach;
|
||||
}
|
||||
|
||||
switch (mach)
|
||||
{
|
||||
__EOF__
|
||||
|
||||
for fc in ${sim_mips_multi_configs}; do
|
||||
|
||||
dnl Split up the entry. ${c} contains the first three elements.
|
||||
dnl Note: outer sqaure brackets are m4 quotes.
|
||||
c=`echo ${fc} | sed ['s/:[^:]*$//']`
|
||||
bfdmachs=`echo ${fc} | sed 's/.*://'`
|
||||
name=`echo ${c} | sed 's/:.*//'`
|
||||
machine=`echo ${c} | sed 's/.*:\(.*\):.*/\1/'`
|
||||
filter=`echo ${c} | sed 's/.*://'`
|
||||
|
||||
dnl Build the following lists:
|
||||
dnl
|
||||
dnl SIM_MIPS_MULTI_FLAGS: all -M and -F flags used by the simulator
|
||||
dnl SIM_MIPS_MULTI_SRC: all makefile-generated source files
|
||||
dnl SIM_MIPS_MULTI_OBJ: the objects for ${SIM_MIPS_MULTI_SRC}
|
||||
dnl SIM_MIPS_MULTI_IGEN_CONFIGS: igen configuration strings.
|
||||
dnl
|
||||
dnl Each entry in ${SIM_MIPS_MULTI_IGEN_CONFIGS} is a prefix (m32
|
||||
dnl or m16) followed by the NAME, MACHINE and FILTER part of
|
||||
dnl the ${sim_mips_multi_configs} entry.
|
||||
AS_VAR_APPEND([SIM_MIPS_MULTI_FLAGS], [" -F ${filter} -M ${machine}"])
|
||||
|
||||
dnl Check whether special handling is needed.
|
||||
AS_CASE([${c}],
|
||||
[*:*mips16*:*], [dnl
|
||||
dnl Run igen twice, once for normal mode and once for mips16.
|
||||
ws="m32 m16"
|
||||
|
||||
dnl The top-level function for the mips16 simulator is
|
||||
dnl in a file m16${name}_run.c, generated by the
|
||||
dnl tmp-run-multi Makefile rule.
|
||||
AS_VAR_APPEND([SIM_MIPS_MULTI_SRC], [" m16${name}_run.c"])
|
||||
AS_VAR_APPEND([SIM_MIPS_MULTI_OBJ], [" m16${name}_run.o"])
|
||||
AS_VAR_APPEND([SIM_MIPS_MULTI_FLAGS], [" -F 16"])
|
||||
],
|
||||
[*:*micromips32*:*], [dnl
|
||||
dnl Run igen thrice, once for micromips32, once for micromips16,
|
||||
dnl and once for m32.
|
||||
ws="micromips_m32 micromips16 micromips32"
|
||||
|
||||
dnl The top-level function for the micromips simulator is
|
||||
dnl in a file micromips${name}_run.c, generated by the
|
||||
dnl tmp-run-multi Makefile rule.
|
||||
AS_VAR_APPEND([SIM_MIPS_MULTI_SRC], [" micromips${name}_run.c"])
|
||||
AS_VAR_APPEND([SIM_MIPS_MULTI_OBJ], [" micromips${name}_run.o"])
|
||||
AS_VAR_APPEND([SIM_MIPS_MULTI_FLAGS], [" -F 16,32"])
|
||||
],
|
||||
[*:*micromips64*:*], [dnl
|
||||
dnl Run igen thrice, once for micromips64, once for micromips16,
|
||||
dnl and once for m64.
|
||||
ws="micromips_m64 micromips16 micromips64"
|
||||
|
||||
dnl The top-level function for the micromips simulator is
|
||||
dnl in a file micromips${name}_run.c, generated by the
|
||||
dnl tmp-run-multi Makefile rule.
|
||||
AS_VAR_APPEND([SIM_MIPS_MULTI_SRC], [" micromips${name}_run.c"])
|
||||
AS_VAR_APPEND([SIM_MIPS_MULTI_OBJ], [" micromips${name}_run.o"])
|
||||
AS_VAR_APPEND([SIM_MIPS_MULTI_FLAGS], [" -F 16,32,64"])
|
||||
],
|
||||
[ws=m32])
|
||||
|
||||
dnl Now add the list of igen-generated files to ${SIM_MIPS_MULTI_SRC}
|
||||
dnl and ${SIM_MIPS_MULTI_OBJ}.
|
||||
for w in ${ws}; do
|
||||
for base in engine icache idecode model semantics support; do
|
||||
AS_VAR_APPEND([SIM_MIPS_MULTI_SRC], [" ${w}${name}_${base}.c"])
|
||||
AS_VAR_APPEND([SIM_MIPS_MULTI_SRC], [" ${w}${name}_${base}.h"])
|
||||
AS_VAR_APPEND([SIM_MIPS_MULTI_OBJ], [" ${w}${name}_${base}.o"])
|
||||
done
|
||||
AS_VAR_APPEND([SIM_MIPS_MULTI_IGEN_CONFIGS], [" ${w}${c}"])
|
||||
done
|
||||
|
||||
dnl Add an include for the engine.h file. This file declares the
|
||||
dnl top-level foo_engine_run() function.
|
||||
echo "#include \"${w}${name}_engine.h\"" >> mips/multi-include.h
|
||||
|
||||
dnl Add case statements for this engine to sim_engine_run().
|
||||
for mach in `echo ${bfdmachs} | sed 's/,/ /g'`; do
|
||||
echo " case bfd_mach_${mach}:" >> mips/multi-run.c
|
||||
AS_VAR_IF([mach], ["${sim_mips_multi_default}"], [dnl
|
||||
echo " default:" >> mips/multi-run.c
|
||||
sim_mips_seen_default=yes
|
||||
])
|
||||
done
|
||||
echo " ${w}${name}_engine_run (sd, next_cpu_nr, nr_cpus, signal);" \
|
||||
>> mips/multi-run.c
|
||||
echo " break;" >> mips/multi-run.c
|
||||
done
|
||||
|
||||
dnl Check whether we added a 'default:' label.
|
||||
AS_VAR_IF([sim_mips_seen_default], [no], [dnl
|
||||
AC_MSG_ERROR(Error in configure.ac: \${sim_mips_multi_configs} doesn't have an entry for \${sim_mips_multi_default})])
|
||||
|
||||
cat << __EOF__ >> mips/multi-run.c
|
||||
}
|
||||
}
|
||||
__EOF__
|
||||
], [dnl
|
||||
dnl For clean-extra target.
|
||||
SIM_MIPS_MULTI_SRC=doesnt-exist.c
|
||||
])
|
||||
SIM_MIPS_IGEN_FLAGS="-F ${sim_mips_igen_filter} ${sim_mips_igen_machine} ${sim_igen_smp}"
|
||||
SIM_MIPS_M16_FLAGS="-F ${sim_mips_m16_filter} ${sim_mips_m16_machine} ${sim_igen_smp}"
|
||||
SIM_MIPS_MICROMIPS16_FLAGS="-F ${sim_mips_micromips16_filter} ${sim_mips_micromips16_machine} ${sim_igen_smp}"
|
||||
SIM_MIPS_MICROMIPS_FLAGS="-F ${sim_mips_micromips_filter} ${sim_mips_micromips_machine} ${sim_igen_smp}"
|
||||
AC_SUBST(SIM_MIPS_IGEN_FLAGS)
|
||||
AC_SUBST(SIM_MIPS_M16_FLAGS)
|
||||
AC_SUBST(SIM_MIPS_MICROMIPS_FLAGS)
|
||||
AC_SUBST(SIM_MIPS_MICROMIPS16_FLAGS)
|
||||
AC_SUBST(SIM_MIPS_GEN)
|
||||
AC_SUBST(SIM_MIPS_MULTI_FLAGS)
|
||||
AC_SUBST(SIM_MIPS_MULTI_IGEN_CONFIGS)
|
||||
AC_SUBST(SIM_MIPS_MULTI_SRC)
|
||||
AC_SUBST(SIM_MIPS_MULTI_OBJ)
|
||||
|
15
sim/mips/aclocal.m4
vendored
15
sim/mips/aclocal.m4
vendored
@ -1,15 +0,0 @@
|
||||
# generated automatically by aclocal 1.15.1 -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 1996-2017 Free Software Foundation, Inc.
|
||||
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# 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_output.m4])
|
3321
sim/mips/configure
vendored
3321
sim/mips/configure
vendored
File diff suppressed because it is too large
Load Diff
@ -1,298 +0,0 @@
|
||||
dnl Process this file with autoconf to produce a configure script.
|
||||
AC_INIT(Makefile.in)
|
||||
AC_CONFIG_MACRO_DIRS([../m4 ../.. ../../config])
|
||||
|
||||
dnl The sim shouldn't be checking $target and changing behavior. But it is,
|
||||
dnl and until we clean that up, we need to expand --target for use below.
|
||||
AC_CANONICAL_SYSTEM
|
||||
|
||||
#
|
||||
# Select the IGEN architecture
|
||||
#
|
||||
SIM_MIPS_GEN=IGEN
|
||||
sim_mips_igen_machine="-M mipsIV"
|
||||
sim_mips_m16_machine="-M mips16,mipsIII"
|
||||
sim_mips_igen_filter="32,64,f"
|
||||
sim_mips_m16_filter="16"
|
||||
|
||||
case "${target}" in
|
||||
mips*tx39*) SIM_MIPS_GEN=IGEN
|
||||
sim_mips_igen_filter="32,f"
|
||||
sim_mips_igen_machine="-M r3900"
|
||||
;;
|
||||
mips64vr41*) SIM_MIPS_GEN=M16
|
||||
sim_mips_igen_machine="-M vr4100"
|
||||
sim_mips_m16_machine="-M vr4100"
|
||||
;;
|
||||
mips64*)
|
||||
SIM_MIPS_GEN=MULTI
|
||||
sim_mips_multi_configs="\
|
||||
vr4100:mipsIII,mips16,vr4100:32,64:mips4100,mips4111\
|
||||
vr4120:mipsIII,mips16,vr4120:32,64:mips4120\
|
||||
vr5000:mipsIV:32,64,f:mips4300,mips5000,mips8000\
|
||||
vr5400:mipsIV,vr5400:32,64,f:mips5400\
|
||||
vr5500:mipsIV,vr5500:32,64,f:mips5500"
|
||||
sim_mips_multi_default=mips5000
|
||||
;;
|
||||
mips*-sde-elf* | mips*-mti-elf*)
|
||||
SIM_MIPS_GEN=MULTI
|
||||
sim_mips_multi_configs="\
|
||||
micromips:micromips64,micromipsdsp:32,64,f:mips_micromips\
|
||||
mipsisa64r2:mips64r2,mips16,mips16e,mdmx,dsp,dsp2,mips3d,smartmips:32,64,f:mipsisa32r2,mipsisa64r2,mipsisa32r5,mipsisa64r5\
|
||||
mipsisa64r6:mips64r6:32,64,f:mipsisa32r6,mipsisa64r6"
|
||||
sim_mips_multi_default=mipsisa64r2
|
||||
;;
|
||||
mips16*) SIM_MIPS_GEN=M16
|
||||
;;
|
||||
mipsisa32r2*) SIM_MIPS_GEN=MULTI
|
||||
sim_mips_multi_configs="\
|
||||
micromips:micromips32,micromipsdsp:32,f:mips_micromips\
|
||||
mips32r2:mips32r2,mips3d,mips16,mips16e,mdmx,dsp,dsp2,smartmips:32,f:mipsisa32r2"
|
||||
sim_mips_multi_default=mipsisa32r2
|
||||
;;
|
||||
mipsisa32r6*) SIM_MIPS_GEN=IGEN
|
||||
sim_mips_igen_machine="-M mips32r6"
|
||||
sim_mips_igen_filter="32,f"
|
||||
;;
|
||||
mipsisa32*) SIM_MIPS_GEN=M16
|
||||
sim_mips_igen_machine="-M mips32,mips16,mips16e,smartmips"
|
||||
sim_mips_m16_machine="-M mips16,mips16e,mips32"
|
||||
sim_mips_igen_filter="32,f"
|
||||
;;
|
||||
mipsisa64r2*) SIM_MIPS_GEN=M16
|
||||
sim_mips_igen_machine="-M mips64r2,mips3d,mips16,mips16e,mdmx,dsp,dsp2"
|
||||
sim_mips_m16_machine="-M mips16,mips16e,mips64r2"
|
||||
;;
|
||||
mipsisa64r6*) SIM_MIPS_GEN=IGEN
|
||||
sim_mips_igen_machine="-M mips64r6"
|
||||
;;
|
||||
mipsisa64sb1*) SIM_MIPS_GEN=IGEN
|
||||
sim_mips_igen_machine="-M mips64,mips3d,sb1"
|
||||
;;
|
||||
mipsisa64*) SIM_MIPS_GEN=M16
|
||||
sim_mips_igen_machine="-M mips64,mips3d,mips16,mips16e,mdmx"
|
||||
sim_mips_m16_machine="-M mips16,mips16e,mips64"
|
||||
;;
|
||||
mips*lsi*) SIM_MIPS_GEN=M16
|
||||
sim_mips_igen_machine="-M mipsIII,mips16"
|
||||
sim_mips_m16_machine="-M mips16,mipsIII"
|
||||
sim_mips_igen_filter="32,f"
|
||||
;;
|
||||
mips*) SIM_MIPS_GEN=IGEN
|
||||
sim_mips_igen_filter="32,f"
|
||||
;;
|
||||
esac
|
||||
|
||||
# The MULTI generator can combine several simulation engines into one.
|
||||
# executable. A configuration which uses the MULTI should set two
|
||||
# variables: ${sim_mips_multi_configs} and ${sim_mips_multi_default}.
|
||||
#
|
||||
# ${sim_mips_multi_configs} is the list of engines to build. Each
|
||||
# space-separated entry has the form NAME:MACHINE:FILTER:BFDMACHS,
|
||||
# where:
|
||||
#
|
||||
# - NAME is a C-compatible prefix for the engine,
|
||||
# - MACHINE is a -M argument,
|
||||
# - FILTER is a -F argument, and
|
||||
# - BFDMACHS is a comma-separated list of bfd machines that the
|
||||
# simulator can run.
|
||||
#
|
||||
# Each entry will have a separate simulation engine whose prefix is
|
||||
# m32<NAME>. If the machine list includes "mips16", there will also
|
||||
# be a mips16 engine, prefix m16<NAME>. The mips16 engine will be
|
||||
# generated using the same machine list as the 32-bit version,
|
||||
# but the filter will be "16" instead of FILTER.
|
||||
#
|
||||
# The simulator compares the bfd mach against BFDMACHS to decide
|
||||
# which engine to use. Entries in BFDMACHS should be bfd_mach
|
||||
# values with "bfd_mach_" removed. ${sim_mips_multi_default} says
|
||||
# which entry should be the default.
|
||||
SIM_MIPS_MULTI_FLAGS=
|
||||
SIM_MIPS_MULTI_SRC=
|
||||
SIM_MIPS_MULTI_OBJ=
|
||||
SIM_MIPS_MULTI_IGEN_CONFIGS=
|
||||
if test ${SIM_MIPS_GEN} = MULTI; then
|
||||
|
||||
# Simple sanity check.
|
||||
if test -z "${sim_mips_multi_configs}" || test -z "${sim_mips_multi_default}"; then
|
||||
AC_MSG_ERROR(Error in configure.ac: MULTI simulator not set up correctly)
|
||||
fi
|
||||
|
||||
# Start in a known state.
|
||||
rm -f multi-include.h multi-run.c
|
||||
sim_mips_seen_default=no
|
||||
|
||||
cat << __EOF__ > multi-run.c
|
||||
/* Main entry point for MULTI simulators.
|
||||
Copyright (C) 2003-2022 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
--
|
||||
|
||||
This file was generated by sim/mips/configure. */
|
||||
|
||||
#include "sim-main.h"
|
||||
#include "multi-include.h"
|
||||
#include "elf-bfd.h"
|
||||
#include "elfxx-mips.h"
|
||||
#include "elf/mips.h"
|
||||
|
||||
#define SD sd
|
||||
#define CPU cpu
|
||||
|
||||
void
|
||||
sim_engine_run (SIM_DESC sd,
|
||||
int next_cpu_nr,
|
||||
int nr_cpus,
|
||||
int signal) /* ignore */
|
||||
{
|
||||
int mach;
|
||||
|
||||
if (STATE_ARCHITECTURE (sd) == NULL)
|
||||
mach = bfd_mach_${sim_mips_multi_default};
|
||||
else if (elf_elfheader (STATE_PROG_BFD (sd))->e_flags
|
||||
& EF_MIPS_ARCH_ASE_MICROMIPS)
|
||||
mach = bfd_mach_mips_micromips;
|
||||
else
|
||||
{
|
||||
mach = _bfd_elf_mips_mach (elf_elfheader (STATE_PROG_BFD (sd))->e_flags);
|
||||
if (!mach)
|
||||
mach = STATE_ARCHITECTURE (SD)->mach;
|
||||
}
|
||||
|
||||
switch (mach)
|
||||
{
|
||||
__EOF__
|
||||
|
||||
for fc in ${sim_mips_multi_configs}; do
|
||||
|
||||
# Split up the entry. ${c} contains the first three elements.
|
||||
# Note: outer sqaure brackets are m4 quotes.
|
||||
c=`echo ${fc} | sed ['s/:[^:]*$//']`
|
||||
bfdmachs=`echo ${fc} | sed 's/.*://'`
|
||||
name=`echo ${c} | sed 's/:.*//'`
|
||||
machine=`echo ${c} | sed 's/.*:\(.*\):.*/\1/'`
|
||||
filter=`echo ${c} | sed 's/.*://'`
|
||||
|
||||
# Build the following lists:
|
||||
#
|
||||
# SIM_MIPS_MULTI_FLAGS: all -M and -F flags used by the simulator
|
||||
# SIM_MIPS_MULTI_SRC: all makefile-generated source files
|
||||
# SIM_MIPS_MULTI_OBJ: the objects for ${SIM_MIPS_MULTI_SRC}
|
||||
# SIM_MIPS_MULTI_IGEN_CONFIGS: igen configuration strings.
|
||||
#
|
||||
# Each entry in ${SIM_MIPS_MULTI_IGEN_CONFIGS} is a prefix (m32
|
||||
# or m16) followed by the NAME, MACHINE and FILTER part of
|
||||
# the ${sim_mips_multi_configs} entry.
|
||||
SIM_MIPS_MULTI_FLAGS="${SIM_MIPS_MULTI_FLAGS} -F ${filter} -M ${machine}"
|
||||
|
||||
# Check whether special handling is needed.
|
||||
case ${c} in
|
||||
*:*mips16*:*)
|
||||
# Run igen twice, once for normal mode and once for mips16.
|
||||
ws="m32 m16"
|
||||
|
||||
# The top-level function for the mips16 simulator is
|
||||
# in a file m16${name}_run.c, generated by the
|
||||
# tmp-run-multi Makefile rule.
|
||||
SIM_MIPS_MULTI_SRC="${SIM_MIPS_MULTI_SRC} m16${name}_run.c"
|
||||
SIM_MIPS_MULTI_OBJ="${SIM_MIPS_MULTI_OBJ} m16${name}_run.o"
|
||||
SIM_MIPS_MULTI_FLAGS="${SIM_MIPS_MULTI_FLAGS} -F 16"
|
||||
;;
|
||||
*:*micromips32*:*)
|
||||
# Run igen thrice, once for micromips32, once for micromips16,
|
||||
# and once for m32.
|
||||
ws="micromips_m32 micromips16 micromips32"
|
||||
|
||||
# The top-level function for the micromips simulator is
|
||||
# in a file micromips${name}_run.c, generated by the
|
||||
# tmp-run-multi Makefile rule.
|
||||
SIM_MIPS_MULTI_SRC="${SIM_MIPS_MULTI_SRC} micromips${name}_run.c"
|
||||
SIM_MIPS_MULTI_OBJ="${SIM_MIPS_MULTI_OBJ} micromips${name}_run.o"
|
||||
SIM_MIPS_MULTI_FLAGS="${SIM_MIPS_MULTI_FLAGS} -F 16,32"
|
||||
;;
|
||||
*:*micromips64*:*)
|
||||
# Run igen thrice, once for micromips64, once for micromips16,
|
||||
# and once for m64.
|
||||
ws="micromips_m64 micromips16 micromips64"
|
||||
|
||||
# The top-level function for the micromips simulator is
|
||||
# in a file micromips${name}_run.c, generated by the
|
||||
# tmp-run-multi Makefile rule.
|
||||
SIM_MIPS_MULTI_SRC="${SIM_MIPS_MULTI_SRC} micromips${name}_run.c"
|
||||
SIM_MIPS_MULTI_OBJ="${SIM_MIPS_MULTI_OBJ} micromips${name}_run.o"
|
||||
SIM_MIPS_MULTI_FLAGS="${SIM_MIPS_MULTI_FLAGS} -F 16,32,64"
|
||||
;;
|
||||
*)
|
||||
ws=m32
|
||||
;;
|
||||
esac
|
||||
|
||||
# Now add the list of igen-generated files to ${SIM_MIPS_MULTI_SRC}
|
||||
# and ${SIM_MIPS_MULTI_OBJ}.
|
||||
for w in ${ws}; do
|
||||
for base in engine icache idecode model semantics support; do
|
||||
SIM_MIPS_MULTI_SRC="${SIM_MIPS_MULTI_SRC} ${w}${name}_${base}.c"
|
||||
SIM_MIPS_MULTI_SRC="${SIM_MIPS_MULTI_SRC} ${w}${name}_${base}.h"
|
||||
SIM_MIPS_MULTI_OBJ="${SIM_MIPS_MULTI_OBJ} ${w}${name}_${base}.o"
|
||||
done
|
||||
SIM_MIPS_MULTI_IGEN_CONFIGS="${SIM_MIPS_MULTI_IGEN_CONFIGS} ${w}${c}"
|
||||
done
|
||||
|
||||
# Add an include for the engine.h file. This file declares the
|
||||
# top-level foo_engine_run() function.
|
||||
echo "#include \"${w}${name}_engine.h\"" >> multi-include.h
|
||||
|
||||
# Add case statements for this engine to sim_engine_run().
|
||||
for mach in `echo ${bfdmachs} | sed 's/,/ /g'`; do
|
||||
echo " case bfd_mach_${mach}:" >> multi-run.c
|
||||
if test ${mach} = ${sim_mips_multi_default}; then
|
||||
echo " default:" >> multi-run.c
|
||||
sim_mips_seen_default=yes
|
||||
fi
|
||||
done
|
||||
echo " ${w}${name}_engine_run (sd, next_cpu_nr, nr_cpus, signal);" \
|
||||
>> multi-run.c
|
||||
echo " break;" >> multi-run.c
|
||||
done
|
||||
|
||||
# Check whether we added a 'default:' label.
|
||||
if test ${sim_mips_seen_default} = no; then
|
||||
AC_MSG_ERROR(Error in configure.ac: \${sim_mips_multi_configs} doesn't have an entry for \${sim_mips_multi_default})
|
||||
fi
|
||||
|
||||
cat << __EOF__ >> multi-run.c
|
||||
}
|
||||
}
|
||||
__EOF__
|
||||
else
|
||||
# For clean-extra
|
||||
SIM_MIPS_MULTI_SRC=doesnt-exist.c
|
||||
fi
|
||||
SIM_MIPS_IGEN_FLAGS="-F ${sim_mips_igen_filter} ${sim_mips_igen_machine} ${sim_igen_smp}"
|
||||
SIM_MIPS_M16_FLAGS="-F ${sim_mips_m16_filter} ${sim_mips_m16_machine} ${sim_igen_smp}"
|
||||
SIM_MIPS_MICROMIPS16_FLAGS="-F ${sim_mips_micromips16_filter} ${sim_mips_micromips16_machine} ${sim_igen_smp}"
|
||||
SIM_MIPS_MICROMIPS_FLAGS="-F ${sim_mips_micromips_filter} ${sim_mips_micromips_machine} ${sim_igen_smp}"
|
||||
AC_SUBST(SIM_MIPS_IGEN_FLAGS)
|
||||
AC_SUBST(SIM_MIPS_M16_FLAGS)
|
||||
AC_SUBST(SIM_MIPS_MICROMIPS_FLAGS)
|
||||
AC_SUBST(SIM_MIPS_MICROMIPS16_FLAGS)
|
||||
AC_SUBST(SIM_MIPS_GEN)
|
||||
AC_SUBST(SIM_MIPS_MULTI_FLAGS)
|
||||
AC_SUBST(SIM_MIPS_MULTI_IGEN_CONFIGS)
|
||||
AC_SUBST(SIM_MIPS_MULTI_SRC)
|
||||
AC_SUBST(SIM_MIPS_MULTI_OBJ)
|
||||
|
||||
SIM_AC_OUTPUT
|
Loading…
x
Reference in New Issue
Block a user