Check lf_printf for type correctness
[binutils-gdb.git] / sim / ppc / ChangeLog
1 Fri Nov 24 11:24:34 1995 Michael Meissner <meissner@tiktok.cygnus.com>
2
3 * lf.h (__attribute__): If not GCC and at least 2.7.0, define as
4 nothing.
5 (lf_printf): Add printf __attribute__, so the compiler will
6 automatically check the format string.
7
8 * configure{,.in} (--enable-sim-icache): If argument is define,
9 add -R to flags passed to igen.
10
11 * igen.c (stdlib.h): Include if the system supplies one.
12 (semantics_use_cache_struct): New global for -R flag to say
13 semantics is to use the cache structure directly rather than
14 putting the values into local variables.
15 (first_undef, last_undef): New structures to remember names to
16 #undef if -R.
17 (lf_print_c_extraction): If -R and this is semantics, emit names
18 as #defines pointing to the cache structure, rather than loading
19 the values into local variables.
20 (lf_print_c_semantic_function): If -R, #undef all of the names
21 defined in lf_print_c_extraction.
22 (main): Recognize -R.
23
24 * idecode_fields.h (SPR_*): Redefine spr_* macros as SPR_* to
25 avoid a name confict if -R passed to igen.
26
27 * ppc-instructions (mfspr, mtspr): Rename spr field to SPR.
28 (model_data): Add field to count the various # of CRs that the
29 mtcrf instruction used.
30 (model_mon_info): Return structures counting the # of CRs that the
31 mtcrf instruction used.
32 (branches, sync instructions): Do not call model functions if
33 WITH_MODEL_ISSUE is 0.
34
35 * mon.c (stdlib.h): Include if the system supplies one.
36 (mon_sort_instruction_names): New function to sort instruction
37 names alphabetically.
38 (mon_print_info): Call qsort with mon_sort_instruction_names to
39 sort instruction names. Don't abort if WITH_MODEL_ISSUE is 0.
40
41 * debug.h (ITRACE): Make printf_filtered arguments type correct.
42 * idecode_expression.h (CR0_COMPARE): Ditto.
43 * psim.c (psim_read_register): Ditto.
44
45 * igen.c (lf_print_my_prefix): Use __attribute__((__unused__)) to
46 silence compiler warnings about unused automatically generated
47 variables.
48 (lf_print_c_extraction): Ditto.
49 * idecode_expression.h (FPSCR_BEGIN): Ditto.
50
51 * ppc-cache-rules: Define rules for making a bitmask for all
52 registers.
53
54 * ppc-instructions: Rewrite model specific functions to use the
55 bitmask of the register number, instead of using the register
56 pointer to get the register number, and then making the bitmask.
57
58 Wed Nov 22 15:24:27 1995 Michael Meissner <meissner@tiktok.cygnus.com>
59
60 * ppc-instructions (model_branches): Add conditional argument to
61 count the number of times each type of conditional branch is used.
62 (conditional branches): Pass B0 or -1 to model_branches.
63 (model_mon_info): Print out conditional branch counts.
64 (model-data): Add support for printing out conditional branch
65 types.
66
67 Tue Nov 21 16:31:25 1995 Michael Meissner <meissner@tiktok.cygnus.com>
68
69 * igen.c (insn_table_load_insns): Add support for model-static for
70 internal functions that should not be inlined.
71 (lf_print_c_semantic): Remove model_cleanup.
72 (gen_model_{c,h}): Ditto.
73
74 * ppc-instructions: Redo model specific support once again. Add
75 floating point support to the model specific information. Flesh
76 out all of the floating mutiply add/subtract instructions. Add
77 better tracing support to the model specific information.
78
79 Sun Nov 19 23:00:52 1995 Michael Meissner <meissner@tiktok.cygnus.com>
80
81 * ppc-instructions (model data, model_busy): Rather than using a
82 bit mask for the busy units, just use a char array. Also, only
83 support 2 function units an insn can use, rather than a loop.
84
85 Fri Nov 17 14:08:08 1995 Michael Meissner <meissner@tiktok.cygnus.com>
86
87 * table.c (table_entry_read): Move setting entry->line_nr to after
88 the model specific fields so the line numbers for the annex are
89 correct.
90
91 * cpu.c (cpu_{create,init,halt}): Check for WITH_MODEL_ISSUE
92 before calling the model functions.
93
94 * debug.c (trace_descriptor): Add trace_model support.
95 * debug.h (trace_options): Ditto.
96
97 * igen.c (gen_icache_h): Create type idecode_cache as void if not
98 caching instructions.
99 (gen_model_{c,h}): Drop model_issue support. Add support for
100 model_cleanup.
101 (lf_print_my_prefix): Initialize a const itable_index with the
102 current index.
103 (lf_print_c_semantic): Call model_cleanup at the end of the
104 function to check for instructions that aren't supported yet by
105 the scheduling code.
106
107 * mon.h (count_type): New type for counters.
108 * mon.c: Use count_type instead of unsigned.
109
110 * ppc-instructions: Redo scheduling code once again. Make it all
111 inline friendly. Instead of having general code emitted by igen,
112 go the route of having each semantic routine call the appropriate
113 module.
114
115 Thu Nov 16 09:52:26 1995 Michael Meissner <meissner@tiktok.cygnus.com>
116
117 * table.c (table_entry_read): Allow the annex to have blank lines.
118
119 * ppc-instructions: Change lines in model stuff that just have a
120 tab to just newline. Add 601 support. Document most instructions
121 in terms of model specific timing information. Drop 'FUNCTION'
122 from PPC_FUNCTION_UNIT_xxx enums. Change PPC_UNIT_UNKNOWN ->
123 PPC_UNIT_BAD. Add TRACE(trace_tbd) for all data cache
124 instruction.s. Signal illegal instruciton if data cache block
125 invalidate is issued from problem state.
126
127 * igen.c (max_model_fields_len): New static to keep track of the
128 max size for the model specific fields.
129 (model_c_insn): Use max_model_fields_len to size fields.
130 (insn_table_insert_insn): Set max_model_fields_len.
131 (model_table_insert): Ditto.
132 (gen_model_{c,h}): Model_issue is now called with a processor
133 argument.
134
135 * debug.c (trace_description): Add support for trace_tbd.
136
137 * mon.c (mon_issue): Pass processor argument to model_issue.
138
139 * Makefile.in: Delete all function unit support, since the newer
140 table driven model support replaces it.
141 * cpu.{c,h}: Ditto.
142 * mon.c: Ditto.
143 * inline.{c,h}: Ditto.
144 * std-config.h: Ditto.
145 * options.c: Ditto.
146 * configure{,.in}: Ditto.
147 * Makefile.in: Ditto.
148 * psim.c: Ditto.
149 * function_unit.{c,h}: Delete these now usused files.
150
151 * std-config.h (WITH_MODEL_ISSUE): Add new macro on whether to
152 trace instructions in a model specific manor.
153 * options.c (print_options): Print it out.
154 * configure{,.in}: Add --enable-sim-model-issue option.
155 * Makefile.in: Add --enable-sim-model-issue flags.
156 * igen.c (lf_print_c_semantic): Add call to mon_issue here. Check
157 for WITH_MODEL_ISSUE.
158 * mon.c (mon_issue): Remove call to mon_issue_here.
159
160 * ppc-instructions: Move branch tracing to the actual branch
161 instructions, rather than testing it in model_issue. Add code to
162 code successful/unsuccessful branch predictions, and the number of
163 conditional branches that fell through.
164
165 Wed Nov 15 17:32:13 1995 Michael Meissner <meissner@tiktok.cygnus.com>
166
167 * cpu.h (cpu_model): Add declaration.
168
169 * cpu.c (struct _cpu): Add model_ptr to hold model specific
170 information.
171 (cpu_model): Return the model internal pointer.
172 (cpu_{create,init,halt}): Call the appropriate model function.
173
174 * inline.c (mon.c): Move include of mon.c after model.c.
175
176 * mon.c (_cpu_mon): Add fields to count unaligned memory
177 references.
178 (mon_issue): Call model_issue, not function_unit_issue.
179 (mon_{read,write}): Count # of unaligned memory accesses.
180 (mon_print_info): Switch to calling model_mon_info and
181 model_mon_info_free instead of function_unit version. Print out
182 number of unaligned reads/writes.
183
184 * {ppc-instructions,igen.c}: More global changes to add model
185 specific features.
186
187 * inline.{c,h}: Provide for inlining options.c.
188 * options.{c,h}: Ditto.
189 * std-config.h: Add OPTIONS_INLINE.
190
191 Tue Nov 14 04:47:25 1995 Michael Meissner <meissner@tiktok.cygnus.com>
192
193 * Makefile.in (devices.o, main.o): Update dependency.
194
195 * igen.c (gen_model_h): Use correct variable in loop.
196 (gen_model_c): Use strcmp, strcasecmp.
197 (gen_model_c): Use EXTERN_MODEL for arrays.
198 (gen_model_h): Use STATIC_MODEL for arrays.
199 (lf_print_c_semantic_function_header): Delete unused function.
200
201 * main.c (cpu.h): Include cpu.h to get model.h.
202
203 * inline.h ({EXTERN,STATIC}_MODEL): Define.
204
205 Mon Nov 13 09:14:13 1995 Michael Meissner <meissner@tiktok.cygnus.com>
206
207 * igen.c ({insn,model}_table_fields): Spell mnemonic correctly.
208 (gen_itable_h,itable_c_insn): Ditto.
209 (model support): Move model support around, add support for
210 model-data, model-internal. Use annex field for model-macros
211 now.
212
213 * configure.in (--enable-sim-inline): If --enable-sim-inline=no,
214 also define INLINE as nothing.
215 * configure: Regenerate.
216
217 * std-config.h (INLINE): Rather than nuking INLINE, only define it
218 as __inline__ if any of the INLINE flags are non-zero.
219
220 * options.c (print_options): Print out WITH_XOR_ENDAIN.
221
222 Mon Nov 13 23:03:45 1995 Andrew Cagney <cagneyhighland.com.au>
223
224 * ppc-instructions (rfi): Add missing code.
225
226 * cpu.c (cpu_get_time_base): Fix calculation of current value of
227 time base register.
228
229 * ppc-spr-table (TBL, TBU): Fix TBL/TBU entries - was confusing
230 m[tf]tb with m[tf]spr.
231
232 * ppc-instructions (mtspr, mfspr): Fix mttbl - wasn't storing
233 lower word.
234
235 Mon Nov 13 21:35:37 1995 Andrew Cagney <cagneyhighland.com.au>
236
237 * std-config.h (INLINE, STATIC_INLINE): Was being set to static
238 inline.. Only problem being that with ppc-opcode-simple this gave
239 it the chance to inline all the idecode functions with potentially
240 disasterous results on a 16mb PC. For moment hobble INLINE.
241
242 * configure.in, std-config.h (WITH_SMP): Make that 5 processors by
243 default ...
244
245 * configure.in: Tweek flags passed to gcc for --with-sim-warnings.
246 Firstly make them errors and secondly remove the options gcc-245
247 doesn't reconize.
248
249 Mon Nov 13 17:57:24 1995 Andrew Cagney <cagney@highland.com.au>
250
251 * misc.c (zalloc), cpu.c (cpu_init), devices
252 (console_io_read_buffer_callback, icu_io_read_buffer_callback,
253 vm_io_read_buffer_callback), main.c (zalloc), mon.c (memset),
254 sim_calls.c (zalloc) : replace bzero() with memset().
255
256 * emul_netbsd.c (write_direntries), psim.c (psim_read_register,
257 psim_write_register): replace bcopy() with memcpy().
258
259 Sun Nov 12 20:55:41 1995 Andrew Cagney <cagneyhighland.com.au>
260
261 * configure.in: for --disable-sim-inline (--enable-sim-inline=no),
262 force DEFAULT_INLINE to 0 rather then trusting the std
263 configuration.
264
265 Sun Nov 12 20:55:41 1995 Andrew Cagney <cagneyhighland.com.au>
266
267 * igen.c (lf_print_idecode_table, idecode_table_leaf): Fix
268 generation of switch entries in tables - treat the same as
269 cracking/semantic functions.
270
271 * igen.c (idecode_switch_end, idecode_switch_leaf): Fix generation
272 of a boolean switch statement (field zero or non-zero).
273
274 * ppc-opcode-test-1, ppc-opcode-test-2: New files. These test the
275 switch/table generation ability of igen.
276
277 * igen.c (idecode_switch_leaf): Fix code output when a switch
278 statement needs to look up a table.
279
280 * igen.c (idecode_declare_if_switch): New function called from
281 gen_idecode_c - need to declare any idecode switch functions
282 before they are used in idecode tables.
283
284 * igen.c (lf_print_c_cracker_function, idecode_crack_leaf,
285 idecode_crack_insn): Add is_inline_function argument to code
286 printing cracker functions which indicates if STATIC_IDECODE or
287 STATIC_INLINE_IDECODE should be used for definition. For
288 idecode_crack_insn (which implies not duplicating/expanding) don't
289 declare function as inline - we assume that the only time this is
290 code is generated is when things are being tested. For
291 idecode_crack_leaf, make static (instead of INLINE) if the
292 instructions parent is a table as function will always be called
293 via a table.
294
295 * igen.c (idecode_expand_if_switch): Declare as STATIC_IDECODE not
296 STATIC_INLINE_IDECODE. Only the outermost idecode switch will be
297 called directly, all others are called via a table.
298
299 * igen.c (lf_print_semantic_function_header, semantics_h_leaf,
300 semantics_h_insn, semantics_h_function,
301 lf_print_c_semantic_function, semantics_c_function): Add
302 is_inline_function argument to lf_print_semantic_function_header
303 to indicate if an inline or static function declaration/definition
304 should be output. Depending on situtation call accordingly:
305 functions (not instruction semantic routines) are always inline;
306 Semantic routines are made inline when there is no icache (cache
307 will contain the function address) and are duplicating (see above)
308 and the parent of the instruction is a switch statement.
309
310 * igen.c (opcode_field_new): Delete. Code changed to use ZALLOC
311 and moved to insn_table_find_opcode_field.
312
313 * table.c (table_open): Fix typo (nr_model_fields vs nr_fields).
314
315 * igen.c (model_c_insn): Suggestion - document the name of the
316 instruction on each line of the instruction model table.
317
318 Fri Nov 10 00:44:38 1995 Andrew Cagney <cagneyhighland.com.au>
319
320 * emul_netbsd.c (do_ioctl): Cleanup compilation.
321
322 * sim_callbacks.h (__attribute__): Only define if not defined (was
323 already defined on NetBSD host).
324
325 Wed Nov 8 21:49:52 1995 Andrew Cagney <cagneyhighland.com.au>
326
327 * std-config.h (WITH_XOR_ENDIAN), configure.in, Makefile.in: New
328 macro, indicates if the PowerPC's horrible XOR endian mode should
329 be suported. Add to configure and make.
330
331 * vm_n.h (vm_data_map_read_N, vm_data_map_write_N), vm.c
332 (vm_instruction_map_read): If XOR endian, xor the address
333 with a value from an xor table (indexed by size of access).
334
335 * vm.c (vm_synchronize_context), cpu.c (cpu_synchronize_context):
336 set up xor table to xor if there is a conflict between the
337 CURRENT_TARGET_ENDIAN and the endian indicated in the MSR. Move
338 check of suported change of endian mode from cpu.c to vm.c.
339
340 * vm.c (vm_data_map_write_buffer, vm_data_map_read_buffer):
341 Hopefully added correct hack to handle XOR endian mode.
342
343 FIXME: If NONSTRICT alignment and XOR ENDIAN and MSR indicates
344 little endian mode, the model accepts miss aligned transfers.
345
346 FIXME: Need to create an `init' device that, during
347 initializatioin for XOR mode, it mushes (XOR address) all the dma
348 data before passing it on to the core for storage. Just like the
349 real thing really.
350
351 Wed Nov 8 21:49:52 1995 Andrew Cagney <cagneyhighland.com.au>
352
353 * devices.c (halt_io_write_buffer_callback): Use value written to
354 halt device to determine exit status. Thus allowing
355 success/failure of OEA tests.
356
357 Wed Nov 8 00:10:38 1995 Andrew Cagney <cagneyhighland.com.au>
358
359 * ppc-instructions (icbi): If icache present flush it.
360
361 Tue Nov 7 23:36:31 1995 Andrew Cagney <cagneyhighland.com.au>
362
363 * devices.c (htab_init_callback): Add code to create htab/pte.
364
365 * devices.c (dma_file, file_init_callback, htab_init_callback):
366 New function - Dma the named file into memory at the specified
367 address. Use.
368
369 * device_tree.h, device_tree.c (scand_*): New functions.
370
371 Tue Nov 7 23:36:31 1995 Andrew Cagney <cagneyhighland.com.au>
372
373 * filter_filename.c, Makefile.in: Change so that only dependant on
374 a very limited nr of files. Stops an unnecessary dependency.
375
376 Tue Nov 7 15:44:33 1995 Andrew Cagney <cagney@highland.com.au>
377
378 * core.c (core_map_find_mapping): Use cpu_halt rather than error
379 to abort an access to an undefined address.
380
381 Sun Nov 12 07:58:09 1995 Michael Meissner <meissner@tiktok.cygnus.com>
382
383 * igen.c (model_table_insert_{macro,function}): New functions.
384 (insn_table_load_insns): Call them.
385 (gen_model_h): Move section emiting model-macros to be first.
386 (model_{c,h}_function): New functions cloned from semantic
387 functions to print out the prototype and function for
388 model-functions.
389 (gen_model_{c,h}): Print out model-functions.
390
391 * ppc-instructions (model_{start,halt,print_info}): Add dummy
392 model-functions.
393
394 * options.c (print_options): Print out WITH_{,DEFAULT_}MODEL, not
395 WITH_PPC_{,DEFAULT_}_MODEL.
396 (options_ppc): Delete now unused function.
397 (cpu.h): Include cpu.h, not just basics.h.
398
399 * std-config.h (WITH_{,DEFAULT_}MODEL): Define.
400
401 * igen.c (model_macros, last_model_macro): New statics to keep
402 track of macros to go in model.h.
403 (insn_table_load_insns): Add model-macros to model_macros linked
404 list.
405 (model_table_fields): Add field for printable name.
406 (gen_model_h): If there are model macros defined, print them out.
407 Print out DEFAULT_MODEL as the first model if there any models
408 specified, otherwise MODEL_NONE. Print out external decl for
409 current_model. Print out decl for model_set.
410 (gen_model_c): Add function model_set. Switch to use printable
411 name for the model, not the internal identifier used.
412
413 * psim.c (current_model): New global variable.
414
415 * ppc-instructions: Add macros for flag defines. Switch first
416 model so 604 is first.
417
418 * main.c (main): Call model_set, not function_unit_model.
419 * sim_calls.c (sim_open): Ditto.
420 * sim_calls.c, Makefile.in: sim_calls.c now includes cpu.h.
421
422 Sat Nov 11 07:27:41 1995 Michael Meissner <meissner@tiktok.cygnus.com>
423
424 * mon.h (mon_events): New enumeration for other events we want to
425 handle.
426 (mon_event): Add declaration for function.
427
428 * mon.c (mon_event): New function.
429 (mon_print_info): Print icache misses.
430
431 * psim.c (run_until_stop): Monitor icache misses.
432
433 * configure.in (--enable-sim-inline): Fix typos in handling comma
434 separated inline options.
435 (--enable-sim-icache): Echo icache size.
436 * configure: Regenerate.
437
438 * igen.c (semantics_h_print_function): Emit STATIC_SEMANTICS
439 instead of INLINE_SEMANTICS so that the compiler won't keep all of
440 the semantic functions as inline RTL, given that the address of
441 the function is taken which forces outline calls anyway.
442 (lf_print_c_semantic_function_header): Ditto.
443 (gen_semantics_h): Define STATIC_SEMANTICS as nothing if not
444 defined.
445 (lf_print_c_cracker_function): Emit STATIC_IDECODE instead of
446 STATIC_INLINE_IDECODE.
447 (gen_idecode_c): Define STATIC_IDECODE if not defined.
448 (gen_model_h): Use #ifdefs to define types to hold model units,
449 cycles, and flags.
450 (model_table_insert): Add a sentinel functional unit at the end to
451 simplify loop processing.
452 (model_c_insn): Use <function-unit>_SENTINAL instead of 0 for any
453 instruction not specifing a function unit for the current model.
454 (gen_model_{c,h}): Provide bounds for model_time_mapping.
455
456 * inline.h (STATIC_SEMANTICS): Define to be static if
457 SEMANTICS_INLINE is defined.
458 (STATIC_IDECODE): Define to be static if IDECODE_INLINE is
459 defined.
460
461 * options.c (print_options): Fix typo.
462
463 Fri Nov 10 06:39:46 1995 Michael Meissner <meissner@tiktok.cygnus.com>
464
465 * configure.in (--enable-sim-{opcode,config}): Use $srcdir when
466 check for the existence of files.
467 * configure: Regenerate.
468
469 * table.c (table): New field nr_model_fields.
470 (table_open): New parameter nr_model_fields.
471 (table_entry_read): Parse model fields that begin with a '*' after
472 each instruction.
473 * igen.c, dgen.c: Change callers of table_open.
474
475 * igen.c: Add support for dumping model specific information in
476 model.h and model.c.
477 (insn_field_name): Delete unused array.
478 (global variables): Make global variables static, so we can tell
479 when they are no longer used.
480 (cache_semantic_actual): Delete unused variable.
481 (insn_table_load_insns): If the insn is really a machine model,
482 call model_table_insert instead of other processing.
483 (model_table_insert): New function to handle defining the
484 functional units of a particular machine model.
485 (insn_table): Add last_function field so we can add functions at
486 the end.
487 (insn_table_insert_function): Use last_function field when
488 appending new function.
489
490 * ppc-instructions: Add a few model specific information for 603,
491 603e, and 604 for testing purposes.
492
493 * table.h (table_model_entry): New linked list to hold model
494 specific information, one per line.
495 (table_entry): Add model_first, model_last fields.
496
497 * configure.in (--enable-sim-inline): If gcc is found and
498 --enable-sim-inline is not specified, defaine DEFAULT_INLINE to 1,
499 not 2.
500 (--enable-sim-reserved-bits): New switch to check whether reserved
501 bits are set in the instruction.
502 (--enable-sim-opcode): Make complex the default.
503 (all switches): Add appropriate checks and error messages.
504 * configure: Regenerate.
505
506 * Makefile.in (RESERVED_CFLAGS): New variable set by
507 --enable-sim-reserved-bits.
508 (CONFIG_CFLAGS): Include RESERVED_CFLAGS.
509 (BUILT_SRC): igen now generates model.c and model.h.
510 (LIB_OBJ): Include table.o.
511 (tmp-igen): Add -m/-M options to write model.c/model.h.
512 (model.o): New object.
513 (CPU_H): Include model.h.
514
515 * cpu.h: Include model.h.
516
517 * std-config.h (WITH_RESERVED_BITS): Define.
518 (MODEL_INLINE): Ditto.
519
520 * options.c (print_options): Print out WITH_RESERVED_BITS.
521
522 Thu Nov 9 12:22:15 1995 Michael Meissner <meissner@tiktok.cygnus.com>
523
524 * configure.in: If --silent, don't output information messages.
525 * configure: Regenerate.
526
527 * configure.in (--enable-sim-alignment): Fix typo in specifing non
528 strict alignment.
529 (--enable-sim-switch): Make default on.
530 (--enable-sim-duplicate): Make default on.
531 (--enable-sim-smp): Make default 0.
532 (--enable-sim-mon): Don't set sim_float if not set.
533 (--enable-sim-inline): If gcc is found and --enable-sim-inline is
534 not specified, define DEFAULT_INLINE to be 2.
535 (all --enable-sim-* rules): Echo rules set to non empty to file
536 descriptor 6.
537 * configure: Regenerate.
538
539 * options.c (options_env): Fix typo if WITH_ENV is 0.
540 (print_options): Print GCC compiler version if available and
541 date/time options was compiled. If OPCODE_RULES, IGEN_FLAGS,
542 and/or DGEN_FLAGS are defined, print them.
543
544 * Makefile.in (all link actions): Pass SIM_CFLAGS as well as
545 CFLAGS.
546 (options.o): Compile options.o with OPCODE_RULES, IGEN_FLAGS, and
547 DGEN_FLAGS defined, so they can be printed out.
548
549 * igen.c (lf_print_c_validate): Check for WITH_ASSERT, so that
550 this test can be compiled away if the user really wants a fast
551 simulator by not doing assertion failures.
552
553 Wed Nov 8 13:19:47 1995 Michael Meissner <meissner@tiktok.cygnus.com>
554
555 * options.c: New file to print out all of the WITH_ options.
556 * options.h: New include file to declare print_options.
557 * debug.h (trace_options): Add trace_opts to call print_options.
558 * debug.c (trace_description): Add trace_opts support.
559 * main.c (main): If user requested options, print them.
560 * sim_calls.c (sim_open): Ditto.
561
562 * igen.c (opcode_field_new): Add void to make it a proper prototype.
563
564 * emul_generic.c (emul_enter_call): Make printf_filtered arguments
565 type correct.
566 * emul_netbsd.c (do_kill): Ditto.
567 * registers.c (registers_dump): Ditto.
568 * vm.c (om_translate_effective_to_real): Ditto.
569 * vm_n.h (vm_data_map_read_N): Ditto.
570 (vm_data_map_write_N): Ditto.
571 * devices.h (DTRACE_INIT): Ditto.
572 (DTRACE_{ATTACH,DETACH}_ADDRESS): Ditto.
573 (DTRACE_IO_{READ,WRITE}_BUFFER): Ditto.
574 (DTRACE_DMA_{READ,WRITE}_BUFFER): Ditto.
575 * devices.c (update_for_binary_section): Ditto.
576 (write_stack_arguments): Ditto.
577 (stack_ioctl_callback): Ditto.
578 * device_tree.c (device_tree_add_passthrough): Ditto.
579 (device_tree_{add,find}_device): Ditto.
580 (device_tree_{add,find}_integer): Ditto.
581 (device_tree_find_{string,boolean}): Ditto.
582 (device_tree_init{,_device}): Ditto.
583 (device_tree_dump): Ditto.
584 * sim_calls.c (sim_{read,write}): Ditto.
585 (sim_{fetch,store}_register): Ditto.
586 (sim_stop_reason): Ditto.
587
588 * sim_callbacks.h (printf_filtered): Declare with attribute
589 printf, so we can enable format checks.
590
591 * devices.c (console_io_{read,write}_buffer_callback): Cast swtich
592 argument to int, since ANSI doesn't allow long switch values.
593 * emul_netbsd.c (do___sysctl): Ditto.
594
595 * emul_netbsd.c (do___sysctl): Fix up printf call.
596
597 * corefile.c (core_translate): Don't do arithmetic with void *
598 pointers. Cast to char * first.
599
600 * function_unit.c (FUNC_{LOAD,STORE}): Rename from {LOAD,STORE}
601 and change all uses.
602
603 * Makefile.in ({FUNC,MODEL,WARNING}_CFLAGS): New flags set by
604 configure --enable switches.
605 (CONFIG_CFLAGS): Include FUNC_CFLAGS and MODE_CFLAGS.
606 (.c.o): Include WARNING_CFLAGS.
607 (CPU_H): Include function_unit.h.
608 (LIB_OBJ): Include function_unit.o.
609 (BUILT_SRC_WO_CONFIG): Split from BUILT_SRC and do not include
610 config.h or ppc-config.h.
611 (BUILT_SRC): Include BUILT_SRC_WO_CONFIG, config.h and
612 ppc-config.h.
613 (filter_filename.o): Include config.h/ppc-config.h dependencies.
614 (idecode.o, semantics.o, psim.o): Specify CC line without
615 WARNING_CFLAGS so that we don't get all of the unused variable
616 warnings that are generated.
617 (function_unit.o): Add rule to build.
618 (main.o, sim_calls.o): Add function_unit.h, itable.h dependencies.
619 (mon.o): Include mon.c dependency.
620 (TAGS): Depend on BUILT_SRC.
621 (clean): Don't delete config.h or ppc-config.h
622
623 * basics.h (sim_callbacks.h): Move include after the include of
624 config.h and ppc-config.h.
625
626 * bits.{h,c} (ROTL32,ROTL64): Move these functions to bits.c. Add
627 support for BITS_INLINE to inline these. Add declarations to
628 bits.h.
629
630 * configure.in (--enable-sim-warnings): Add new option to specify
631 compiler warnings for all modules except idecode.o and semantics.o
632 which have lots of unused variables because they are machine
633 generated.
634 (--enable-sim-function-unit): New switch to configure whether
635 function unit support is compiled in or not.
636 (--enable-sim-{,default-}mode): New switches to control which cpu
637 model is used.
638 * configure: Regenerate.
639
640 * corefile.c (core_attach_address_callback): Delete unused
641 variable device_address.
642
643 * cpu.c (struct _cpu): Add function unit pointer field func_unit.
644 (cpu_create): If WITH_FUNCTION_UNIT, call function_unit_create.
645 (cpu_init): If WITH_FUNCTION_UNIT, call function_unit_init.
646 (cpu_halt): If WITH_FUNCTION_UNIT, call function_unit_halt.
647 (cpu_function_unit): New function to return func_unit field.
648
649 * cpu.h (function_unit.h): Include new include file.
650 (cpu_function_unit): Declare.
651
652 * debug.c (stdlib.h): Test HAVE_STDLIB_H, not HAVE_STDLIB.
653 (config.h): Include config.h.
654
655 * devices.c (icu_io_write_buffer_callback): Delete unused variable
656 system.
657
658 * emul_generic.c (emul_exit_call): Print out status value.
659
660 * emul_netbsd.c (do_read): Delete unused variable nr_moved.
661
662 * filter_filename.h (includes): Include config.h, ppc-config.h,
663 not basics.h.
664
665 * inline.c: Include bits.c if BITS_INLINE. Include
666 function_unit.c if FUNCTION_UNIT_INLINE.
667
668 * inline.h (INLINE_BITS): Define if BITS_INLINE.
669 (INLINE_FUNCTION_UNIT): Define if FUNCTION_UNIT_INLINE.
670
671 * interrupts.c (instruction_storage_interrupt): Delete unused
672 variable nia.
673
674 * lf.h (config.h): Include config.h.
675
676 * main.c (includes): Include function_unit.c. If HAVE_UNISTD_H,
677 include unistd.h.
678 (usage): Update for -m model, -i, and -I options.
679 (main): Delete unused variables stack_pointer and i. Add support
680 for -i, -m model arguments. Call psim_print_info with verbose ==
681 1 if -i, and verbose == 2 if -I.
682
683 * mon.c (stdio.h): Include stdio.h to pick up sprintf prototype.
684 (mon_issue): Call function_unit_issue if function units are
685 supported.
686 (mon_print_info): Take psim * argument. Print out information
687 from function_unit if available. Move read/write stats to always
688 print, instead of printing if verbose > 1. Fix up plural
689 vs. singular usage.
690
691 * mon.h (mon_print_info): Update prototype.
692
693 * psim.c (current_ppc_model): Add global variable.
694 (psim_print_info): Pass system argument to mon_print_info.
695
696 * sim_calls.c (function_unit.h): Include.
697 (sim_open): Add support for -i and -m model options. If -i call
698 psim_print_info with verbose == 1, if -I, with verbose == 2.
699 (sim_resume): Delete unused variable program_counter.
700
701 * std-config.h (WITH_FUNCTION_UNIT): Define.
702 (ppc_model): Add enumeration giving all PowerPC models currently
703 known about.
704 ({WITH,CURRENT}_PPC_MODEL): Define.
705 (FUNCTION_UNIT_INLINE): Define.
706
707 * table.c (config.h): Include config.h.
708
709 * vm.c (om_virtual_to_real): Print pte_word_{0,1} so the compiler
710 doesn't complain that they're unused.
711
712 * vm_n.h (vm_data_map_read_N): Delete unused variable rval.
713
714 Mon Nov 6 23:15:54 1995 Andrew Cagney <cagney@highland.com.au>
715
716 * sim-endian.c (ppc-endian.c), sim-endian.h (ppc-endian.h):
717 renameed. These files are target independant.
718 * Makefile.in, basics.h: update for new name.
719
720 * sim-endian.h (SWAP_N), sim-endian.c (_SWAP_1): Rename existing
721 SWAP_<N> to _SWAP_<N> so that sim-endian.h can contain SWAP_N
722 macro's as required.
723
724 * sim-endian.c, sim-endian-n.h (new file): Move endian code into a
725 debugable header file.
726
727 * ppc-instructions (Byte-Reverse): Enable byte reverse
728 instructions using SWAP_N macros.
729
730 Mon Nov 6 10:39:28 1995 Michael Meissner <meissner@tiktok.cygnus.com>
731
732 * Makefile.in (config.status): Remove references to config.make
733 and config.hdr.
734
735 * config.{make,hdr}: Delete, no longer used.
736 * build-psim: Ditto.
737
738 Mon Nov 6 20:49:56 1995 Andrew Cagney <cagney@highland.com.au>
739
740 * sim_calls.c (sim_open): Fix parsing of `target sim' options.
741
742 * device_tree.c (device_tree_add_string): Wasn't saving the value
743 of the string being entered into the tree.
744
745 * psim.c (create_filed_device_tree): Not terminating string device
746 names with a null.
747
748 * psim.c (psim_create): Use `env' instead of
749 `environment-architecture' to be consistent with configure.
750 Reconize user/uea, virtual/vea and operating/oea.
751
752 Sat Nov 4 12:29:45 1995 Fred Fish <fnf@cygnus.com>
753
754 * core.c: Rename to corefile.c
755 * core.h: Rename to corefile.h
756 * inline.c: Include corefile.h, renamed from core.h.
757 * cpu.h: Include corefile.h, renamed from core.h
758 * vm.c: Include corefile.h, renamed from core.h
759 * corefile.c: Include corefile.h rather than core.h
760 * README.psim (KNOWN PROBLEMS): Change core.* references to corefile.*
761 references.
762 * Makefile.in (CPU_H): Change core.h to corefile.h
763 (vm.o): Change dependency to corefile.h
764 (LIB_SRC): Change core.c to corefile.c.
765 (LIB_OBJ): Change core.o to corefile.o.
766 (corefile.o): Change dependencies to corefile.c, corefile.h.
767
768 Fri Nov 3 11:37:24 1995 Michael Meissner <meissner@tiktok.cygnus.com>
769
770 * ppc-instructions (data cache instructions): Make all data cache
771 instructions nops instead of invalid instructions.
772
773 * Makefile.in (CONFIG_CFLAGS): Add ALIGNMENT_CFLAGS and
774 TIMEBASE_CFLAGS which weren't included.
775
776 Thu Nov 2 08:54:04 1995 Michael Meissner <meissner@tiktok.cygnus.com>
777
778 * Makefile.in: Uncomment built file dependencies.
779
780 * configure.in: Rewrite --enable-sim switch handling to use the
781 autoconf builtins so it works correctly if the configure or
782 Makefile.in files are modified and make decides to rebuild
783 Makefile. Also document all of the --enable-sim switches
784 supported. Check whether getrusage and sys/resource.h are
785 supported.
786 * config.in: Regenerate.
787 * configure: Regenerate.
788 * Makefile.in: Add support for all of the variables set with
789 --enable-sim switches.
790
791 * Makefile.in (clean): make clean now removes all built sources as
792 well.
793
794 * cpu.c: Use HAVE_STRING_H, HAVE_STRINGS_H, HAVE_UNISTD_H,
795 HAVE_TIME_H, HAVE_SYS_TIMES_H, HAVE_SYS_RESOURCE_H defined in
796 the generated config.h.
797 * debug.c: Ditto.
798 * device_tree.c: Ditto.
799 * devices.c: Ditto.
800 * dgen.c: Ditto.
801 * emul_netbsd.c: Ditto.
802 * igen.c: Ditto.
803 * lf.c: Ditto.
804 * misc.c: Ditto.
805 * psim.c: Ditto.
806 * registers.c: Ditto.
807 * sim_calls.c: Ditt.
808 * table.c: Ditto.
809
810
811 * main.c (main): Call psim_print_info with verbose == 2.
812
813 * mon.c (mon_print_info): Align the cpu number and number of
814 instructions fields. Do not print an instruction category if the
815 CPU did not execute any of those instructions. Print out number
816 of reads and writes. If getrusage is supported, print out number
817 of simulated instructins per second.
818
819 * configure.in: Add support for --enable-sim-opcode=stupid.
820 * configure: Regenerate.
821
822 Wed Nov 1 23:46:59 1995 Andrew Cagney <cagney@highland.com.au>
823
824 * std-config (INLINE_DEVICE_TREE): Don't inline either of
825 device_tree.c or devices.c. There is no significant gain.
826
827 * configure.in, Makefile.in: add --enable-sim-icache=[0-9]* and
828 IGEN_ICACHE macro.
829
830 Wed Nov 1 23:46:59 1995 Andrew Cagney <cagney@highland.com.au>
831
832 * igen.c (main), misc.h (target_a2i, i2target), misc.c: Add
833 functions to convert between target and igen internal bit numbers.
834 Make IO go through these functions. Add -b (bit size) and -h (high
835 bit nr) options to igen. Typical usage would be: ./igen -b 16 -h
836 15 for a 16 bit instruction format with the msb given a number 15.
837
838 Wed Nov 1 22:17:32 1995 Andrew Cagney <cagney@highland.com.au>
839
840 * dgen.c (main): Was outputting optarg even when it was NULL.
841
842 Tue Oct 31 23:48:33 1995 Andrew Cagney <cagney@highland.com.au>
843
844 * vm_n.h (vm_data_map_load_N, vm_data_map_store_n), debug.h,
845 debug.c: Add tracing of load/store unit (virtual) with -t
846 load-store.
847
848 Tue Oct 31 21:44:01 1995 Andrew Cagney <cagney@highland.com.au>
849
850 * std-config.h (WITH_ENVIRONMENT): Add USER_ENVIRONMENT which does
851 not include things such as the time base and events.
852
853 * interrupt.c, sim_calls.c, cpu.h, vm.c, configure.in: Add UEA to
854 all environment switches for above.
855
856 * psim.c (psim_create): ditto - new device tree node name is
857 /options/environment-architecture with values user, virtual and
858 operating.
859
860 Tue Oct 31 21:31:32 1995 Andrew Cagney <cagney@highland.com.au>
861
862 * ppc-opcode-stupid: Third example of use of opcode table - this
863 one expands all mtspr/mfspr and branch instructions. Appears to
864 give about a 10% gain in performance if everything enabled. Also
865 takes about 150mb of swap to build.
866
867 Wed Nov 1 10:49:48 1995 Michael Meissner <meissner@tiktok.cygnus.com>
868
869 * emul_netbsd.c (do_exit): Print arguments and close parenthesis
870 if tracing, since exit doesn't go through emul_exit_call.
871 (do_read): Print arguments if tracing.
872 (do_write): Ditto.
873 (do_open): Ditto.
874 (do_break): Ditto.
875 (do_kill): Ditto.
876 (do_dup): Ditto.
877 (do_sigprocmask): Replace trace with printing arguments if
878 tracing.
879 (do_ioctl): Print arguments if tracing.
880 (do_umask): Ditto.
881 (do_dup2): Ditto.
882 (do_fcntl): Ditto.
883 (do_gettimeofday): Ditto.
884 (do_getrusage): Ditto.
885 (do_fstatfs): Ditto.
886
887 * filter_filename.c: New file to provide filter_filename to strip
888 the directory prefix from a file.
889 * filter_filename.h: New include file to declare filter_filename.
890
891 * debug.h: Include filter_filename.h.
892 (TRACE,DTRACE,ERROR): Use filter_filename on __FILE__.
893
894 * misc.h: Include filter_filename.h.
895 (ASSERT): Use filter_filename on __FILE__.
896
897 * igen.c (lf_print_my_prefix): Use filter_filename on the filename
898 argument.
899
900 * Makefile.in: Add filter_filename support.
901
902 * ppc-instructions (dcbi, icbi): Make these NOPs rather than
903 invalid instructions.
904
905 * configure.in: Add support for more --enable-sim-* switches.
906 Use config.make and config.hdr to write to Makefile and config.h
907 respectively. Don't rewrite Makefile, just append to it.
908 * configure: Regenerate.
909 * config.{make,hdr}: New shell scripts.
910
911 * Makefile.in: Remove all variables set by configure.in.
912 (psim.o): Depend on $(BUILT_SRC) also.
913
914 * emul_netbsd.c (do_gettimeofday,do_getrusage): When comparing an
915 integer, use 0, not NULL.
916
917 Tue Oct 31 15:20:04 1995 Michael Meissner <meissner@tiktok.cygnus.com>
918
919 * configure.in: Add support for --enable-sim-inline,
920 --enable-sim-bswap, --enable-sim-cflags, --enable-sim-complex,
921 --enable-sim-switch, --enable-sim-duplicate, --enable-sim-filter,
922 and --enable-sim-endian switch to control various Makefile
923 variables.
924 * configure: Regenerate from configure.in.
925 * Makefile.in: Add various Make variables that the various
926 switches alter.
927
928 * std-config.h (DEFAULT_INLINE): Don't set this to 2 if using GCC
929 and optimizing by default.
930
931 Fri Oct 27 19:26:27 1995 Andrew Cagney <cagney@highland.com.au>
932
933 * bits.h (ROTL32, ROTL64): Were functions, made them macros, now
934 make them functions again. Appears 2.6.3 is confused by just a
935 macro.
936
937 Thu Oct 26 18:31:58 1995 Andrew Cagney <cagney@highland.com.au>
938
939 * ppc-endian.c (SWAP_8): Fix 8 byte swap!
940
941 * psim.c (psim_create): Not correctly checking that runtime
942 configuration of things like ENDIAN, ENVIRONMENT and ALIGNMENT
943 matched the compiled in ones.
944
945 * debug.h (ITRACE), igen.c: Tidy up more tracing flags -
946 trace_semantics is now different to trace_idecode, the former
947 checks the cache.
948
949 Tue Oct 24 21:54:13 1995 Andrew Cagney <cagney@highland.com.au>
950
951 * ppc-instructions (mtsrin): Missing instruction
952 * ppc-instructions (mfsrin): Missing instruction
953 * ppc-instructions (eieio): Missing instruction
954
955 Tue Oct 24 20:55:29 1995 Andrew Cagney <cagney@highland.com.au>
956
957 * build-psim: New shell script - see internals for usage,
958 simplifies the process of building custom simulators.
959
960 Mon Oct 23 23:48:59 1995 Andrew Cagney <cagney@highland.com.au>
961
962 * std-config.h (SEMANTICS_INLINE): Tidy up notes on each of the
963 INLINE macros. Make SEMANTICS_INLINE == 1 if DEFAULT_INLINE == 2.
964 Don't use DEFAULT_INLINE to define REGISTERS_INLINE DEVICES_INLINE
965 DEVICE_TREE_INLINE or INTERRUPTS_INLINE as none of these are on
966 the instruction or data critical paths.
967
968 * FIXME: need to set up OS_EMUL_INLINE/EMUL_GENERIC_INLINE but
969 not on critical path.
970
971 * FIXME: devices.c/emul_netbsd.c would benefit (slightly) from
972 the inclusion of device_tree.c/emul_generic.c.
973
974 Mon Oct 23 00:31:50 1995 Andrew Cagney <cagney@highland.com.au>
975
976 * os_emul.[hc], emul_generic.[hc], emul_netbsd.[hc]: replace
977 system.[hc]. Start of suport for multiple emulations and
978 emulation state (os_emul object).
979
980 * emul_generic.[hc]: Start of code to implement proper system call
981 tracing (from spy).
982
983 Sun Oct 22 21:33:51 1995 Andrew Cagney <cagney@highland.com.au>
984
985 * cpu.h, cpu.c (cpu_init): New function, zero the registers before
986 the processor is started. Fixes problem of registers being
987 undefined when restarting from within gdb.
988
989 * cpu.h, cpu.c (cpu_flush_icache): New function, flushes the
990 instruction cache (if present). Fixes problem of cpu caching gdb
991 breakpoint instructions.
992
993 FIXME: PSIM sometimes aborts calling error(), it should instead
994 call sim_error() say which takes care of housekeeping such as
995 saving the CIA before calling error.
996
997 * NOTE: cpu_flush_cache() instead of cpu_synchronize_context() is
998 used when restarting a simulation because the latter has the
999 unwanted side effect (well I as a kernel hacker think it is) of
1000 performing an isync when the instruction stream doesn't contain
1001 one.
1002
1003 Sun Oct 22 19:27:48 1995 Andrew Cagney <cagney@highland.com.au>
1004
1005 * mon.h (new), mon.c (new), std-config.h (WITH_MON): Performance
1006 monitoring module. Counts both instructions issued and
1007 load/stores.
1008
1009 * NOTE: mon does not contain to count instruction loads as this
1010 information is already available from the mon_issue() hook.
1011
1012 * FIXME: mon doesn't have access to register usage information.
1013 This is needed if the user wants to monitor things like register
1014 stalls.
1015
1016 * igen.c (lf_print_c_semantic), vm_n.h: Add counting code.
1017
1018 * psim.h, psim.c (psim_create), cpu.h, cpu.c (cpu_create): Attach
1019 a common monitor to each of the cpus. Delete
1020 cpu_increment_number_of_insns() and cpu_get_number_of_insns()
1021 replaced by copied code in mon.[hc].
1022
1023 Sun Oct 22 18:42:45 1995 Andrew Cagney <cagney@highland.com.au>
1024
1025 * sim_calls.c, main.c, psim.c (psim_create): always create
1026 `WITH_SMP' cpus. The actual number of CPU's active in a
1027 simulation run is taken from the device node: /init/smp (an
1028 integer). WITH_SMP changed to 2 (remember to put it back to 0).
1029
1030 Fri Oct 20 17:26:54 1995 Andrew Cagney <cagney@highland.com.au>
1031
1032 * system.c: More system call emulation. If code appears NetBSD
1033 specific, make conditional to being compiled on a NetBSD system
1034 (sigh).
1035
1036 Wed Oct 18 23:02:20 1995 Andrew Cagney <cagney@highland.com.au>
1037
1038 * Makefile.in, gen.c(delete), igen.c(new), dgen.c(new),
1039 lf.[ch](new), table.[ch](new): Split into two generators - igen
1040 that outputs the instruction tables and dgen that outputs the spr
1041 tables. Add -f (filter out) flag to igen to filter out certain
1042 instructions (ex 64 bit ones) from the created tables. Include
1043 $(LIBIBERTY_LIB) in link options in case host lacks some libc
1044 functions.
1045
1046 * NOTE: igen, since it was originally written for the
1047 PowerPC/RS6000, things the MSB is 0 and the LSB is 63{31}.
1048
1049 * Makefile.in, std-config.h, ppc-cache-rules(new),
1050 ppc-opcode-complex(new), ppc-opcode-simple(new): (for igen) Create
1051 cache-rule and opcode-rule tables from macros found std-config.h.
1052 Delete corresponding macro's from std-config.h.
1053
1054 * FIXME: under this new igen scheme, when playing around with igen
1055 options, you'll find that depenencies don't work very well.
1056
1057 * igen.c (gen_itable_c, gen_itable_h), Makefile.in: code to output
1058 an table of all the instructions. Code to output a type
1059 enumerating all the instructin names.
1060
1061 * igen.c(lf_print_c_semantic): Move call to increment instruction
1062 counter so that it occures _after_ the instruction has been fully
1063 validated, was double counting illegal/invalid instructions. Add
1064 conditional so only compiled in when WITH_PROFILE enabled (enabled
1065 by default).
1066
1067 * igen.c, cpu.h, cpu.c(cpu_increment_number_of_insns): Include
1068 itable.h, count individual instruction types not just total,
1069 adjust reporting functions to output this.
1070
1071 * ppc-instructions (64 bit Load Doubleword with Update Indexed):
1072 Had 32./ instead of 31./
1073
1074 * ppc-instructions (64 bit Store Double Word Conditional Indexed):
1075 bitrot - updated to use newer CR register operators.
1076
1077 * ppc-instructions (64bit Floating Convert from Integer
1078 Doubleword): Correct call to Round_Float().
1079
1080 Mon Oct 16 00:31:20 1995 Andrew Cagney <cagney@highland.com.au>
1081
1082 * basics.h: #include "sim_callbacks.h" earlier so that its
1083 prototypes are declared in all other header files.
1084
1085 * bits.h, bits.c, idecode_expression.h (ROTL32, ROTL64): Update
1086 doc in bits.h, remove dead code in bits.c, move ROTL32/ROTL64 into
1087 bits.h.
1088
1089 * FIXME: the bits.h/bits.c macro's should be replaced with
1090 (inline) c functions.
1091
1092 * cpu.c(cpu_add_commas), device_tree.h, device_tree.c(scand_*):
1093 Add size of buffer argument to functions writing a string into a
1094 buffer. Check for buffer overflow.
1095
1096 Sun Oct 15 22:16:11 1995 Andrew Cagney <cagney@highland.com.au>
1097
1098 * devices.h, devices.c, debug.h, debug.c: add macro's for tracing
1099 of each device. Make parameter names consistent so macros work.
1100 Use macro's in device functions.
1101
1102 * device_tree.c, devices.h, devices.c: include path to device in a
1103 devices node when creating it.
1104
1105 * device_tree.c, debug.h, debug.c: Add tracing of `device-tree'.
1106
1107 * core.c: add tracing of core-device, adjust parameter names in
1108 core functions to be consistent with those in devices*.
1109
1110 Sun Oct 15 20:33:20 1995 Andrew Cagney <cagney@highland.com.au>
1111
1112 * debug.h, debug.c (trace_option): New function. Parses the trace
1113 option, updating the trace array.
1114
1115 * debug.h, debug.c (trace_usage): New function. Outputs the list
1116 of all possible trace options.
1117
1118 * sim_calls.c (sim_open), main.c (main): Use new trace_option() to
1119 parse trace options specified with the simpler -t flag. Adjust
1120 usage.
1121
1122 * FIXME: basic parsing of command line options is still duplicated
1123 by main.c and sim_calls.c
1124
1125 Thu Oct 26 10:42:28 1995 Michael Meissner <meissner@tiktok.cygnus.com>
1126
1127 * Makefile.in (clean): Delete *.i and *.out files.
1128
1129 * ppc-endian.c (SWAP_n): Add SET argument to allow use of SWAP
1130 macros for either assignment or return. Fix SWAP_8 to use a
1131 union, and two SWAP_4's. Delete SWAP_N, since nobody uses it now.
1132 (ENDIAN_N): Add SET argument to SWAP_n calls. Delete macro defs
1133 that hardwired swapping on/off, let optimizer delete dead code.
1134
1135 * main.c (main): Add printf that we caught a signal and print out
1136 the failing address.
1137
1138 Thu Oct 19 21:43:39 1995 Fred Fish <fnf@fishfood.amigalib.com>
1139
1140 * Makefile.in: Remove tabs from otherwise empty line.
1141 Confuses many non-GNU versions of "make".
1142
1143 Wed Oct 18 08:51:25 1995 Michael Meissner <meissner@tiktok.cygnus.com>
1144
1145 * Makefile.in (clean): Delete files produced by gen.
1146
1147 Mon Oct 16 17:34:24 1995 Michael Meissner <meissner@tiktok.cygnus.com>
1148
1149 * gen.c (lf_print_c_semantic_function): Move counting # of
1150 instructions here so it works with caching.
1151 (gen_idecode_c): Move from here.
1152
1153 Wed Oct 11 17:13:15 1995 Andrew Cagney <cagney@highland.com.au>
1154
1155 * gen.c, ppc-instructions, psim.c: Fix code for generating
1156 cracking instruction cache. Delete the code that cached just the
1157 result from doing an instruction lookup - this ran slower than no
1158 cache at all.
1159
1160 Fri Oct 13 09:58:43 1995 Michael Meissner <meissner@tiktok.cygnus.com>
1161
1162 * Makefile.in (gen.o): Include $(INLINE_CFLAGS).
1163
1164 * debug.h (ppc_trace): Rename from trace, to avoid a conflict with
1165 TCL when gdb is linked with the simulator.
1166 * debug.c (ppc_trace): Ditto.
1167 * sim_calls.c (sim_open): Change trace -> ppc_trace.
1168 * main.c (main): Ditto.
1169
1170 * cpu.c (cpu_add_commas): Remove extra static.
1171
1172 Thu Oct 12 11:35:53 1995 Michael Meissner <meissner@tiktok.cygnus.com>
1173
1174 * Makefile.in (psim.o): Now that inlines are turned on, make
1175 psim.o depend on all sources.
1176
1177 * cpu.c (cpu_add_commas): New function to format a long with
1178 commas.
1179 (cpu_print_info): Use it to print number_of_insns.
1180
1181 * ppc-endian.c (SWAP_n): New macros to speed up byte swapping for
1182 2, 4, and 8 bytes.
1183 (ENDIAN_N): If both target and host byte orders are known, don't
1184 bother testing CURRENT_{TARGET,HOST}_BYTE_ORDER.
1185
1186 * ppc-endian.h (target specific H2T_n/T2H_n macros): Remove #if 0
1187 to allow target specific H2T_n/T2H_n macros to be used.
1188 (htonl, ntohl): If compiled on a 486 by GCC and WITH_BSWAP is
1189 non-zero, redefine the htonl/ntohl macros to use the BSWAP instead
1190 of the 3 instruction sequence that runs on 386s.
1191
1192 * std-config.h (WITH_{HOST,TARGET}_BYTE_ORDER): Don't override if
1193 specified on the compile line.
1194 (WITH_BSWAP): If not defined, define as 0.
1195
1196 * Makefile.in (INLINE_CFLAGS): Add -DDEFAULT_INLINE=2 to add
1197 default inline support. Pass INLINE_CFLAGS when compiling.
1198
1199 * devices.{h,c} (unimp_device_ioctl): Use STATIC_DEVICES, not
1200 INLINE_DEVICES since GCC doesn't like inline functions that
1201 accept variable arguments.
1202 (stack_ioctl_callback): Make function just static because GCC
1203 doesn't like inline functions that accept variable arguments.
1204
1205 * devices.h (STATIC_DEVICES): Define as empty if not defined.
1206
1207 * inline.c: Correct pathnames of included C files to match current
1208 implementation.
1209
1210 * inline.h (STATIC_DEVICES): If DEVICES_INLINE is defined to be
1211 non-zero, define STATIC_DEVICES to be static.
1212
1213 * std-config.h (INLINE): If GNU C and optimizing, define this as
1214 __inline__.
1215 (DEFAULT_INLINE): If not defined, define as 0.
1216 (ENDIAN_INLINE): If not defined, define as DEFAULT_INLINE.
1217 ({CORE,VM,CPU,EVENTS,REGISTERS,INTERRUPTS}_INLINE): Ditto.
1218 ({SPREG,IDECODE}_INLINE): Ditto.
1219
1220 Wed Oct 11 17:13:15 1995 Andrew Cagney <cagney@highland.com.au>
1221
1222 * ppc-instructions: Initial cut of floating point suport added.
1223 Of note include - use of host IEEE floating point instructions,
1224 use of PowerPC manual pseudo code to handle the FPSCR. It is not
1225 currently a pretty sight.
1226
1227 * memory_map.h, memory_map.c, memory_map_n.h, core.h, core.c:
1228 merge into core.h, core.c, core_n.h. The type memory_map replaced
1229 with core_map. This removes a level of pointer indirection when
1230 translating an address.
1231
1232 * memory_map.h, memory_map.c, memory_map_n.h: delete.
1233
1234 * Makefile.in et.al (sorry): tweek to use new core, core_map and
1235 core.h.
1236
1237 Wed Oct 11 12:10:26 1995 Andrew Cagney <cagney@highland.com.au>
1238
1239 * sim_calls.c, main.c: Add -g (trace_gdb) option, add tracing to
1240 most of the other functions in sim_calls.c.
1241
1242 * basics.h (CONCAT3), memory_map.c, memory_map_n.h, Makefile.in:
1243 Add macros to better cover up `generic' code. Makes it possible
1244 to step through the generic code!
1245
1246 * vm.c, vm_n.h, Makefile.in: ditto
1247
1248 Tue Oct 10 15:42:59 1995 Andrew Cagney <cagney@highland.com.au>
1249
1250 * devices.h, devices.c, memory_map.h, memory_map.c: Changed
1251 callback interface so that there is a read/write buffer but no
1252 read/write_word. VEA default memory read/write handler sometimes
1253 couldn't resolve an access and of those some were for a memory
1254 fault and some were because gdb was making a bogus request.
1255
1256 * devices.h, devices.c, memory_map.h, memory_map.c, vm.h, vm.c:
1257 eliminate transfer_mode (raw or cooked) parameter from read/write
1258 buffer.
1259
1260 Fri Oct 6 20:23:56 1995 Andrew Cagney <cagney@highland.com.au>
1261
1262 * ppc-instructions (fmul, fmuls): correct instruction format - had
1263 FRB instead of FRC.
1264
1265 Wed Oct 4 17:31:12 1995 Andrew Cagney <cagney@highland.com.au>
1266
1267 * psim.c, device_tree.h, device_tree.c, devices.c (printd_*,
1268 scand_*): new functions to parse/print fields in device names
1269 while hiding any machine dependency.
1270
1271 * devices.c, psim.c: Change the stack init code so that it is
1272 handled by a device. Arguments passed across using a device ioctl
1273 (hack).
1274
1275 * devices.h, devices.c: device ioctl callback changed to allow a
1276 variable number of arguments. This gives greater flexability and
1277 greater chance of bugs.
1278
1279 Tue Oct 3 22:01:56 1995 Andrew Cagney <cagney@highland.com.au>
1280
1281 * main.c (printf_filtered, error): Missing va_end() to close off
1282 variable argument use.
1283
1284 * Makefile.in (tmp-gencode): comment out hack to get around some
1285 versions of make not handling files being created as side-effects.
1286
1287 * gen.c (lf_open): Add -n (real_file_name) option. Specifies an
1288 alternative file name to use in output files for things like #line
1289 macros.
1290
1291 Makefile.in (tmp-gencode): Use gen -n so that debug info is
1292 correct.
1293
1294 * Makefile.in (TARGETLIB): Use this instead of libsim.a in the
1295 Makefile.
1296
1297 Sat Oct 7 22:40:59 1995 Michael Meissner <meissner@tiktok.cygnus.com>
1298
1299 * sim_calls.c (sim_set_callbacks): Define new function.
1300
1301 Fri Oct 6 17:23:10 1995 Michael Meissner <meissner@tiktok.cygnus.com>
1302
1303 * psim.c (psim_print_info): Print exit status or signal number.
1304
1305 Mon Oct 2 11:46:37 1995 Michael Meissner <meissner@tiktok.cygnus.com>
1306
1307 * cpu.c (struct _cpu): Add number_of_insns field to trace how many
1308 instructions are executed.
1309 (cpu_increment_number_of_insns): New function to increment the
1310 number of instructions issued.
1311 (cpu_get_number_of_insns): New function to return the number of
1312 instructions issued.
1313 (cpu_print_info): New function to print cpu related information.
1314 At present, print the number of instructions executed.
1315
1316 * gen_idecode_c: Emit call to cpu_increment_number_of_insns within
1317 idecode_issue.
1318
1319 * psim.c (psim_print_info): New function to iterate over each of
1320 the CPU's calling cpu_print_info.
1321
1322 * psim.h,cpu.h: Add new declarations.
1323
1324 * sim_calls.c (sim_open): Add argument processing to add the same
1325 switches main.c accepts for the standalone processor.
1326 (sim_close): Call psim_print_info if -I.
1327
1328 * main.c (main): Add comment saying to update sim_calls.c when
1329 adding switches. Add -I to call psim_print_info when done.
1330 (usage): Update usage message.
1331
1332 Sun Oct 1 13:52:59 1995 Michael Meissner <meissner@tiktok.cygnus.com>
1333
1334 * main.c (printf_filtered): Correct to match new prototype.
1335
1336 Sat Sep 30 20:47:05 1995 Michael Meissner <meissner@tiktok.cygnus.com>
1337
1338 * sim_callbacks.h (printf_filtered): Correct prototype.
1339
1340 Thu Sep 21 16:26:49 1995 Michael Meissner <meissner@tiktok.cygnus.com>
1341
1342 * device_tree.c (OEA_MEMORY_SIZE): Define if not defined to
1343 0x100000.
1344 (clayton_memory_size): Define as OEA_MEMORY_SIZE.
1345
1346 * std-config.h (WITH_TRACE): Default to 1 now.
1347
1348 * psim.c (write_stack_arguments): Don't write any stack arguments
1349 if OEA.
1350
1351 * main.c (main): Switch to using getopt. Make -p also set
1352 trace_semantics. Make -a turn on all trace flags. Make -C turn
1353 on console tracing.
1354
1355 * device_tree.c (create_option_device_node): Assume a program is
1356 OEA if the start address is < 4096, not just == 0.
1357
1358 Wed Sep 20 13:36:06 1995 Ian Lance Taylor <ian@cygnus.com>
1359
1360 * Makefile.in (maintainer-clean): New synonym for realclean.
1361
1362 Sun Sep 10 10:23:56 1995 Michael Tiemann <tiemann@axon.cygnus.com>
1363
1364 * registers.c (register_description): Add gdb synonyms for cr
1365 (cnd) and msr (ps).
1366
1367 Fri Sep 8 13:16:10 1995 Ian Lance Taylor <ian@cygnus.com>
1368
1369 * Makefile.in (install): Don't install in $(tooldir).
1370
1371 * configure.in: Call AC_CONFIG_HEADER. Don't try to use
1372 bfd/hosts/*.h file or bfd/config/*.mh file. Call AC_PROG_CC and
1373 AC_PROG_RANLIB. Substitute in values for CFLAGS, HDEFINES, AR,
1374 and CC_FOR_BUILD. Call AC_CHECK_HEADERS for various header files.
1375 Touch stamp.h if creating config.h.
1376 * configure: Rebuild.
1377 * config.in: New file, created by autoheader.
1378 * Makefile.in (AR): Define as @AR@.
1379 (CC): New variable, defined as @CC@.
1380 (CFLAGS): Define as @CFLAGS@.
1381 (CC_FOR_BUILD): New variable, defined as @CC_FOR_BUILD@.
1382 (RANLIB): Define as @RANLIB@.
1383 (HDEFINES, TDEFINES): New variables.
1384 (@host_makefile_frag@): Remove.
1385 (mostlyclean): Make the same as clean, not distclean.
1386 (clean): Remove config.log.
1387 (distclean): Remove config.h and stamp-h.
1388 (Makefile): Don't depend upon @frags@. Just rebuild Makefile when
1389 invoking config.status.
1390 (config.h, stamp-h): New targets.
1391 (gen, gen.o): Build with CC_FOR_BUILD, not CC.
1392 (ppc-config.h): Rename from old config.h build.
1393 * (basics.h,gen.c,ppc-endian.c,psim.c): Include ppc-config.h.
1394
1395 Fri Sep 8 09:51:03 1995 Michael Meissner <meissner@tiktok.cygnus.com>
1396
1397 * configure{,.in}: Don't include sysdep.h from bfd, since bfd no
1398 longer provides it.
1399 * basics.h (sysdep.h): Don't include it.
1400 * Makefile.in (BASICS_H): Remove sysdep.h.
1401
1402 Wed Sep 6 13:25:42 1995 Andrew Cagney <cagney@highland.com.au>
1403
1404 * core.c (core_add_data): First growth of bss was being put at
1405 wrong address (0) instead of &end.
1406
1407 * core.c (core_add_stack, core_add_data): Was not handling case
1408 where bss/stack is grown across the current end-of-{bss,stack}.
1409
1410 Wed Sep 6 00:46:10 1995 Andrew Cagney <cagney@highland.com.au>
1411
1412 * system.c (system_call): Fix SYS_break - was aligning bss to a
1413 page boundary instead of just an 8 byte one; On first call sbrk(0)
1414 != sbrk(0).
1415
1416 Thu Aug 24 14:48:54 1995 Michael Meissner <meissner@tiktok.cygnus.com>
1417
1418 * Makefile.in (install): Fix install rule.
1419
1420 Tue Aug 22 09:31:18 1995 Michael Meissner <meissner@tiktok.cygnus.com>
1421
1422 * system.c (system_call): Add read support.
1423
1424 * main.c (main): -t sets trace_device_tree. Correct usage message
1425 to current reality.
1426
1427 * device_tree.c (update_memory_node_for_section): Make tracing
1428 output line up. If not code or readonly, assume that the section
1429 is a data section and has read/write permissions. Add readonly
1430 support.
1431
1432 * core.c (create_core_from_addresses): Print end address in traces
1433 and make tracing output line up.
1434
1435 * Makefile.in: Rewrite from Makefile to work with the Cygnus
1436 environment, and support compiling in a different directory than
1437 the sources reside in.
1438
1439 * ppc-endian.h: Rename from endian.h so that it doesn't get
1440 confused with /usr/include/sys/endian.h on Linux. Add Linux
1441 endian support.
1442
1443 * ppc-endian.c: Rename to be consistant with ppc-endian.h.
1444 Include ppc-endian.h, not endian.h.
1445
1446 * basics.h (sysdep.h): Include sysdep.h that configure makes.
1447 Include ppc-endian.h, not endian.h.
1448
1449 * std-config.h: Rename from ppc-config. Put #ifndefs around most
1450 configuration macros, so they can be overridden via CFLAGS. By
1451 default, turn off tracing.
1452
1453 * configure.in: Clone from other simulator targets.
1454 * configure: Generate via autoconf from configure.in.
1455
1456 Sat Aug 19 09:05:32 1995 Andrew Cagney <cagney@highland.com.au>
1457
1458 * ppc-instructions: fix srawi (was geting XER[CA] real wrong).
1459
1460 * interrupts.c (data_storage_interrupt): allow stack to grow by
1461 upto one MB per increment.
1462
1463 * ppc-instructions: divw was computing rA / rA not rA / rB
1464
1465 * main.c (main): really stupid. Wasn't exiting with correct status
1466
1467 Fri Aug 18 00:38:01 1995 Andrew Cagney <cagney@highland.com.au>
1468
1469 * system.c (system_call): add system calls kill(2) and getpid(2).
1470
1471 * main.c (main): Check/return exit status when simulation
1472 finishes.
1473
1474 Thu Aug 17 14:29:18 1995 Andrew Cagney <cagney@highland.com.au>
1475
1476 * device_tree.c (create_option_device_node): Alignment rules (at
1477 least for the moment) now are for strict alignment only for LE OEA
1478 mode. (Because of compiler problems).
1479
1480 * system.c (system_call) SYS_exit: Wasn't exiting with correct status.
1481
1482 Thu Aug 17 01:16:38 1995 Andrew Cagney <cagney@highland.com.au>
1483
1484 * vm.c (DEFINE_VM_DATA_MAP_WRITE_N): For miss aligned transfer
1485 forgot to return.
1486
1487 * system.c (system_call): didn't page align break argument before
1488 determining increment break increment.
1489
1490 * psim/ppc: Re-arange entire directory structure so that
1491 everything lives in the one directory. While a pain for cleaning,
1492 makes building across multiple architectures much simpler.
1493
1494 * devices.c, device_tree.c: Added code that provides a simple
1495 illustration of how an interrupt control device could be
1496 implemented.
1497
1498 * devices.c: Added code so that the dumb console device can read
1499 (from stdin) as well as write to stdout.
1500