aboutsummaryrefslogtreecommitdiff
path: root/sim
AgeCommit message (Collapse)AuthorFilesLines
2010-08-24 * sim/cris/asm/nonvcv32.ms: Neutralize changed &&-in-macro gas syntax.Hans-Peter Nilsson2-4/+8
2010-07-29[include/opcode]DJ Delorie7-204/+240
* rx.h (RX_Operand_Type): Add TwoReg. (RX_Opcode_ID): Remove ediv and ediv2. [opcodes] * rx-decode.opc (SRR): New. (rx_decode_opcode): Use it for movbi and movbir. Decode NOP2 (mov r0,r0) and NOP3 (max r0,r0) special cases. * rx-decode.c: Regenerate. [sim/rx] * rx.c (decode_cache_base): New. (id_names): Remove ediv and edivu. (optype_names): Add TwoReg. (maybe_get_mem_page): New. (rx_get_byte): Call it. (get_op): Add TwoReg support. (put_op): Likewise. (PD, PS, PS2, GD, GS, GS2, DSZ, SSZ, S2SZ, US1, US2, OM): "opcode" is a pointer now. (DO_RETURN): New. We use longjmp to return an exception result. (decode_opcode): Make opcode a pointer to the decode cache. Save decoded opcode information and re-use. Call DO_RETURN instead of return throughout. Remove ediv and edivu. * mem.c (ptdc): New. Adds decode cache. (rx_mem_ptr): Support it. (rx_mem_decode_cache): New. * mem.h (enum mem_ptr_action): add MPA_DECODE_CACHE. (rx_mem_decode_cache): Declare. * gdb-if.c (sim_resume): Add decode_opcode's setjmp logic here... * main.c (main): ...and here. Use a fast loop if neither trace nor disassemble is given. * cpu.h (RX_MAKE_STEPPED, RX_MAKE_HIT_BREAK, RX_MAKE_EXITED, RX_MAKE_STOPPED, RX_EXITED, RX_STOPPED): Adjust so that 0 is not a valid code for anything.
2010-07-28Sort *alphabetically* this timeDJ Delorie1-1/+1
2010-07-28[sim/rx]DJ Delorie12-748/+2359
* README.txt: New. * config.h (CYCLE_ACCURATE, CYCLE_STATS): New. * configure.in (--enable-cycle-accurate, --enable-cycle-stats): New. Default to enabled. * configure: Regenerate. * cpu.h (regs_type): Add cycle tracking info. (reset_pipeline_stats): Declare. (halt_pipeline_stats): Declare. (pipeline_stats): Declare. * main.c (done): Call pipeline_stats(). * mem.h (rx_mem_ptr): Moved to here ... * mem.c (mem_ptr): ... from here. Rename throughout. (mem_put_byte): Move LEDs to Port A. Add Port B to control cycle statistics. Move UART to SCI4. (mem_put_hi): Add TPU 1-2. TPU 1 and 2 count CPU cycles. * reg.c (init_regs): Set Rt reg to -1 (no reg). * rx.c: Add cycle counting and statistics throughout. (rx_get_byte): Optimize for speed. (decode_opcode): Likewise. (reset_pipeline_stats): New. (halt_pipeline_stats): New. (pipeline_stats): New. * trace.c (sim_disasm_one): Print cycle count. [include/opcode] * rx.h (RX_Opcode_ID): Add nop2 and nop3 for statistics.
2010-07-28* MAINTAINERS: Add self as RX maintainer. Sort list.DJ Delorie2-1/+6
2010-07-07 * gdb-if.c (sim_store_register): Add case for sim_rx_acc_regnum.Kevin Buettner2-0/+8
2010-06-24Add "acc" register. Revise register order and names.Kevin Buettner2-0/+12
2010-06-08oops - omitted from previous deltaNick Clifton1-0/+5
2010-06-08 * reg.c (set_oszc): Use unsigned int for the mask.Nick Clifton2-4/+9
(set_szc, set_osz, set_sz): Likewise.
2010-05-28Revert accidentally committed changes that aren't ready yet.Kevin Buettner1-7/+0
2010-05-28 * gdb-if.c (sim_do_command): Add a "sim verbose noisy" command.Kevin Buettner2-1/+14
2010-05-262010-05-26 Ozkan Sezer <sezeroz@gmail.com>Ozkan Sezer10-13/+41
gdb/ * ser-tcp.c (net_open): Check error return from socket() call by its equality to -1 not by it being negative. (net_close): Likewise. gdb/gdbserver/ * gdbreplay.c (remote_open): Check error return from socket() call by its equality to -1 not by it being negative. * remote-utils.c (remote_open): Likewise. sim/arm/ * communicate.c (MYread_char): Check error return from accept() call by its equality to -1 not by it being negative. (MYread_charwait): Likewise. * main.c (main): Likewise for both socket() and accept() calls. sim/common/ * dv-sockser.c (dv_sockser_init): Check error return from socket() call by its equality to -1 not by it being negative. (connected_p): Likewise for accept() call. sim/cris/ * dv-rv.c (hw_rv_init_socket): Check error return from socket() call by its equality to -1 not by it being negative. (hw_rv_write): Likewise. (hw_rv_handle_incoming): Likewise. (hw_rv_poll_once): Likewise. * rvdummy.c (setupsocket): Likewise. (main): Likewise for accept() call as returned from setupsocket(). sim/m32c/ * main.c (setup_tcp_console): Check error return from socket() call by its equality to -1 not by it being negative.
2010-05-20Fix erc32 sim build failure due to missing stdint.h.Joel Brobecker2-3/+10
* sis.h: Remove #include <stdint.h>. (uint64, int64): Redefine without using stdint.h. (UINT64_MAX): Define.
2010-05-112010-04-20 Tiemen Schut <T.Schut@sron.nl>Joel Sherrill6-42/+54
* erc32.c (sis_memory_write): Change prototype to const unsigned char *. * func.c (exec_cmd, event, advance_time, wait_for_irq): Use uint64 for counts. * interf.c (run_sim): Change icount to uint64_t. Use strtol directly. (sim_resume): Specify maximum run time as uint64. * sis.c (run_sim): Change icount to uint64_t. * sis.h: Define uint64 as uint64_t. Change various fields and prototypes to uint64 to support longer simulations.
2010-04-26sim: unify target->subdir handling for default testsMike Frysinger11-248/+461
The testsuite subdir has a note about unifying the target->subdir logic, so do just that. The end goal here is to have `make check` work out of the box without having to delve into dejagnu internals. The target-specific logic is split out of the top level configure.ac file and into a dedicated configure.tgt similar to other subprojects (gdb and ld and etc...) with the difference that this file has to be included at the m4 level instead of the shell level. This is necessary only because autoconf requires AC_CONFIG_SUBDIRS be given a string literal and not a variable value. Then the toplevel and the testsuite configure files pull this in, the sim subdir gets expanded into testsuite/site.exp, and the default sim run code uses this info to set the sim path to the local compiled run file if it hasn't already been specified. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-04-23sim: fix fpu missing initializer warningsMike Frysinger2-2/+6
The current fpu code with externals enabled results in the warnings: common/sim-fpu.c:2437: warning: missing initializer common/sim-fpu.c:2437: warning: (near initialization for 'sim_fpu_zero.sign') common/sim-fpu.c:2440: warning: missing initializer common/sim-fpu.c:2440: warning: (near initialization for 'sim_fpu_qnan.sign') So tweak the old style initializers to avoid these. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-04-22sim: profile: implement --profile-file backendMike Frysinger2-1/+5
Need to update the sim_profile_print_bar() call after the common/ changes. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-04-22sim: profile: implement --profile-file backendMike Frysinger2-1/+5
Need to update the sim_profile_print_bar() call after the common/ changes. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-04-22sim: profile: implement --profile-file backendMike Frysinger2-1/+5
The common/ code uses sim_cpu rather than SIM_CPU to avoid inter-header dependency issues, so follow convention to fix building some targets. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-04-22sim: profile: implement --profile-file backendMike Frysinger3-111/+150
The profile code already has options and handling for accepting a file to write the profile output like the trace code, but it doesn't actually use it. At the moment, it simply opens the file at the start and closes it at the end. So add two new local functions the way the trace code is doing it and have them figure out whether to write the output to stdout or the specified file. Then convert all existing output in the profile code to use these helpers. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-04-19sim: mn10300: convert to new sockser status codeMike Frysinger2-14/+26
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-04-19sim: add --model-info helper optionMike Frysinger2-1/+35
There is an architecture-info flag for listing possible arch values, but there is on equivalent for listing possible model values. So add the equivalent for models. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-04-14sim: constify sim_write source buffer (part 2)Mike Frysinger30-18/+74
As pointed out by Sandra Loosemore, a bunch of targets define sim_write themselves instead of using the common/ code. So constify them too. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-04-13sim: dv-sockser: pass up connected stateMike Frysinger3-3/+11
A few ports rely on internal dv-sockser state in order to detect whether a connection has been made (look for 'extern sockser_addr'). Rather than continuing that tradition, extend the existing status function to return the socket connection status. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-04-13sim: constify sim_write source bufferMike Frysinger3-2/+7
Most the sim write functions declare their source buffer const because they only ever read from it. The global sim_write() function does not follow this convention though which causes some warnings when trying to pass it const strings or buffers. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-04-12sim: add more hacking notesMike Frysinger2-0/+249
I found the documentation lacking in many places, so I tried filling in a lot of holes that I personally fell into. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-04-12sim: add helper macros for branch profilingMike Frysinger2-0/+21
The profile code has a lot of helper macros already, but none yet for the branch profiling code. So add ones for the basic functions -- taken and untaken branches. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-04-12sim: add missing values to array initializersMike Frysinger12-60/+74
The sim code has a lot of static initializer for options and devices, but since they aren't using newer struct style, they have to specify a value for every option otherwise gcc spits a lot of warnings about "missing initializer". So add NULL/0 stubs for pointers/values. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-04-12sim: constify dup_arg_pMike Frysinger2-3/+8
The dup_arg_p function is only given const strings, and it maintains a local table of those const strings. So constify the whole thing to fix the GCC warnings: common/sim-options.c: In function 'sim_parse_args': common/sim-options.c:559: warning: passing argument 1 of 'dup_arg_p' discards qualifiers from pointer target type common/sim-options.c: In function 'print_help': common/sim-options.c:675: warning: passing argument 1 of 'dup_arg_p' discards qualifiers from pointer target type Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-04-10sim: also constify sim_fpu_print_funcMike Frysinger2-1/+2
2010-04-10sim: constify sim_fpu_print_statusMike Frysinger2-1/+6
I've committed the following patch as obvious. The local "prefix" variable is only assigned const strings, and only passed to printf() functions, so add "const" to avoid gcc warnings: common/sim-fpu.c: In function 'sim_fpu_print_status': common/sim-fpu.c:2508: warning: initialization discards qualifiers from pointer target type common/sim-fpu.c:2566: warning: assignment discards qualifiers from pointer target type Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-04-10sim: drop duplicate break statements in sim-fpuMike Frysinger2-6/+4
2010-04-10sim: constify save_data()Mike Frysinger2-1/+5
The local save_data() function takes a pointer to a buffer and only uses it as the source to the memcpy() function. Since it is given const strings, GCC likes to spit out warnings: common/sim-trace.c: In function 'trace_prefix': common/sim-trace.c:697: warning: passing argument 5 of 'save_data' discards qualifiers from pointer target type So I've committed this as obvious. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-04-10sim: add const markings to env stringMike Frysinger2-1/+6
The sim-options code assigns a const string to "char *" in decoding the current environment settings, and only uses it to pass to a printf. GCC outputs the warnings: common/sim-options.c: In function 'standard_option_handler': common/sim-options.c:271: warning: assignment discards qualifiers from pointer target type common/sim-options.c:272: warning: assignment discards qualifiers from pointer target type common/sim-options.c:273: warning: assignment discards qualifiers from pointer target type So I've committed this as "obvious". Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-04-02sim: fix typos in hw-ports.hMike Frysinger2-5/+9
2010-03-30sim: v850: fix build failure after watchpoint constificationMike Frysinger2-2/+7
2010-03-30sim: use socklen_t with accept()Mike Frysinger5-14/+100
The accept() function takes a socklen_t, not an int. Using an int causes: dv-sockser.c: In function 'connected_p': dv-sockser.c:273: warning: pointer targets in passing argument 3 of 'accept' differ in signedness So use the same socklen_t detection code as gdb and convert the accept().
2010-03-30sim: fix printf format warning about non-string literalMike Frysinger3-2/+7
This is the normal "passing a buffer straight to printf makes GCC warn". While we know this particular case is fine, the trend in this source tree is to fix this anyways to avoid the warnings.
2010-03-30sim: constify watchpoint interrupt namesMike Frysinger3-5/+13
GCC issues warnings because const strings like "foo" are passed as char*. sim-watch.c: In function 'watchpoint_type_to_str': sim-watch.c:120: warning: return discards qualifiers from pointer target type
2010-03-30sim: change raddr to address_wordMike Frysinger2-2/+7
The sim read/write buffer functions deal with address_word's, not unsigned_words's, so make sure the local raddr variable matches accordingly.
2010-03-30sim: fix unused cpu_nr warningsMike Frysinger2-1/+6
The trace_option_handler() function only uses cpu_nr when the SIM_HAVE_ADDR_RANGE define is enabled. So move the decl down to where the code exists. Otherwise GCC warns: sim-trace.c: In function 'trace_option_handler': sim-trace.c:236: warning: unused variable 'cpu_nr'
2010-03-30sim: update device_error() prototypeMike Frysinger8-4/+20
The device_error() takes a printf style string, so update the prototype accordingly. The message should be const and it should use an attribute. This fixes gcc warnings like: sim-core.c: In function 'sim_core_map_attach': sim-core.c:200: warning: passing argument 2 of 'device_error' discards qualifiers from pointer target type sim-core.c:237: warning: passing argument 2 of 'device_error' discards qualifiers from pointer target type sim-core.c: In function 'sim_core_attach': sim-core.c:304: warning: passing argument 2 of 'device_error' discards qualifiers from pointer target type sim-core.c:314: warning: passing argument 2 of 'device_error' discards qualifiers from pointer target type sim-core.c:335: warning: passing argument 2 of 'device_error' discards qualifiers from pointer target type sim-core.c:348: warning: passing argument 2 of 'device_error' discards qualifiers from pointer target type
2010-03-30sim: fix unused profile_print_addr_ranges warningMike Frysinger2-0/+7
The profile_print_addr_ranges() function is only used when SIM_HAVE_ADDR_RANGE is defined, so #ifdef it accordingly.
2010-03-30sim: tweak static order on hw_glue_portsMike Frysinger2-1/+5
GCC likes to warn when static comes after const: dv-glue.c:191: warning: 'static' is not at beginning of declaration
2010-03-30sim: convert old style function definitionsMike Frysinger5-26/+21
GCC currently emits warnings like: nrun.c: In function 'usage': nrun.c:223: warning: old-style function definition
2010-03-22sim: always enable support for the --endian optionMike Frysinger2-6/+6
The gdb code always passes down -E <little|big> to the sim core when using the sim target. But the sim core only recognizes this option when the sim supports big endian systems. So for little endian simulators, any attempt to use the sim target fails with: (gdb) target sim gdbsim: invalid option -- 'E' unable to create simulator instance Since always respecting the option doesn't cause any problems, do just that. If someone tries to use an invalid endian, they'll get an error anyways.
2010-03-16sim: avoid TRACE redefine warningsMike Frysinger3-16/+13
The common code sets up an autoconf option --enable-sim-trace which adds -DTRACE= to CPPFLAGS. This causes warnings in the building of some files that declare a local TRACE() helper macro. So punt it from hw-ports.c (since it isn't actually used) and convert hw-properties.c to HW_TRACE().
2010-03-15sim: rename bool argument to avoid stdbool clashMike Frysinger2-1/+6
Including stdbool.h before hw-properties.h results in a build error due to the hw_add_boolean_property function having an argument named "bool" in its prototype. The source file has already be renamed to not use this ("boolean" instead), so match the header to the source.
2010-02-27sim/moxie/Jan Kratochvil2-2/+7
* interp.c (sim_create_inferior): Fix crashes on zero PROG_BFD or ARGV.
2010-02-14* ppc-instructions: Fix missing assignment in last change.Andreas Schwab2-0/+5