Commit graph

156 commits

Author SHA1 Message Date
Andrew Cagney
ac9a7d8a2c Implement separate user (SPU) and interrupt (SPI) stack pointers. 1998-02-13 05:22:49 +00:00
Andrew Cagney
b41dff6b54 Don't abort() when system call is unknown. 1998-02-11 07:11:28 +00:00
Andrew Cagney
19431a0280 Ensure zero-hardwired bits in DPSW remain zero. 1998-02-11 06:34:30 +00:00
Andrew Cagney
8904ad6940 D10v memory map changed. Update.
Initialize IMAP/DMAP registers to hardware reset value.
1998-02-10 07:26:55 +00:00
Andrew Cagney
412c4e940e Add config support for the size of the target address and OF cell. 1998-01-31 14:07:23 +00:00
Michael Meissner
629cfff05f Exit status is in r0, not r2 1998-01-26 03:23:55 +00:00
Michael Meissner
88f7d309fd If DEBUG has 0x20 set, turn traps into batch debugging 1998-01-25 00:13:19 +00:00
Michael Meissner
8831cb01b0 First round of d10v ABI changes 1998-01-23 16:30:08 +00:00
Fred Fish
cee687386d * interp.c (UMEM_SEGMENTS): New define, set to 128.
(sim_size): Use UMEM_SEGMENTS rather than hardwired constant.
	(sim_close): Reset prog_bfd to NULL after closing it.  Also
	reset prog_bfd_was_opened_p after closing prog_bfd.
	(sim_load): Reset prog_bfd_was_opened_p after closing prog_bfd.
	(sim_create_inferior): Get start address from abfd not prog_bfd.
	(xfer_mem): Do bounds checking on addresses and return zero length
	read/write on bad addresses, rather than aborting.  Prepare to
	be able to handle xfers that cross segment boundaries, but not
	yet implemented.  Only emit debug message when d10v_debug is
	set as well as DEBUG being defined.
1998-01-22 21:51:31 +00:00
Doug Evans
462cfbc4eb * aclocal.m4: Recognize --enable-maintainer-mode.
*/configure: Regenerated.
1998-01-20 06:37:00 +00:00
Andrew Cagney
38d0ccc27a Fix typo, REP_S was refering to REP_E register.
Add test.
1997-12-08 23:44:11 +00:00
Andrew Cagney
bc6df23d14 For "trap", IBT and RIE exceptions, mask all PSW.SM. NB: Stepping
through an exception may not work correctly.
For GDB reads/writes to the control registers, ensure the cpu state is
updated correctly.
1997-12-08 03:22:58 +00:00
Doug Evans
6e51f990a2 Regenerate configure files. 1997-12-04 17:26:06 +00:00
Andrew Cagney
7f48c9fe1d Add DM (bit 4) to PSW. See 7-1 for more info.
Test.
1997-12-04 07:01:30 +00:00
Andrew Cagney
aa49c64f3e * d10v_sim.h (SEXT56): Define.
* simops.c (OP_4201): For "rac", sign extend 56 bit value before
it is shifted.
* d10v_sim.h (MAX32, MIN32, MASK32, MASK40): Re-define using
SIGNED64 macro.
1997-12-03 08:03:33 +00:00
Fred Fish
193e528cd4 * interp.c (sim_resume): Call do_2_short with LEFT_FIRST or
RIGHT_FIRST, as appropriate, instead of hardcoded ints that
	don't match enum values.
