aboutsummaryrefslogtreecommitdiff
path: root/sim
AgeCommit message (Collapse)AuthorFilesLines
2015-12-25sim: m32r: migrate from WITH_DEVICES to WITH_HWMike Frysinger12-178/+361
The m32r port was using the device framework to handle two devices: the cache and uart registers. Both can be implemented in the newer hardware framework instead which allows us to drop the device logic entirely, as well as delete the tconfig.h file. While creating the new uart device model, I also added support for using stdin to read/write data rather than only supporting sockets. This has been lightly tested as there doesn't appear to be test coverage for the code already. If anyone still cares about this port, then they should (hopefully) file bug reports.
2015-12-25sim: cris: migrate from WITH_DEVICES to WITH_HWMike Frysinger10-126/+113
The cris port was using the device framework to handle two addresses when the --cris-900000xx flag was specified. That can be implemented using the newer hardware framework instead which allows us to drop the device logic entirely, as well as delete the tconfig.h file. Basically we create a new cris_900000xx device model and move the read logic out of devices.c and into that. The rest of the devices logic was callback to the hardware framework already.
2015-12-25sim: cris: clean up rvdummy a bitMike Frysinger2-2/+6
This fixes a few warnings when compiling the rvdummy tool.
2015-12-25sim: cris: set up sane default path to rvdummyMike Frysinger2-1/+14
Much like we autodetect the path to the run program when there is none set explicitly, do the same for the rvdummy program. Otherwise the default make check fails to execute the helper properly.
2015-12-25sim: hw-properties: delete trace callsMike Frysinger2-4/+8
These trace calls don't seem to add anything useful and break the cris hw tests, so punt them. They were disabled before commit 6d519a4606b9 but were re-enabled as part of TRACE macro cleanups.
2015-12-25sim: drop WITH_ENGINE defineMike Frysinger3-15/+5
We enable this everywhere already, and all new ports should use the engine logic, so no point in making it an option to disable.
2015-12-25sim: sim-model: build for everyoneMike Frysinger29-49/+75
Rather than include this for some targets, set it up so we can build it all the time via the common code. This makes it easier for targets to opt into it when they're ready, increases build coverage, and allows us to centralize much of the logic. We also get to delete tconfig.h from two more targets -- they were setting WITH_DEVICES to 0 which has the same behavior as not defining it at all. While the SIM_HAVE_MODEL knob is gone, we now have WITH_MODEL_P, but it is only used by the common sim-model code. We use it to declare dummy model lists when the arch hasn't created its own.
2015-12-25sim: move MACH/MODEL types into SIM_xxx namespaceMike Frysinger33-116/+172
The "MACH" and "MODEL" names are a bit generic and collide with symbols used by other sections of code (like h8300's opcodes). Since these are sim-specific types, they really should have a "SIM_" prefix.
2015-12-25sim: arm: delete unused codeMike Frysinger23-3651/+34
These vestiges of the 20 year old emulator are just getting in the way. Punt all the dead code we either don't compile or don't use.
2015-12-25sim: move WITH_SCACHE_PBB to sim-main.hMike Frysinger18-49/+57
This helps us break up tconfig.h more. Any file using this define should be pulling in sim-main.h already, so things should continue working.
2015-12-25sim: device_error: puntMike Frysinger12-52/+32
Only four targets implement this function, and three of them do nothing. The 4th merely calls abort. Since calls to this function are followed by calls to sim_hw_abort or sim_io_error, this is largely useless. In the two places where we don't, replace the call with sim_engine_abort. We want to kill off the WITH_DEVICES logic in favor of WITH_HW, so this is a good first step.
2015-12-25sim: always enable callback memoryMike Frysinger4-13/+13
We enable WITH_CALLBACK_MEMORY everywhere and don't provide a way to turn it off, and no target does so. Make it unconditional for all to keep things simple.
2015-12-25sim: dv-pal: always use CPU_INDEXMike Frysinger2-5/+7
Since the core always provides CPU_INDEX, use it. The current code doesn't actually use it even though it should since it doesn't include the right headers.
2015-12-24sim: mips: delete TARGET_TX3904 defineMike Frysinger3-2/+5
With the LMA cleanup, we no longer need this define.
2015-12-24sim: mips: move SIM_QUIET_NAN_NEGATED to sim-main.hMike Frysinger3-4/+8
We want to kill off tconfig.h, so move the one define mips still uses to sim-main.h.
2015-12-24sim: make LMA loading the default for all targetsMike Frysinger25-42/+72
Most targets already default to loading code via their LMA, but for a few, this means the default changes from loading VMA to LMA. It's better to have the different targets be consistent, and allows some code clean up.
2015-12-24sim: cris: move option install to sim_openMike Frysinger5-19/+18
We've moved custom option install for other targets to sim_open, so update cris too. It's the last one using MODULE_LIST, so we can drop that from the common code too.
2015-12-24sim: delete old breakpoint codeMike Frysinger11-83/+26
This code relies on the old sim-break module, but that was deleted in 2003. The module only existed for gdb to tell the sim to set breakpoints on its behalf, but then that logic was abandoned in favor of gdb knowing all about proper breakpoints (since it does already for non-sim targets). Some dead code lived on in the older ports though -- clean it up now.
2015-12-24sim: h8300: move h8300-specific options out of common codeMike Frysinger5-34/+69
Register the options in sim_open like other arches to avoid having to hack up the common modules.
2015-12-24sim: enable watchpoint module everywhereMike Frysinger18-35/+37
We build & bundle the watchpoint module everywhere, but we don't make the command line flags available by default. A few targets opted in, but most did not. Just enable the flag for everyone. Not all targets will respect the flags (making them nops), but shouldn't be a big deal. This is how we handle other common modules already.
2015-12-24sim: delete SIM_HAVE_FLATMEM supportMike Frysinger6-54/+13
No target has used this, and it's a cheap hack in place in using the common memory module. We want everyone using that though, so drop support for flatmem entirely.
2015-12-24sim: delete SIM_HAVE_MEM_SIZEMike Frysinger8-28/+16
This define isn't used anywhere (doesn't seem to ever have been used by versions committed), so delete the commented out code as it's dead.
2015-12-24sim: delete SIM_HAVE_SIMCACHEMike Frysinger6-18/+12
This was used by the old run interface, but we punted that awhile ago, so drop this define too.
2015-12-15Fix invalid left shift of negative valueDominik Vogt11-33/+55
Fix occurrences of left-shifting negative constants in C code. sim/arm/ChangeLog: * thumbemu.c (handle_T2_insn): Fix left shift of negative value. * armemu.c (handle_v6_insn): Likewise. sim/avr/ChangeLog: * interp.c (sign_ext): Fix left shift of negative value. sim/mips/ChangeLog: * micromips.igen (process_isa_mode): Fix left shift of negative value. sim/msp430/ChangeLog: * msp430-sim.c (get_op, put_op): Fix left shift of negative value. sim/v850/ChangeLog: * simops.c (v850_bins): Fix left shift of negative value.
2015-12-15Add support for the MRS instruction to the AArch64 simulator.Nick Clifton2-9/+53
* aarch64/simulator.c (system_get): New function. Provides read access to the dczid system register. (do_mrs): New function - implements the MRS instruction. (dexSystem): Call do_mrs for the MRS instruction. Halt on unimplemented system instructions.
2015-12-07Add support for MSP430 F5 hardware multiply.Nick Clifton2-10/+59
* msp430-sim.c (sim_open): Check for needed memory at address 0x500 not 0x200. (get_op): Add support for F5 hardware multiply addresses. (put_op): Likewise.
2015-11-24Add an AArch64 simulator to GDB.Nick Clifton23-4/+31400
sim * configure.tgt: Add aarch64 entry. * configure: Regenerate. * sim/aarch64/configure.ac: New configure template. * sim/aarch64/aclocal.m4: Generate. * sim/aarch64/config.in: Generate. * sim/aarch64/configure: Generate. * sim/aarch64/cpustate.c: New file - functions for accessing AArch64 registers. * sim/aarch64/cpustate.h: New header. * sim/aarch64/decode.h: New header. * sim/aarch64/interp.c: New file - interface between GDB and simulator. * sim/aarch64/Makefile.in: New makefile template. * sim/aarch64/memory.c: New file - functions for simulating aarch64 memory accesses. * sim/aarch64/memory.h: New header. * sim/aarch64/sim-main.h: New header. * sim/aarch64/simulator.c: New file - aarch64 simulator functions. * sim/aarch64/simulator.h: New header. include/gdb * sim-aarch64.h: New file. sim/test * configure: Regenerate. * sim/aarch64: New directory.
2015-11-22sim: common: set up CPPFLAGS/CXXFLAGS/LDFLAGS from configure [PR sim/18762]Mike Frysinger2-0/+8
Make sure we pass down the CPP/CXX/LD flags that configure set up for us like we already do for C flags.
2015-11-22sim: sim_do_commandf: fix call to va_end [PR sim/19273]Mike Frysinger2-2/+13
Make sure we call va_end even in the error case.
2015-11-22sim: ppc: avoid use of $< in ordinary rules [PR sim/13834]Mike Frysinger2-5/+13
POSIX does not define $< behavior in ordinary rules, so avoid its use to fix building on non-GNU make setups. Reported-by: Christopher January <chris.january@allinea.com>
2015-11-22sim: common: add PRI printf definesMike Frysinger2-0/+28
Keeping track of the right printf formats for the various types can be a pretty big hassle, especially in common code which has to support a variety of bitsizes. Take a page from the existing standards and add a set of PRI macros which hide the details in a common header.
2015-11-22sim: avr: move global state to sim/cpu stateMike Frysinger3-134/+157
We don't want global variables in the sim as all state should be in the sim state or in the cpu state. This pushes down all that logic for avr.
2015-11-22sim: avr: switch to common sim-regMike Frysinger2-4/+14
This is not entirely useful as avr doesn't (yet) store its register state in the cpu state, but it does allow for switching to the common code for these functions.
2015-11-22sim: sh: delete global callback/argvMike Frysinger3-46/+53
We can use the sim state everywhere now to get these values on the fly.
2015-11-22sim: h8300: delete global callback/kind/nameMike Frysinger2-47/+27
We can use the sim state everywhere now to get these values on the fly.
2015-11-22sim: mn10300: drop global callback handleMike Frysinger3-7/+8
It's used in one place and can easily be replaced by using the sim state.
2015-11-17sim: mn10300/v850: drop unused WITH_CORE defineMike Frysinger4-2/+8
This was dropped from the sim core in 1997, so no point in having these sim ports continue to define it.
2015-11-17sim: always enable modulo memoryMike Frysinger12-36/+30
Having this be a config option doesn't make sense: the code size is pretty much the same (as all the logic is still active), and if it's disabled, the sim throws an error if you try to use it. That means we can't break sims that weren't using it before by enabling it all the time.
2015-11-17[sim/ppc] Fix printf_filtered referencePedro Alves2-16/+21
Building a gdb that includes the PPC sim in C++ mode fails to link with: (...)s.o compile-object-load.o compile-object-run.o compile-loc2c.o compile-c-support.o inflow.o init.o \ ../sim/ppc/libsim.a ../readline/libreadline.a ../opcodes/libopcodes.a ../bfd/libbfd.a -lz ../libiberty/libiberty.a ../libdecnumber/libdecnumber.a -ldl -ldl -lncurses -lm -ldl -lguile-2.0 -lgc -lpthread -ldl -lutil -lm -lpython2.7 -Xlinker -export-dynamic -lexpat -llzma -lbabeltrace -lbabeltrace-ctf ../libiberty/libiberty.a build-gnulib/import/libgnu.a ../sim/ppc/libsim.a(sim_calls.o): In function `sim_open': /home/pedro/gdb/mygit/cxx-convertion/src/sim/ppc/sim_calls.c:73: undefined reference to `printf_filtered' /home/pedro/gdb/mygit/cxx-convertion/src/sim/ppc/sim_calls.c:73: undefined reference to `printf_filtered' ../sim/ppc/libsim.a(sim_calls.o): In function `sim_close': /home/pedro/gdb/mygit/cxx-convertion/src/sim/ppc/sim_calls.c:93: undefined reference to `printf_filtered' /home/pedro/gdb/mygit/cxx-convertion/src/sim/ppc/sim_calls.c:93: undefined reference to `printf_filtered' ../sim/ppc/libsim.a(sim_calls.o): In function `sim_load': /home/pedro/gdb/mygit/cxx-convertion/src/sim/ppc/sim_calls.c:102: undefined reference to `printf_filtered' ../sim/ppc/libsim.a(sim_calls.o):/home/pedro/gdb/mygit/cxx-convertion/src/sim/ppc/sim_calls.c:102: more undefined references to `printf_filtered' follow collect2: error: ld returned 1 exit status The undefined references come from TRACE macro calls, which expand to calls to printf_filtered. But note that the sim's 'printf_filtered' is actually a #define to 'sim_io_printf_filtered', in sim_callbacks.h : #define printf_filtered sim_io_printf_filtered AFAICS, this is not meant to call gdb's printf_filtered function. The ChangeLog entry that added the printf_filtered macro reads: Tue Jul 30 21:12:24 1996 Andrew Cagney <cagney@kremvax.highland.com.au> * sim_callbacks.h (sim_io_printf_filtered): Replace printf_filtered with a local simulator specific version. Add #define printf_filtered to simplify updating of existing code. That is, just another incomplete/partial transition. Maybe prior to 1996 this was really meant to call gdb's printf_filtered version. The reference to printf_filtered appears because sim_calls.c, the compilation unit that fails to link, has this at the top: #undef printf_filtered /* blow away the mapping */ presumably so that this further below: void sim_io_printf_filtered(const char *fmt, ...) { (...) callbacks->printf_filtered(callbacks, "%s", message); } works. So those TRACE macros instances in sim_calls.c just happen to work because gdb is linked in, which satisfies the 'printf_filtered' reference, when GDB is built in C mode. When built in C++ mode, the problem is exposed, as GDB's printf_filtered is mangled. The fix here is to make the TRACE macro call sim_io_printf_filtered directly. (Standalone "run" doesn't fail to link simply because the offending routines are not part of its link.) sim/ppc/ChangeLog 2015-11-17 Pedro Alves <palves@redhat.com> * debug.h (TRACE, ITRACE, DTRACE, DITRACE, PTRACE): Call sim_io_printf_filtered instead of printf_filtered.
2015-11-17sim: sim-close: use XCONCAT2 helperMike Frysinger2-3/+6
No point in open coding this logic when we've got nifty helpers to do it.
2015-11-16sim: sim-stop/sim-reason/sim-reg: move to common obj listMike Frysinger44-56/+119
Now that all arches (for the most part) have moved over, move sim-stop.o, sim-reason.o, and sim-reg.o to the common object list and out of all the arch ports.
2015-11-15sim: cr16: drop global callback stateMike Frysinger4-62/+70
Now that we have access to the sim state in all the right places, use existing sim helpers in place of cr16_callback directly.
2015-11-15sim: cr16: convert to common sim engine logicMike Frysinger5-157/+96
Now that we have access to the sim state everywhere, we can convert to the common engine logic for overall processing. This frees us up from tracking exception state ourselves.
2015-11-15sim: cr16: convert to common sim memory modulesMike Frysinger8-589/+62
The cr16 port has a lot of translation/offset logic baked into it, but it all looks like copy & paste from the d10v port rather than something the cr16 port wants.
2015-11-15sim: cr16: push down sd/cpu varsMike Frysinger6-788/+833
By itself, this commit doesn't really change anything. It lays the groundwork for using the cpu state in follow up commits, both for engine state and for cpu state. Splitting things up this way so it is easier to see how things have changed.
2015-11-15sim: cr16: delete unused memory helpersMike Frysinger3-20/+6
These aren't used anywhere and are just leftover from the d10v port. Delete them so follow up commits are easier to follow.
2015-11-15sim: cr16: switch to common sim-regMike Frysinger3-13/+61
This is mostly to get us off the weird cr16 specific memory functions, but it's also a good clean up to move to the common core.
2015-11-15sim: cr16/d10v: drop redundant call to sim_create_inferiorMike Frysinger4-2/+8
With the conversion to the nrun frontend, this call should no longer be necessary. It also actively crashes when trying to use the sd state.
2015-11-15sim: d10v: drop global callback stateMike Frysinger4-137/+149
Now that we have access to the sim state in all the right places, use existing sim helpers in place of d10v_callback directly.
2015-11-15sim: d10v: convert to common sim engine logicMike Frysinger5-218/+137
Now that we have access to the sim state everywhere, we can convert to the common engine logic for overall processing. This frees us up from tracking exception state ourselves.