aboutsummaryrefslogtreecommitdiff
path: root/sim
AgeCommit message (Collapse)AuthorFilesLines
2010-12-04* Makefile.in: Use CC_FOR_BUILD to build opc2c.Masaki Muranaka2-3/+12
2010-11-23sim: profile: fix building with --disable-sim-profileMike Frysinger2-0/+16
When the sim is configured with profile support disabled, the build fails: ./../common/sim-profile.c: In function 'profile_option_handler': ./../common/sim-profile.c:337:6: warning: implicit declaration of function 'PROFILE_PC_FREQ' ./../common/sim-profile.c:337:6: error: lvalue required as left operand of assignment ./../common/sim-profile.c:351:6: warning: implicit declaration of function 'PROFILE_PC_NR_BUCKETS' ./../common/sim-profile.c:351:6: error: lvalue required as left operand of assignment ./../common/sim-profile.c:381:6: warning: implicit declaration of function 'PROFILE_PC_SHIFT' ./../common/sim-profile.c:381:6: error: lvalue required as left operand of assignment ./../common/sim-profile.c:405:8: warning: implicit declaration of function 'PROFILE_PC_START' ./../common/sim-profile.c:405:8: error: lvalue required as left operand of assignment ./../common/sim-profile.c:406:8: warning: implicit declaration of function 'PROFILE_PC_END' ./../common/sim-profile.c:406:8: error: lvalue required as left operand of assignment ./../common/sim-profile.c: In function 'profile_uninstall': ./../common/sim-profile.c:1299:7: warning: implicit declaration of function 'PROFILE_INSN_COUNT' ./../common/sim-profile.c:1299:37: warning: comparison between pointer and integer ./../common/sim-profile.c:1300:2: warning: passing argument 1 of 'zfree' makes pointer from integer without a cast ../common/sim-utils.h:30:6: note: expected 'void *' but argument is of type 'int' make[2]: *** [sim-profile.o] Error 1 So add some stubs similar to how some of the other subsystems are stubbed out so things build correctly. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-11-23sim: cast away hw/device differencesMike Frysinger2-0/+8
When building with device and hw support, the sim-core code generates a lot of build time warnings such as: ./../common/sim-core.c: In function 'sim_core_map_attach': ./../common/sim-core.c:198:7: warning: passing argument 1 of 'device_error' from incompatible pointer type ../common/sim-core.h:347:6: note: expected 'struct device *' but argument is of type 'struct hw *' ./../common/sim-core.c:235:7: warning: passing argument 1 of 'device_error' from incompatible pointer type ../common/sim-core.h:347:6: note: expected 'struct device *' but argument is of type 'struct hw *' In reality, these two structures get cast back and forth in the core code already and so are "compatible". So tweak the three functions that generate all of these warnings to include the casts automatically. I know this isn't exactly clean, but the current device/hw ifdef approach is full of landmines itself and I'm not entirely sure how to unscrew it. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-11-16sim: dv-sockser: add a write buffer variantMike Frysinger3-4/+18
Rather than having to bang out chunks of data one byte at a time over the socket interface, add a write variant that accepts an arbitrarily long buffer. This speeds things up considerably when we have many chars to send out at once. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-11-12* rx.c (lsb_count): New.DJ Delorie2-7/+94
(divu_cycles): New. (div_cycles): New. (decode_opcode): Fix cycle count math for div, divu, suntil, and swhile.
2010-10-09Regenerate for bool -> bool_ changeAlan Modra4-59/+67
2010-10-06 * callback.c (os_lseek): Call wrap on lseek result.Hans-Peter Nilsson2-1/+5
2010-10-06 * traps.c (cris_break_13_handler): Pass lseekHans-Peter Nilsson2-0/+13
offset parameter as sign-extended.
2010-10-06 * sim/cris/c/seek3.c, sim/cris/c/seek4.c: New tests.Hans-Peter Nilsson3-0/+97
2010-09-30 * mem.c (rx_mem_ptr): When invalidating the decode cache, accountKevin Buettner2-3/+15
for the fact that the instruction decoder never uses swapped addresses.
2010-09-29 * rx.c (decode_opcode: RXO_int): Only break out of the emulationNick Clifton2-1/+8
loop if rx_syscall() does not return a RX_STEPPED result.
2010-09-24 * rx.c (decode_opcode): Add cycle information for RXO_smovu.Kevin Buettner2-0/+8
2010-09-24Fix typo in ChangeLog entry.Kevin Buettner1-1/+1
2010-09-23 * cpu.h (reset_decoder): Declare.Kevin Buettner4-0/+15
* load.c (rx_load): Call `reset_decoder'. * rx.c (reset_decoder): New function.
2010-09-23 * rx.c (decode_opcode): Declare `rx' as unsigned.Kevin Buettner2-1/+3
2010-09-23 * fpu.c, gdb-if.c, load.c, misc.c, syscalls.c (config.h): Include.Kevin Buettner6-0/+9
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>