1997-02-04 21:42:27 +00:00
|
|
|
dnl Process this file with autoconf to produce a configure script.
|
1998-04-26 22:03:55 +00:00
|
|
|
sinclude(../common/aclocal.m4)
|
1996-06-26 03:26:09 +00:00
|
|
|
AC_PREREQ(2.5)dnl
|
1995-11-08 15:44:38 +00:00
|
|
|
AC_INIT(Makefile.in)
|
|
|
|
|
1996-11-20 10:00:42 +00:00
|
|
|
SIM_AC_COMMON
|
1995-11-08 15:44:38 +00:00
|
|
|
|
1997-05-21 06:54:13 +00:00
|
|
|
dnl Options available in this module
|
1998-04-05 07:16:54 +00:00
|
|
|
SIM_AC_OPTION_INLINE()
|
1997-09-22 09:40:57 +00:00
|
|
|
SIM_AC_OPTION_ALIGNMENT(NONSTRICT_ALIGNMENT)
|
1997-05-21 06:54:13 +00:00
|
|
|
SIM_AC_OPTION_HOSTENDIAN
|
|
|
|
SIM_AC_OPTION_WARNINGS
|
|
|
|
|
1998-02-02 14:14:17 +00:00
|
|
|
# Ensure a reasonable default simulator is constructed: (DEPRECATED)
|
1996-06-05 08:16:16 +00:00
|
|
|
case "${target}" in
|
1997-09-07 20:33:22 +00:00
|
|
|
# start-sanitize-tx19
|
|
|
|
mipstx19*-*-*) SIMCONF="-mips1 -mcpu=r1900 -mno-fp --warnings";;
|
|
|
|
# end-sanitize-tx19
|
1997-10-29 19:42:49 +00:00
|
|
|
# start-sanitize-tx49
|
|
|
|
mips64tx49*-*-*) SIMCONF="-mips3 --warnings -mcpu=r4900";;
|
|
|
|
# end-sanitize-tx49
|
1997-02-11 13:26:34 +00:00
|
|
|
# start-sanitize-r5900
|
1997-09-23 16:21:23 +00:00
|
|
|
mips64r59*-*-*) SIMCONF="-mips3 --warnings -mcpu=r5900";;
|
1997-02-11 13:26:34 +00:00
|
|
|
# end-sanitize-r5900
|
1998-02-19 21:28:50 +00:00
|
|
|
mips64vr4100-*-*) SIMCOMF="-mips0 -mcpu=r4100 -mgp64 --warnings" ;;
|
1996-06-05 08:16:16 +00:00
|
|
|
mips64*-*-*) SIMCONF="-mips0 --warnings";;
|
Add support for mips16 (16 bit MIPS implementation):
* gencode.c (inst_type): Add mips16 instruction encoding types.
(GETDATASIZEINSN): Define.
(MIPS_DECODE): Add REG flag to dsllv, dsrav, and dsrlv. Add
jalx. Add LEFT flag to mfhi and mflo. Add RIGHT flag to mthi and
mtlo.
(MIPS16_DECODE): New table, for mips16 instructions.
(bitmap_val): New static function.
(struct mips16_op): Define.
(mips16_op_table): New table, for mips16 operands.
(build_mips16_operands): New static function.
(process_instructions): If PC is odd, decode a mips16
instruction. Break out instruction handling into new
build_instruction function.
(build_instruction): New static function, broken out of
process_instructions. Check modifiers rather than flags for SHIFT
bit count and m[ft]{hi,lo} direction.
(usage): Pass program name to fprintf.
(main): Remove unused variable this_option_optind. Change
``*loptarg++'' to ``loptarg++''.
(my_strtoul): Parenthesize && within ||.
* interp.c (sim_trace): If tracefh is NULL, set it to stderr.
(LoadMemory): Accept a halfword pAddr if vAddr is odd.
(simulate): If PC is odd, fetch a 16 bit instruction, and
increment PC by 2 rather than 4.
* configure.in: Add case for mips16*-*-*.
* configure: Rebuild.
1996-11-26 18:12:44 +00:00
|
|
|
mips16*-*-*) SIMCONF="-mips0 --warnings";;
|
1996-06-05 08:16:16 +00:00
|
|
|
mips*-*-*) SIMCONF="-mips2 --warnings";;
|
|
|
|
*) SIMCONF="-mips0 --warnings";;
|
|
|
|
esac
|
1996-11-20 10:00:42 +00:00
|
|
|
AC_SUBST(SIMCONF)
|
1995-11-08 15:44:38 +00:00
|
|
|
|
1998-02-02 14:14:17 +00:00
|
|
|
# DEPRECATED
|
1998-05-12 05:36:47 +00:00
|
|
|
#
|
|
|
|
# Instead of defining a `subtarget' macro, code should be checking
|
|
|
|
# the value of {STATE,CPU}_ARCHITECTURE to identify the architecture
|
|
|
|
# in question.
|
|
|
|
#
|
1997-09-20 18:22:22 +00:00
|
|
|
case "${target}" in
|
|
|
|
# start-sanitize-tx19
|
|
|
|
mipstx19*-*-*) SIM_SUBTARGET="-DSUBTARGET_R3900=1";;
|
|
|
|
# end-sanitize-tx19
|
1998-05-18 15:55:05 +00:00
|
|
|
mips*tx39*) SIM_SUBTARGET="-DSUBTARGET_R3900=1";;
|
1997-09-20 18:22:22 +00:00
|
|
|
*) SIM_SUBTARGET="";;
|
|
|
|
esac
|
|
|
|
AC_SUBST(SIM_SUBTARGET)
|
|
|
|
|
1997-10-14 07:27:31 +00:00
|
|
|
|
1998-02-02 14:14:17 +00:00
|
|
|
|
1997-10-14 07:27:31 +00:00
|
|
|
#
|
|
|
|
# Select the byte order of the target
|
|
|
|
#
|
1998-01-21 22:08:37 +00:00
|
|
|
mips_endian=
|
|
|
|
default_endian=
|
1997-10-14 07:27:31 +00:00
|
|
|
case "${target}" in
|
|
|
|
# start-sanitize-tx19
|
1998-01-21 22:08:37 +00:00
|
|
|
mipstx19*-*-*) default_endian=BIG_ENDIAN ;;
|
1997-10-14 07:27:31 +00:00
|
|
|
# end-sanitize-tx19
|
|
|
|
# start-sanitize-r5900
|
|
|
|
mips64r59*-*-*) mips_endian=LITTLE_ENDIAN ;;
|
|
|
|
# end-sanitize-r5900
|
1998-01-21 22:08:37 +00:00
|
|
|
mips64*-*-*) default_endian=BIG_ENDIAN ;;
|
|
|
|
mips16*-*-*) default_endian=BIG_ENDIAN ;;
|
|
|
|
mips*-*-*) default_endian=BIG_ENDIAN ;;
|
|
|
|
*) default_endian=BIG_ENDIAN ;;
|
1997-10-14 07:27:31 +00:00
|
|
|
esac
|
1998-01-21 22:08:37 +00:00
|
|
|
SIM_AC_OPTION_ENDIAN($mips_endian,$default_endian)
|
1997-10-14 07:27:31 +00:00
|
|
|
|
|
|
|
|
1998-02-02 14:14:17 +00:00
|
|
|
|
1997-10-14 07:27:31 +00:00
|
|
|
#
|
|
|
|
# Select the bitsize of the target
|
|
|
|
#
|
1998-02-23 16:55:38 +00:00
|
|
|
mips_addr_bitsize=
|
1997-10-14 07:27:31 +00:00
|
|
|
case "${target}" in
|
|
|
|
# start-sanitize-tx19
|
|
|
|
mipstx19*-*-*) mips_bitsize=32 ; mips_msb=31 ;;
|
|
|
|
# end-sanitize-tx19
|
|
|
|
# start-sanitize-r5900
|
1998-02-23 16:55:38 +00:00
|
|
|
mips64r59*-*-*) mips_bitsize=64 ; mips_msb=63 ; mips_addr_bitsize=32;;
|
1997-10-14 07:27:31 +00:00
|
|
|
# end-sanitize-r5900
|
|
|
|
mips64*-*-*) mips_bitsize=64 ; mips_msb=63 ;;
|
|
|
|
mips16*-*-*) mips_bitsize=64 ; mips_msb=63 ;;
|
|
|
|
mips*-*-*) mips_bitsize=32 ; mips_msb=31 ;;
|
|
|
|
*) mips_bitsize=64 ; mips_msb=63 ;;
|
|
|
|
esac
|
1998-02-23 16:55:38 +00:00
|
|
|
SIM_AC_OPTION_BITSIZE($mips_bitsize,$mips_msb,$mips_addr_bitsize)
|
1997-10-14 07:27:31 +00:00
|
|
|
|
|
|
|
|
1998-02-02 14:14:17 +00:00
|
|
|
|
1997-10-14 07:27:31 +00:00
|
|
|
#
|
|
|
|
# Select the floating hardware support of the target
|
|
|
|
#
|
|
|
|
mips_fpu=HARDWARE_FLOATING_POINT
|
1998-02-03 05:39:15 +00:00
|
|
|
mips_fpu_bitsize=
|
1997-10-14 07:27:31 +00:00
|
|
|
case "${target}" in
|
|
|
|
# start-sanitize-tx19
|
|
|
|
mipstx19*-*-*) mips_fpu=SOFT_FLOATING_POINT ;;
|
|
|
|
# end-sanitize-tx19
|
1998-05-18 15:55:05 +00:00
|
|
|
mips*tx39*) mips_fpu=HARD_FLOATING_POINT
|
1998-02-03 05:39:15 +00:00
|
|
|
mips_fpu_bitsize=32
|
|
|
|
;;
|
1997-10-14 07:27:31 +00:00
|
|
|
# start-sanitize-r5900
|
1998-02-23 16:55:38 +00:00
|
|
|
mips64r59*-*-*) mips_fpu=HARD_FLOATING_POINT ; mips_fpu_bitsize=32 ;;
|
1997-10-14 07:27:31 +00:00
|
|
|
# end-sanitize-r5900
|
|
|
|
mips64*-*-*) mips_fpu=HARD_FLOATING_POINT ;;
|
|
|
|
mips16*-*-*) mips_fpu=HARD_FLOATING_POINT ;;
|
1998-06-09 15:42:04 +00:00
|
|
|
mips*-*-*) mips_fpu=HARD_FLOATING_POINT ; mips_fpu_bitsize=32 ;;
|
1997-10-14 07:27:31 +00:00
|
|
|
*) mips_fpu=HARD_FLOATING_POINT ;;
|
|
|
|
esac
|
1998-02-03 05:39:15 +00:00
|
|
|
SIM_AC_OPTION_FLOAT($mips_fpu,$mips_fpu_bitsize)
|
1997-10-14 07:27:31 +00:00
|
|
|
|
|
|
|
|
1998-02-02 14:14:17 +00:00
|
|
|
|
1998-02-01 03:29:48 +00:00
|
|
|
#
|
|
|
|
# Select the level of SMP support
|
|
|
|
#
|
|
|
|
case "${target}" in
|
|
|
|
# start-sanitize-r5900
|
|
|
|
mips64r59*-*-*) mips_smp=1 ;;
|
|
|
|
# end-sanitize-r5900
|
|
|
|
*) mips_smp=0 ;;
|
|
|
|
esac
|
|
|
|
SIM_AC_OPTION_SMP($mips_smp)
|
|
|
|
|
|
|
|
|
1998-02-02 14:14:17 +00:00
|
|
|
|
1997-10-24 07:54:21 +00:00
|
|
|
#
|
1997-11-05 09:43:34 +00:00
|
|
|
# Select the IGEN architecture
|
1997-10-24 07:54:21 +00:00
|
|
|
#
|
1998-02-03 05:39:15 +00:00
|
|
|
sim_use_gen=IGEN
|
1997-12-09 04:01:06 +00:00
|
|
|
sim_igen_machine="-M mipsIV"
|
|
|
|
sim_m16_machine="-M mips16"
|
1997-11-05 09:43:34 +00:00
|
|
|
sim_igen_filter="32,64,f"
|
|
|
|
sim_m16_filter="16"
|
1997-10-24 07:54:21 +00:00
|
|
|
case "${target}" in
|
1997-10-27 06:42:13 +00:00
|
|
|
# start-sanitize-tx19
|
1997-11-05 09:43:34 +00:00
|
|
|
mipstx19*-*-*) sim_default_gen=M16
|
1998-04-15 23:17:16 +00:00
|
|
|
sim_use_gen=M16
|
1997-12-09 04:01:06 +00:00
|
|
|
sim_igen_machine="-M tx19"
|
|
|
|
sim_m16_machine="-M tx19"
|
1997-11-05 09:43:34 +00:00
|
|
|
sim_igen_filter="32"
|
|
|
|
sim_m16_filter="16"
|
|
|
|
;;
|
1997-10-27 06:42:13 +00:00
|
|
|
# end-sanitize-tx19
|
1998-05-29 01:42:20 +00:00
|
|
|
mips*tx39*) sim_default_gen=IGEN
|
1998-04-02 19:35:39 +00:00
|
|
|
sim_use_gen=IGEN
|
1998-02-03 05:39:15 +00:00
|
|
|
sim_igen_filter="32,f"
|
|
|
|
sim_igen_machine="-M r3900"
|
|
|
|
;;
|
1997-10-24 07:54:21 +00:00
|
|
|
# start-sanitize-r5900
|
1997-11-05 09:43:34 +00:00
|
|
|
mips64r59*-*-*) sim_default_gen=IGEN
|
1998-01-31 06:56:13 +00:00
|
|
|
sim_use_gen=IGEN
|
1997-12-09 04:01:06 +00:00
|
|
|
sim_igen_machine="-M r5900"
|
1997-11-05 09:43:34 +00:00
|
|
|
;;
|
1997-10-24 07:54:21 +00:00
|
|
|
# end-sanitize-r5900
|
1998-03-03 17:03:57 +00:00
|
|
|
# start-sanitize-vr4320
|
|
|
|
mips64vr4320-*-*) sim_default_gen=IGEN
|
|
|
|
sim_use_gen=IGEN
|
|
|
|
sim_igen_machine="-M mipsIV,vr4320 -G gen-multi-sim=vr4320"
|
|
|
|
;;
|
|
|
|
# end-sanitize-vr4320
|
|
|
|
mips64vr43*-*-*) sim_default_gen=IGEN
|
|
|
|
sim_use_gen=IGEN
|
|
|
|
sim_igen_machine="-M mipsIV"
|
|
|
|
# start-sanitize-vr4320
|
|
|
|
sim_igen_machine="-M mipsIV,vr4320 -G gen-multi-sim=mipsIV"
|
|
|
|
# end-sanitize-vr4320
|
|
|
|
;;
|
1998-08-12 10:50:35 +00:00
|
|
|
# start-sanitize-cygnus
|
1997-11-05 09:43:34 +00:00
|
|
|
mips64vr54*-*-*) sim_default_gen=IGEN
|
|
|
|
sim_use_gen=IGEN
|
1997-12-09 04:01:06 +00:00
|
|
|
sim_igen_machine="-M vr5000,vr5400 -G gen-multi-sim=vr5400"
|
1997-11-05 09:43:34 +00:00
|
|
|
;;
|
1998-08-12 10:50:35 +00:00
|
|
|
# end-sanitize-cygnus
|
1997-11-14 08:27:38 +00:00
|
|
|
mips64vr5*-*-*) sim_default_gen=IGEN
|
1997-12-12 19:24:34 +00:00
|
|
|
sim_use_gen=IGEN
|
1997-12-09 04:01:06 +00:00
|
|
|
sim_igen_machine="-M vr5000"
|
1998-08-12 10:50:35 +00:00
|
|
|
# start-sanitize-cygnus
|
1997-12-12 19:24:34 +00:00
|
|
|
sim_igen_machine="-M vr5000,vr5400 -G gen-multi-sim=vr5000"
|
1998-08-12 10:50:35 +00:00
|
|
|
# end-sanitize-cygnus
|
1997-11-14 08:27:38 +00:00
|
|
|
;;
|
1998-02-19 21:28:50 +00:00
|
|
|
mips64vr4100-*-*) echo "NOTE: mips64vr4100 still uses gencode"
|
|
|
|
sim_default_gen=M16
|
|
|
|
sim_igen_machine="-M tx19"
|
|
|
|
sim_m16_machine="-M tx19"
|
|
|
|
sim_igen_filter = "32,64,f"
|
|
|
|
sim_m16_filter = "16"
|
|
|
|
sim_use_gen=NO
|
|
|
|
;;
|
|
|
|
|
1998-02-02 14:14:17 +00:00
|
|
|
mips64*-*-*) sim_default_gen=IGEN
|
|
|
|
sim_igen_filter="32,64,f"
|
|
|
|
sim_use_gen=IGEN
|
|
|
|
;;
|
1997-11-05 09:43:34 +00:00
|
|
|
mips16*-*-*) sim_default_gen=M16
|
1998-02-02 14:14:17 +00:00
|
|
|
sim_igen_filter="32,64,f"
|
|
|
|
sim_m16_filter="16"
|
1998-02-03 05:39:15 +00:00
|
|
|
sim_use_igen=NO
|
1997-11-05 09:43:34 +00:00
|
|
|
;;
|
1998-02-02 14:14:17 +00:00
|
|
|
mips*-*-*) sim_default_gen=IGEN
|
1997-11-05 09:43:34 +00:00
|
|
|
sim_igen_filter="32,f"
|
1998-02-02 14:14:17 +00:00
|
|
|
sim_use_gen=IGEN
|
1997-11-05 09:43:34 +00:00
|
|
|
;;
|
1997-10-24 07:54:21 +00:00
|
|
|
esac
|
1998-02-01 03:29:48 +00:00
|
|
|
sim_igen_flags="-F ${sim_igen_filter} ${sim_igen_machine} ${sim_igen_smp}"
|
|
|
|
sim_m16_flags=" -F ${sim_m16_filter} ${sim_m16_machine} ${sim_igen_smp}"
|
1997-10-27 07:55:24 +00:00
|
|
|
AC_SUBST(sim_igen_flags)
|
|
|
|
AC_SUBST(sim_m16_flags)
|
1997-10-24 07:54:21 +00:00
|
|
|
|
1998-02-02 14:14:17 +00:00
|
|
|
|
|
|
|
|
1997-11-05 09:43:34 +00:00
|
|
|
#
|
|
|
|
# Enable igen
|
|
|
|
#
|
|
|
|
AC_ARG_ENABLE(sim-igen,
|
|
|
|
[ --enable-sim-igen=opts Enable IGEN simulator],
|
|
|
|
[case "${enableval}" in
|
|
|
|
yes) sim_gen="${sim_default_gen}";;
|
|
|
|
no) sim_gen=NO;;
|
|
|
|
16) sim_gen=M16;;
|
1998-03-18 00:20:40 +00:00
|
|
|
*) AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-igen"); sim_gen="";;
|
1997-11-05 09:43:34 +00:00
|
|
|
esac
|
|
|
|
if test x"$silent" != x"yes" && test x"$sim_gen" != x""; then
|
|
|
|
echo "Setting sim_igen = $sim_gen" 6>&1
|
|
|
|
fi],[sim_gen="${sim_use_gen}"])dnl
|
|
|
|
AC_SUBST(sim_gen)
|
|
|
|
|
|
|
|
|
1998-05-22 05:23:04 +00:00
|
|
|
#
|
1998-05-18 15:55:05 +00:00
|
|
|
# Add simulated hardware devices
|
|
|
|
#
|
1998-05-22 05:23:04 +00:00
|
|
|
hw_enabled=no
|
1998-05-18 15:55:05 +00:00
|
|
|
case "${target}" in
|
1998-08-25 14:16:58 +00:00
|
|
|
# start-sanitize-tx3904
|
|
|
|
mips*tx39*)
|
|
|
|
hw_enabled=yes
|
|
|
|
hw_extra_devices="tx3904cpu tx3904irc tx3904tmr tx3904sio"
|
|
|
|
mips_extra_objs="dv-sockser.o"
|
|
|
|
SIM_SUBTARGET="$SIM_SUBTARGET -DTARGET_TX3904=1"
|
|
|
|
;;
|
|
|
|
# end-sanitize-tx3904
|
|
|
|
# start-sanitize-sky
|
|
|
|
mips64r59*-sky-*)
|
|
|
|
mips_extra_objs="$mips_extra_objs "'$(SIM_SKY_OBJS)'
|
|
|
|
SIM_SUBTARGET="-DTARGET_SKY -DWITH_DEVICES=1 -DDEVICE_INIT=1"
|
|
|
|
;;
|
|
|
|
# end-sanitize-sky
|
|
|
|
*)
|
|
|
|
mips_extra_objs=""
|
|
|
|
;;
|
1998-05-18 15:55:05 +00:00
|
|
|
esac
|
1998-05-22 05:23:04 +00:00
|
|
|
SIM_AC_OPTION_HARDWARE($hw_enabled,$hw_devices,$hw_extra_devices)
|
1998-08-25 14:16:58 +00:00
|
|
|
AC_SUBST(mips_extra_objs)
|
1998-05-18 15:55:05 +00:00
|
|
|
|
|
|
|
|
1998-03-18 00:20:40 +00:00
|
|
|
AC_PATH_X
|
|
|
|
mips_extra_libs=""
|
|
|
|
# start-sanitize-sky
|
|
|
|
# Enable GPU2 library
|
|
|
|
AC_ARG_WITH(sim-gpu2,
|
|
|
|
[ --with-sim-gpu2=path Use GPU2 library under given directory],
|
|
|
|
[if test -d "${withval}"
|
|
|
|
then
|
|
|
|
SIM_SUBTARGET="${SIM_SUBTARGET} -DSKY_GPU2 -I${withval}/include"
|
1998-06-23 17:59:31 +00:00
|
|
|
mips_extra_libs="-L${withval}/lib -lgpu2 -L${x_libraries} -lX11 -lXext"
|
1998-03-18 00:20:40 +00:00
|
|
|
else
|
|
|
|
AC_MSG_ERROR("Directory ${withval} does not exist.");
|
|
|
|
fi])dnl
|
1998-04-21 21:14:09 +00:00
|
|
|
# Enable target accurate FP library
|
|
|
|
AC_ARG_WITH(sim-funit,
|
|
|
|
[ --with-sim-funit=path Use target FP library under given directory],
|
|
|
|
[if test -d "${withval}"
|
|
|
|
then
|
|
|
|
SIM_SUBTARGET="${SIM_SUBTARGET} -DSKY_FUNIT -I${withval}/include"
|
|
|
|
mips_extra_libs="${mips_extra_libs} -L${withval}/lib -lfunit"
|
|
|
|
else
|
|
|
|
AC_MSG_ERROR("Directory ${withval} does not exist.");
|
|
|
|
fi])dnl
|
1998-03-18 00:20:40 +00:00
|
|
|
# end-sanitize-sky
|
|
|
|
AC_SUBST(mips_extra_libs)
|
|
|
|
|
1997-05-21 06:54:13 +00:00
|
|
|
AC_CHECK_HEADERS(string.h strings.h stdlib.h stdlib.h)
|
1996-06-03 15:58:45 +00:00
|
|
|
AC_CHECK_LIB(m, fabs)
|
1996-09-26 10:39:34 +00:00
|
|
|
AC_CHECK_FUNCS(aint anint sqrt)
|
1996-06-03 15:58:45 +00:00
|
|
|
|
1996-11-20 10:00:42 +00:00
|
|
|
SIM_AC_OUTPUT
|