Commit Graph

128 Commits

Author SHA1 Message Date
Doug Evans 22469a10e8 * Make-common.in (SIM_ENVIRONMENT): New variable.
(CONFIG_CFLAGS): Add it.
	* aclocal.m4 (SIM_AC_OPTION_ENVIRONMENT): Handle
	--enable-sim-environment option.
	* configure: Regenerated.
	* sim-config.h (environment support): Rewrite.
	* sim-config.c (current_environment): Define as enum, unconditionally.
	(current_alignment): Define unconditionally.
	(config_environment_to_a): Update.
	(config_alignment_to_a): Fix type of argument.  Define unconditionally.
	(sim_config): Handle environment and alignment determination
	unconditionally.  Delete sanity checks of current_environment,
	unnecessary.
	(print_sim_config): Update.
	* sim-options.c (STANDARD_OPTIONS enum): Add OPTION_ENVIRONMENT.
	(standard_options): Add --environment.
	(standard_option_handler): Likewise.
1997-12-04 02:04:42 +00:00
Andrew Cagney aaa11abe42 Clarify meaning of sim_signalled's SIGRC argument. Document that this
isn't possible in sim-reason.c and just return the target SIGRC
instead.

For simulators that rely on sim-reason.c, replace SIG* with SIM_SIG*.

Hack nrun.c so that when it is executed (ARGV[0]) as `step' instead
of `run' it single steps the simulator.  Allows testing of single step
without full GDB.
1997-11-22 12:52:44 +00:00
Doug Evans 1ebc7e0e24 * sim-signal.c, sim-signal.h: New files.
* Make-common.in (sim-signal.o): Add rule for.
	(SIM_NEW_COMMON_OBJS): Add sim-signal.o.
	* sim-abort.c: Don't include <signal.h>.
	* sim-basics.h: #include "sim-signal.h".
	* sim-break.c: Don't include <signal.h>.
	(sim_handle_breakpoint): Replace SIGTRAP with SIM_SIGTRAP.
	* sim-core.c: Don't include <signal.h>.
	(SIGBUS): Delete definition.
	(sim_core_signal): Replace SIGSEGV,SIGBUS with SIM_SIGSEGV,SIM_SIGBUS.
	* sim-engine.c: Don't include <signal.h>.
	(sim_engine_abort): Replace SIGABRT with SIM_SIGABRT.
	* sim-reason.c (sim_stop_reason): Call sim_signal_to_host.
	* sim-resume.c: Don't include <signal.h>.
	(SIGTRAP): Delete definition.
	(has_stepped): Replace SIGTRAP with SIM_SIGTRAP.
	* sim-stop.c: Don't include <signal.h>.
	(control_c_simulation): Replace SIGINT with SIM_SIGINT.
	* sim-watch.c: Don't include <signal.h>.
	(handle_watchpoint): Replace SIGINT with SIM_SIGINT.