PR 13496
1997-12-02 23:13:56 +00:00
Andrew Cagney
d294a657d5 For "msbu", subtract unsigned product from ACC,
Test.
1997-12-02 07:18:53 +00:00
Andrew Cagney
9420287ed2 For "mulxu", store unsigned product in ACC.
Test.
1997-12-02 06:37:09 +00:00
Andrew Cagney
ae55807561 For MACU add unsigned multiply to accumulator.
Test.
1997-12-02 05:18:27 +00:00
Andrew Cagney
51b057f27b For sub2w, compute carry according to negated addition rules.
Test.
1997-12-02 00:27:27 +00:00
Andrew Cagney
70ee56c585 Rework sim/common/sim-alu.h to differentiate between direcct
subtraction (involves borrow) and negated addition (involves carry).
Update d30v so that it uses this method.  Add more tests.
1997-12-01 06:27:02 +00:00
Andrew Cagney
87192c630a * simops.c (OP_4201): "rachi". Sign extend bit 40 of ACC. Sign
extend bit 44 all constants.
(OP_4201): Replace GCC specific 0x..LL with SIGNED64 macro.
1997-11-10 22:40:14 +00:00
Andrew Cagney
b5da31ac7c Correct name of file given in ChangeLog for change: Pass lma_p and
sim_write args to sim_load_file.
1997-10-25 05:04:25 +00:00
Andrew Cagney
1315b4cb60 Address MSC compiler issues in d10v_sim.h 1997-10-24 00:52:23 +00:00
Andrew Cagney
9e03a68f13 Add LMA_P and DO_WRITE arguments to sim/common/sim-load.c:sim_load_file().
Update all simulators.
Clarify behavour of sim_load in remote-sim.h
1997-10-22 05:26:27 +00:00
Fred Fish
1155e06e3f * simops.c (OP_6A01): Change OP_POSTDEC to OP_POSTINC and move
exception generation code to OP_6E01.
	(OP_6E01): Change OP_POSTINC to OP_POSTDEC and insert exception
	generation code.
PR 13550
1997-10-13 18:26:52 +00:00
Fred Fish
b83093ff79 * simops.c (OP_6401): postdecrement on r15 is OK, remove exception.
(OP_6601): Ditto.
PR 13498
1997-10-11 16:50:05 +00:00
Fred Fish
93f0cb6975 * simops.c (OP_6401): postdecrement on r15 is OK, remove exception.
(OP_6601): Ditto.
1997-10-11 16:48:47 +00:00
Fred Fish
5f90b21e40 * d10v_sim.h (INC_ADDR): Align MOD_E to increment before testing
for end condition.
PR 13334
1997-09-27 20:04:22 +00:00
Fred Fish
823f2df47f * interp.c (pc_addr): Discard upper bit(s) of PC in case
IMAP1 selects unified memory.
PR 13275
1997-09-27 19:57:05 +00:00
Andrew Cagney
92f91d1ff0 Remove need to update <targ>/Makefile.in when adding optional options
to <targ>/configure.in.
Simplify logic used to select target [default] endianness.
1997-09-23 01:25:26 +00:00
Andrew Cagney
794e9ac96a Simplify logic behind the generic configuration option --enable-sim-alignment. 1997-09-22 02:49:57 +00:00
Andrew Cagney
b45caf050c Add support for --enable-sim-alignment to simulator common aclocal.m4
Add support for --alignment={strict,nonstrict,forced} to simulator common
run-time options.
For v850 use, make the default NONSTRICT_ALIGNMENT.
1997-09-22 00:24:46 +00:00
Martin Hunt
30d8198448 Wed Sep 10 22:30:24 1997 Martin M. Hunt <hunt@cygnus.com>
* interp.c (sim_resume): Increment PC at end of rep
	loop.

	* simops.c (OP_4201): Fix rachi instruction.
1997-09-11 05:32:23 +00:00
David Edelsohn
6fea47635b * configure: Regenerated to track ../common/aclocal.m4 changes. 1997-09-05 00:42:05 +00:00
Andrew Cagney
8811705410 Fix doco on enable-sim-inline. 1997-08-27 22:43:18 +00:00
Andrew Cagney
fafce69ab1 Add ABFD argument to sim_create_inferior. Document.
Add file sim-hload.c - generic load for hardware only simulators.
Review each simulators sim_open, sim_load, sim_create_inferior so that
they more closely match required behavour.
1997-08-27 04:44:41 +00:00
Andrew Cagney
7230ff0faa Flush defunct sim_kill. 1997-08-26 02:05:18 +00:00
Andrew Cagney
247fccdeb5 Add ABFD argument to sim_open call. Pass through to sim_config so
that image properties such as endianness can be checked.

