aboutsummaryrefslogtreecommitdiff
path: root/sim
AgeCommit message (Collapse)AuthorFilesLines
2015-03-14sim: drop duplicate header checksMike Frysinger52-313/+218
The SIM_AC_COMMON macro already checks for a bunch of headers, so specific sim ports need not do it themselves.
2015-03-14sim: move sim-io.h to sim-assert.hMike Frysinger3-1/+8
Since sim-endian.c doesn't actually use sim_io funcs, it's weird to include the sim-io.h header here. It's doing so only for the assert header. So lets relocate the include to the right place.
2015-03-10sim: bfin: fix up linux-fixed-code.h generation more [PR sim/13160]Mike Frysinger2-1/+7
Add a trailing semi-colon to the sed print command as the BSD sed implementation wants it. It's a nop otherwise and works fine on GNU/etc... implementations too.
2015-03-09sim: bfin: fix bug referenceMike Frysinger1-1/+1
2015-03-09sim: bfin: fix up linux-fixed-code.h generation [PR sim/10143]Mike Frysinger2-3/+11
The use of $< ends up picking the wrong object out of the depend list. Specify the input name directly to avoid fragility. On BSD systems, we need to make sure all options come before the non-options (i.e. the files). Reported-by: Chris Johns <chrisj@rtems.org> URL: https://sourceware.org/bugzilla/show_bug.cgi?id=13160
2015-03-08sim: microblaze: fix printf stringMike Frysinger2-1/+5
Since sizeof returns a size_t, use %zu to display it.
2015-02-27Fixes problems building the V850 simulator introduced with the previous delta.Nick Clifton6-206/+305
* sim-main.h (reg64_t): New type. (v850_regs): Add selID_sregs field. (VR, SAT16, SAT32, ABS16, ABS32 ): New macros. * v850-dc: Add fields for v850e3v5 instructions. * v850.igen (cvtf.dl): Use correctly signed local value. (cvtf.dw, cvtf.sw, trncf.dul, trncf.dl, trncf.sul, trncf.sw): Likewise. * interp.c: Fix old style function declarations. * simops.c: Likewise.
2015-02-24Adds support for emulating V850 e3v5 instructions to the simulator.Nick Clifton2-22/+855
* v850.igen: Add more e3v5 support. (FMAF.S): New pattern. (FMSF.S): New pattern. (FNMAF.S): New pattern. (FNMSF.S): New pattern. (cnvq15q30): New pattern. (cnvq30q15): New pattern. (cnvq31q62): New pattern. (cnvq62q31): New pattern. (dup.h): New pattern. (dup.w): New pattern. (expq31): New pattern. (modadd): New pattern. (mov.dw): New pattern. (mov.h): New pattern. (mov.w): New pattern. (pki16i32): New pattern. (pki16ui8): New pattern. (pki32i16): New pattern. (pki64i32): New pattern. (pkq15q31): New pattern. (pkq30q31): New pattern. (pkq31q15): New pattern. (pkui8i16): New pattern. (vabs.h): New pattern. (vabs.w): New pattern. (vadd.dw): New placeholder pattern. (vadd.h): New placeholder pattern. (vadd.w): New placeholder pattern. (vadds.h): New placeholder pattern. (vadds.w): New placeholder pattern. (vaddsat.h): New placeholder pattern. (vaddsat.w): New placeholder pattern. (vand): New pattern. (vbiq.h): New placeholder pattern. (vbswap.dw): New placeholder pattern. (vbswap.h): New placeholder pattern. (vbswap.w): New placeholder pattern. (vcalc.h): New placeholder pattern. (vcalc.w): New placeholder pattern. (vcmov): New placeholder pattern.
2015-02-24Fix the detection of illegal memory accesses in the MSP430 simulator.Nick Clifton2-34/+67
* msp430-sim.c (sim_open): Allocate memory regions matching those declared in the libgloss/msp430 linker scripts. Allow sim_load_file to fail. (get_op): Test the correct address bit when checking for out of range addresses. Include the address in the error message when an illegal access to the hardware multiplier is detected. (put_op): Test the correct address bit when checking for out of range addresses.
2015-02-22sim/erc32: Use readline.h for readline types and functions.Jiri Gaisler3-12/+8
Use gdb's readline.h for readline types.
2015-02-21sim/erc32: File loading via command line did not workJiri Gaisler1-1/+4
* sis.c (main) load binary file from argv parameters
2015-02-21sim/erc32: Fix incorrect simulator performance reportJiri Gaisler5-17/+39
2015-02-21sim/erc32: Remove unused defines in Makefile and switch off statisticsJiri Gaisler2-1/+5
2015-02-21sim/erc32: Use fenv.h for host FPU accessJiri Gaisler2-161/+35
2015-02-21sim/erc32: Perform pseudo-init if binary linked to non-zero address.Jiri Gaisler4-0/+37
Binaries produced by most erc32 tool-chains do not include system initialization. sis will detect this and initialize necessary registers for memory and timer control.
2015-02-21sim/erc32: Corrected wrong CPU implementation and version ID in psrJiri Gaisler2-1/+5
2015-02-21sim/erc32: Disassembly in stand-alone mode did not work.Jiri Gaisler2-3/+19
The API to print_insn_sparc() has changed over the years ...
2015-02-20sim: drop unused headersMike Frysinger9-288/+25
These look like left over hacks from the days where we had to protect ourselves from the compiler and C library. None of these checks are relevant, and we have common configure logic to do header tests. Punt them all now.
2015-02-19sim: drop unused sim_kill functionMike Frysinger10-36/+20
This has been deprecated for a long time and no one calls it.
2015-02-20sim: ChangeLog: Correct the related items position and format.Chen Gang4-20/+18
Move several items from sim/ChangeLog to sim/*/ChangeLog. Also remove the incorrect white space in sim/common/ChangeLog.
2015-02-19sim: microblaze: fix build failure after opcodes updateMike Frysinger2-3/+7
Commit 07774fccc3280323f43db9ed204f628503b34663 update the microblaze opcodes table to avoid C++ collisions, but missed updating the sim. That caused it to fail to build due to missing keywords.
2015-02-14sim/common/gentmap.c: Include "string.h".Chen Gang2-0/+5
The related warnings: gcc ../../../binutils-gdb/sim/mcore/../common/gentmap.c -o gentmap -g -O -I. -I../../../binutils-gdb/sim/mcore -I../common -I../../../binutils-gdb/sim/mcore/../common -I../../include -I../../../binutils-gdb/sim/mcore/../../include -I../../bfd -I../../../binutils-gdb/sim/mcore/../../bfd -I../../opcodes -I../../../binutils-gdb/sim/mcore/../../opcodes ../../../binutils-gdb/sim/mcore/../common/gentmap.c: In function ‘main’: ../../../binutils-gdb/sim/mcore/../common/gentmap.c:119:7: warning: implicit declaration of function ‘strcmp’ [-Wimplicit-function-declaration] if (strcmp (argv[1], "-h") == 0) ^ 2015-02-13 Chen Gang <gang.chen.5i5j@gmail.com> * gentmap.c: Include "string.h".
2015-02-11sim/mcore/interp.c: Include "unistd.h".Chen Gang2-0/+5
The related warnings: gcc -DHAVE_CONFIG_H -DPROFILE=1 -DWITH_PROFILE=-1 -DDEFAULT_INLINE=0 -I. -I../../../binutils-gdb/sim/mcore -I../common -I../../../binutils-gdb/sim/mcore/../common -I../../include -I../../../binutils-gdb/sim/mcore/../../include -I../../bfd -I../../../binutils-gdb/sim/mcore/../../bfd -I../../opcodes -I../../../binutils-gdb/sim/mcore/../../opcodes -g -O2 -c -o interp.o -MT interp.o -MMD -MP -MF .deps/interp.Tpo ../../../binutils-gdb/sim/mcore/interp.c ../../../binutils-gdb/sim/mcore/interp.c: In function ‘handle_trap1’: ../../../binutils-gdb/sim/mcore/interp.c:559:22: warning: implicit declaration of function ‘link’ [-Wimplicit-function-declaration] cpu.gr[RET1] = link ((char *) a[0], (char *) a[1]); ^ ../../../binutils-gdb/sim/mcore/interp.c:585:22: warning: implicit declaration of function ‘access’ [-Wimplicit-function-declaration] cpu.gr[RET1] = access ((char *) a[0], a[1]); ^ 2015-02-11 Chen Gang <gang.chen.5i5j@gmail.com> * interp.c: Include "unistd.h".
2015-02-03sim: Be sure of calling freeargv() after successfully call buildargv().Chen Gang2-0/+8
Or there will be memory leak. 2015-02-02 Chen Gang <gang.chen.5i5j@gmail.com> * microblaze/interp.c (sim_do_command): Call freeargv() before return.
2015-02-03sim: Be sure of calling freeargv() after successfully call buildargv().Chen Gang2-0/+7
Or there will be memory leak. 2015-02-02 Chen Gang <gang.chen.5i5j@gmail.com> * mcore/interp.c (sim_do_command): Call freeargv() before return.
2015-02-03sim: Call freeargv() when failure occursChen Gang2-1/+9
After successfully call buildargv(), the code need to be sure of calling freeargv() in any cases. 2015-02-02 Chen Gang <gang.chen.5i5j@gmail.com> * common/sim-options.c (sim_args_command): Call freeargv() when failure occurs.
2015-01-15Build failure in sim/rx/gdb-if.c on windowsJoel Brobecker2-4/+10
This should fix a build failure reported on x86_64-mingw32 by Daniel Calcoen due to conflicting declarations of "open". This patch just renames the static global in sim/rx/gdb-if.c into "rx_sim_is_open". sim/rx/ChangeLog: * gdb-if.c (open): Rename to... (rx_sim_is_open): This. Replace all uses of "open" by uses of "rx_sim_is_open" throughout. Tested by rebuilding on x86_64-linux.
2015-01-07Regenerate sim/common/aclocal.m4 and sim/common/configure...Joel Brobecker3-11/+14
... using automake 1.11.1, which is the version we're currently using throughout, instead of 1.11.3. This should be a no-op in practice, but will help automake/aclocal version-related differences to cloud real changes being made. sim/common/ChangeLog: * aclocal.m4, configure: Regenerate using automake 1.11.1.
2015-01-01Update year range in copyright notice of all files owned by the GDB project.Joel Brobecker546-546/+546
gdb/ChangeLog: Update year range in copyright notice of all files.
2014-12-27Update sto/ldo implementations with 16 bit offsetsAnthony Green2-20/+32
2014-12-25Whitespace cleanupAnthony Green1-0/+5
2014-12-25Whitespace cleanupAnthony Green1-4/+55
2014-12-24Add support for moxie's mul.x and umul.x instructionsAnthony Green2-2/+28
2014-12-12Add zex instruction support for moxie portAnthony Green2-2/+22
2014-12-03callback.h:struct host_callback_struct compilation error on Windows hosts.Joel Brobecker7-8/+28
On Windows, a recent gnulib update imported the lstat module, and this caused a remote-sim.c build failure in struct host_callback_struct: In file included from /[...]/gdb/remote-sim.c:34:0: /[...]/gdb/../include/gdb/callback.h:93:9: error: duplicate member '_stati64' int (*lstat) (host_callback *, const char *, struct stat *); ^ What happens it that gnulib's stat.h makes the following defines: /* Large File Support on native Windows. */ #if 1 # define stat _stati64 #endif and then: #if 1 # if ! 0 /* mingw does not support symlinks, therefore it does not have lstat. But without links, stat does just fine. */ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) # define lstat stat # endif So, the following fields in struct host_callback_struct... int (*stat) (host_callback *, const char *, struct stat *); int (*fstat) (host_callback *, int, struct stat *); int (*lstat) (host_callback *, const char *, struct stat *); ... get translated to... int (*_stati64) (host_callback *, const char *, struct _stati64 *); int (*_fstati64) (host_callback *, int, struct _stati64 *); int (*_stati64) (host_callback *, const char *, struct _stati64 *); ... which causes two fields to have the same name. This patch fixes the issue by renaming the stat-related fields by adding a "to_" prefix, similar to what is done in GDB's target_ops vector. include/gdb/ChangeLog: * callback.h (struct host_callback_struct) <to_stat>: Renamed from "stat". <to_fstat>: Renamed from "fstat". <to_lstat>: Renamed from "lstat". sim/common/ChangeLog: * sim-io.c (sim_io_stat, sim_io_fstat): Adjust calls to "stat" and "fstat" callbacks by calls to "to_stat" and "to_fstat" (resp) callbacks following renaming in callback.h. * syscall.c (cb_syscall): Likewise. Adjust calls to "lstat" callback by call to "to_lstat" callback sim/cris/ChangeLog: * traps.c (cris_break_13_handler): Adjust call to "fstat" callback by call to "to_fstat" following renaming in callback.h. sim/h8300/ChangeLog: * compile.c (sim_resume): Adjust calls to "stat" and "fstat" callbacks by calls to "to_stat" and "to_fstat" (resp) callbacks following renaming in callback.h.
2014-11-28Correct fabs and fneg insns in simulatorOleg Endo2-3/+21
It seems that the implementation of the SH fabs and fneg insns in the simulator is not correct. They use the FP_UNARY macro which checks the FPSCR.PR setting and raises an exception if PR = 1 (double precision) and the register number is not even (i.e. a valid DF reg number). For normal unary FP insns this is fine. However, fneg and fabs perform the same (integer) operations regardless of the FPSCR.PR setting. This issue initially popped up here https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63260 I've checked some of the failing tests mentioned in GCC PR 63260 above with the patch applied and the failures go away. sim/sh/ChangeLog (tiny patch): * gencode.c (fabs, fneg): Implement as integer operation instead of using the FP_UNARY macro.
2014-11-23sim/ppc/*: Change immediatly to immediatelyJoel Sherrill5-6/+11
sim/ppc/ChangeLog: * ChangeLog, ChangeLog.00, hw_com.c, ld-cache.h, ppc-instructions: Change immediatly to immediately.
2014-11-23sim/igen/: Change immediatly to immediatelyJoel Sherrill3-2/+6
sim/igen/ChangeLog: * igen/ld-cache.h, igen/table.h: Change immediatly to immediately.
2014-11-23s/immediatly/immediately/ in sim/sh/ChangeLog entry.Joel Sherrill1-1/+1
2014-08-28Shadow SIM's debug_printf functionGary Benson2-0/+7
GDB and SIM both have functions called "debug_printf", which conflicts at link time. This commit shadows SIM's debug_printf with a macro so that SIM's symbol ends up being called "sim_debug_printf". sim/common/ChangeLog: * sim-trace.h (debug_printf): New define.
2014-08-27psim: Correct spelling in comments.Joel Sherrill6-2/+11
2014-08-27 Joel Sherrill <joel.sherrill@oarcorp.com> * basics.h, device.c, device.h, hw_htab.c, hw_memory.c: Correct spelling in comments.
2014-08-23Fix m32r-elf sim, default hardware to off.Hans-Peter Nilsson4-12/+13
The situation here is similar to that of the other nearby (previous) sims fixed; it fails at the dv_sockser_install declaration in sim/m32r/tconfig.in. But, as opposed to e.g. frv, this *does* have a definition of UART_INCHAR_ADDR et al. It's somewhat tempting to keep sim-hardware enabled here but, I'm disabling it for the same reasons as for frv. Unsurprisingly (as m32r seems to be the template), the same confusing lines are in sim/m32r/Makefile.in as in sim/frv/Makefile.in at that time, deleted in 73e76d20. Again, commit 73e76d20 (for m32r as well as for frv) attempted to move the non-existing dv-sockser.o use to $(m32r_extra_objs) but missed that AC_SUBST would only affect @m32r_extra_objs@ and not $(m32r_extra_objs) per se so nothing happened. As for frv, I'm removing the $(m32r_extra_objs) too, to avoid confusion. Make check-sim for m32r-elf shows no regressions (5 failures; 100 expected passes) compared to bf3d9781ec049 (before the recent config.in regen, after sim-hardware mostly-enabled) and eed23bb4a1 (before the sim-hardware mostly-enabled; 2013-03-23). sim/m32r: * configure.ac: Default simulator hardware to off again. Remove dead m32r_extra_objs substitution. * configure: Regenerate. * Makefile.in: Remove unused frv_extra_objs.
2014-08-23Fix sh64-elf sim, default hardware to off.Hans-Peter Nilsson3-15/+9
See nearby (previous) commit for the iq2000 sim; this similarly fails at the dv_sockser_install declaration in sim/sh64/tconfig.in. I'm disabling simulator hardware to be consistent with the state before 94c63d78f (2013-03-23) and with the actions for the frv sim and the iq2000 sim. Make check-sim for sh64-elf shows no regressions (25 failures; 357 expected passes) compared to bf3d9781ec049 (before the recent config.in regen, after sim-hardware mostly-enabled) and eed23bb4a1 (before the sim-hardware mostly-enabled; 2013-03-23). sim/sh64: * configure.ac: Default simulator hardware to off again without emitting errors when off or dv-sockser.o unavailable. * configure: Regenerate.
2014-08-23Fix iq2000-elf sim, default hardware to off.Hans-Peter Nilsson3-15/+9
See nearby (previous) commit for the frv sim; this similarly fails at the dv_sockser_install declaration in sim/iq2000/tconfig.in. There's no HAVE_DV_SOCKSER conditionals here and no other dv-sockser.o artefacts so maybe there is no further fallout, but I'm going to disable sim-hardware just be consistent with the state before 94c63d78f (2013-03-23) and with the actions for the frv sim. Make check-sim for iq2000-elf shows no failures but that's in no small part because it has no test-suite. sim/iq2000: * configure.ac: Default simulator hardware to off again without emitting errors when off or dv-sockser.o unavailable. * configure: Regenerate.
2014-08-23Fix frv-elf sim, default hardware to off.Hans-Peter Nilsson4-12/+13
At 2974be626, frv-elf fails at the dv_sockser_install declaration in sim/frv/tconfig.in. But, with the trivial #include's added (see other sims tconfig.in, like cris or mn10300), it *still* fails building sim/frv/devices.c because of a missing UART_INCHAR_ADDR. I have no insight into what'd be a valid value, except that there's a definition in m32r, which was probably used as a template with frv not finished. Simulated hardware should not have been be enabled, and was indeed not enabled by default before 94c63d78f (2013-03-23), where it seems to have been enabled for no simulator-specific reason. Except dv-sockser.o wasn't enabled even then: sim/frv/config.in wasn't regenerated, so HAVE_DV_SOCKSER was never defined. Maybe people were fooled by this in sim/frv/Makefile.in at that time (these two lines were later deleted, in 73e76d20): CONFIG_DEVICES = dv-sockser.o CONFIG_DEVICES = (As it seems people have missed it before: the second line overrides the first...) I'm guessing these lines were part of the never-completed hardware-support. Commit 73e76d20 attempted to move the imagined dv-sockser.o from $(CONFIG_DEVICES) to $(frv_extra_objs) but missed that AC_SUBST would only affect @frv_extra_objs@ (not $(frv_extra_objs) per se) so nothing happened regarding sockser: dv-sockser.o was not compiled and HAVE_DV_SOCKSER was not defined. I'm removing the $(frv_extra_objs) too, to avoid confusion. The best action seems to be disabling all hardware support by default again until a specific sim maintainer finishes the work. Make check-sim for frv-elf shows no failures after this. sim/frv: * configure.ac: Default simulator hardware to off again. Remove dead frv_extra_objs substitution. * configure: Regenerate. * Makefile.in: Remove unused frv_extra_objs.
2014-08-19Fix --diable-shared --enable-plugins build breakageAlan Modra56-52/+1785
Directories that don't use libtool need to add -ldl (on most *nix hosts) to provide dlopen for libbfd. config/ * plugins.m4 (AC_PLUGINS): If plugins are enabled, add -ldl to LIBS via AC_SEARCH_LIBS. gdb/ * acinclude.m4 (GDB_AC_CHECK_BFD): Don't add -ldl. * config.in: Regenerate. sim/ppc/ * configure.ac: Invoke AC_PLUGINS. * config.in: Regenerate. and regen lots of configure files.
2014-08-19Replace static variables in the MSP430 simulator with fields in the cpu ↵Nick Clifton3-66/+98
state structure. * msp430-sim.c: Move static hardware multiply support variables from here... * msp430-sim.h (msp430_cpu_state): ... into here ... * msp430-sim.c (get_op, put_op): ... and update references to use the msp430_cpu_state structure.
2014-08-15Regenerate sim configury.Roland McGrath78-234/+1427
2014-06-30Sim - Use long int format instead of int to avoid compiling warningMichael Eager2-3/+8
2014-07-01 Chen Gang <gang.chen.5i5j@gmail.com> * sim/microblaze/interp.c: Use long int format instead of int format to avoid compiling warnings.
2014-06-03Fix a small but in the emulation of the MSP430 hardware multiply.Nick Clifton2-3/+37
* msp430-sim.c (get_op): Handle reads of low result register when in MAC mode. (put_op): Copy MAC result into result words. Handle writes to the low result register.