3 * igen.c ({insn,model}_table_fields): Spell mnemonic correctly.
4 (gen_itable_h,itable_c_insn): Ditto.
5 (model support): Move model support around, add support for
6 model-data, model-internal. Use annex field for model-macros
9 * configure.in (--enable-sim-inline): If --enable-sim-inline=no,
10 also define INLINE as nothing.
11 * configure: Regenerate.
13 * std-config.h (INLINE): Rather than nuking INLINE, only define it
14 as __inline__ if any of the INLINE flags are non-zero.
16 * options.c (print_options): Print out WITH_XOR_ENDAIN.
18 Mon Nov 13 23:03:45 1995 Andrew Cagney <cagneyhighland.com.au>
20 * ppc-instructions (rfi): Add missing code.
22 * cpu.c (cpu_get_time_base): Fix calculation of current value of
25 * ppc-spr-table (TBL, TBU): Fix TBL/TBU entries - was confusing
26 m[tf]tb with m[tf]spr.
28 * ppc-instructions (mtspr, mfspr): Fix mttbl - wasn't storing
31 Mon Nov 13 21:35:37 1995 Andrew Cagney <cagneyhighland.com.au>
33 * std-config.h (INLINE, STATIC_INLINE): Was being set to static
34 inline.. Only problem being that with ppc-opcode-simple this gave
35 it the chance to inline all the idecode functions with potentially
36 disasterous results on a 16mb PC. For moment hobble INLINE.
38 * configure.in, std-config.h (WITH_SMP): Make that 5 processors by
41 * configure.in: Tweek flags passed to gcc for --with-sim-warnings.
42 Firstly make them errors and secondly remove the options gcc-245
47 * misc.c (zalloc), cpu.c (cpu_init), devices
48 (console_io_read_buffer_callback, icu_io_read_buffer_callback,
49 vm_io_read_buffer_callback), main.c (zalloc), mon.c (memset),
50 sim_calls.c (zalloc) : replace bzero() with memset().
52 * emul_netbsd.c (write_direntries), psim.c (psim_read_register,
53 psim_write_register): replace bcopy() with memcpy().
55 Sun Nov 12 20:55:41 1995 Andrew Cagney <cagneyhighland.com.au>
57 * configure.in: for --disable-sim-inline (--enable-sim-inline=no),
58 force DEFAULT_INLINE to 0 rather then trusting the std
61 Sun Nov 12 20:55:41 1995 Andrew Cagney <cagneyhighland.com.au>
63 * igen.c (lf_print_idecode_table, idecode_table_leaf): Fix
64 generation of switch entries in tables - treat the same as
65 cracking/semantic functions.
67 * igen.c (idecode_switch_end, idecode_switch_leaf): Fix generation
68 of a boolean switch statement (field zero or non-zero).
70 * ppc-opcode-test-1, ppc-opcode-test-2: New files. These test the
71 switch/table generation ability of igen.
73 * igen.c (idecode_switch_leaf): Fix code output when a switch
74 statement needs to look up a table.
76 * igen.c (idecode_declare_if_switch): New function called from
77 gen_idecode_c - need to declare any idecode switch functions
78 before they are used in idecode tables.
80 * igen.c (lf_print_c_cracker_function, idecode_crack_leaf,
81 idecode_crack_insn): Add is_inline_function argument to code
82 printing cracker functions which indicates if STATIC_IDECODE or
83 STATIC_INLINE_IDECODE should be used for definition. For
84 idecode_crack_insn (which implies not duplicating/expanding) don't
85 declare function as inline - we assume that the only time this is
86 code is generated is when things are being tested. For
87 idecode_crack_leaf, make static (instead of INLINE) if the
88 instructions parent is a table as function will always be called
91 * igen.c (idecode_expand_if_switch): Declare as STATIC_IDECODE not
92 STATIC_INLINE_IDECODE. Only the outermost idecode switch will be
93 called directly, all others are called via a table.
95 * igen.c (lf_print_semantic_function_header, semantics_h_leaf,
96 semantics_h_insn, semantics_h_function,
97 lf_print_c_semantic_function, semantics_c_function): Add
98 is_inline_function argument to lf_print_semantic_function_header
99 to indicate if an inline or static function declaration/definition
100 should be output. Depending on situtation call accordingly:
101 functions (not instruction semantic routines) are always inline;
102 Semantic routines are made inline when there is no icache (cache
103 will contain the function address) and are duplicating (see above)
104 and the parent of the instruction is a switch statement.
106 * igen.c (opcode_field_new): Delete. Code changed to use ZALLOC
107 and moved to insn_table_find_opcode_field.
109 * table.c (table_open): Fix typo (nr_model_fields vs nr_fields).
111 * igen.c (model_c_insn): Suggestion - document the name of the
112 instruction on each line of the instruction model table.
114 Fri Nov 10 00:44:38 1995 Andrew Cagney <cagneyhighland.com.au>
116 * emul_netbsd.c (do_ioctl): Cleanup compilation.
118 * sim_callbacks.h (__attribute__): Only define if not defined (was
119 already defined on NetBSD host).
121 Wed Nov 8 21:49:52 1995 Andrew Cagney <cagneyhighland.com.au>
123 * std-config.h (WITH_XOR_ENDIAN), configure.in, Makefile.in: New
124 macro, indicates if the PowerPC's horrible XOR endian mode should
125 be suported. Add to configure and make.
127 * vm_n.h (vm_data_map_read_N, vm_data_map_write_N), vm.c
128 (vm_instruction_map_read): If XOR endian, xor the address
129 with a value from an xor table (indexed by size of access).
131 * vm.c (vm_synchronize_context), cpu.c (cpu_synchronize_context):
132 set up xor table to xor if there is a conflict between the
133 CURRENT_TARGET_ENDIAN and the endian indicated in the MSR. Move
134 check of suported change of endian mode from cpu.c to vm.c.
136 * vm.c (vm_data_map_write_buffer, vm_data_map_read_buffer):
137 Hopefully added correct hack to handle XOR endian mode.
139 FIXME: If NONSTRICT alignment and XOR ENDIAN and MSR indicates
140 little endian mode, the model accepts miss aligned transfers.
142 FIXME: Need to create an `init' device that, during
143 initializatioin for XOR mode, it mushes (XOR address) all the dma
144 data before passing it on to the core for storage. Just like the
147 Wed Nov 8 21:49:52 1995 Andrew Cagney <cagneyhighland.com.au>
149 * devices.c (halt_io_write_buffer_callback): Use value written to
150 halt device to determine exit status. Thus allowing
151 success/failure of OEA tests.
153 Wed Nov 8 00:10:38 1995 Andrew Cagney <cagneyhighland.com.au>
155 * ppc-instructions (icbi): If icache present flush it.
157 Tue Nov 7 23:36:31 1995 Andrew Cagney <cagneyhighland.com.au>
159 * devices.c (htab_init_callback): Add code to create htab/pte.
161 * devices.c (dma_file, file_init_callback, htab_init_callback):
162 New function - Dma the named file into memory at the specified
165 * device_tree.h, device_tree.c (scand_*): New functions.
167 Tue Nov 7 23:36:31 1995 Andrew Cagney <cagneyhighland.com.au>
169 * filter_filename.c, Makefile.in: Change so that only dependant on
170 a very limited nr of files. Stops an unnecessary dependency.
174 * core.c (core_map_find_mapping): Use cpu_halt rather than error
175 to abort an access to an undefined address.
179 * igen.c (model_table_insert_{macro,function}): New functions.
180 (insn_table_load_insns): Call them.
181 (gen_model_h): Move section emiting model-macros to be first.
182 (model_{c,h}_function): New functions cloned from semantic
183 functions to print out the prototype and function for
185 (gen_model_{c,h}): Print out model-functions.
187 * ppc-instructions (model_{start,halt,print_info}): Add dummy
190 * options.c (print_options): Print out WITH_{,DEFAULT_}MODEL, not
191 WITH_PPC_{,DEFAULT_}_MODEL.
192 (options_ppc): Delete now unused function.
193 (cpu.h): Include cpu.h, not just basics.h.
195 * std-config.h (WITH_{,DEFAULT_}MODEL): Define.
197 * igen.c (model_macros, last_model_macro): New statics to keep
198 track of macros to go in model.h.
199 (insn_table_load_insns): Add model-macros to model_macros linked
201 (model_table_fields): Add field for printable name.
202 (gen_model_h): If there are model macros defined, print them out.
203 Print out DEFAULT_MODEL as the first model if there any models
204 specified, otherwise MODEL_NONE. Print out external decl for
205 current_model. Print out decl for model_set.
206 (gen_model_c): Add function model_set. Switch to use printable
207 name for the model, not the internal identifier used.
209 * psim.c (current_model): New global variable.
211 * ppc-instructions: Add macros for flag defines. Switch first
212 model so 604 is first.
214 * main.c (main): Call model_set, not function_unit_model.
215 * sim_calls.c (sim_open): Ditto.
216 * sim_calls.c, Makefile.in: sim_calls.c now includes cpu.h.
220 * mon.h (mon_events): New enumeration for other events we want to
222 (mon_event): Add declaration for function.
224 * mon.c (mon_event): New function.
225 (mon_print_info): Print icache misses.
227 * psim.c (run_until_stop): Monitor icache misses.
229 * configure.in (--enable-sim-inline): Fix typos in handling comma
230 separated inline options.
231 (--enable-sim-icache): Echo icache size.
232 * configure: Regenerate.
234 * igen.c (semantics_h_print_function): Emit STATIC_SEMANTICS
235 instead of INLINE_SEMANTICS so that the compiler won't keep all of
236 the semantic functions as inline RTL, given that the address of
237 the function is taken which forces outline calls anyway.
238 (lf_print_c_semantic_function_header): Ditto.
239 (gen_semantics_h): Define STATIC_SEMANTICS as nothing if not
241 (lf_print_c_cracker_function): Emit STATIC_IDECODE instead of
242 STATIC_INLINE_IDECODE.
243 (gen_idecode_c): Define STATIC_IDECODE if not defined.
244 (gen_model_h): Use #ifdefs to define types to hold model units,
246 (model_table_insert): Add a sentinel functional unit at the end to
247 simplify loop processing.
248 (model_c_insn): Use <function-unit>_SENTINAL instead of 0 for any
249 instruction not specifing a function unit for the current model.
250 (gen_model_{c,h}): Provide bounds for model_time_mapping.
252 * inline.h (STATIC_SEMANTICS): Define to be static if
253 SEMANTICS_INLINE is defined.
254 (STATIC_IDECODE): Define to be static if IDECODE_INLINE is
257 * options.c (print_options): Fix typo.
261 * configure.in (--enable-sim-{opcode,config}): Use $srcdir when
262 check for the existence of files.
263 * configure: Regenerate.
265 * table.c (table): New field nr_model_fields.
266 (table_open): New parameter nr_model_fields.
267 (table_entry_read): Parse model fields that begin with a '*' after
269 * igen.c, dgen.c: Change callers of table_open.
271 * igen.c: Add support for dumping model specific information in
273 (insn_field_name): Delete unused array.
274 (global variables): Make global variables static, so we can tell
275 when they are no longer used.
276 (cache_semantic_actual): Delete unused variable.
277 (insn_table_load_insns): If the insn is really a machine model,
278 call model_table_insert instead of other processing.
279 (model_table_insert): New function to handle defining the
280 functional units of a particular machine model.
281 (insn_table): Add last_function field so we can add functions at
283 (insn_table_insert_function): Use last_function field when
284 appending new function.
286 * ppc-instructions: Add a few model specific information for 603,
287 603e, and 604 for testing purposes.
289 * table.h (table_model_entry): New linked list to hold model
290 specific information, one per line.
291 (table_entry): Add model_first, model_last fields.
293 * configure.in (--enable-sim-inline): If gcc is found and
294 --enable-sim-inline is not specified, defaine DEFAULT_INLINE to 1,
296 (--enable-sim-reserved-bits): New switch to check whether reserved
297 bits are set in the instruction.
298 (--enable-sim-opcode): Make complex the default.
299 (all switches): Add appropriate checks and error messages.
300 * configure: Regenerate.
302 * Makefile.in (RESERVED_CFLAGS): New variable set by
303 --enable-sim-reserved-bits.
304 (CONFIG_CFLAGS): Include RESERVED_CFLAGS.
305 (BUILT_SRC): igen now generates model.c and model.h.
306 (LIB_OBJ): Include table.o.
307 (tmp-igen): Add -m/-M options to write model.c/model.h.
308 (model.o): New object.
309 (CPU_H): Include model.h.
311 * cpu.h: Include model.h.
313 * std-config.h (WITH_RESERVED_BITS): Define.
314 (MODEL_INLINE): Ditto.
316 * options.c (print_options): Print out WITH_RESERVED_BITS.
320 * configure.in: If --silent, don't output information messages.
321 * configure: Regenerate.
323 * configure.in (--enable-sim-alignment): Fix typo in specifing non
325 (--enable-sim-switch): Make default on.
326 (--enable-sim-duplicate): Make default on.
327 (--enable-sim-smp): Make default 0.
328 (--enable-sim-mon): Don't set sim_float if not set.
329 (--enable-sim-inline): If gcc is found and --enable-sim-inline is
330 not specified, define DEFAULT_INLINE to be 2.
331 (all --enable-sim-* rules): Echo rules set to non empty to file
333 * configure: Regenerate.
335 * options.c (options_env): Fix typo if WITH_ENV is 0.
336 (print_options): Print GCC compiler version if available and
337 date/time options was compiled. If OPCODE_RULES, IGEN_FLAGS,
338 and/or DGEN_FLAGS are defined, print them.
340 * Makefile.in (all link actions): Pass SIM_CFLAGS as well as
342 (options.o): Compile options.o with OPCODE_RULES, IGEN_FLAGS, and
343 DGEN_FLAGS defined, so they can be printed out.
345 * igen.c (lf_print_c_validate): Check for WITH_ASSERT, so that
346 this test can be compiled away if the user really wants a fast
347 simulator by not doing assertion failures.
351 * options.c: New file to print out all of the WITH_ options.
352 * options.h: New include file to declare print_options.
353 * debug.h (trace_options): Add trace_opts to call print_options.
354 * debug.c (trace_description): Add trace_opts support.
355 * main.c (main): If user requested options, print them.
356 * sim_calls.c (sim_open): Ditto.
358 * igen.c (opcode_field_new): Add void to make it a proper prototype.
360 * emul_generic.c (emul_enter_call): Make printf_filtered arguments
362 * emul_netbsd.c (do_kill): Ditto.
363 * registers.c (registers_dump): Ditto.
364 * vm.c (om_translate_effective_to_real): Ditto.
365 * vm_n.h (vm_data_map_read_N): Ditto.
366 (vm_data_map_write_N): Ditto.
367 * devices.h (DTRACE_INIT): Ditto.
368 (DTRACE_{ATTACH,DETACH}_ADDRESS): Ditto.
369 (DTRACE_IO_{READ,WRITE}_BUFFER): Ditto.
370 (DTRACE_DMA_{READ,WRITE}_BUFFER): Ditto.
371 * devices.c (update_for_binary_section): Ditto.
372 (write_stack_arguments): Ditto.
373 (stack_ioctl_callback): Ditto.
374 * device_tree.c (device_tree_add_passthrough): Ditto.
375 (device_tree_{add,find}_device): Ditto.
376 (device_tree_{add,find}_integer): Ditto.
377 (device_tree_find_{string,boolean}): Ditto.
378 (device_tree_init{,_device}): Ditto.
379 (device_tree_dump): Ditto.
380 * sim_calls.c (sim_{read,write}): Ditto.
381 (sim_{fetch,store}_register): Ditto.
382 (sim_stop_reason): Ditto.
384 * sim_callbacks.h (printf_filtered): Declare with attribute
385 printf, so we can enable format checks.
387 * devices.c (console_io_{read,write}_buffer_callback): Cast swtich
388 argument to int, since ANSI doesn't allow long switch values.
389 * emul_netbsd.c (do___sysctl): Ditto.
391 * emul_netbsd.c (do___sysctl): Fix up printf call.
393 * corefile.c (core_translate): Don't do arithmetic with void *
394 pointers. Cast to char * first.
396 * function_unit.c (FUNC_{LOAD,STORE}): Rename from {LOAD,STORE}
399 * Makefile.in ({FUNC,MODEL,WARNING}_CFLAGS): New flags set by
400 configure --enable switches.
401 (CONFIG_CFLAGS): Include FUNC_CFLAGS and MODE_CFLAGS.
402 (.c.o): Include WARNING_CFLAGS.
403 (CPU_H): Include function_unit.h.
404 (LIB_OBJ): Include function_unit.o.
405 (BUILT_SRC_WO_CONFIG): Split from BUILT_SRC and do not include
406 config.h or ppc-config.h.
407 (BUILT_SRC): Include BUILT_SRC_WO_CONFIG, config.h and
409 (filter_filename.o): Include config.h/ppc-config.h dependencies.
410 (idecode.o, semantics.o, psim.o): Specify CC line without
411 WARNING_CFLAGS so that we don't get all of the unused variable
412 warnings that are generated.
413 (function_unit.o): Add rule to build.
414 (main.o, sim_calls.o): Add function_unit.h, itable.h dependencies.
415 (mon.o): Include mon.c dependency.
416 (TAGS): Depend on BUILT_SRC.
417 (clean): Don't delete config.h or ppc-config.h
419 * basics.h (sim_callbacks.h): Move include after the include of
420 config.h and ppc-config.h.
422 * bits.{h,c} (ROTL32,ROTL64): Move these functions to bits.c. Add
423 support for BITS_INLINE to inline these. Add declarations to
426 * configure.in (--enable-sim-warnings): Add new option to specify
427 compiler warnings for all modules except idecode.o and semantics.o
428 which have lots of unused variables because they are machine
430 (--enable-sim-function-unit): New switch to configure whether
431 function unit support is compiled in or not.
432 (--enable-sim-{,default-}mode): New switches to control which cpu
434 * configure: Regenerate.
436 * corefile.c (core_attach_address_callback): Delete unused
437 variable device_address.
439 * cpu.c (struct _cpu): Add function unit pointer field func_unit.
440 (cpu_create): If WITH_FUNCTION_UNIT, call function_unit_create.
441 (cpu_init): If WITH_FUNCTION_UNIT, call function_unit_init.
442 (cpu_halt): If WITH_FUNCTION_UNIT, call function_unit_halt.
443 (cpu_function_unit): New function to return func_unit field.
445 * cpu.h (function_unit.h): Include new include file.
446 (cpu_function_unit): Declare.
448 * debug.c (stdlib.h): Test HAVE_STDLIB_H, not HAVE_STDLIB.
449 (config.h): Include config.h.
451 * devices.c (icu_io_write_buffer_callback): Delete unused variable
454 * emul_generic.c (emul_exit_call): Print out status value.
456 * emul_netbsd.c (do_read): Delete unused variable nr_moved.
458 * filter_filename.h (includes): Include config.h, ppc-config.h,
461 * inline.c: Include bits.c if BITS_INLINE. Include
462 function_unit.c if FUNCTION_UNIT_INLINE.
464 * inline.h (INLINE_BITS): Define if BITS_INLINE.
465 (INLINE_FUNCTION_UNIT): Define if FUNCTION_UNIT_INLINE.
467 * interrupts.c (instruction_storage_interrupt): Delete unused
470 * lf.h (config.h): Include config.h.
472 * main.c (includes): Include function_unit.c. If HAVE_UNISTD_H,
474 (usage): Update for -m model, -i, and -I options.
475 (main): Delete unused variables stack_pointer and i. Add support
476 for -i, -m model arguments. Call psim_print_info with verbose ==
477 1 if -i, and verbose == 2 if -I.
479 * mon.c (stdio.h): Include stdio.h to pick up sprintf prototype.
480 (mon_issue): Call function_unit_issue if function units are
482 (mon_print_info): Take psim * argument. Print out information
483 from function_unit if available. Move read/write stats to always
484 print, instead of printing if verbose > 1. Fix up plural
487 * mon.h (mon_print_info): Update prototype.
489 * psim.c (current_ppc_model): Add global variable.
490 (psim_print_info): Pass system argument to mon_print_info.
492 * sim_calls.c (function_unit.h): Include.
493 (sim_open): Add support for -i and -m model options. If -i call
494 psim_print_info with verbose == 1, if -I, with verbose == 2.
495 (sim_resume): Delete unused variable program_counter.
497 * std-config.h (WITH_FUNCTION_UNIT): Define.
498 (ppc_model): Add enumeration giving all PowerPC models currently
500 ({WITH,CURRENT}_PPC_MODEL): Define.
501 (FUNCTION_UNIT_INLINE): Define.
503 * table.c (config.h): Include config.h.
505 * vm.c (om_virtual_to_real): Print pte_word_{0,1} so the compiler
506 doesn't complain that they're unused.
508 * vm_n.h (vm_data_map_read_N): Delete unused variable rval.
512 * sim-endian.c (ppc-endian.c), sim-endian.h (ppc-endian.h):
513 renameed. These files are target independant.
514 * Makefile.in, basics.h: update for new name.
516 * sim-endian.h (SWAP_N), sim-endian.c (_SWAP_1): Rename existing
517 SWAP_<N> to _SWAP_<N> so that sim-endian.h can contain SWAP_N
520 * sim-endian.c, sim-endian-n.h (new file): Move endian code into a
521 debugable header file.
523 * ppc-instructions (Byte-Reverse): Enable byte reverse
524 instructions using SWAP_N macros.
528 * Makefile.in (config.status): Remove references to config.make
531 * config.{make,hdr}: Delete, no longer used.
536 * sim_calls.c (sim_open): Fix parsing of `target sim' options.
538 * device_tree.c (device_tree_add_string): Wasn't saving the value
539 of the string being entered into the tree.
541 * psim.c (create_filed_device_tree): Not terminating string device
544 * psim.c (psim_create): Use `env' instead of
545 `environment-architecture' to be consistent with configure.
546 Reconize user/uea, virtual/vea and operating/oea.
550 * core.c: Rename to corefile.c
551 * core.h: Rename to corefile.h
552 * inline.c: Include corefile.h, renamed from core.h.
553 * cpu.h: Include corefile.h, renamed from core.h
554 * vm.c: Include corefile.h, renamed from core.h
555 * corefile.c: Include corefile.h rather than core.h
556 * README.psim (KNOWN PROBLEMS): Change core.* references to corefile.*
558 * Makefile.in (CPU_H): Change core.h to corefile.h
559 (vm.o): Change dependency to corefile.h
560 (LIB_SRC): Change core.c to corefile.c.
561 (LIB_OBJ): Change core.o to corefile.o.
562 (corefile.o): Change dependencies to corefile.c, corefile.h.
566 * ppc-instructions (data cache instructions): Make all data cache
567 instructions nops instead of invalid instructions.
569 * Makefile.in (CONFIG_CFLAGS): Add ALIGNMENT_CFLAGS and
570 TIMEBASE_CFLAGS which weren't included.
574 * Makefile.in: Uncomment built file dependencies.
576 * configure.in: Rewrite --enable-sim switch handling to use the
577 autoconf builtins so it works correctly if the configure or
578 Makefile.in files are modified and make decides to rebuild
579 Makefile. Also document all of the --enable-sim switches
580 supported. Check whether getrusage and sys/resource.h are
582 * config.in: Regenerate.
583 * configure: Regenerate.
584 * Makefile.in: Add support for all of the variables set with
585 --enable-sim switches.
587 * Makefile.in (clean): make clean now removes all built sources as
590 * cpu.c: Use HAVE_STRING_H, HAVE_STRINGS_H, HAVE_UNISTD_H,
591 HAVE_TIME_H, HAVE_SYS_TIMES_H, HAVE_SYS_RESOURCE_H defined in
592 the generated config.h.
594 * device_tree.c: Ditto.
597 * emul_netbsd.c: Ditto.
602 * registers.c: Ditto.
607 * main.c (main): Call psim_print_info with verbose == 2.
609 * mon.c (mon_print_info): Align the cpu number and number of
610 instructions fields. Do not print an instruction category if the
611 CPU did not execute any of those instructions. Print out number
612 of reads and writes. If getrusage is supported, print out number
613 of simulated instructins per second.
615 * configure.in: Add support for --enable-sim-opcode=stupid.
616 * configure: Regenerate.
620 * std-config (INLINE_DEVICE_TREE): Don't inline either of
621 device_tree.c or devices.c. There is no significant gain.
623 * configure.in, Makefile.in: add --enable-sim-icache=[0-9]* and
628 * igen.c (main), misc.h (target_a2i, i2target), misc.c: Add
629 functions to convert between target and igen internal bit numbers.
630 Make IO go through these functions. Add -b (bit size) and -h (high
631 bit nr) options to igen. Typical usage would be: ./igen -b 16 -h
632 15 for a 16 bit instruction format with the msb given a number 15.
636 * dgen.c (main): Was outputting optarg even when it was NULL.
640 * vm_n.h (vm_data_map_load_N, vm_data_map_store_n), debug.h,
641 debug.c: Add tracing of load/store unit (virtual) with -t
646 * std-config.h (WITH_ENVIRONMENT): Add USER_ENVIRONMENT which does
647 not include things such as the time base and events.
649 * interrupt.c, sim_calls.c, cpu.h, vm.c, configure.in: Add UEA to
650 all environment switches for above.
652 * psim.c (psim_create): ditto - new device tree node name is
653 /options/environment-architecture with values user, virtual and
658 * ppc-opcode-stupid: Third example of use of opcode table - this
659 one expands all mtspr/mfspr and branch instructions. Appears to
660 give about a 10% gain in performance if everything enabled. Also
661 takes about 150mb of swap to build.
665 * emul_netbsd.c (do_exit): Print arguments and close parenthesis
666 if tracing, since exit doesn't go through emul_exit_call.
667 (do_read): Print arguments if tracing.
673 (do_sigprocmask): Replace trace with printing arguments if
675 (do_ioctl): Print arguments if tracing.
679 (do_gettimeofday): Ditto.
680 (do_getrusage): Ditto.
683 * filter_filename.c: New file to provide filter_filename to strip
684 the directory prefix from a file.
685 * filter_filename.h: New include file to declare filter_filename.
687 * debug.h: Include filter_filename.h.
688 (TRACE,DTRACE,ERROR): Use filter_filename on __FILE__.
690 * misc.h: Include filter_filename.h.
691 (ASSERT): Use filter_filename on __FILE__.
693 * igen.c (lf_print_my_prefix): Use filter_filename on the filename
696 * Makefile.in: Add filter_filename support.
698 * ppc-instructions (dcbi, icbi): Make these NOPs rather than
699 invalid instructions.
701 * configure.in: Add support for more --enable-sim-* switches.
702 Use config.make and config.hdr to write to Makefile and config.h
703 respectively. Don't rewrite Makefile, just append to it.
704 * configure: Regenerate.
705 * config.{make,hdr}: New shell scripts.
707 * Makefile.in: Remove all variables set by configure.in.
708 (psim.o): Depend on $(BUILT_SRC) also.
710 * emul_netbsd.c (do_gettimeofday,do_getrusage): When comparing an
711 integer, use 0, not NULL.
715 * configure.in: Add support for --enable-sim-inline,
716 --enable-sim-bswap, --enable-sim-cflags, --enable-sim-complex,
717 --enable-sim-switch, --enable-sim-duplicate, --enable-sim-filter,
718 and --enable-sim-endian switch to control various Makefile
720 * configure: Regenerate from configure.in.
721 * Makefile.in: Add various Make variables that the various
724 * std-config.h (DEFAULT_INLINE): Don't set this to 2 if using GCC
725 and optimizing by default.
729 * bits.h (ROTL32, ROTL64): Were functions, made them macros, now
730 make them functions again. Appears 2.6.3 is confused by just a
735 * ppc-endian.c (SWAP_8): Fix 8 byte swap!
737 * psim.c (psim_create): Not correctly checking that runtime
738 configuration of things like ENDIAN, ENVIRONMENT and ALIGNMENT
739 matched the compiled in ones.
741 * debug.h (ITRACE), igen.c: Tidy up more tracing flags -
742 trace_semantics is now different to trace_idecode, the former
747 * ppc-instructions (mtsrin): Missing instruction
748 * ppc-instructions (mfsrin): Missing instruction
749 * ppc-instructions (eieio): Missing instruction
753 * build-psim: New shell script - see internals for usage,
754 simplifies the process of building custom simulators.
758 * std-config.h (SEMANTICS_INLINE): Tidy up notes on each of the
759 INLINE macros. Make SEMANTICS_INLINE == 1 if DEFAULT_INLINE == 2.
760 Don't use DEFAULT_INLINE to define REGISTERS_INLINE DEVICES_INLINE
761 DEVICE_TREE_INLINE or INTERRUPTS_INLINE as none of these are on
762 the instruction or data critical paths.
764 * FIXME: need to set up OS_EMUL_INLINE/EMUL_GENERIC_INLINE but
765 not on critical path.
767 * FIXME: devices.c/emul_netbsd.c would benefit (slightly) from
768 the inclusion of device_tree.c/emul_generic.c.
772 * os_emul.[hc], emul_generic.[hc], emul_netbsd.[hc]: replace
773 system.[hc]. Start of suport for multiple emulations and
774 emulation state (os_emul object).
776 * emul_generic.[hc]: Start of code to implement proper system call
781 * cpu.h, cpu.c (cpu_init): New function, zero the registers before
782 the processor is started. Fixes problem of registers being
783 undefined when restarting from within gdb.
785 * cpu.h, cpu.c (cpu_flush_icache): New function, flushes the
786 instruction cache (if present). Fixes problem of cpu caching gdb
787 breakpoint instructions.
789 FIXME: PSIM sometimes aborts calling error(), it should instead
790 call sim_error() say which takes care of housekeeping such as
791 saving the CIA before calling error.
793 * NOTE: cpu_flush_cache() instead of cpu_synchronize_context() is
794 used when restarting a simulation because the latter has the
795 unwanted side effect (well I as a kernel hacker think it is) of
796 performing an isync when the instruction stream doesn't contain
801 * mon.h (new), mon.c (new), std-config.h (WITH_MON): Performance
802 monitoring module. Counts both instructions issued and
805 * NOTE: mon does not contain to count instruction loads as this
806 information is already available from the mon_issue() hook.
808 * FIXME: mon doesn't have access to register usage information.
809 This is needed if the user wants to monitor things like register
812 * igen.c (lf_print_c_semantic), vm_n.h: Add counting code.
814 * psim.h, psim.c (psim_create), cpu.h, cpu.c (cpu_create): Attach
815 a common monitor to each of the cpus. Delete
816 cpu_increment_number_of_insns() and cpu_get_number_of_insns()
817 replaced by copied code in mon.[hc].
821 * sim_calls.c, main.c, psim.c (psim_create): always create
822 `WITH_SMP' cpus. The actual number of CPU's active in a
823 simulation run is taken from the device node: /init/smp (an
824 integer). WITH_SMP changed to 2 (remember to put it back to 0).
828 * system.c: More system call emulation. If code appears NetBSD
829 specific, make conditional to being compiled on a NetBSD system
834 * Makefile.in, gen.c(delete), igen.c(new), dgen.c(new),
835 lf.[ch](new), table.[ch](new): Split into two generators - igen
836 that outputs the instruction tables and dgen that outputs the spr
837 tables. Add -f (filter out) flag to igen to filter out certain
838 instructions (ex 64 bit ones) from the created tables. Include
839 $(LIBIBERTY_LIB) in link options in case host lacks some libc
842 * NOTE: igen, since it was originally written for the
843 PowerPC/RS6000, things the MSB is 0 and the LSB is 63{31}.
845 * Makefile.in, std-config.h, ppc-cache-rules(new),
846 ppc-opcode-complex(new), ppc-opcode-simple(new): (for igen) Create
847 cache-rule and opcode-rule tables from macros found std-config.h.
848 Delete corresponding macro's from std-config.h.
850 * FIXME: under this new igen scheme, when playing around with igen
851 options, you'll find that depenencies don't work very well.
853 * igen.c (gen_itable_c, gen_itable_h), Makefile.in: code to output
854 an table of all the instructions. Code to output a type
855 enumerating all the instructin names.
857 * igen.c(lf_print_c_semantic): Move call to increment instruction
858 counter so that it occures _after_ the instruction has been fully
859 validated, was double counting illegal/invalid instructions. Add
860 conditional so only compiled in when WITH_PROFILE enabled (enabled
863 * igen.c, cpu.h, cpu.c(cpu_increment_number_of_insns): Include
864 itable.h, count individual instruction types not just total,
865 adjust reporting functions to output this.
867 * ppc-instructions (64 bit Load Doubleword with Update Indexed):
868 Had 32./ instead of 31./
870 * ppc-instructions (64 bit Store Double Word Conditional Indexed):
871 bitrot - updated to use newer CR register operators.
873 * ppc-instructions (64bit Floating Convert from Integer
874 Doubleword): Correct call to Round_Float().
878 * basics.h: #include "sim_callbacks.h" earlier so that its
879 prototypes are declared in all other header files.
881 * bits.h, bits.c, idecode_expression.h (ROTL32, ROTL64): Update
882 doc in bits.h, remove dead code in bits.c, move ROTL32/ROTL64 into
885 * FIXME: the bits.h/bits.c macro's should be replaced with
886 (inline) c functions.
888 * cpu.c(cpu_add_commas), device_tree.h, device_tree.c(scand_*):
889 Add size of buffer argument to functions writing a string into a
890 buffer. Check for buffer overflow.
894 * devices.h, devices.c, debug.h, debug.c: add macro's for tracing
895 of each device. Make parameter names consistent so macros work.
896 Use macro's in device functions.
898 * device_tree.c, devices.h, devices.c: include path to device in a
899 devices node when creating it.
901 * device_tree.c, debug.h, debug.c: Add tracing of `device-tree'.
903 * core.c: add tracing of core-device, adjust parameter names in
904 core functions to be consistent with those in devices*.
908 * debug.h, debug.c (trace_option): New function. Parses the trace
909 option, updating the trace array.
911 * debug.h, debug.c (trace_usage): New function. Outputs the list
912 of all possible trace options.
914 * sim_calls.c (sim_open), main.c (main): Use new trace_option() to
915 parse trace options specified with the simpler -t flag. Adjust
918 * FIXME: basic parsing of command line options is still duplicated
919 by main.c and sim_calls.c
923 * Makefile.in (clean): Delete *.i and *.out files.
925 * ppc-endian.c (SWAP_n): Add SET argument to allow use of SWAP
926 macros for either assignment or return. Fix SWAP_8 to use a
927 union, and two SWAP_4's. Delete SWAP_N, since nobody uses it now.
928 (ENDIAN_N): Add SET argument to SWAP_n calls. Delete macro defs
929 that hardwired swapping on/off, let optimizer delete dead code.
931 * main.c (main): Add printf that we caught a signal and print out
936 * Makefile.in: Remove tabs from otherwise empty line.
937 Confuses many non-GNU versions of "make".
941 * Makefile.in (clean): Delete files produced by gen.
945 * gen.c (lf_print_c_semantic_function): Move counting # of
946 instructions here so it works with caching.
947 (gen_idecode_c): Move from here.
951 * gen.c, ppc-instructions, psim.c: Fix code for generating
952 cracking instruction cache. Delete the code that cached just the
953 result from doing an instruction lookup - this ran slower than no
958 * Makefile.in (gen.o): Include $(INLINE_CFLAGS).
960 * debug.h (ppc_trace): Rename from trace, to avoid a conflict with
961 TCL when gdb is linked with the simulator.
962 * debug.c (ppc_trace): Ditto.
963 * sim_calls.c (sim_open): Change trace -> ppc_trace.
964 * main.c (main): Ditto.
966 * cpu.c (cpu_add_commas): Remove extra static.
970 * Makefile.in (psim.o): Now that inlines are turned on, make
971 psim.o depend on all sources.
973 * cpu.c (cpu_add_commas): New function to format a long with
975 (cpu_print_info): Use it to print number_of_insns.
977 * ppc-endian.c (SWAP_n): New macros to speed up byte swapping for
979 (ENDIAN_N): If both target and host byte orders are known, don't
980 bother testing CURRENT_{TARGET,HOST}_BYTE_ORDER.
982 * ppc-endian.h (target specific H2T_n/T2H_n macros): Remove #if 0
983 to allow target specific H2T_n/T2H_n macros to be used.
984 (htonl, ntohl): If compiled on a 486 by GCC and WITH_BSWAP is
985 non-zero, redefine the htonl/ntohl macros to use the BSWAP instead
986 of the 3 instruction sequence that runs on 386s.
988 * std-config.h (WITH_{HOST,TARGET}_BYTE_ORDER): Don't override if
989 specified on the compile line.
990 (WITH_BSWAP): If not defined, define as 0.
992 * Makefile.in (INLINE_CFLAGS): Add -DDEFAULT_INLINE=2 to add
993 default inline support. Pass INLINE_CFLAGS when compiling.
995 * devices.{h,c} (unimp_device_ioctl): Use STATIC_DEVICES, not
996 INLINE_DEVICES since GCC doesn't like inline functions that
997 accept variable arguments.
998 (stack_ioctl_callback): Make function just static because GCC
999 doesn't like inline functions that accept variable arguments.
1001 * devices.h (STATIC_DEVICES): Define as empty if not defined.
1003 * inline.c: Correct pathnames of included C files to match current
1006 * inline.h (STATIC_DEVICES): If DEVICES_INLINE is defined to be
1007 non-zero, define STATIC_DEVICES to be static.
1009 * std-config.h (INLINE): If GNU C and optimizing, define this as
1011 (DEFAULT_INLINE): If not defined, define as 0.
1012 (ENDIAN_INLINE): If not defined, define as DEFAULT_INLINE.
1013 ({CORE,VM,CPU,EVENTS,REGISTERS,INTERRUPTS}_INLINE): Ditto.
1014 ({SPREG,IDECODE}_INLINE): Ditto.
1018 * ppc-instructions: Initial cut of floating point suport added.
1019 Of note include - use of host IEEE floating point instructions,
1020 use of PowerPC manual pseudo code to handle the FPSCR. It is not
1021 currently a pretty sight.
1023 * memory_map.h, memory_map.c, memory_map_n.h, core.h, core.c:
1024 merge into core.h, core.c, core_n.h. The type memory_map replaced
1025 with core_map. This removes a level of pointer indirection when
1026 translating an address.
1028 * memory_map.h, memory_map.c, memory_map_n.h: delete.
1030 * Makefile.in et.al (sorry): tweek to use new core, core_map and
1035 * sim_calls.c, main.c: Add -g (trace_gdb) option, add tracing to
1036 most of the other functions in sim_calls.c.
1038 * basics.h (CONCAT3), memory_map.c, memory_map_n.h, Makefile.in:
1039 Add macros to better cover up `generic' code. Makes it possible
1040 to step through the generic code!
1042 * vm.c, vm_n.h, Makefile.in: ditto
1046 * devices.h, devices.c, memory_map.h, memory_map.c: Changed
1047 callback interface so that there is a read/write buffer but no
1048 read/write_word. VEA default memory read/write handler sometimes
1049 couldn't resolve an access and of those some were for a memory
1050 fault and some were because gdb was making a bogus request.
1052 * devices.h, devices.c, memory_map.h, memory_map.c, vm.h, vm.c:
1053 eliminate transfer_mode (raw or cooked) parameter from read/write
1058 * ppc-instructions (fmul, fmuls): correct instruction format - had
1063 * psim.c, device_tree.h, device_tree.c, devices.c (printd_*,
1064 scand_*): new functions to parse/print fields in device names
1065 while hiding any machine dependency.
1067 * devices.c, psim.c: Change the stack init code so that it is
1068 handled by a device. Arguments passed across using a device ioctl
1071 * devices.h, devices.c: device ioctl callback changed to allow a
1072 variable number of arguments. This gives greater flexability and
1073 greater chance of bugs.
1077 * main.c (printf_filtered, error): Missing va_end() to close off
1078 variable argument use.
1080 * Makefile.in (tmp-gencode): comment out hack to get around some
1081 versions of make not handling files being created as side-effects.
1083 * gen.c (lf_open): Add -n (real_file_name) option. Specifies an
1084 alternative file name to use in output files for things like #line
1087 Makefile.in (tmp-gencode): Use gen -n so that debug info is
1090 * Makefile.in (TARGETLIB): Use this instead of libsim.a in the
1095 * sim_calls.c (sim_set_callbacks): Define new function.
1099 * psim.c (psim_print_info): Print exit status or signal number.
1103 * cpu.c (struct _cpu): Add number_of_insns field to trace how many
1104 instructions are executed.
1105 (cpu_increment_number_of_insns): New function to increment the
1106 number of instructions issued.
1107 (cpu_get_number_of_insns): New function to return the number of
1108 instructions issued.
1109 (cpu_print_info): New function to print cpu related information.
1110 At present, print the number of instructions executed.
1112 * gen_idecode_c: Emit call to cpu_increment_number_of_insns within
1115 * psim.c (psim_print_info): New function to iterate over each of
1116 the CPU's calling cpu_print_info.
1118 * psim.h,cpu.h: Add new declarations.
1120 * sim_calls.c (sim_open): Add argument processing to add the same
1121 switches main.c accepts for the standalone processor.
1122 (sim_close): Call psim_print_info if -I.
1124 * main.c (main): Add comment saying to update sim_calls.c when
1125 adding switches. Add -I to call psim_print_info when done.
1126 (usage): Update usage message.
1130 * main.c (printf_filtered): Correct to match new prototype.
1134 * sim_callbacks.h (printf_filtered): Correct prototype.
1138 * device_tree.c (OEA_MEMORY_SIZE): Define if not defined to
1140 (clayton_memory_size): Define as OEA_MEMORY_SIZE.
1142 * std-config.h (WITH_TRACE): Default to 1 now.
1144 * psim.c (write_stack_arguments): Don't write any stack arguments
1147 * main.c (main): Switch to using getopt. Make -p also set
1148 trace_semantics. Make -a turn on all trace flags. Make -C turn
1151 * device_tree.c (create_option_device_node): Assume a program is
1152 OEA if the start address is < 4096, not just == 0.
1156 * Makefile.in (maintainer-clean): New synonym for realclean.
1160 * registers.c (register_description): Add gdb synonyms for cr
1165 * Makefile.in (install): Don't install in $(tooldir).
1167 * configure.in: Call AC_CONFIG_HEADER. Don't try to use
1168 bfd/hosts/*.h file or bfd/config/*.mh file. Call AC_PROG_CC and
1169 AC_PROG_RANLIB. Substitute in values for CFLAGS, HDEFINES, AR,
1170 and CC_FOR_BUILD. Call AC_CHECK_HEADERS for various header files.
1171 Touch stamp.h if creating config.h.
1172 * configure: Rebuild.
1173 * config.in: New file, created by autoheader.
1174 * Makefile.in (AR): Define as @AR@.
1175 (CC): New variable, defined as @CC@.
1176 (CFLAGS): Define as @CFLAGS@.
1177 (CC_FOR_BUILD): New variable, defined as @CC_FOR_BUILD@.
1178 (RANLIB): Define as @RANLIB@.
1179 (HDEFINES, TDEFINES): New variables.
1180 (@host_makefile_frag@): Remove.
1181 (mostlyclean): Make the same as clean, not distclean.
1182 (clean): Remove config.log.
1183 (distclean): Remove config.h and stamp-h.
1184 (Makefile): Don't depend upon @frags@. Just rebuild Makefile when
1185 invoking config.status.
1186 (config.h, stamp-h): New targets.
1187 (gen, gen.o): Build with CC_FOR_BUILD, not CC.
1188 (ppc-config.h): Rename from old config.h build.
1189 * (basics.h,gen.c,ppc-endian.c,psim.c): Include ppc-config.h.
1193 * configure{,.in}: Don't include sysdep.h from bfd, since bfd no
1195 * basics.h (sysdep.h): Don't include it.
1196 * Makefile.in (BASICS_H): Remove sysdep.h.
1200 * core.c (core_add_data): First growth of bss was being put at
1201 wrong address (0) instead of &end.
1203 * core.c (core_add_stack, core_add_data): Was not handling case
1204 where bss/stack is grown across the current end-of-{bss,stack}.
1208 * system.c (system_call): Fix SYS_break - was aligning bss to a
1209 page boundary instead of just an 8 byte one; On first call sbrk(0)
1214 * Makefile.in (install): Fix install rule.
1218 * system.c (system_call): Add read support.
1220 * main.c (main): -t sets trace_device_tree. Correct usage message
1223 * device_tree.c (update_memory_node_for_section): Make tracing
1224 output line up. If not code or readonly, assume that the section
1225 is a data section and has read/write permissions. Add readonly
1228 * core.c (create_core_from_addresses): Print end address in traces
1229 and make tracing output line up.
1231 * Makefile.in: Rewrite from Makefile to work with the Cygnus
1232 environment, and support compiling in a different directory than
1233 the sources reside in.
1235 * ppc-endian.h: Rename from endian.h so that it doesn't get
1236 confused with /usr/include/sys/endian.h on Linux. Add Linux
1239 * ppc-endian.c: Rename to be consistant with ppc-endian.h.
1240 Include ppc-endian.h, not endian.h.
1242 * basics.h (sysdep.h): Include sysdep.h that configure makes.
1243 Include ppc-endian.h, not endian.h.
1245 * std-config.h: Rename from ppc-config. Put #ifndefs around most
1246 configuration macros, so they can be overridden via CFLAGS. By
1247 default, turn off tracing.
1249 * configure.in: Clone from other simulator targets.
1250 * configure: Generate via autoconf from configure.in.
1254 * ppc-instructions: fix srawi (was geting XER[CA] real wrong).
1256 * interrupts.c (data_storage_interrupt): allow stack to grow by
1257 upto one MB per increment.
1259 * ppc-instructions: divw was computing rA / rA not rA / rB
1261 * main.c (main): really stupid. Wasn't exiting with correct status
1265 * system.c (system_call): add system calls kill(2) and getpid(2).
1267 * main.c (main): Check/return exit status when simulation
1272 * device_tree.c (create_option_device_node): Alignment rules (at
1273 least for the moment) now are for strict alignment only for LE OEA
1274 mode. (Because of compiler problems).
1276 * system.c (system_call) SYS_exit: Wasn't exiting with correct status.
1280 * vm.c (DEFINE_VM_DATA_MAP_WRITE_N): For miss aligned transfer
1283 * system.c (system_call): didn't page align break argument before
1284 determining increment break increment.
1286 * psim/ppc: Re-arange entire directory structure so that
1287 everything lives in the one directory. While a pain for cleaning,
1288 makes building across multiple architectures much simpler.
1290 * devices.c, device_tree.c: Added code that provides a simple
1291 illustration of how an interrupt control device could be
1294 * devices.c: Added code so that the dumb console device can read
1295 (from stdin) as well as write to stdout.