More strongly document the expected behavour of each of the sim_*
interfaces.

Add default endian argument to simulator config macro
SIM_AC_OPTION_ENDIAN.  Use in sim_config.
1997-08-25 23:14:25 +00:00
David Edelsohn
81f464815d * interp.c (sim_open): Undo patch to add -E support. 1997-04-22 17:31:11 +00:00
Andrew Cagney
8517f62b16 Ref gdb/11763 - can't stop a running simulator:
o	Provide poll_quit callback to simulators
		so that they can poll for SIGINT on
		clueless OS's.

	o	Add sim_stop to simulators so that clients
		can request a halt (eg gdbtk's STOP button)
		Works for PPC!

	o	Re-arange remote-sim.c so that the
		hard work is moved from gdbsim_resume()
		to gdbsim_wait() (where it should be).
1997-04-18 12:24:52 +00:00
David Edelsohn
04885cc34c * Makefile.in (SIM_OBJS): Add sim-load.o.
* d10v_sim.h (exec_bfd): Rename to prog_bfd.
	* interp.c: #include bfd.h.
	(myname, sim_kind, start_address): New static locals.
	(prog_bfd_was_opened_p, prog_bfd): New static locals.
	(decode_pc): Update to use prog_bfd.
	(sim_open): Set sim_kind, myname.  Ignore -E arg.
	(sim_close): Close prog_bfd if simulator opened it.
	(sim_create_inferior): Return SIM_RC.  Delete arg start_address.
	(sim_load): Return SIM_RC.  New arg abfd.  Set start address from bfd.
	Call sim_load_file to load file into simulator.
	* simops.c (trace_input_func): exec_bfd renamed to prog_bfd.
1997-04-17 10:02:27 +00:00
Andrew Cagney
87e43259f1 Cleanups to compile under FreeBSD 1997-04-17 06:05:19 +00:00
Andrew Cagney
08db4a658e Get configure to define RETSIGTYPE 1997-04-07 05:58:59 +00:00
David Edelsohn
8020feac30 * interp.c (sim_open): New arg `kind'. 1997-04-02 23:30:24 +00:00
David Edelsohn
fbda74b1c1 * aclocal.m4: Check for stdlib.h, string.h, strings.h, unistd.h.
(sim-debug): Allow arguments.  Define WITH_DEBUG in addition to
	-DDEBUG.
	* configure: Regenerated to track ../common/aclocal.m4 changes.
1997-04-02 23:17:50 +00:00
Andrew Cagney
a35e91c3c7 New file common/sim-config.c sets/checks simulator configuration options.
Update common/aclocal.m4 to better work with sim-config.[hc].
1997-04-02 05:04:25 +00:00
Andrew Cagney
a77aa7ec4b * configure: Re-generate.
* Make-common.in (CSEARCH): Do not include the gdb directory in
        the search path.
        * Make-common.in (SIM_ENDIAN, SIM_HOSTENDIAN, SIM_INLINE,
        SIM_WARNING): Drop, requiring the simulator specific Makefile.in
        to explicitly incorporate these.

        * aclocal.m4 (--enable-sim-alignment); New option. Strongly
        specify the alignment restrictions of the target architecture -
        without this option all alignment restrictions are accomodated.
        (--enable-sim-assert): New option.  Conditionally compile in
        assertion statements.
        (--enable-sim-float): New option. Strongly specify the target's
        floating point support.
        (--enable-sim-hardware): New option.  Specify the hardware devices
        included in the simulation.
        (--enable-sim-packages): New option.  Specify the hardware
        packages included in the simulation.
        (--enable-sim-regparm): New option.  Specify that parameters be
        passed in registers instead of on the stack.
        (--enable-sim-reserved-bits): New option. Specify that reserved
        bits within an instruction are are correctly set.
        (--enable-sim-smp): New option. Specify the level of SMP support
        to be included in the simulator.
        (--enable-sim-stdcall): New option.  Specify an alternative
        function call convention.
        (--enable-sim-xor-endian): New option.  Configure xor-endian
        support used by some targets to implement bi-endian support.
1997-03-17 15:29:29 +00:00
Michael Meissner
eb312eff6e Add comment to changelog 1997-03-14 16:24:02 +00:00
Michael Meissner
601fb8aea6 Regenerate simulator configure scripts; Remove d10v traps 1-3, Make 15 the system call trap, keeping 0 temporarily 1997-03-14 16:21:57 +00:00
David Edelsohn
395adcffb2 * interp.c: Delete redundant prototypes of sim_foo fns.
(sim_open): New SIM_DESC result.  Argument is now in argv form.
	(other sim_*): New SIM_DESC argument.
1997-03-13 20:44:07 +00:00
Michael Meissner
f4b022d37c Fix problems in setting the carry bit 1997-03-13 20:30:50 +00:00
Michael Meissner
fd435e9f09 Fix os_printf_filtered; Flush stdout after calling printf_filtered 1997-03-13 16:04:50 +00:00
David Edelsohn
19c5af72af * Makefile.in (@COMMON_MAKEFILE_FRAG): Use
COMMON_{PRE,POST}_CONFIG_FRAG instead.
	* configure.in: sinclude ../common/aclocal.m4.
	* configure: Regenerated.
1997-02-04 21:42:27 +00:00
Stu Grossman
ae0d7848d8 * ../common/aclocal.m4 (COMMON_MAKEFILE_FRAG): Quote a couple of $'s in
comments and single quotes.  Fixes a problem found on hpux.
1997-01-24 18:44:29 +00:00
Stu Grossman
a695143eae * configure: Remove targ-vals.def when doing distclean. (Change
is actually in ../common/aclocal.m4.)
1997-01-24 00:44:03 +00:00
Stu Grossman
2757866e9e * configure: Remove Make-common.in from dependencies. (Actually in
../common/aclocal.m4).
1997-01-24 00:04:57 +00:00
Stu Grossman
295dbbe44c * configure configure.in Makefile.in: Update to new configure
scheme which is more compatible with WinGDB builds.
	* configure.in:  Improve comment on how to run autoconf.
	* configure:  Re-run autoconf to get new ../common/aclocal.m4.
	* Makefile.in:  Use autoconf substitution to install common
	makefile fragment.
1997-01-23 22:09:52 +00:00
Martin Hunt
dbdae3de36 Mon Dec 16 13:39:03 1996 Martin M. Hunt <hunt@pizza.cygnus.com>
* interp.c (xfer_mem): Change unified memory to 0x0.
1996-12-16 21:39:47 +00:00
David Edelsohn
72eeb00634 * config.in (WORDS_BIGENDIAN): Add.
* configure: Regenerated.
	* d10v_sim.h: #include "config.h"
1996-11-26 03:53:40 +00:00
Michael Meissner
24cbf0a416 Make address in I/O space a bus error; properly cast calloc 1996-11-21 00:44:48 +00:00
David Edelsohn
27bc3f8ecb New file. 1996-11-20 09:28:40 +00:00
David Edelsohn
cee402dd99 * Makefile.in: Delete all stuff moved to ../common/Make-common.in.
(SIM_OBJS,SIM_EXTRA_CFLAGS,SIM_EXTRA_CLEAN): Define.
	* configure.in: Simplify using macros in ../common/aclocal.m4.
	Call AC_CHECK_HEADERS(unistd.h).
	* configure: Regenerated.
	* config.in: New file.
	* interp.c: #include "callback.h".
	* simops.c: #include "config.h".  #include <unistd.h> if present.
1996-11-20 09:27:24 +00:00
Martin Hunt
849c575f97 Fri Nov 8 16:19:55 1996 Martin M. Hunt <hunt@pizza.cygnus.com>
* d10v-sim.h (simops): Add flag is_long.
	(State): Add pc_changed.  Instructions which update the PC should
	use the JMP macro which sets this.
	(JMP): New macro.  Sets the PC and the pc_changed flag.

	* gencode.c (write_opcodes): Add is_long field.

	* interp.c (lookup_hash): If we blindly apply a short opcode's mask
	to a long opcode we could get a false match.  Check the opcode size.
	(hash): Add a size field to the hash table.
	(sim_open): Initialize size field in hash table.
	(sim_resume): Change to logic for setting the PC.  Used to increment the
	PC if it had not been changed.  This didn't allow single-instruction loops.
	Now checks the flag State.pc_changed.  Also now stops when ^C is received.
	(dmem_addr): Fix translation of data segments to unified memory.
	(sim_ctrl_c): New function.  When ^C is received, set stop_simulator flag.

	* simops.c: Changed all branch and jump instructions to use new JMP macro.
	(OP_20000000): Corrected trace information to show this is a ldi.l, not
	a ldi.s instruction.
1996-11-09 00:38:07 +00:00
Martin Hunt
5c839c675a Thu Oct 31 19:13:55 1996 Martin M. Hunt <hunt@pizza.cygnus.com>
* interp.c (sim_fetch_register, sim_store_register): Fix bug where
	updating the accumulators was overwriting other parts of the global
	State variable.
1996-11-01 03:15:44 +00:00
Michael Meissner
b30cdd3565 Fix -t option to work with memory mapping; Print PC in some error messages 1996-10-30 22:43:02 +00:00
Martin Hunt
c422ecc7a4 Tue Oct 29 12:13:52 1996 Martin M. Hunt <hunt@pizza.cygnus.com>
* interp.c (sim_size): Now allocates unified memory for imap segments
	0,1,2, and 127. Initializes imap0 and imap1 to 0x1000.  Initializes dmap to 0.
	(sim_write): Just call xfer_mem().
	(sim_read): Just call xfer_mem().
	(xfer_mem): New function. Does appropriate memory mapping and copies bytes.
	(dmem_addr): New function. Reads dmap register and translates data
 	addresses to local addresses.
	(pc_addr): New function. Reads imap register and computes local address
	corresponding to contents of the PC.
	(sim_resume): Change to use pc_addr().
	(sim_create_inferior): Change reinitialization code. Also reinitializes
	imap[01] and dmap.
	(sim_fetch_register): Add fake registers 32,33,34 for imap0, imap1, and dmap.
	(sim_store_register): Add fake registers 32,33,34 for imap0, imap1, and dmap.

	* simops.c (MEMPTR): Redefine to use dmem_addr().
	(OP_5F00): Replace references to STate.imem with dmem_addr().

	* d10v-sim.h (State): Remove mem_min and mem_max. Add umem[128].
	(RB,SW,RW,SLW,RLW): Redefine to use dmem_addr().
	(IMAP0,IMAP1,DMAP,SET_IMAP,SET_IMAP1,SET_DMAP): Define.
1996-10-29 20:31:08 +00:00
Michael Meissner
aeb1f26ba8 Provide better statistics, particularly for doing VLIW work; Fix ldb to correctly sign extend 1996-10-22 19:49:37 +00:00
Martin Hunt
eca43eb1f5 Mon Oct 21 16:16:26 1996 Martin M. Hunt <hunt@pizza.cygnus.com>
* interp.c (sim_resume): Change the way single-stepping and exceptions
 	are handled so single-stepping works again.
1996-10-21 23:17:43 +00:00
Michael Meissner
55116079e2 Make simulated loads/stores faster on x86, AIX, and big endian hosts 1996-10-17 16:47:51 +00:00
Michael Meissner
d6fe5ca568 Make read/write memory functions inlined 1996-10-16 22:16:21 +00:00
Michael Meissner
5c2556697f Make read/write memory functions inlined 1996-10-16 22:14:23 +00:00
Michael Meissner
11ec4de669 Fix tracing of accumulators 1996-10-16 17:52:31 +00:00
Michael Meissner
57bc1a721a Better error messages when a program stops due to signal; support d10v getpid/kill 1996-10-15 15:44:10 +00:00
Michael Meissner
8918b3a72b Fix ld2w r2,@r2 so that r3 loads the proper value 1996-10-13 02:25:01 +00:00
Michael Meissner
a18cb10038 Fix tracing for st2w 1996-09-25 20:33:21 +00:00
Martin Hunt
c58a1ec2aa Fri Sep 20 15:36:45 1996 Martin M. Hunt <hunt@pizza.cygnus.com>
* interp.c (sim_create_inferior): Reinitialize State every time
	sim_create_inferior() is called.
1996-09-20 22:39:45 +00:00
Michael Meissner
c12f5c678e Make sure cmp{,eq,u}i use correct casts 1996-09-20 01:42:15 +00:00
Michael Meissner
addb61a5b2 Fix tracing info 1996-09-19 17:23:21 +00:00
Michael Meissner
f061ddf67d Make sure there is a trailing space after the instruction 1996-09-19 15:06:37 +00:00
Michael Meissner
891513ee79 Provide macros that can be overriden for the width of the PC & line number fields 1996-09-19 15:02:27 +00:00
Michael Meissner
74473ea10c Add dependencies on lib{bfd,iberity}.a 1996-09-19 14:31:01 +00:00
Michael Meissner
0535fa1aa0 Rename sim_bfd -> exec_bfd for gdb compatibility 1996-09-18 13:56:57 +00:00
Michael Meissner
a49a15ade8 Make exit/stop return correct exit value; Add line number tracing. 1996-09-18 13:23:31 +00:00
Michael Meissner
215ac9533c Fix brf0{t,f}.s <label> -> instruction not to execute instruction if branch succeeds 1996-09-15 03:46:52 +00:00
Michael Meissner
19d44375ff For unknown traps, print contents of registers and continue execution 1996-09-14 02:36:40 +00:00
Mark Alexander
65c0d7dee9 * simops.c (OP_5F00): Fix problems with system calls. 1996-09-12 19:52:40 +00:00
Michael Meissner
a57190924d Correct trap tracing information 1996-09-12 16:20:05 +00:00
Michael Meissner
5ceef1b54f fix typo 1996-09-11 22:56:25 +00:00
Michael Meissner
2254cd90a9 Addi needs to set the carry 1996-09-09 21:12:46 +00:00
Michael Meissner
308f64d3ac Fix ld2w tracing 1996-09-09 20:45:33 +00:00
Michael Meissner
60fc5b7270 Correct tracing of cpfg 1996-09-09 20:10:31 +00:00
Michael Meissner
293c76a376 Make ex{f,t}* tests agree with book 1996-09-09 18:24:18 +00:00
Michael Meissner
069398aaff Fix accumulator shifts 1996-09-09 17:30:36 +00:00
Martin Hunt
ea2155e858 Fri Sep 6 17:56:17 1996 Martin M. Hunt <hunt@pizza.cygnus.com>
* simops.c (OP_2600, OP_2601): Changed min and max comparisons
	to use signed register values.
1996-09-07 00:58:25 +00:00
Michael Meissner
9b86c7e2e2 Second pass at canadian cross 1996-09-04 19:11:53 +00:00
Michael Meissner
1eaaf3050e First cut at dealing with canadian crosses; make -t in debugger set d10v_debug if DEBUG 1996-09-04 18:50:13 +00:00
Michael Meissner
7eebfc6296 More debug support; Enable -t/-v to work correctly; Add --enable-sim-cflags configure switch 1996-09-04 17:42:51 +00:00
Michael Meissner
87178dbdf7 Enhance debug support 1996-09-04 15:41:43 +00:00
Mark Alexander
8719be26c4 * simops.c: Include correct syscall.h for d10v, not host's.
Fix #ifdef SYS_stat.
1996-09-04 11:51:06 +00:00