1997-11-19 08:00:37 +00:00
Doug Evans e5ce1670c1 * Make-common.in (SIM_NEW_COMMON_OBJS): New variable.
* sim-base.h (CIA_ADDR): Provide default definition.
1997-11-18 23:55:33 +00:00
Doug Evans 38377b3a48 * Make-common.in (srccom): New variable. 1997-11-18 07:14:20 +00:00
Doug Evans f7abc1ca0c * Make-common.in (DEP, COMMON_DEP_CFLAGS): Define.
(LIB_OBJS): Add syscall.o.
	(gentmap): Pass $(NL_TARGET) to $(CC).
	(syscall.o): Add rule for.
	(sim_main_headers): Add $(SIM_EXTRA_DEPS).
	(sim-bits.o): Depend on $(sim-n-bits_h).
	(sim-load.o): Depend on callback.h.

	* Make-common.in (cgen-*.o): Update dependencies, mem-ops.h renamed to
	cgen-mem.h, sem-ops.h renamed to cgen-ops.h.
	* cgen-mem.h, cgen-ops.h: New files.

	* aclocal.m4 (--enable-sim-scache): Pass -DWITH_SCACHE=0 for "=no".

	* Makefile.in (nltvals.def): Depend on gennltvals.sh.
	Rewrite build rule.
	* callback.c: #include string.h or strings.h.
	#include sys/types.h and sys/stat.h.
	(cb_init_syscall_map,cb_init_errno_map,cb_init_open_map): Declare.
	(enosys): New function.
	(os_get_errno,os_open): Update.
	(os_stat,os_fstat): New functions.
	(os_init): Initialize syscall_map, errno_map, open_map.
	(default_callback): Add entries for os_stat, os_fstat, syscall_map,
	errno_map, open_map, signal_map, stat_map.
	(cb_read_target_syscall_maps): New function.
	(cb_target_to_host_syscall): New function.
	(cb_host_to_target_errno): Renamed from host_to_target_errno.
	(cb_target_to_host_open): Renamed from target_to_host_open.
	(store): New function.
	(cb_host_to_target_stat): New function.
	* gentmap.c (sys_tdefs): New global.
	(gen_targ_vals_h): Output target syscall numbers.
	(gen_targ_map_c): Update.  Output target syscall translation map.
	* gentvals.sh: New first argument `target'.  Preface table with
	#ifdef NL_TARGET_$target if non-null target passed.
	* gennltvals.sh: New file.
	* nltvals.def: Regenerated.
1997-11-17 23:09:08 +00:00
Doug Evans 5dcf955d46 * Make-common.in (BUILT_SRC_FROM_COMMON): Remove files no longer
built this way.
	(sim-config.o): Remove non-existent $(sim-nconfig_h) dependency.
	(clean): Don't delete $(BUILT_SRC_FROM_COMMON) if building in
	source tree.
1997-11-12 20:29:53 +00:00
Andrew Cagney 7456a10d9b * sim-alu.h (ALU64_HAD_OVERFLOW): Define.
(ALU64_SUB): Define.
* Make-common.in (all): Build SIM_EXTRA_ALL first.
(.gdbinit): Remove dependencies, generate once per build.
1997-10-14 09:39:05 +00:00
Stu Grossman b9d580a4b0 * Make-common.in: New files sim-break.c, sim-break.h.
* sim-base.h:  Add point to breakpoint list to sim_state_base.
	* sim-break.c sim-break.h:  New modules that implement intrinsic
	breakpoint support.
	* sim-module.c:  Add breakpoint module.
1997-09-25 00:51:17 +00:00
Andrew Cagney 4141b1c63d * Make-common.in (SIM_SCACHE, SIM_DEFAULT_MODEL): Assign configured values.
(CONFIG_CFLAGS): Add same.
1997-09-23 04:05:50 +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 a34abff813 o Add modulo argument to sim_core_attach
o	Add sim-memopt module - memory option processing.
1997-09-04 03:47:39 +00:00
David Edelsohn 88d5f8e854 * gdbinit.in: New file.
* aclocal.m4 (SIM_AC_OUTPUT): Build .gdbinit.
	* Make-common.in (distclean): Delete .gdbinit.
	(.gdbinit): Add rule for.
	* configure: Regenerated to track ../common/aclocal.m4 changes.
1997-09-04 00:49:57 +00:00
David Edelsohn 645ab3ec42 (TAGS): Add support for "/* TAGS: foo */" marker. 1997-09-02 22:03:41 +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 f03b093cd3 o Implement generic halt/restart/abort module.
Use in tic80 and d30v simulators.
o	Add signal hook to sim-core module
1997-05-19 03:42:33 +00:00
Andrew Cagney 3971886ac1 Add flakey floating-point support to the TI c80 simulator. 1997-05-05 12:46:25 +00:00
David Edelsohn 968d32cc40 (cgen-utils.o): Update cgen-{mem,sem}.h dependencies. 1997-05-01 20:43:24 +00:00
David Edelsohn c967f1874a * Makefile.in (sim-options_h): Define.
(sim-{module,options,trace,profile,utils}.o): Clean up dependencies.
	(sim-model.o): Add new rule.
	(cgen-{scache,trace,utils}.o): Add new rules.
	* aclocal.m4 (SIM_AC_OPTION_{SCACHE,DEFAULT_MODEL}): Add.
	* cgen-scache.c (scache_print_profile): Change `sd' arg to `cpu'.
	Indent output by 2 spaces.
	* cgen-scache.h (scache_print_profile): Update.
	* cgen-trace.c (trace_insn_fini): Indent output by 2 spaces.
	Use trace_printf, not fprintf.
	(trace_extract): Use trace_printf, not cgen_trace_printf.
	* genmloop.sh (!FAST case): Increment `insn_count'.
	* sim-base.h (sim_state_base): Only include scache_size if WITH_SCACHE.
	(sim_cpu_base): Rename member `sd' to `state' to be consistent with
	access macro's name.
	* sim-core.c (sim_core_init): Use EXTERN_SIM_CORE to define it.
	Change return type to SIM_RC.
	(sim_core_{install,uninstall}): New functions.
	* sim-core.h (sim_core_{install,uninstall}): Declare.
	(sim_core_init): Use EXTERN_SIM_CORE to define it.
	Change return type to SIM_RC.
	* sim-model.h (models,machs,model_install): Declare.
	* sim-module.c (modules): Add scache_install, model_install.
	(sim_post_argv_init): Set cpu->state backlinks.
	* sim-options.c (standard_options): Delete --simcache-size,--max-insns.
	(standard_option_handler): Likewise.
	* sim-profile.c (PROFILE_{HISTOGRAM,LABEL}_WIDTH): Move to
	sim-profile.h.
	(*): Assume ANSI C.
	(profile_options): Delete --profile-simcache.
	(profile_option_handler): Likewise.
	(profile_print_insn): Change `sd' arg to `cpu'.  Indent output 2
	spaces.
	(profile_print_{memory,model}): Likewise.
	(profile_print_simcache): Delete.
	(profile_print_speed): New function.
	(profile_print): Rewrite.
	* sim-profile.h (PROFILE_scache): Renamed from PROFILE_simcache.
	(WITH_PROFILE_SCACHE_P): Renamed from WITH_PROFILE_SIMCACHE_P.
	(PROFILE_DATA): Delete members simcache_{hits,misses}.
	(PROFILE_COUNT_SIMCACHE_{HIT,MISS}): Delete.
	(PROFILE_{CALLBACK,CPU_CALLBACK}): New types.
	(profile_print): Update prototype.
