From 1fe052808af59da1d2c4718efe8678cb5eabea0a Mon Sep 17 00:00:00 2001 From: Andrew Cagney Date: Fri, 2 May 1997 08:41:15 +0000 Subject: [PATCH] Update devo version of m32r sim to build with recent sim/common changes. --- sim/common/ChangeLog | 71 +++++++++ sim/common/cgen-utils.c | 7 +- sim/common/sim-core.c | 32 +++- sim/common/sim-n-core.h | 96 +++++++----- sim/m32r/ChangeLog | 329 ++++++++++++++++++++++++++++++++++++++++ sim/m32r/mem-ops.h | 32 ++-- 6 files changed, 504 insertions(+), 63 deletions(-) create mode 100644 sim/m32r/ChangeLog diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog index 925db91a62c..6ffc2b271d2 100644 --- a/sim/common/ChangeLog +++ b/sim/common/ChangeLog @@ -1,3 +1,74 @@ +Fri May 2 17:59:42 1997 Andrew Cagney + + * sim-core.c (sim_core_map_to_str): New function ascii equivalent + to map type. + + * sim-n-core.h (sim_core_read_N, sim_core_write_N): Use in trace + statement. + +Fri May 2 17:28:02 1997 Andrew Cagney + + * cgen-trace.c: Prepend additional trace_printf argument. + + * cgen-utils.c (sim_disassemble_insn): Add additional core + arguments. + +Fri May 2 11:40:23 1997 Andrew Cagney + + * nrun.c (main): Catch/report errorenous simulator states. + + * sim-module.c: #include "libiberty.h" so that xmalloc is defined. + * sim-trace.c: #include string.h/strings.h so that memset is + defined. + * sim-utils.c: Ditto. + * sim-profile.c: Ditto. And stdlib.h. + (print_bar): Only define when used by instruction or memory profiler. + + * sim-options.c (standard_option_handler): Make ul more local. + + * sim-load.c (sim_load_file): Make the name constant. + (sim_load_file): Passify gcc. + + * sim-utils.h: New file, pre-declare utilites in corresponding .c + file. + * sim-utils.c, sim-load.c: Include sim-utils.h. + + * sim-base.h (sim_cpu): Pre define here so available to all. + + * sim-core.h (DECLARE_SIM_CORE_WRITE_N, DECLARE_SIM_CORE_READ_N): + Restore the sim_cpu and instruction_address arguments so that full + information is available to the abort function. + * sim-core.c (sim_core_find_mapping, sim_core_write_buffer): Ditto. + * sim-n-core.h (sim_core_write_N, sim_core_read_N): Update. + + * sim-trace.h, sim-trace.c (trace_option_handler): Add interim + tracing support for sim-events and sim-core. + (trace_option_handler): Convert #if to if where possible so always + compiled/checked by C compiler. + * sim-n-core.h (sim_core_write_N, sim_core_read_N): Update. + + * sim-base.h: Adjust comment documenting how to define the cpu + structure. + (sim_state_base): Add sim_core and sim_events to simulator base + object. + + * sim-trace.h, sim-trace.c (trace_printf): Add SIM_DESC argument. + * sim-core.c (sim_core_init, sim_core_attach, + sim_core_find_mapping): Update. + * sim-events.c (ETRACE, sim_events_init, sim_events_time, + update_time_from_event, insert_sim_event, + sim_events_schedule_after_signal, sim_events_deschedule, + sim_events_tick): Ditto. + + * sim-basics.h (sim-module.h, sim-trace.h, sim-profile.h, + sim-model.h): Move #includes from here. + * sim-base.h: To here. + (sim-core.h, sim-events.h, sim-io.h): Include also + +Wed Apr 30 15:37:54 1997 Andrew Cagney + + * callback.c (default_callback): Missing initialisers. + Thu May 1 10:40:47 1997 Doug Evans * sim-utils.c (sim_add_commas): New function. diff --git a/sim/common/cgen-utils.c b/sim/common/cgen-utils.c index d8e57bfb5b1..6aa9107a65d 100644 --- a/sim/common/cgen-utils.c +++ b/sim/common/cgen-utils.c @@ -19,6 +19,7 @@ with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "sim-main.h" +#include #include "dis-asm.h" #include "cpu-opc.h" #include "decode.h" @@ -237,13 +238,13 @@ sim_disassemble_insn (SIM_CPU *cpu, const struct cgen_insn *insn, switch (abuf->length) { case 1 : - insn_value = sim_core_read_1 (CPU_STATE (cpu), sim_core_read_map, pc); + insn_value = sim_core_read_1 (CPU_STATE (cpu), sim_core_read_map, pc, NULL, NULL_CIA); break; case 2 : - insn_value = sim_core_read_2 (CPU_STATE (cpu), sim_core_read_map, pc); + insn_value = sim_core_read_2 (CPU_STATE (cpu), sim_core_read_map, pc, NULL, NULL_CIA); break; case 4 : - insn_value = sim_core_read_4 (CPU_STATE (cpu), sim_core_read_map, pc); + insn_value = sim_core_read_4 (CPU_STATE (cpu), sim_core_read_map, pc, NULL, NULL_CIA); break; default: abort (); diff --git a/sim/common/sim-core.c b/sim/common/sim-core.c index 7e41bd98aff..0268131e701 100644 --- a/sim/common/sim-core.c +++ b/sim/common/sim-core.c @@ -54,7 +54,7 @@ EXTERN_SIM_CORE\ (SIM_RC) sim_core_init (SIM_DESC sd) { - sim_core *memory = &sd->core; + sim_core *memory = STATE_CORE(sd); sim_core_maps map; for (map = 0; map < nr_sim_core_maps; @@ -77,6 +77,20 @@ sim_core_init (SIM_DESC sd) +STATIC_INLINE_SIM_CORE\ +(const char *) +sim_core_map_to_str (sim_core_maps map) +{ + switch (map) + { + case sim_core_read_map: return "read"; + case sim_core_write_map: return "write"; + case sim_core_execute_map: return "exec"; + default: return "(invalid-map)"; + } +} + + STATIC_INLINE_SIM_CORE\ (sim_core_mapping *) new_sim_core_mapping(SIM_DESC sd, @@ -186,7 +200,7 @@ sim_core_attach(SIM_DESC sd, device *client, void *optional_buffer) { - sim_core *memory = &sd->core; + sim_core *memory = STATE_CORE(sd); sim_core_maps map; void *buffer; int buffer_freed; @@ -265,9 +279,11 @@ sim_core_find_mapping(SIM_DESC sd, sim_core_maps map, unsigned_word addr, unsigned nr_bytes, - int abort) /*either 0 or 1 - helps inline */ + int abort, /*either 0 or 1 - helps inline */ + sim_cpu *cpu, + sim_cia cia) { - sim_core_mapping *mapping = sd->core.map[map].first; + sim_core_mapping *mapping = STATE_CORE (sd)->map[map].first; SIM_ASSERT((addr & (nr_bytes - 1)) == 0); /* must be aligned */ SIM_ASSERT((addr + (nr_bytes - 1)) >= addr); /* must not wrap */ while (mapping != NULL) { @@ -277,8 +293,8 @@ sim_core_find_mapping(SIM_DESC sd, mapping = mapping->next; } if (abort) - sim_io_error (sd, "access to unmaped address 0x%x (%d bytes)\n", - addr, nr_bytes); + sim_io_error (sd, "access to unmaped address 0x%lx (%d bytes)\n", + (unsigned long) addr, nr_bytes); return NULL; } @@ -306,7 +322,7 @@ sim_core_read_buffer(SIM_DESC sd, sim_core_mapping *mapping = sim_core_find_mapping(sd, map, raddr, 1, - 0); /*dont-abort*/ + 0, NULL, NULL_CIA); /*dont-abort*/ if (mapping == NULL) break; #if (WITH_DEVICES) @@ -347,7 +363,7 @@ sim_core_write_buffer(SIM_DESC sd, unsigned_word raddr = addr + count; sim_core_mapping *mapping = sim_core_find_mapping(sd, map, raddr, 1, - 0); /*dont-abort*/ + 0, NULL, NULL_CIA); /*dont-abort*/ if (mapping == NULL) break; #if (WITH_DEVICES) diff --git a/sim/common/sim-n-core.h b/sim/common/sim-n-core.h index 1bcb7227bd6..35e6e727027 100644 --- a/sim/common/sim-n-core.h +++ b/sim/common/sim-n-core.h @@ -23,67 +23,91 @@ #error "N must be #defined" #endif +#include "sim-xcat.h" + /* NOTE: see end of file for #undef of these macros */ #define unsigned_N XCONCAT2(unsigned_,N) #define T2H_N XCONCAT2(T2H_,N) #define H2T_N XCONCAT2(H2T_,N) -#define core_map_read_N XCONCAT2(core_map_read_,N) -#define core_map_write_N XCONCAT2(core_map_write_,N) +#define sim_core_read_N XCONCAT2(sim_core_read_,N) +#define sim_core_write_N XCONCAT2(sim_core_write_,N) INLINE_SIM_CORE(unsigned_N) -core_map_read_N(engine *system, - core_maps map, - unsigned_word addr) +sim_core_read_N(SIM_DESC sd, + sim_core_maps map, + unsigned_word addr, + sim_cpu *cpu, + sim_cia cia) { - core_mapping *mapping = core_map_find_mapping(system, map, - addr, - sizeof(unsigned_N), - 1); /*abort*/ + unsigned_N val; + sim_core_mapping *mapping = sim_core_find_mapping (sd, map, + addr, + sizeof (unsigned_N), + 1, + cpu, cia); /*abort*/ #if (WITH_DEVICES) if (WITH_CALLBACK_MEMORY && mapping->device != NULL) { unsigned_N data; - if (device_io_read_buffer(mapping->device, - &data, - mapping->space, - addr, - sizeof(unsigned_N)) != sizeof(unsigned_N)) - device_error(mapping->device, "internal error - core_read_N() - io_read_buffer should not fail"); - return T2H_N(data); + if (device_io_read_buffer (mapping->device, + &data, + mapping->space, + addr, + sizeof (unsigned_N)) != sizeof (unsigned_N)) + device_error (mapping->device, "internal error - sim_core_read_N() - io_read_buffer should not fail"); + val = T2H_N (data); } else #endif - return T2H_N(*(unsigned_N*)core_translate(mapping, addr)); + val = T2H_N (*(unsigned_N*) sim_core_translate (mapping, addr)); + if (STATE_CORE (sd)->trace) + trace_printf (sd, cpu, "sim-n-core.c:%d: read-%d %s:0x%08lx -> 0x%lx\n", + __LINE__, + sizeof (unsigned_N), + sim_core_map_to_str (map), + (unsigned long) addr, + (unsigned long) val); + return val; } INLINE_SIM_CORE(void) -core_map_write_N(engine *system, - core_maps map, +sim_core_write_N(SIM_DESC sd, + sim_core_maps map, unsigned_word addr, - unsigned_N val) + unsigned_N val, + sim_cpu *cpu, + sim_cia cia) { - core_mapping *mapping = core_map_find_mapping(system, map, - addr, - sizeof(unsigned_N), - 1); /*abort*/ + sim_core_mapping *mapping = sim_core_find_mapping(sd, map, + addr, + sizeof (unsigned_N), + 1, + cpu, cia); /*abort*/ #if (WITH_DEVICES) if (WITH_CALLBACK_MEMORY && mapping->device != NULL) { - unsigned_N data = H2T_N(val); - if (device_io_write_buffer(mapping->device, - &data, - mapping->space, - addr, - sizeof(unsigned_N), /* nr_bytes */ - processor, - cia) != sizeof(unsigned_N)) - device_error(mapping->device, "internal error - core_write_N() - io_write_buffer should not fail"); + unsigned_N data = H2T_N (val); + if (device_io_write_buffer (mapping->device, + &data, + mapping->space, + addr, + sizeof (unsigned_N), /* nr_bytes */ + cpu, + cia) != sizeof (unsigned_N)) + device_error (mapping->device, "internal error - sim_core_write_N() - io_write_buffer should not fail"); } else #endif - *(unsigned_N*)core_translate(mapping, addr) = H2T_N(val); + *(unsigned_N*) sim_core_translate (mapping, addr) = H2T_N (val); + if (STATE_CORE (sd)->trace) + trace_printf (sd, cpu, "sim-n-core.c:%d: write-%d %s:0x%08lx <- 0x%lx\n", + __LINE__, + sizeof (unsigned_N), + sim_core_map_to_str (map), + (unsigned long) addr, + (unsigned long) val); } @@ -91,5 +115,5 @@ core_map_write_N(engine *system, #undef unsigned_N #undef T2H_N #undef H2T_N -#undef core_map_read_N -#undef core_map_write_N +#undef sim_core_read_N +#undef sim_core_write_N diff --git a/sim/m32r/ChangeLog b/sim/m32r/ChangeLog new file mode 100644 index 00000000000..7ee891e1dfc --- /dev/null +++ b/sim/m32r/ChangeLog @@ -0,0 +1,329 @@ +Fri May 2 16:30:26 1997 Andrew Cagney + + * mem-ops.h: Stub additional core read/write arguments. + + * sim-main.h: Declare sim_cia - type SI. + (struct _sim_cpu): Move base type to end per common. + (struct _sim_state): Ditto. + +Thu May 1 11:15:34 1997 Doug Evans + + Merge from branch into devo. CGEN generic files moved to common + directory. K&R C support is no longer provided. + +Thu Apr 24 00:39:51 1997 Doug Evans + + * configure: Regenerated to track ../common/aclocal.m4 changes. + +Sat Apr 12 12:57:33 1997 Felix Lee + + * Makefile.in, seman-cache.c: new file, for wingdb build. + * sim-alloca.h: fixed for wingdb. + +Mon Apr 7 13:33:29 1997 Doug Evans + + * decode.c (*): m32r_cgen_insn_table renamed to ..._entries. + * mainloop.in: Use CGEN_INSN_INDEX instead of CGEN_INSN_TYPE. + * simdefs.h (INSN_NAME): m32r_cgen_insn_table renamed to ..._entries. + +Fri Apr 4 19:23:12 1997 Doug Evans + + * cgen-utils.in (ex_illegal): Fill in abuf->length, abuf->addr. + (exc_illegal): Likewise. + * decode.c (decode_vars): Add decode_illegal. + * genmloop.sh: #include "cpu-opc.h". + * sem-switch.c (case_INSN_ILLEGAL): Declare. + (labels): Add case_INSN_ILLEGAL. + (SWITCH): Add INSN_ILLEGAL case. + +Wed Mar 26 12:34:00 1997 Doug Evans + + * model.c (model_module): Use 0 not NULL. + + * genmloop.sh (sim_main_loop): Handle k&r c. + + * sem-switch.c: Regenerate to get k&r c support. + * semantics.c: Likewise. + + * m32r.c (ADD_{OV,CA}_SI,SUB_{OV,CA}_SI): Renamed to {ADD,SUB}[OC]FSI. + (ADDCSI,SUBCSI): New functions. + * sem-switch.c (addv,addv3,addx,subv,subx): Fix carry bit handling. + * semantics.c (addv,addv3,addx,subv,subx): Fix carry bit handling. + + * simcache.c (simcache_{install,init,uninstall}): Use + DECLARE_MODULE_INSTALL_HANDLER. + (simcache_option_handler): Use DECLARE_OPTION_HANDLER. + + * utils.c: #include "semops.h". + +Tue Mar 11 14:30:26 1997 Doug Evans + + * profile.c (profile_print_simcache): Fix thinko in printf text. + + * simdefs.h (struct argbuf): Add member to fmt_20 so it's not empty. + +Mon Mar 10 11:06:29 1997 Doug Evans + + * m32r.c (h_cr_get): Rewrite. + (h_cr_set): Rewrite. + * sem-switch.c (rte): bcarry renamed to bcond. + * semantics.c (rte): Likewise. + * simdefs.h (CPU_STATE): Likewise. + + * config.in (HAVE_SYS_TIME_H): Add. + * configure.in: Check for sys/time.h. + * configure: Regenerated. + * utils.c: Include sys/time.h if present. + + * common.c (sim_parse_args): Account for NULL terminating entry + in long_options table. + + * genmloop.sh (RUN_FAST_P): Don't run fast if tracing. + Always use cache if configured in. + * mainloop.in (do_extract_insn{16,32}): New functions. + (normal,fast): Call them. Handle starting in left slot. + * simcache.c (simcache_option_handler): Disallow -c0. + * sem-switch.c (TRACE_RESULT): Redefine so no tracing. + + * profile.c (profile_print_simcache): Fix percentage calc. + + * Makefile.in (INCLUDE_DEPS): Delete simcommon.h. + +Sun Mar 9 20:42:17 1997 Doug Evans + + * Makefile.in (COMMON_{PRE,POST}_CONFIG_FRAG): Add delimiters for. + (M32R_INCLUDE_DEPS): Use cpu-sim.h instead of m32r-sim.h. + Add mod-list.h. + (mrun.o): Don't depend on M32R_INCLUDE_DEPS. + (sim-if.o,m32r.o,utils.o): Likewise. + (common.o): Don't explicitly depend on mod-list.h. + (mainloop.c): Pass CPU to genmloop.sh. + (stamp-modules): Depend on configure. + (decode.o): Depend on decode,h, memops.h, semops.h, cpu-opc.h. + (extract.o): Depend on decode.h, memops.h, semops.h. + (semantics.o,seman-cache.o): Likewise. + (model.o,ops.o): Depend on memops.h. + (extr-cache.o): Disable building for the moment. + + * simcommon.h: Delete, move contents into cgen-sim.h. + * cgen-sim.h: Don't include ansidecl.h,bfd.h,simfns.h. + (UINT,CGEN_CAT3): Define. + ({extract,semantic}_fn_t): Renamed to {EXTRACT,SEMANTIC}_FN. + (decode_t): Renamed to DECODE. + + * simfns.h: Delete, contents moved to memops.h,semops.h. + * memops.h: New file. + * semops.h: New file. + * decode.h: Renamed from semantics.h. + + * sim-argv.h: New file. + * Makefile.in (memory.o,trace.o,profile.o,simcache.o,common): Add + dependency of sim-argv.h. + + * sim-alloca.h: New file. + * common.c: Include it. + * Makefile.in (common.o): Add dependency. + + * config.in (HAVE_TIME_H,HAVE_SYS_RESOURCE_H): Add. + (HAVE_GETRUSAGE,HAVE_TIME): Add. + * configure.in: sinclude ../common/aclocal.m4. + Check for headers time.h, sys/resource.h. + Check for functions time, getrusage. + (sim_link_{files,links}): Add link cpu-opc.h. + (sim_profile): Add simcache. + (SIM_AC_PROFILE): Add simcache, profile.o. + (simcache module): Delete extr-cache.o for now. + (--enable-sim-cache): Allow specification of default cache size. + * configure: Regenerated. + + * decode.c: #include cgen-sim.h,memops.h,semops.h,decode.h, + cpu-sim.h,cpu-opc.h. Don't include m32r-sim.h. + Regenerate. + + * extract.c: #include cgen-sim.h,decode.h,cpu-sim.h. + Don't include m32r-sim.h. + (*): Define/Undef FLD macro. Use it to reference ARGBUF. + Simplify profiling test with PROFILE_MODEL_P. + (mvfc,mvtc): Fix access of control registers. + * semantic.c: #include cgen-sim.h,memops.h,semops.h,decode.h,cpu-sim.h. + Don't include m32r-sim.h. + (*): Define/Undef FLD macro. Use it to reference ARGBUF. + Simplify profiling test with PROFILE_MODEL_P. + (mvfc,mvtc): Fix access of control registers. + + * sem-switch.c: New file, for GCC computed goto support. + + * genmloop.sh: Add #include's of bfd.h,callback.h,cgen-sim.h, + memops.h,semops.h,trace.h,cpu-sim.h. + (RUN_FAST_P): Change default to run fast if cache size > 0 + and not profiling. + (sim_main_loop): Record execution time. + Record instruction count even in fast mode. + (init): Allow cpu to provide init code in mainloop.in. + (FAST): Define as 0 or 1 depending on fast mode. + * mainloop.in (normal): Combine with fast case. + Add support for GCC computed gotos. Count simcache hits/misses. + (init): Initialize "switch" labels if GNUC. + + * cgen-utils.in: Don't include opcode/cgen.h. + Include cgen-sim.h, cpu-opc.h. + * common.c: Don't include simcommon.h,mod-list.h. Include cgen-sim.h. + * m32r-sim.h: Don't include mod-list.h + (RUN_FAST_P): Delete. + * m32r.c: Don't include profile.h. #include ansidecl.h,cgen-sim.h, + semops.h,memory.h,trace.h + (h_cr_get,h_cr_set): New functions. + * memory.c: #include cgen-sim.h,callback.h. + * ops.c: Don't include profile.h,m32r-sim.h. + Include cgen-sim.h,memops.h,cpu-sim.h. + (MEMOPS_DEFINE_INLINE): Renamed from SIMFNS_DEFINE_INLINE. + * trace.c: Include cgen-sim.h,cpu-opc.h. + * trace.h (trace_insn_{init,fini}): Declare. + + * model.c: Don't include signal.h,stdlib.h,m32r-sim.h. + Include cgen-sim.h,cpu-sim.h,cpu-opc.h. + Regenerate to get new insn aliases. + + * mrun.c: #include "ansidecl.h". + (STATE): Use struct sim_state instead. + + * profile.c: Surround #include with HAVE_STDLIB_H. + Don't include simcommon.h. Include cgen-sim.h,cpu-opc.h. + (PROFILE_{READ,WRITE}_MASK): Replace with PROFILE_MEMORY_MASK. + (profile_print_simcache): New function. + (profile_print): Call it. Print simulator speed stats. + * profile.h (PROFILE_{READ,WRITE}_MASK): Replace with + PROFILE_MEMORY_MASK. + (MODULE_PROFILE_SIMCACHE_P): Define. + (PROFILE_SIMCACHE_MASK): Define. + (PROFILE_COUNT): New members total_insn_count,exec_time. + New members simcache_hits,simcache_misses. + (PROFILE_SIMCACHE_{HITS,MISSES}): Define. + (PROFILE_MODEL_P): New macro. + (PROFILE_COUNT_SIMCACHE_{HIT,MISS}): New macros. + + * sim-if.c: Surround #include with HAVE_STDLIB_H. + Don't include simcommon.h,m32r-sim.h. Include cgen-sim.h,cpu-sim.h. + (sim_resume): Use USING_SIMCACHE_P instead of RUN_FAST_P. + (sim_info): Pass verbose to profile_print. + + * simcache.c: Include cgen-sim.h,callback.h. + (USING_SIMCACHE_P): Replace with SIMCACHE_P. + (simcache_option_handler): Ensure cache size at least 2. + Allow config time specification of default cache size. + * simcache.h (struct simcache): Support GCC computed gotos. + (SIMCACHE_DEFAULT_CACHE_SIZE): USe CONFIG_SIM_CACHE_SIZE if defined. + (USING_SIMCACHE_P): New macro. + + * simdefs.h: Don't include m32r-opc.h. + (CGEN_MAX_SIM_INSNS): Define. + (CPU_STATE): Regenerate. + (ARGBUF): Regenerate. + (extract,semantic handler decls): Delete, moved to decode.h. + + * tconfig.in: Don't include cgen-sim.h,m32r-sim.h. + (USE_SEM_SWITCH): Define. + + * utils.c: Include bfd.h,time.h,sys/resource.h. + (sim_time_get,sim_time_elapsed): New functions. + * cgen-sim.h (SIM_TIME,sim_time_get,sim_time_elapsed): Declare. + +Fri Jan 31 20:25:06 1997 Doug Evans + + * configure.in (AC_CHECK_HEADERS): Handle i386-windows. + * configure: Regenerated. + * model.c: #include . + * simcache.c: #include "libiberty.h". + * simcommon.h (alloca): Handle i386-windows. + + * common.c: #include libiberty.h. + (sim_signal_to_host): Return 5 if wingdb. + +Mon Jan 27 15:22:49 1997 Doug Evans + + * configure.in (sim_cache): Enabled by default now, pass default + cache size to --enable-sim-cache. + * simcache.c (simcache_option_handler): Allow -c 0. + + * simdefs.h,simfns.h: Regenerate + * decode.c,extract.c,model.c,ops.c,semantics.c: Regenerate. + +Tue Jan 21 16:21:01 1997 Doug Evans + + Add model profiling support. + * configure.in: Handle --enable-sim-model. + (sim_profile): Add model. + * Makefile.in (model.o): Add rule. + * cgen-sim.h (UNIT,INSN_TIMING,MACH,MODEL): New types. + * extract.c (*): Add model profiling support. + * m32r.c (model_mark_{get,set}_h_gr): New functions. + (model_mark_{busy,unbusy}_reg): New functions. + * profile.c (profile_option_handler): Recognize --profile model. + (profile_print_model): New function. + (profile_print): Call it. + * profile.h (MODULE_profile_model,MODULE_PROFILE_MODEL_P): Define. + (PROFILE_MODEL_MASK,PROFILE_LABEL_WIDTH): Define. + (PROFILE_COUNT): New members cycle_count,cti_stall_count, + load_stall_count,taken_count,untaken_count. + * semantics.c (*): Add model profiling support. + * simcommon.h (struct sim_state): New members mach,model. + * simdefs.h (CPU_PROFILE,MODEL_TYPE,UNIT_TYPE): New type. + (MAX_MODELS,MAX_UNITS): Define. + * tconfig.in (STATE_EXTRA_MEMBERS): Add cpu_profile. + + * Makefile.in (INCLUDE_DEPS): Add $(SIM_MODULES_HDRS). + (stamp-modules): Depend on genmodlist.sh. + * common.c (standard_options): Add --max-insns. + (copy_argv): New function. + * tconfig.in (SIM_HAVE_MAX_INSNS): Define. + * genmloop.sh: Allow mainloop.in to contain support code. + * mainloop.in: Move do_insn16,do_insn32 here. + * m32r.c (do_trap): Handle SYS_argvlen,SYS_argv,SYS_read. + * sim-if.c (sim_open): Don't set max insn count. + (sim_create_inferior): Save argv,envp. + * simcommon.h (struct sim_state): New members argv,envp. + * simdefs.h ([GS]ETTWI,[GS]ETTUWI,[GS]ETTAI): Define. + ([GS]ETMEMWI,[GS]ETMEMUWI,[GS]ETMEMAI): Define. + (ARGBUF): New members h_gr_get, h_gr_set. + * trace.c (trace_insn_init,trace_insn_fini): New functions. + (trace_printf): Print to buffer, output later by trace_insn_fini. + * trace.h (TRACE_INSN_{INIT,FINI}): Define. + +Thu Dec 19 16:01:59 1996 Doug Evans + + * configure.in (AC_FUNC_ALLOCA): Call. + * configure: Regenerate. + * config.h (HAVE_ALLOCA_H): Add. + * simcommon.h: Add alloca support. + (DECLARE_MODULE_INSTALL_HANDLER): Define. + (DECLARE_OPTION_HANDLER): Define. + (MEM_FN): Declare using PARAMS. + (DECLARE_MEM_FN): Define. + * trace.c (trace_result): Tweak for !STDC. + * cgen-sim.h (UDI_FN_SUPPORT): Define if ! HAVE_LONGLONG. + * cgen-utils.in (disasm_sprintf): Fix va_arg call in !STDC case. + * common.c (sim_print_help_fn): Use PARAMS. + (standard_option_handler): Fix decl for !STDC systems. + * memory.c: #include + (mem_flat_{install,init,uninstall}): Fix decl for !STDC systems. + (mem_flat_{read,write},mem_flat_option_handler): Likewise. + * profile.c (profile_install): Likewise. + (profile_option_handler): Likewise. + +Thu Dec 19 11:06:19 1996 Doug Evans + + * semantics.c (*): Don't suffix big unsigned numbers with "U". + Prefix them with 0x instead. + + * cgen-sim.h (DI_FN_SUPPORT): Define if ! HAVE_LONGLONG. + (SLADI,SRADI,CONVSIDI,CONVDISI): Delete, moved to simfns.h. + * semantics.c (machi,maclo,macwhi,macwlo,mulhi,mullo): Implement. + (mulwhi,mulwlo,mvtachi,mvtaclo,rac,rach): Implement. + * simfns.h: Add decls for functional DI,UDI,SF,DF,XF,TF support. + Add support for boolean and/or. + * utils.c: Redo naming of DI functional support. + (ANDDI,ORDI,ADDDI,MULDI,GEDI,LEDI,CONVHIDI): New functions. + +Tue Dec 17 12:57:48 1996 Doug Evans + + * Directory created. diff --git a/sim/m32r/mem-ops.h b/sim/m32r/mem-ops.h index cd8cc4b33e8..835ef34912d 100644 --- a/sim/m32r/mem-ops.h +++ b/sim/m32r/mem-ops.h @@ -269,7 +269,7 @@ GETMEMQI (SIM_CPU *cpu, ADDR a) if (! MEM_CHECK_ALIGNMENT (a, QI)) { engine_signal (cpu, SIM_SIGALIGN); } PROFILE_COUNT_READ (cpu, a, MODE_QI); - return sim_core_read_1 (CPU_STATE (cpu), sim_core_read_map, a); + return sim_core_read_1 (CPU_STATE (cpu), sim_core_read_map, a, NULL, NULL_CIA); } #else extern QI GETMEMQI (SIM_CPU *, ADDR); @@ -284,7 +284,7 @@ GETMEMHI (SIM_CPU *cpu, ADDR a) if (! MEM_CHECK_ALIGNMENT (a, HI)) { engine_signal (cpu, SIM_SIGALIGN); } PROFILE_COUNT_READ (cpu, a, MODE_HI); - return sim_core_read_2 (CPU_STATE (cpu), sim_core_read_map, a); + return sim_core_read_2 (CPU_STATE (cpu), sim_core_read_map, a, NULL, NULL_CIA); } #else extern HI GETMEMHI (SIM_CPU *, ADDR); @@ -299,7 +299,7 @@ GETMEMSI (SIM_CPU *cpu, ADDR a) if (! MEM_CHECK_ALIGNMENT (a, SI)) { engine_signal (cpu, SIM_SIGALIGN); } PROFILE_COUNT_READ (cpu, a, MODE_SI); - return sim_core_read_4 (CPU_STATE (cpu), sim_core_read_map, a); + return sim_core_read_4 (CPU_STATE (cpu), sim_core_read_map, a, NULL, NULL_CIA); } #else extern SI GETMEMSI (SIM_CPU *, ADDR); @@ -314,7 +314,7 @@ GETMEMDI (SIM_CPU *cpu, ADDR a) if (! MEM_CHECK_ALIGNMENT (a, DI)) { engine_signal (cpu, SIM_SIGALIGN); } PROFILE_COUNT_READ (cpu, a, MODE_DI); - return sim_core_read_8 (CPU_STATE (cpu), sim_core_read_map, a); + return sim_core_read_8 (CPU_STATE (cpu), sim_core_read_map, a, NULL, NULL_CIA); } #else extern DI GETMEMDI (SIM_CPU *, ADDR); @@ -329,7 +329,7 @@ GETMEMUQI (SIM_CPU *cpu, ADDR a) if (! MEM_CHECK_ALIGNMENT (a, UQI)) { engine_signal (cpu, SIM_SIGALIGN); } PROFILE_COUNT_READ (cpu, a, MODE_UQI); - return sim_core_read_1 (CPU_STATE (cpu), sim_core_read_map, a); + return sim_core_read_1 (CPU_STATE (cpu), sim_core_read_map, a, NULL, NULL_CIA); } #else extern UQI GETMEMUQI (SIM_CPU *, ADDR); @@ -344,7 +344,7 @@ GETMEMUHI (SIM_CPU *cpu, ADDR a) if (! MEM_CHECK_ALIGNMENT (a, UHI)) { engine_signal (cpu, SIM_SIGALIGN); } PROFILE_COUNT_READ (cpu, a, MODE_UHI); - return sim_core_read_2 (CPU_STATE (cpu), sim_core_read_map, a); + return sim_core_read_2 (CPU_STATE (cpu), sim_core_read_map, a, NULL, NULL_CIA); } #else extern UHI GETMEMUHI (SIM_CPU *, ADDR); @@ -359,7 +359,7 @@ GETMEMUSI (SIM_CPU *cpu, ADDR a) if (! MEM_CHECK_ALIGNMENT (a, USI)) { engine_signal (cpu, SIM_SIGALIGN); } PROFILE_COUNT_READ (cpu, a, MODE_USI); - return sim_core_read_4 (CPU_STATE (cpu), sim_core_read_map, a); + return sim_core_read_4 (CPU_STATE (cpu), sim_core_read_map, a, NULL, NULL_CIA); } #else extern USI GETMEMUSI (SIM_CPU *, ADDR); @@ -374,7 +374,7 @@ GETMEMUDI (SIM_CPU *cpu, ADDR a) if (! MEM_CHECK_ALIGNMENT (a, UDI)) { engine_signal (cpu, SIM_SIGALIGN); } PROFILE_COUNT_READ (cpu, a, MODE_UDI); - return sim_core_read_8 (CPU_STATE (cpu), sim_core_read_map, a); + return sim_core_read_8 (CPU_STATE (cpu), sim_core_read_map, a, NULL, NULL_CIA); } #else extern UDI GETMEMUDI (SIM_CPU *, ADDR); @@ -389,7 +389,7 @@ SETMEMQI (SIM_CPU *cpu, ADDR a, QI val) if (! MEM_CHECK_ALIGNMENT (a, QI)) { engine_signal (cpu, SIM_SIGALIGN); return; } PROFILE_COUNT_WRITE (cpu, a, MODE_QI); - sim_core_write_1 (CPU_STATE (cpu), sim_core_read_map, a, val); + sim_core_write_1 (CPU_STATE (cpu), sim_core_read_map, a, val, NULL, NULL_CIA); } #else extern void SETMEMQI (SIM_CPU *, ADDR, QI); @@ -404,7 +404,7 @@ SETMEMHI (SIM_CPU *cpu, ADDR a, HI val) if (! MEM_CHECK_ALIGNMENT (a, HI)) { engine_signal (cpu, SIM_SIGALIGN); return; } PROFILE_COUNT_WRITE (cpu, a, MODE_HI); - sim_core_write_2 (CPU_STATE (cpu), sim_core_read_map, a, val); + sim_core_write_2 (CPU_STATE (cpu), sim_core_read_map, a, val, NULL, NULL_CIA); } #else extern void SETMEMHI (SIM_CPU *, ADDR, HI); @@ -419,7 +419,7 @@ SETMEMSI (SIM_CPU *cpu, ADDR a, SI val) if (! MEM_CHECK_ALIGNMENT (a, SI)) { engine_signal (cpu, SIM_SIGALIGN); return; } PROFILE_COUNT_WRITE (cpu, a, MODE_SI); - sim_core_write_4 (CPU_STATE (cpu), sim_core_read_map, a, val); + sim_core_write_4 (CPU_STATE (cpu), sim_core_read_map, a, val, NULL, NULL_CIA); } #else extern void SETMEMSI (SIM_CPU *, ADDR, SI); @@ -434,7 +434,7 @@ SETMEMDI (SIM_CPU *cpu, ADDR a, DI val) if (! MEM_CHECK_ALIGNMENT (a, DI)) { engine_signal (cpu, SIM_SIGALIGN); return; } PROFILE_COUNT_WRITE (cpu, a, MODE_DI); - sim_core_write_8 (CPU_STATE (cpu), sim_core_read_map, a, val); + sim_core_write_8 (CPU_STATE (cpu), sim_core_read_map, a, val, NULL, NULL_CIA); } #else extern void SETMEMDI (SIM_CPU *, ADDR, DI); @@ -449,7 +449,7 @@ SETMEMUQI (SIM_CPU *cpu, ADDR a, UQI val) if (! MEM_CHECK_ALIGNMENT (a, UQI)) { engine_signal (cpu, SIM_SIGALIGN); return; } PROFILE_COUNT_WRITE (cpu, a, MODE_UQI); - sim_core_write_1 (CPU_STATE (cpu), sim_core_read_map, a, val); + sim_core_write_1 (CPU_STATE (cpu), sim_core_read_map, a, val, NULL, NULL_CIA); } #else extern void SETMEMUQI (SIM_CPU *, ADDR, UQI); @@ -464,7 +464,7 @@ SETMEMUHI (SIM_CPU *cpu, ADDR a, UHI val) if (! MEM_CHECK_ALIGNMENT (a, UHI)) { engine_signal (cpu, SIM_SIGALIGN); return; } PROFILE_COUNT_WRITE (cpu, a, MODE_UHI); - sim_core_write_2 (CPU_STATE (cpu), sim_core_read_map, a, val); + sim_core_write_2 (CPU_STATE (cpu), sim_core_read_map, a, val, NULL, NULL_CIA); } #else extern void SETMEMUHI (SIM_CPU *, ADDR, UHI); @@ -479,7 +479,7 @@ SETMEMUSI (SIM_CPU *cpu, ADDR a, USI val) if (! MEM_CHECK_ALIGNMENT (a, USI)) { engine_signal (cpu, SIM_SIGALIGN); return; } PROFILE_COUNT_WRITE (cpu, a, MODE_USI); - sim_core_write_4 (CPU_STATE (cpu), sim_core_read_map, a, val); + sim_core_write_4 (CPU_STATE (cpu), sim_core_read_map, a, val, NULL, NULL_CIA); } #else extern void SETMEMUSI (SIM_CPU *, ADDR, USI); @@ -494,7 +494,7 @@ SETMEMUDI (SIM_CPU *cpu, ADDR a, UDI val) if (! MEM_CHECK_ALIGNMENT (a, UDI)) { engine_signal (cpu, SIM_SIGALIGN); return; } PROFILE_COUNT_WRITE (cpu, a, MODE_UDI); - sim_core_write_8 (CPU_STATE (cpu), sim_core_read_map, a, val); + sim_core_write_8 (CPU_STATE (cpu), sim_core_read_map, a, val, NULL, NULL_CIA); } #else extern void SETMEMUDI (SIM_CPU *, ADDR, UDI); -- 2.30.2