Add multi-sim support to simulator.
[external/binutils.git] / sim / igen / ChangeLog
1 Tue Sep  9 03:30:26 1997  Andrew Cagney  <cagney@b1.cygnus.com>
2
3         * igen.c (gen_run_c): New function. Generate sim_engine_run that
4         looks at the currently selected architecture.
5
6         * gen-engine.c, gen-idecode.c: Add multi-sim support - generate
7         one engine per model.
8         
9         * gen-semantics.c, gen-icache.c gen-support.c:
10         Update.
11
12         * ld-insn.h, ld-insn-h (load_insn_table): Rewrite.  table.h only
13         returns a line at a time.  Parse multi-word instructions.  Add
14         multi-sim support.
15
16         * table.h, table.c: Simplify.  Only parse a single line at a time.
17         ld-insn can handle the rest.
18
19         * filter.h, filter.c (filter_parse, filter_add, filter_is_subset,
20         filter_is_common, filter_is_member, filter_next): New filter
21         operations.
22         (dump_filter): Ditto.
23         
24         * gen.h, gen.c: New file.  Takes the insn table and turns it into
25         a set of decode tables and semantic functions.
26         
27         * ld-insn.c: Copy generator code from here.
28         * gen.c: To here.
29
30 Fri Aug  8 11:43:45 1997  Andrew Cagney  <cagney@b1.cygnus.com>
31
32         * misc.h (NZALLOC): Allocate an N element array of TYPE.
33
34         * table.h, table.c: Simplify table parser so that it only
35         understands colon delimited lines and code blocks.
36         (table_read): Parse '{' ... '}' as a code block.
37         (table_print_code): New function, print out a code block to file.
38         (main): Add suport for standalone testing.
39         
40         * ld-insn.h, ld-insn.c:
41         
42         
43 Mon Sep  1 11:41:12 1997  Andrew Cagney  <cagney@b1.cygnus.com>
44
45         * gen-idecode.c (error_leaf_contains_multiple_insn): Make static.
46         (print_jump_definition, print_jump, print_jump_internal_function,
47         print_jump_insn, print_jump_until_stop_body): Delete, moved to
48         sim-engine.c
49
50         * igen.c (print_itrace_format): Delete unused variable chp.
51         (gen-engine.h): Include.
52
53         * table.c (current_file_name, current_line_entry,
54         current_line_entry): Make static.
55
56 Wed Aug  6 12:31:17 1997  Andrew Cagney  <cagney@b1.cygnus.com>
57
58         * configure.in: Define AR_FOR_BUILD, AR_FLAGS_FOR_BUILD,
59         RANLIB_FOR_BUILD and CFLAGS_FOR_BUILD.
60         * configure.in: Include simulator common/aclocal.m4.
61         * configure.in: Add --enable-sim-warnings option.
62         * configure: Re-generate.
63         
64         * Makefile.in: Use.
65
66         * Makefile.in (tmp-filter): New rule.
67         (igen.o, tmp-table, tmp-ld-decode, tmp-ld-cache, tmp-ld-insn,
68         ld-decode.o, ld-cache.o, ld-insn.o): Fix dependencies.
69         
70         * gen.h, gen.c: New files.
71         
72         * Makefile.in (gen.o, tmp-gen): New rules, update all
73         dependencies.
74         
75 Tue Jun 24 11:46:45 1997  Andrew Cagney  <cagney@b1.cygnus.com>
76
77         * ld-insn.c (load_insn_table): Accept %s as a function type.
78
79 Thu Jun  5 17:14:32 1997  Andrew Cagney  <cagney@b1.cygnus.com>
80
81         * igen.c (print_itrace_prefix): Move printing of insn prefix to
82         here.
83         (print_itrace_format): Drop printing of MY_NAME in instruction
84         trace.  Printing of insn prefix moved.
85         (print_itrace): Ditto.
86
87 Fri May 30 11:27:37 1997  Andrew Cagney  <cagney@b1.cygnus.com>
88
89         * gen-icache.c (print_icache_function_header): Pass
90         table_line_entry instead of separate file and line.
91
92         * table.c (table_entry_read): Set assembler source file/line-nr to
93         the current not initial file.
94         (table_entry_read): Fix line numbering of source files.
95
96         table.h (table_line_entry): New structure.  Exactly specifies a
97         source file/line-nr.
98         (table_*_entry): Add this to all.
99         
100         table.c (table_entry_print_cpp_line_nr): Change to use values from
101         a table_line_entry struct.
102         (table_entry_read): Save table_line_entry in all structures read.
103
104         gen-icache.c, gen-support.c, gen-idecode.c, gen-semantics.c,
105         gen-model.c: Update all references.
106         
107 Thu May 29 10:29:57 1997  Andrew Cagney  <cagney@b1.cygnus.com>
108
109         * igen.c (print_my_defines): Define MY_NAME - a string.  For
110         MY_PREFIX, undefine the name of the function incase some dumb
111         header defined it.  it.
112         (print_itrace): Use MY_NAME not MY_PREFIX.
113
114         * lf.c (lf_write): New function write an N character buffer to the
115         file.
116
117         * igen.c (print_itrace): When available, use the assembler to
118         print the insn-trace.
119         (print_itrace_prefix): New function, print first part of call to
120         print_one_insn.
121         (print_itrace_format): New function, print fmt argument for
122         print_one_insn.
123         
124         * table.c (table_entry_read): Save any assembler lines instead of
125         discarding them.
126
127 Wed May 28 09:55:29 1997  Andrew Cagney  <cagney@b1.cygnus.com>
128
129         * gen-icache.c (print_icache_body): Process immeds.
130
131         * gen-semantics.c (print_semantic_body): When computing NIA, skip
132         any immed words that follow the instruction word.
133
134         * ld-insn.c (parse_insn_format): Parse immeds appended to an
135         instruction.
136
137         * igen.c (main): Allow any register to be specified as the zero
138         register.
139         (semantic_zero_reg): Global, index to zero register.
140
141         * gen-semantics.c (print_semantic_body): Zero selected register.
142
143 Tue May 27 14:12:32 1997  Andrew Cagney  <cagney@b1.cygnus.com>
144
145         * igen.h: Stop options and code gen type bit masks overlaping.
146
147 Fri May 23 12:01:08 1997  Andrew Cagney  <cagney@b1.cygnus.com>
148
149         * gen-semantics.c (print_semantic_body): Incorrect test for
150         zero-r0 code.
151
152 Fri May 16 14:32:31 1997  Andrew Cagney  <cagney@b1.cygnus.com>
153
154         * gen-semantics.c (print_semantic_body): Use common sim-engine
155         interface.
156
157 Fri May 16 11:48:30 1997  Andrew Cagney  <cagney@b1.cygnus.com>
158
159         * gen-semantics.c (print_semantic_body): Add code to clear r0.
160
161         * igen.c (main): Add new option zero-r0, which adds code to clear
162         GPR(0) each cycle.
163
164 Wed May  7 12:31:30 1997  Andrew Cagney  <cagney@b1.cygnus.com>
165
166         * igen.c (print_itrace): Fix so line-nr is passed to trace
167         function.
168
169         * gen-idecode.c (print_idecode_validate): Correct FP code.
170
171         * gen-support.c (gen_support_h): Always pass MY_INDEX to support
172         functions.
173         (print_support_function_name): Ditto.
174
175 Tue May  6 06:12:04 1997  Mike Meissner  <meissner@cygnus.com>
176
177         * igen.c (print_itrace): Call trace_one_insn to trace
178         instructions, rather than doing it directly.
179
180 Mon May  5 14:11:46 1997  Mike Meissner  <meissner@cygnus.com>
181
182         * gen-engine.c (engine_switch_leaf): Remove extra %s.
183         (print_engine_floating_point_unavailable): Wrap in #ifdef
184         UNUSED/#endif, until somebody uses it.
185
186         * gen-idecode.c (error_leaf_contains_multiple_insn): Remove unused
187         variable.
188         (print_jump_until_stop_body): Wrap in #ifdef UNUSED/#endif, until
189         somebody uses it.
190         (print_idecode_validate): Use long formats to print long values.
191
192         * gen-semantics.c (print_idecode_invalid): Set name to "unknown"
193         if we get an unexpected type.
194
195 Fri May  2 13:28:06 1997  Andrew Cagney  <cagney@b1.cygnus.com>
196
197         * igen.c (print_itrace): Pass SD as well as CPU to calls to
198         trace_printf.
199
200         * gen-support.c (gen_support_h): Always pass sim_cia cia to
201         support functions.
202         (print_support_function_name): Ditto.
203
204 Wed Apr 30 17:35:51 1997  Andrew Cagney  <cagney@b1.cygnus.com>
205
206         * gen-support.c (support_c_function): Remove unnecessary memset of
207         cia.
208         * gen-semantics.c (print_semantic_body): Wasn't closing
209         generated comment.
210
211 Tue Apr 29 11:11:12 1997  Andrew Cagney  <cagney@b1.cygnus.com>
212
213         * ld-insn.c (load_insn_table): Report instructions that do not
214         have at least a format and name.
215         (insn_table_find_opcode_field): Check progress is being made.
216
217         * gen-support.c (support_c_function): Report empty function body.
218
219 Thu Apr 24 11:43:45 1997  Andrew Cagney  <cagney@b1.cygnus.com>
220
221         * ld-insn.c (insn_table_expand_opcode): Allow reserved fields to
222         be broken up.
223         (insn_table_expand_insns): Allow special rules to apply to groups
224         of instructions when all members of the group match the special
225         mask/value.
226
227         * gen-semantics.c (print_c_semantic): Ditto.
228         * igen.c (print_semantic_function_formal): Ditto.
229         (print_semantic_function_type): Ditto.
230         * igen.c (print_icache_function_formal): Ditto.
231         * gen-idecode.c (print_idecode_issue_function_body): Ditto.
232
233         * gen-idecode.c (gen_idecode_h): Prepend the global_prefix to the
234         instruction_address type.
235
236         * gen-semantics.c (print_semantic_body): Call cpu_error when an
237         unimplemented instruction is encountered - gives the interpreter
238         the chance to stop correctly.
239
240 Wed Apr 23 20:06:36 1997  Andrew Cagney  <cagney@b1.cygnus.com>
241
242         * igen.c (print_function_name): Allow dot's in instruction names.
243
244 Tue Apr 22 21:46:28 1997  Andrew Cagney  <cagney@b1.cygnus.com>
245
246         * igen.c (main), igen.h: Support new option - delayed-branch -
247         generate code to drive a delayed branch processor.
248
249         * gen-idecode.c (gen_idecode_h): Define instruction_address type.
250
251         * igen.c (print_icache_function_formal): Replace address_word with
252         instruction_address.
253         (print_semantic_function_formal): Ditto.
254         (print_semantic_function_type): Ditto.
255         * gen-idecode.c (print_idecode_issue_function_body): Ditto.
256
257         * gen-semantics.c (print_semantic_body): Ditto.
258         (print_c_semantic): Ditto.
259
260         * gen-support.c (support_c_function): Return a zeroed CIA instead
261         of just zero - works with any cia type.
262
263         * igen.c (print_itrace): For delayed branch case, print just the
264         current instruction.
265         
266 Thu Apr 17 07:02:33 1997  Doug Evans  <dje@canuck.cygnus.com>
267
268         * igen.c (print_itrace): Use TRACE_FOO_P and trace_printf.
269
270 Tue Apr 15 15:20:31 1997  Ian Lance Taylor  <ian@cygnus.com>
271
272         * Makefile.in (INSTALL): Set to @INSTALL@.
273         (INSTALL_XFORM, INSTALL_XFORM1): Remove.
274
275 Mon Apr 14 16:29:34 1997  Ian Lance Taylor  <ian@cygnus.com>
276
277         * Makefile.in (INSTALL): Change install.sh to install-sh.
278
279 Wed Apr  2 18:51:20 1997  Doug Evans  <dje@canuck.cygnus.com>
280
281         * gen-support.c (gen_support_c): sim-state.h renamed to sim-main.h.
282         * gen-idecode.c (gen_idecode_c): Likewise.
283         * igen.c (gen_semantics_c): Likewise.
284
285 Mon Mar 24 10:10:08 1997  Andrew Cagney  <cagney@kremvax.cygnus.com>
286
287         * gen-icache.c (print_icache_body): No longer define cpu/sd,
288         support.h now defines CPU/SD globally.
289
290         * gen-model.c (gen_model_h): Ditto.
291
292         * gen-idecode.c (print_idecode_issue_function_body): Ditto.
293         (print_jump): Ditto.
294         (print_jump_until_stop_body): Ditto.
295         (print_idecode_validate): Ditto.
296
297         * gen-icache.c (print_icache_body): Ditto.
298
299         * gen-semantics.c (print_semantic_body): Ditto.
300
301         * igen.c (print_semantic_function_formal): Rename cpu to sim_cpu,
302         processor to cpu.
303         (print_icache_function_formal): Ditto.
304
305         * gen-support.c (print_support_function_name): Include sd/cpu arg
306         in support function argument list.
307         (support_c_function): Generate code to cpu/sd from sd/cpu.
308         (gen_support_h): Define _SD the argument prefix for all support
309         functions.  Define SD/CPU to determine sd/cpu from value of _SD
310         macro.
311
312 Tue Mar 18 15:52:24 1997  Andrew Cagney  <cagney@kremvax.cygnus.com>
313
314         * gen-support.c (gen_support_c): Update for renaming of engine to
315         sim-state.
316         
317         * igen.c: Ditto.
318         * gen-idecode.c (gen_idecode_c): Ditto.
319
320 Mon Mar 17 15:17:07 1997  Andrew Cagney  <cagney@kremvax.cygnus.com>
321
322         * ld-decode.c (load_decode_table): Rename slash to reserved.
323         (dump_decode_rule): Ditto.
324
325         * ld-insn.c (parse_insn_format): Differentiate between a `/' -
326         reserved bit - and a `*' - wild card.
327         (parse_insn_format): Change is_slash to more informative reserved.
328         (dump_insn_field): Ditto.
329         (insn_field_is_constant): Ditto.
330         (insn_table_expand_opcode): Ditto.
331
332         * gen-idecode.c (print_idecode_validate): Make check_mask and
333         check_val the correct integer size.
334         (print_idecode_validate): Fix reserved bit check for 64 bit
335         targets.
336
337 Fri Mar 14 11:24:06 1997  Andrew Cagney  <cagney@kremvax.cygnus.com>
338
339         * ld-insn.c (parse_insn_format): Accept '*' as an alternative of
340         `/' in bit fields.  `/' denotes a wild bit.
341
342 Fri Mar  7 18:20:38 1997  Andrew Cagney  <cagney@kremvax.cygnus.com>
343
344         * igen.h, igen.c (main): New options. Control generation of
345         conditional issue and slot verification code.
346
347 Fri Mar  7 18:17:25 1997  Andrew Cagney  <cagney@kremvax.cygnus.com>
348
349         * gen-support.c (print_support_function_name): Prepend the global
350         name prefix when applicable.  Provide #define to map the user
351         specified name the generated globaly unique one.
352
353 Fri Mar  7 18:07:45 1997  Andrew Cagney  <cagney@kremvax.cygnus.com>
354
355         * gen-idecode.c (print_idecode_validate): Wrap each of the checks
356         - reserved bits, floating point and slot validation - with a
357         #ifdef so that they are optional.
358         
359 Fri Mar  7 16:35:13 1997  Andrew Cagney  <cagney@kremvax.cygnus.com>
360
361         * gen-idecode.c (error_leaf_contains_multiple_insn): New function
362         - report the error of a leaf node in the decision tree containing
363         several instructions.
364         (print_idecode_table_leaf): Detect a leaf with multiple instructions.
365         (print_idecode_switch_leaf): Ditto.
366
367         * gen-semantics.h, gen-semantics.c (print_idecode_illegal,
368         print_idecode_invalid): Rename former to latter.  Add argument so
369         that one function can generate all invalid instruction cases -
370         illegal, fp-unavailable, wrong-slot.
371         * gen-engine.c: Update.
372
373         * gen-idecode.c: Use print_idecode_invalid to generate a function
374         call for cases when fp-unavailable and the slot is wrong.
375
376         * gen-idecode.c (print_idecode_validate): New check, generate code
377         to verify that the instruction slot is correct.
378         
379         * igen.c (main): Simplify options.
380
381 Wed Mar  5 09:55:55 1997  Andrew Cagney  <cagney@kremvax.cygnus.com>
382
383         * igen.c (print_itrace): Remove source line reference for trace
384         code - let the user see the generated file.
385         (print_itrace): Print the trace code rather than reference a
386         macro.
387
388 Tue Mar  4 17:31:55 1997  Andrew Cagney  <cagney@kremvax.cygnus.com>
389
390         * igen.c (print_semantic_function_actual): Pass either the
391         processor - smp - or the engine - mono - into semantic functions.
392         Don't pass in both.
393
394         * gen-icache.c (print_icache_body): Dependant on smp, derive
395         processor from engine or engine from processor, and hence ensuring
396         that both are defined in all semantic functions.
397
398 Mon Mar  3 17:11:21 1997  Andrew Cagney  <cagney@kremvax.cygnus.com>
399
400         * ld-insn.c (parse_insn_format): Make the width field optional.
401         If missing assume that the number of characters in the value
402         determines the number of bits in the field.
403         
404 Thu Feb 27 11:27:48 1997  Andrew Cagney  <cagney@kremvax.cygnus.com>
405
406         * ld-insn.c (insn_table_expand_opcode): Replace assertion with
407         more useful error message.
408
409 Tue Feb 25 16:43:27 1997  Andrew Cagney  <cagney@kremvax.cygnus.com>
410
411         * misc.c (error): Output errors on stderr.
412
413         * ld-insn.c (parse_insn_format): Skip any leading spaces.
414         Verify the width of instructions being parsed.
415
416         * table.c (table_entry_read): Parse CPP's convention for
417         specifying original file name/line-nr.
418
419 Wed Feb 19 12:30:28 1997  Andrew Cagney  <cagney@critters.cygnus.com>
420
421         * ld-insn.c (parse_insn_format): Allow trailing spaces in
422         instruction fields.
423
424         * Makefile.in: Create using ../ppc/Makefile.in as a starting
425         point.
426         * configure.in: Ditto vis ../ppc/configure.in
427         
428 Mon Feb 17 10:44:18 1997  Andrew Cagney  <cagney@critters.cygnus.com>
429
430         * gen-support.c (gen_support_c): Always include engine.h instead
431         of cpu.h
432         * gen-idecode.c (gen_idecode_c): Ditto.
433
434         * words.h (instruction_word): Remove instruction_word - now
435         generated by igen.
436         (address_word): New.  Used by igen.
437         
438         * lf.c (lf_print_function_type_function): New, pass a function to
439         print out the type instead of a constant string.
440         
441         * igen.h, igen.c (print_semantic_function_formal,
442         SEMANTIC_FUNCTION_FORMAL): Relace macro with function.
443         (print_semantic_function_actual, SEMANTIC_FUNCTION_ACTUAL): Ditto.
444         (print_semantic_function_type, SEMANTIC_FUNCTION_TYPE): Ditto.
445         (print_icache_function_type, ICACHE_FUNCTION_TYPE): Ditto.
446         (print_icache_function_formal, ICACHE_FUNCTION_FORMAL): Ditto.
447         (print_icache_function_actual, ICACHE_FUNCTION_ACTUAL): Ditto.
448         * gen-idecode.c (print_idecode_table): Update.
449         (idecode_switch_leaf): Update.
450         (print_idecode_switch_function_header): Ditto.
451         (print_idecode_floating_point_unavailable): Ditto.
452         (print_idecode_issue_function_header): Ditto.
453         * igen.c (gen_icache_h): Ditto.
454         * gen-engine.c (print_engine_table): Ditto.
455         (engine_switch_leaf): Ditto.
456         * gen-support.c (print_support_function_name): Ditto.
457         * gen-semantics.c (print_semantic_function_header): Update.
458         Update.
459         * gen-icache.c (print_icache_function_header): Update.
460         (print_icache_function): Update.
461         (print_icache_internal_function_declaration): Update.
462         (print_icache_internal_function_definition): Update.
463
464         * gen-idecode.c (gen_idecode_h): Drop including of idecode_*.h
465         files, will at some stage need to move it into support.
466
467         * igen.h, igen.c (main): New option -e <engine> - generate a full
468         simulation engine.  Previously this was the -d <idecode-file>
469         option.
470         * gen-engine.h, gen-engine.c: Copies of gen-idecode.*.  Will need
471         to clean these up so that that call upon the updated gen-idecode
472         code.
473         
474         * gen-idecode.h, gen-idecode.c: Prune out any code not relevant to
475         generating a decode table.
476         
477         * Makefile.in (igen): Add dependencies for new gen-engine.* files.
478
479         * igen.h, igen.c (main): New option -M - Control what is returned
480         by semantic functions - -1/NIA vs CIA+N/NIA.  Add
481         generate_semantic_returning_modified_nia_only to igen_code enum.
482         * gen-semantics.c (print_semantic_body): As an alternative, make
483         NIA == -1 instead of CIA+insn_size by default.
484         
485         * igen.h, igen.c (main, global_name_prefix, global_uname_prefix):
486         New option -P <prefix> - Prepend all generated functions with the
487         specified prefix.
488         (gen_idecode_c): Adjust.
489         * gen-icache.c (print_icache_struct): Ditto.
490         * gen-support.c (gen_support_c): Ditto.
491
492 Sun Feb 16 15:23:15 1997  Andrew Cagney  <cagney@critters.cygnus.com>
493
494         * igen.c (main): Correct usage. Missleading message about ucase
495         options dumping internal tables.  -F now includes rather then
496         excludes instructions.
497
498         * misc.h, misc.c (a2i): Make 64bit.
499
500         * ld-insn.h (max_insn_bit_size, default_insn_bit_size): Increase
501         max to 64bits, expect trouble.  Make the default 32 bits.
502         * gen-idecode.c (print_idecode_table): Change EXTRACTED*
503         et.al. macro's to use the insn_bit_size instead of assuming 32
504         bits.
505         * gen-icache.c (print_icache_extraction): Ditto.
506         * gen-idecode.c (idecode_switch_start): Ditto.
507         * gen-idecode.c (gen_idecode_c): Ditto
508
509         * igen.h (insn_specifying_widths), igen.c (main): New option -W.
510         Indicates that the instruction field of the table is specifying
511         bit widths instead of bit offsets.
512         * ld-insn.c (parse_insn_format): Parse instruction fields
513         specifying widths.
514
515         * misc.c (a2i): Allow binary numbers to be specified using the
516         syntax 0bNNNN.
517         * ld-insn.c: Allow such numbers to appear in the instruction
518         format.
519
520         * table.c (table_entry_read): Make // a valid comment character.
521         (table_entry_read): Skip lines containing a leading " - these may
522         eventually be used in a disasembler.
523
524 Fri Feb 14 15:23:15 1997  Andrew Cagney  <cagney@critters.cygnus.com>
525
526         * filter.c, filter.h, gen-engine.c, gen-engine.h, gen-icache.c,
527         gen-icache.h, gen-idecode.c, gen-idecode.h, gen-itable.c,
528         gen-itable.h, gen-model.c, gen-model.h, gen-semantics.c,
529         gen-semantics.h, gen-support.c, gen-support.h, igen.c, igen.h,
530         ld-cache.c, ld-cache.h, ld-decode.c, ld-decode.h, ld-insn.c,
531         ld-insn.h, lf.c, lf.h, misc.c, misc.h, table.c, table.h: Copy in
532         from the ../ppc directory.
533
534         * filter_host.c, filter_host.h: Copy in from the ../ppc directory
535         renaming from filter_filename.[hc]