1997-05-01 18:05:37 +00:00
David Edelsohn 717dbb296e * Make-common.in (clean targets): Undo patch of Apr. 22. 1997-04-30 18:35:58 +00:00
Stu Grossman 0f399b0c6b * Make-common.in: Change clean targets to use :: so that other
Makefiles can have their own clean targets.
	* sim-load.c (xprintf eprintf):  Use ANSI_PROTOTYPES instead of
	__STDC__ to control use of stdarg vs. varargs syntax.  Some
	systems can't use __STDC__, but require stdarg.
1997-04-22 16:00:06 +00:00
David Edelsohn e9b2f57903 sim-trace.c: New file. 1997-04-17 14:08:30 +00:00
David Edelsohn c95d08a8d6 * Make-common.in (nrun.o): Add rule for.
* nrun.c: New file.
1997-04-17 12:43:31 +00:00
David Edelsohn 0f2811d1c5 * Make-common.in (sim-options.o, sim-load.o): Add rules for.
(sim_main_headers): Add sim-trace.h.
	* run.c (exec_bfd, target_byte_order): Delete.
	(main): Pass -E <endian> to sim_open.  Delete code to load sections,
	call sim_load instead.  Check return code of sim_create_inferior.
	* sim-base.h (CURRENT_STATE): Define.
	(sim_state_base): Make typedef.  New members options, prog_argv,
	prog_bfd, text_{section,start,end}, start_addr, simcache_size,
	mem_size, memory [+ corresponding access macros].
	(sim_cpu_base): New typedef.
	* sim-trace.h: New file.
	* sim-basics.h: #include it.
	* sim-load.c: New file.
1997-04-17 09:37:02 +00:00
Ian Lance Taylor 6808fd61d2 * Make-common.in (INSTALL): Set to @INSTALL@.
(INSTALL_XFORM, INSTALL_XFORM1): Remove.
	(install-common): Depend upon installdirs.  Use
	$(program_transform_name) directly, rather than using
	$(INSTALL_XFORM).
	(installdirs): New target.
	* Makefile.in (INSTALL): Set to @INSTALL@.
	(INSTALL_XFORM, INSTALL_XFORM1): Remove.
	(install-man): Depend upon installdirs.  Use
	$(program_transform_name) directly, rather than using
	$(INSTALL_XFORM).
	(installdirs): New target.
1997-04-15 19:13:56 +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
Andrew Cagney f2de7dfd8c Add a number of per-simulator options: hostendian, endian, inline, warnings.
Rename *-n.h files to be dos compatible
1997-03-14 15:13:58 +00:00