Fix os_printf_filtered; Flush stdout after calling printf_filtered
[platform/upstream/binutils.git] / sim / d10v / ChangeLog
1 Thu Mar 13 10:29:04 1997  Michael Meissner  <meissner@cygnus.com>
2
3         * simops.c (trace_{input,output}_func): Call flush_stdout from the
4         callback functions.
5         (OP_5F00): Ditto.
6
7 Wed Feb 12 16:04:15 1997  Michael Meissner  <meissner@cygnus.com>
8
9         * simops.c (OP_{1403,15002A02,3{0,4}0{0,1}}): Only use the bottom
10         40 bits of accumulators.  Sign/zero extend as appropriate.
11
12 Tue Feb  4 13:33:30 1997  Doug Evans  <dje@canuck.cygnus.com>
13
14         * Makefile.in (@COMMON_MAKEFILE_FRAG): Use
15         COMMON_{PRE,POST}_CONFIG_FRAG instead.
16         * configure.in: sinclude ../common/aclocal.m4.
17         * configure: Regenerated.
18
19 Thu Jan 23 11:46:23 1997  Stu Grossman  (grossman@critters.cygnus.com)
20
21         * configure configure.in Makefile.in:  Update to new configure
22         scheme which is more compatible with WinGDB builds.
23         * configure.in:  Improve comment on how to run autoconf.
24         * configure:  Re-run autoconf to get new ../common/aclocal.m4.
25         * Makefile.in:  Use autoconf substitution to install common
26         makefile fragment.
27
28 Fri Dec 27 22:54:05 1996  Angela Marie Thomas (angela@cygnus.com)
29
30         * gencode.c: patch to not #include "d10v_sim.h" which
31         unecessarily includes bfd.h and causes wingdb configure
32         to fail.
33
34 Mon Dec 16 13:39:03 1996  Martin M. Hunt  <hunt@pizza.cygnus.com>
35
36         * interp.c (xfer_mem): Change unified memory to 0x0.
37
38 Thu Nov 28 20:42:56 1996  Michael Meissner  <meissner@tiktok.cygnus.com>
39
40         * simops.c (OP_3E01): Fix tracing information.
41         (OP_300{0,1}): Do not propigate sign.
42
43 Mon Nov 25 19:47:40 1996  Doug Evans  <dje@canuck.cygnus.com>
44
45         * config.in (WORDS_BIGENDIAN): Add.
46         * configure: Regenerated.
47         * d10v_sim.h: #include "config.h"
48
49 Sat Nov 23 09:34:50 1996  Michael Meissner  <meissner@tiktok.cygnus.com>
50
51         * gencode.c (write_opcodes): Eliminate warnings when generated
52         table.c is compiled.
53
54 Wed Nov 20 19:41:40 1996  Michael Meissner  <meissner@tiktok.cygnus.com>
55
56         * interp.c (sim_open): Cast result of calloc, and make sure NULL
57         was not returned.
58         (dmem_addr): If address is illegal or in I/O space, signal a bus
59         error.
60         (pc_addr): Signal bus error, not illegal instruction for bogus
61         pc.
62
63 Wed Nov 20 01:23:03 1996  Doug Evans  <dje@canuck.cygnus.com>
64
65         * Makefile.in: Delete all stuff moved to ../common/Make-common.in.
66         (SIM_OBJS,SIM_EXTRA_CFLAGS,SIM_EXTRA_CLEAN): Define.
67         * configure.in: Simplify using macros in ../common/aclocal.m4.
68         Call AC_CHECK_HEADERS(unistd.h).
69         * configure: Regenerated.
70         * config.in: New file.
71         * interp.c: #include "callback.h".
72         * simops.c: #include "config.h".  #include <unistd.h> if present.
73
74 Fri Nov  8 16:19:55 1996  Martin M. Hunt  <hunt@pizza.cygnus.com>
75
76         * d10v-sim.h (simops): Add flag is_long.
77         (State): Add pc_changed.  Instructions which update the PC should
78         use the JMP macro which sets this.
79         (JMP): New macro.  Sets the PC and the pc_changed flag.
80
81         * gencode.c (write_opcodes): Add is_long field.
82         
83         * interp.c (lookup_hash): If we blindly apply a short opcode's mask
84         to a long opcode we could get a false match.  Check the opcode size.
85         (hash): Add a size field to the hash table.
86         (sim_open): Initialize size field in hash table.
87         (sim_resume): Change to logic for setting the PC.  Used to increment the
88         PC if it had not been changed.  This didn't allow single-instruction loops.
89         Now checks the flag State.pc_changed.  Also now stops when ^C is received.
90         (dmem_addr): Fix translation of data segments to unified memory.
91         (sim_ctrl_c): New function.  When ^C is received, set stop_simulator flag.
92
93         * simops.c: Changed all branch and jump instructions to use new JMP macro.
94         (OP_20000000): Corrected trace information to show this is a ldi.l, not
95         a ldi.s instruction.
96         
97 Thu Oct 31 19:13:55 1996  Martin M. Hunt  <hunt@pizza.cygnus.com>
98
99         * interp.c (sim_fetch_register, sim_store_register): Fix bug where
100         updating the accumulators was overwriting other parts of the global
101         State variable.
102
103 Wed Oct 30 17:35:14 1996  Michael Meissner  <meissner@tiktok.cygnus.com>
104
105         * interp.c (bfd.h) Don't include it here any more.
106         (text{,_start,_end}): Move here from simops.c and make extern.
107         (decode_pc): New function to return the PC as an address that the
108         debugger can use.
109         (dmem_addr): Print decoded PC in error message.
110         (pc_addr): Ditto.
111
112         * simops.c (bfd.h) Don't include it here any more.
113         (text{,_start,_end}): Move to simops.c.
114         (trace_input_func): Move decoding of PC, and looking up .text
115         start to decode_pc.
116
117         * d10v_sim.h (bfd.h): Include it here.
118         (text{,_start,_end}): Add external declarations.
119         (exec_bfd): Ditto.
120         (decode_pc): Ditto.
121
122 Tue Oct 29 12:13:52 1996  Martin M. Hunt  <hunt@pizza.cygnus.com>
123
124         * interp.c (sim_size): Now allocates unified memory for imap segments
125         0,1,2, and 127. Initializes imap0 and imap1 to 0x1000.  Initializes dmap to 0.
126         (sim_write): Just call xfer_mem().
127         (sim_read): Just call xfer_mem().
128         (xfer_mem): New function. Does appropriate memory mapping and copies bytes.
129         (dmem_addr): New function. Reads dmap register and translates data
130         addresses to local addresses.
131         (pc_addr): New function. Reads imap register and computes local address
132         corresponding to contents of the PC.
133         (sim_resume): Change to use pc_addr().
134         (sim_create_inferior): Change reinitialization code. Also reinitializes
135         imap[01] and dmap.
136         (sim_fetch_register): Add fake registers 32,33,34 for imap0, imap1, and dmap.
137         (sim_store_register): Add fake registers 32,33,34 for imap0, imap1, and dmap.
138
139         * simops.c (MEMPTR): Redefine to use dmem_addr().
140         (OP_5F00): Replace references to STate.imem with dmem_addr().
141         
142         * d10v-sim.h (State): Remove mem_min and mem_max. Add umem[128].
143         (RB,SW,RW,SLW,RLW): Redefine to use dmem_addr().
144         (IMAP0,IMAP1,DMAP,SET_IMAP,SET_IMAP1,SET_DMAP): Define.
145         
146 Tue Oct 22 15:22:33 1996  Michael Meissner  <meissner@tiktok.cygnus.com>
147
148         * d10v_sim.h (_ins_type): Reorganize, so that we can provide
149         better statistics, like not counting NOPS as parallel
150         instructions, and printing total cycles.
151         (ins_type_counters): Make unsigned long.
152         (left_nops,right_nops): Fold into ins_type_counters.
153
154         * simops.c (trace_input_func): Print new instruction types.
155         Handle OP_R2R3 as input types.
156         (OP_{38000000,7000}): Correctly sign extend bytes.
157         (OP_5E00): Don't count NOPs as parallel instructions.
158         (OP_460B): Remove unused variable.
159         (OP_5F00): Ditto.
160
161         * interp.c (ins_type_counters): Make unsigned long.
162         (left_nops,right_nops): Delete.
163         (most functions): Add prototypes.
164         (INLINE): If GCC and optimize define as __inline__.
165         ({,lookup_}hash,get_operands): Declare as INLINE.
166         (do_parallel): Count conditional operations.
167         (add_commas): New function, to add commas every 3 digits.
168         (sim_size): Call add_commas to print numbers.
169         (sim_{open,resume}): Delete unused variables.
170         (sim_info): Provide better statistics.
171         (sim_read): Add int return type.
172
173 Mon Oct 21 16:16:26 1996  Martin M. Hunt  <hunt@pizza.cygnus.com>
174
175         * interp.c (sim_resume): Change the way single-stepping and exceptions
176         are handled so single-stepping works again.
177
178 Thu Oct 17 12:24:16 1996  Michael Meissner  <meissner@tiktok.cygnus.com>
179
180         * endian.c: Optimize simulated loads/stores on x86, AIX, and big
181         endian hosts.
182
183         * configure.in (--enable-sim-bswap): New switch to enable using
184         the BSWAP instruction on x86's.
185         * configure: Regenerate.
186
187         * Makefile.in ({SWAP,CONFIG}_CFLAGS): Add --enable-sim-bswap
188         support.
189
190 Wed Oct 16 13:50:06 1996  Michael Meissner  <meissner@tiktok.cygnus.com>
191
192         * endian.c: New file.  Move endian functions here from interp.c.
193         Optimize code, and make it work as either inline functions or as a
194         separate file.
195
196         * interp.c: Move endian functions from here to endian.c.
197
198         * Makefile.in (INCLUDE): Add endian.c.
199         (run,libsim.a): Add dependency on endian.o.
200         (endian.o): Add dependency.
201
202         * d10v_sim.h (read/write support): Always go through the machine
203         independent endian functions.  If compiling with GCC and
204         optimizing, include endian.c so the endian functions are inlined.
205
206         * simops.c (OP_5F00): Correct tracing of accumulators.  
207
208 Tue Oct 15 10:57:50 1996  Michael Meissner  <meissner@tiktok.cygnus.com>
209
210         * simops.c (OP_5F00): Add support for getpid, kill system calls.
211
212         * interp.c (do_{2_short,parallel}): If an exception is raised,
213         don't execute the second instruction.
214
215 Sat Oct 12 22:17:43 1996  Michael Meissner  <meissner@tiktok.cygnus.com>
216
217         * simops.c (OP_{31000000,6601,6201,6200}): Store address in a
218         temporary in case the register is overriden when loading.
219         (OP_6200): Output type is OP_DREG for tracing.
220
221 Fri Oct  4 23:46:18 1996  Michael Meissner  <meissner@tiktok.cygnus.com>
222
223         * d10v_sim.h (struct _state): Add mem_{min,max} fields.
224
225         * interp.c (sim_size): Initialize mem_{min,max} fields.
226         (sim_write): Update mem_{min,max} fields.
227         (sim_resume): If PC is not in the minimum/maximum memory range,
228         abort.
229         (sim_create_inferior): Preserve mem_{min,max} fields.
230
231 Fri Sep 27 13:11:58 1996  Mark Alexander  <marka@cygnus.com>
232
233         * simops.c (OP_5F00): Add support for time() system call.
234
235 Wed Sep 25 16:31:41 1996  Michael Meissner  <meissner@tiktok.cygnus.com>
236
237         * simops.c (OP_{6E01,6A01,6E1F,6A00}): Print both words being
238         stored if tracing.
239         (OP_5F00,trace_{in,out}put_func): Add finer grain tracing for
240         system calls.
241
242 Mon Sep 23 17:55:30 1996  Michael Meissner  <meissner@tiktok.cygnus.com>
243
244         * simops.c (op_types): Add OP_{CONSTANT8,R2,R3}.
245         (trace_input_func): Add support for  OP_{CONSTANT8,R2,R3}.
246         (OP_{4900,24800000,4800,4A00,4B00,4D00,4C00}): Add OP_R2 and OP_R3
247         to call/subroutine returns to trace the first two arguments and
248         the return value.  For small jumps, use CONSTANT8, not CONSTANT16.
249
250 Fri Sep 20 15:36:45 1996  Martin M. Hunt  <hunt@pizza.cygnus.com>
251
252         * interp.c (sim_create_inferior): Reinitialize State every time 
253         sim_create_inferior() is called.
254
255 Thu Sep 19 21:38:20 1996  Michael Meissner  <meissner@wogglebug.ziplink.net>
256
257         * simops.c (OP_{401,2000000,601,3000000,23000000}): Get sign right
258         on comparisons.
259         (OP_401): Fix tracing information.
260
261 Thu Sep 19 10:30:22 1996  Michael Meissner  <meissner@tiktok.cygnus.com>
262
263         * simops.c (SIZE_{PC,LINE_NUMBER}): New default sizes for output.
264         (trace_input_func): Use them.
265         (trace_input_func): Make sure there is a trailing space after the
266         instruction.
267         (OP_6200): Fix tracing info.
268
269         * Makefile.in (run): Add dependencies on libbfd.a and
270         libiberity.a.
271
272 Wed Sep 18 09:13:25 1996  Michael Meissner  <meissner@tiktok.cygnus.com>
273
274         * d10v_sim.h (DEBUG_INSTRUCTION): New debug value to include line
275         numbers and function names in debug trace.
276         (DEBUG): If not defined, set to DEBUG_TRACE, DEBUG_VALUES, and
277         DEBUG_LINE_NUMBER. 
278         (SIG_D10V_{STOP,EXIT}): Values to represent the stop instruction
279         and exit system call trap being executed.
280
281         * interp.c (sim_stop_reason): Set exit code correctly for stop
282         instruction and exit system call trap.
283
284         * configure.in (--enable-sim-cflags): Remove trace case.
285         (--enable-sim-debug): New switch to set the debug values.
286         * configure: Regenerate.
287
288         * simops.c (trace_{input,output}_func): Rename from
289         trace_{input,output}.
290         (trace_{input,output}): Call trace_{input,output}_func if
291         d10v_debug is non-zero.
292         (SIZE_INSTRUCTION): Cut down to 8.
293         (SIZE_OPERANDS): Cut down to 18.
294         (SIZE_LOCATION): New value for size of line number, function name
295         field.
296         (init_text_p,text{,_start,_end}): New static variables for
297         printing line number and function name.
298         (exec_bfd): New external that run.c sets.
299         (trace_input_func): Print line number and function name if
300         available and if desired.
301         (OP_4E09): Don't print out DBT message.
302         (OP_5FE0): Set exception field to SIG_D10V_STOP.
303         (OP_5F00): Set exception field to SIG_D10V_EXIT.        
304
305 Sat Sep 14 22:18:43 1996  Michael Meissner  <meissner@tiktok.cygnus.com>
306
307         * interp.c (do_2_short): If the instruction encodes jump->ins,
308         don't do the second instruction if the jump succeeds.
309
310 Fri Sep 13 22:35:19 1996  Michael Meissner  <meissner@tiktok.cygnus.com>
311
312         * simops.c (OP_5F00): Use unknown traps to print all GPRs,
313         accumulators, PC, and F0/F1/C flags.
314
315 Thu Sep 12 12:50:11 1996  Mark Alexander  <marka@cygnus.com>
316
317         * simops.c (OP_5F00): Fix problems with system calls.
318
319 Thu Sep 12 12:19:28 1996  Michael Meissner  <meissner@tiktok.cygnus.com>
320
321         * simops.c (OP_5F00): Correct tracing information for trap.
322
323 Wed Sep 11 18:55:50 1996  Michael Meissner  <meissner@tiktok.cygnus.com>
324
325         * Makefile.in (CSEARCH): Correctly find opcodes directory.
326
327 Mon Sep  9 13:27:26 1996  Michael Meissner  <meissner@tiktok.cygnus.com>
328
329         * simops.c (trace_output): Properly align accumulator output.
330         (OP_3{0,2,4}00): Properly parenthesize test expression.  Add error
331         if shift count is too high.
332         (OP_4E{00,02,04,20,22,40,42}): Make tests agree with book.
333         (OP_4E09): Make cpfg properly trace the input flags.
334         (op_types): Add OP_FLAG_OUTPUT.
335         (trace_{input,output}): Support OP_FLAG_OUTPUT.
336         (OP_31000000): This ld2w varient is a 16-bit memory reference, not
337         an 8-bit memory reference instruction for tracing purposes.
338         (OP_201): Addi needs to set the carry.
339
340 Fri Sep  6 17:56:17 1996  Martin M. Hunt  <hunt@pizza.cygnus.com>
341
342         * simops.c (OP_2600, OP_2601): Changed min and max comparisons
343         to use signed register values.
344
345 Wed Sep  4 11:35:17 1996  Michael Meissner  <meissner@tiktok.cygnus.com>
346
347         * d10v_sim.h (DEBUG_*): Add bit flags for controlling debug
348         output.
349         (_ins_type): New enumeration to specify which container an
350         instruction is in, and whether it is part of a parallel operation.
351         (_state): Add ins_type field.
352         ({,u}int{8,16,32,64}): Use limits.h to size the appropriate types.
353         (ins_type_counters): Counters for the various instruction types.
354         ({left,right}_nops): Counters for the number of nops in each
355         container.
356         (d10v_debug): New variable to indicate whether debugging is turned
357         on.
358
359         * simops.c: (all functions): Change all #ifdef DEBUG code so that
360         the input and output values can be traced, along with the
361         instruction type.  Make the -t option enable tracing.
362         (all functions): Change printf calls to use the printf_filtered
363         function in the callback table.
364
365         * interp.c (_leftright): New enumeration to say whether 2 short
366         instructions are done left first or right first.
367         (do_{long,2_short,parallel}): Indicate in the machine state which
368         type of instruction this is.  Count each of the types of
369         instructions executed.
370         (sim_size): Only print the memory sizes if DEBUG_MEMSIZE debug
371         flag is set.
372         (sim_resume): Pass left/right indication to do_2_short.
373         (all functions): Change printf calls to use the printf_filtered
374         function in the callback table.
375         (sim_trace): Turn on debug flag if DEBUG was defined, and call
376         sim_resume.
377         (sim_info): Print out statistics on instructions.
378         (sim_{trace,create_inferior}): Eliminate extraneous output unless
379         debugging.
380         (sim_open): If args == -t and DEBUG was defined, set d10v_debug.
381         Only initialize the hash table the first time sim_open is called.
382
383         * Makefile.in: Make objects depend on d10v_sim.h.
384         ({,SIM_}CFLAGS): Include configure dependent switches.  Setting
385         CFLAGS does not override host/target defines or SIM_CFLAGS.
386         (CC_FOR_BUILD,gencode): Use CC_FOR_BUILD to compile gencode.
387         (run): By default, the math library is not needed to be linked
388         in.
389         ({BFD,LIBIBERTY}_LIB): Define as variables so they can be
390         overridden.
391         (VPATH): Don't set to anything but @srcdir@ to work with non-GNU
392         makes.
393         ({run,callback}.o): Provide explicit paths to their appropriate
394         source directories.
395         (gencode{,.o},d10v-opc.o): Split compilation into creating object
396         and linking.  Instead of linking in libopcodes.a, just compile
397         d10v-opc.o directly to handle canadian cross.
398         (CSEARCH): Add opcodes directory.
399
400         * configure.in (--enable-sim-cflags): New switch to allow user to
401         set the defaults.
402         (CC_FOR_BUILD): Deal with canadian crosses.
403         * configure: Regenerate.
404
405 Wed Sep 04 04:45:34 1996  Mark Alexander  <marka@cygnus.com>
406
407         * simops.c: Include correct syscall.h for d10v, not host's.
408         Fix #ifdef SYS_stat.
409
410 Tue Sep  3 14:00:04 1996  Michael Meissner  <meissner@tiktok.cygnus.com>
411
412         * simops.c (OP_5F00): Wrap all SYS_xxx traps with #ifdef.
413         Add trap 2 to be printf and trap 3 to be putchar.
414
415 Wed Aug 28 21:42:34 1996  Mark Alexander  <marka@cygnus.com>
416
417         * Makefile.in, d10v_sim.h, interp.c, simops.c: Add support
418         for low-level system calls.
419
420 Wed Aug 28 17:33:19 1996  Martin M. Hunt  <hunt@pizza.cygnus.com>
421
422         * Makefile.in, d10v_sim.h, interp.c: Fix byte-order problems.
423
424 Mon Aug 26 18:30:28 1996  Martin M. Hunt  <hunt@pizza.cygnus.com>
425
426         * d10v_sim.h (SEXT32): Added.
427         * interp.c: Commented out printfs.
428         * simops.c:  Fixed error in sb and st2w. 
429
430 Thu Aug 15 13:30:03 1996  Martin M. Hunt  <hunt@pizza.cygnus.com>
431
432         * Makefile.in, d10v_sim.h, interp.c, simops.c: Added remaining
433         DSP instructions.  Added modulo addressing.
434
435 Sun Aug 11 12:57:15 1996  Martin M. Hunt  <hunt@pizza.cygnus.com>
436
437         * Makefile.in, d10v_sim.h, interp.c, simops.c: Snapshot.
438
439 Fri Aug  2 17:44:24 1996  Martin M. Hunt  <hunt@pizza.cygnus.com>
440
441         * d10v_sim.h, simops.c: Snapshot.
442
443 Thu Aug  1 17:05:24 1996  Martin M. Hunt  <hunt@pizza.cygnus.com>
444
445         * ChangeLog, Makefile.in, configure, configure.in, d10v_sim.h, 
446         gencode.c, interp.c, simops.c: Created.
447