1 2001-07-22 Stephane Carrez <Stephane.Carrez@worldnet.fr>
3 * Makefile.in (SIM_OBJS): Remove sim-resume.o
4 * interp.c (sim_resume): New function from sim-resume.c, install
5 the stepping event after having processed the pending ticks.
6 (has_stepped): Likewise.
7 (sim_info): Produce an output only if verbose or STATE_VERBOSE_P.
9 2001-07-10 Andrew Cagney <ac131313@redhat.com>
11 * Makefile.in (gencode): Provide explicit path to gencode.c.
13 2001-05-20 Stephane Carrez <Stephane.Carrez@worldnet.fr>
15 * Makefile.in (M68HC11_OBJS): Add m68hc12int.o.
16 (m68hc12int.c): Generate using gencode -m6812.
17 (m68hc11int.c): Likewise with -m6811.
19 * gencode.c (m6811_opcode_patterns): New patterns for 68HC12.
20 (m6811_page1_opcodes): Remove duplicate entries.
21 (m6811_page2_opcodes): Likewise.
22 (m6811_page3_opcodes): Likewise.
23 (m6811_page4_opcodes): Likewise.
24 (m6812_page1_opcodes): New table for 68HC12 instructions.
25 (m6812_page2_opcodes): Likewise.
26 (gen_fetch_operands): New modes [] and &[] for 68HC12 operands.
27 (gen_save_result): Likewise.
28 (gen_interpreter_for_table): Handle 68HC11 and 68HC12 opcodes.
29 (cmp_opcode): New function for opcode comparision.
30 (prepare_table): Sort the opcodes.
31 (gen_interpreter): Prepare all the tables and generate either
32 a 68HC11 or a 68HC12 simulator.
33 (main): New options -m6811 and -m6812.
35 * m68hc11_sim.c (cpu_single_step): Use pointer to cpu interpretor.
36 (cpu_special): Simulation of some 68HC12 instructions.
37 (cpu_exg): New function.
39 (cpu_fetch_relbranch16): Likewise.
40 (cpu_push_all): Push according to 68HC11 or 68HC12.
41 (cpu_move16): Likewise.
42 (cpu_move8): Likewise.
43 (cpu_get_indexed_operand16): Likewise.
44 (cpu_get_indexed_operand8): Likewise.
45 (cpu_get_indexed_operand_addr): Likewise.
46 (cpu_set_reg, cpu_set_dst_reg, cpu_get_src_reg, cpu_get_reg): Likewise.
47 (cpu_reset): Setup INIT register according to architecture.
49 * sim-main.h (M6811_Special): Add 68HC12 specific instructions.
50 (_sim_cpu): Keep track of the cpu being simulated.
51 (cpu_get_tmp3, cpu_get_tmp2, cpu_set_tmp3, cpu_set_tmp2): New.
52 (cpu_m68hc11_push_uintxx): Rename of cpu_push_uintxx.
53 (cpu_m68hc11_pop_uint8): Likewise.
54 (cpu_m68hc12_push_uintxx): New functions for 68HC12.
55 (cpu_m68hc12_pop_uintxx): Likewise.
56 (cpu_exg, cpu_dbcc, cpu_move8, cpu_move16): Likewise,
57 (cpu_fetch_relbranch16): Likewise.
58 (cpu_interp_m6811): Rename of cpu_interp.
59 (cpu_interp_m6812): New function.
60 * interp.c (free_state): New function.
61 (dev_list_68hc12): New table.
62 (sim_board_reset): Reset depending on the cpu (HC11 or HC12).
63 (sim_hw_configure): New function.
64 (sim_prepare_for_program): New function.
65 (sim_open): Use above new functions.
66 (sim_close): Call free_state().
67 (sim_info): Print info according to cpu.
68 (sim_create_inferior): Use sim_prepare_for_program.
69 (sim_do_command): Configure the hardware after a change of the
72 2001-05-20 Stephane Carrez <Stephane.Carrez@worldnet.fr>
74 * dv-m68hc11sio.c (m68hc11sio_tx_poll): Always check for
76 * interrupts.c (interrupts_process): Keep track of the last number
77 of masked insn cycles.
78 (interrupts_initialize): Clear last number of masked insn cycles.
79 (interrupts_info): Report them.
80 (interrupts_update_pending): Compute clear and set masks of
81 interrupts and clear the interrupt bits before setting them
82 (due to SCI interrupt sharing).
83 * interrupts.h (struct interrupts): New members last_mask_cycles
84 and xirq_last_mask_cycles.
86 2000-11-26 Stephane Carrez <Stephane.Carrez@worldnet.fr>
88 * dv-m68hc11.c (m68hc11cpu_io_read_buffer): Use attach_size
89 instead of a hard-coded value.
90 (m68hc11cpu_io_write_buffer): Likewise.
91 (dv_m68hc11_descriptor): Define a 68hc12 device.
92 * dv-m68hc11eepr.c (dv_m68hc11eepr_descriptor): Likewise.
93 * dv-m68hc11tim.c (dv_m68hc11tim_descriptor): Likewise.
94 * dv-m68hc11spi.c (dv_m68hc11spi_descriptor): Likewise.
95 * dv-m68hc11sio.c (dv_m68hc11sio_descriptor): Likewise.
97 2000-11-22 Stephane Carrez <Stephane.Carrez@worldnet.fr>
99 * dv-m68hc11.c (attach_m68hc11_regs): Register a delete handler.
100 (m68hc11cpu_delete): Delete handler to detach the address space.
102 2000-11-24 Stephane Carrez <Stephane.Carrez@worldnet.fr>
104 * dv-m68hc11eepr.c (attach_m68hc11eepr_regs): Use hw_malloc.
105 * dv-nvram.c (attach_nvram_regs): Use hw_free and hw_malloc
106 instead of free and malloc.
108 2000-09-11 Stephane Carrez <Stephane.Carrez@worldnet.fr>
110 * Makefile.in: Was missing from initial patch.
112 2000-09-10 Stephane Carrez <Stephane.Carrez@worldnet.fr>
114 * interp.c (sim_store_register): Remove soft register hack.
115 (sim_fetch_register): Likewise.
116 (sim_create_inferior): Likewise.
117 * sim-main.h: Likewise.
119 2000-09-10 Stephane Carrez <Stephane.Carrez@worldnet.fr>
121 * interrupts.c (interrupts_update_pending): Clear the mask of
122 pending interrupts here.
123 (interrupts_get_current): Don't clear the mask of pending interrupts.
125 2000-09-10 Stephane Carrez <Stephane.Carrez@worldnet.fr>
127 * sim-main.h: Define cycle_to_string.
128 * dv-m68hc11tim.c (cycle_to_string): New function to translate
129 the cpu cycle into some formatted time string.
130 (m68hc11tim_print_timer): Use it.
131 * dv-m68hc11sio.c (m68hc11sio_info): Use cycle_to_string.
132 * dv-m68hc11spi.c (m68hc11spi_info): Likewise.
133 * interrupts.c (interrupts_info): Likewise.
134 * m68hc11_sim.c (cpu_info): Likewise.
136 2000-09-06 Stephane Carrez <Stephane.Carrez@worldnet.fr>
138 * dv-m68hc11tim.c (m68hc11tim_timer_event): Compute the overflow
139 interrupt and compare events accurately. Take into account the
140 pending ticks not processed by the simulator yet (introduced a shift).
141 (m68hc11_port_event): Reset the timer interrupt delays.
142 (m68hc11tim_io_read_buffer): Be able to read several bytes.
143 (m68hc11tim_io_write_buffer): Likewise for write.
144 (m68hc11tim_io_write_buffer): Recompute the timer overflow interrupt.
146 2000-09-06 Stephane Carrez <Stephane.Carrez@worldnet.fr>
148 * dv-m68hc11spi.c (m68hc11spi_io_read_buffer): Clear the interrupts.
149 (m68hc11spi_io_write_buffer): Likewise and fix the spi frame.
150 (m68hc11spi_info): Clarify the status report
151 of the SPI when a byte is being sent.
152 (m68hc11spi_clock): Fix the spi send frame.
154 2000-08-11 Stephane Carrez <Stephane.Carrez@worldnet.fr>
156 * sim-main.h (m68hc11_map_level): Define level of address mappings.
157 * dv-m68hc11eepr.c (struct m68hc11eepr ): New flag to indicate
158 whether the eeprom is currently mapped or not.
159 (m68hc11eepr_port_event): Use the flag to see if we must unmap
160 or map the eeprom. Update the flag to reflect the current state.
161 Use M6811_EEPROM_LEVEL when mapping the eeprom.
162 (m68hc11eepr_finish): Remove overlap hack.
163 (attach_m68hc11eepr_regs): Use M6811_IO_LEVEL when mapping the
164 config and control registers.
165 * dv-m68hc11.c (m68hc11cpu_finish): Remove overlap hack.
166 (attach_m68hc11_regs): Use M6811_IO_LEVEL.
167 (m68hc11cpu_io_write): Likewise when unmapping and re-mapping.
168 * dv-m68hc11spi.c (m68hc11spi_finish): Likewise.
169 (attach_m68hc11spi_regs): Likewise.
170 * dv-m68hc11tim.c (m68hc11tim_finish): Likewise.
171 (attach_m68hc11tim_regs): Likewise.
172 * dv-m68hc11sio.c (m68hc11sio_finish): Likewise.
173 (attach_m68hc11sio_regs): Likewise.
174 * interp.c (sim_open): Likewise.
175 * dv-nvram.c (attach_nvram_regs): Likewise.
177 Thu Jul 27 21:27:25 2000 Andrew Cagney <cagney@b1.cygnus.com>
179 * configure, config.in: Regenerate.
181 2000-06-25 Stephane Carrez <Stephane.Carrez@worldnet.fr>
183 * Makefile.in (SIM_RUN_OBJS): Define to use nrun.c
184 * dv-m68hc11.c (m68hc11cpu_finish): Register detach address callback.
185 (dv_m6811_detach_address_callback): New function to detach a
186 device from an address space.
187 * dv-m68hc11eepr.c (m68hc11eepr_port_event): Initialize
188 config register according to --cpu-config option.
189 * sim-main.h (_sim_cpu): Add cpu_config member.
190 * interp.c (sim_open): Delete specific simulator options.
191 * m68hc11_sim.c (cpu_option_handler): New options
192 --emulos and -cpu-config <val> to configure the simulator.
193 (cpu_initialize): Initialize cpu_config member.
195 2000-06-24 Stephane Carrez <Stephane.Carrez@worldnet.fr>
197 * emulos.c: Fix indentation and comments.
198 * gencode.c: Likewise.
199 * dv-m68hc11tim.c (m68hc11tim_timer_event): Handle COMPARE_EVENT.
200 (m68hc11tim_io_write_buffer): Write compare registers and
202 * interp.c: Remove unused global variables.
203 * interrupts.c (idefs): New compare interrupts.
204 Fix indentation and comments.
205 * interrupts.h: Likewise.
207 2000-06-18 Stephane Carrez <Stephane.Carrez@worldnet.fr>
209 * dv-m68hc11sio.c: Fix indentation and comments.
211 * dv-m68hc11.c: Fix indentation and comments.
212 (m68hc11cpu_port_event): Move initialization of M6811_HPRIO from here.
213 * m68hc11_sim.c (cpu_reset): To here.
214 * dv-m68hc11eepr.c: Fix indentation and comments.
216 2000-06-17 Stephane Carrez <Stephane.Carrez@worldnet.fr>
218 * dv-nvram.c: New file, rename from dv-pram.c.
219 * dv-pram.c: Delete file.
220 * sim-main.h: Incorporate m68hc11_sim.h.
221 * m68hc11_sim.h: Delete file.
222 * configure.in: Rename pram into nvram.
223 * interp.c (sim_open): Likewise in creation of device tree.
225 2000-05-31 Stephane Carrez <Stephane.Carrez@worldnet.fr>
227 * interp.c (sim_open): Create the SPI device.
228 * dv-m68hc11spi.c: New file for SPI device simulation.
229 * configure.in (hw_extra_devices): Add SPI device.
231 2000-05-28 Stephane Carrez <Stephane.Carrez@worldnet.fr>
233 * interrupts.c (interrupts_initialize): Clear XIRQ accounting.
234 (interrupts_process): Separate IRQ and XIRQ accounting.
235 (interrupts_info): Report XIRQ accounting.
236 * interrupts.h (struct interrupts): Added accounting for XIRQ.
238 2000-04-16 Stephane Carrez <stcarrez@worldnet.fr>
240 * dv-pram.c (attach_pram_regs): Fix the 'save-modified' mode.
241 * m68hc11_sim.h (_sim_cpu): Allow configuration of cpu mode.
242 * dv-m68hc11.c (attach_m68hc11_regs): Get the cpu MODA,MODB
243 configuration from the 'mode' device tree property.
244 (m68hc11cpu_port_event): Reset M6811_HPRIO to the cpu MODA, MODB
247 2000-02-24 Stephane Carrez <stcarrez@worldnet.fr>
249 * sim-main.h: Remove WITH_TARGET_* defines.
250 * Makefile.in (SIM_EXTRA_CFLAGS): Specify the WITH_TARGET_* flags.
252 2000-02-08 Stephane Carrez <stcarrez@worldnet.fr>
254 * dv-m68hc11sio.c (m68hc11sio_port_event): Setup the SCI to
255 1200 baud when cpu is in bootstrap mode.
257 * dv-m68hc11tim.c (m68hc11tim_io_write_buffer): Be able to
258 write in the TCTN timer register.
260 * dv-m68hc11sio.c (m68hc11sio_io_write_buffer): Divide cpu clock
261 by 4 to obtain the E clock frequency.
262 (sccr2_desc): Use M6811_TIE for TIE bit.
263 (m68hc11sio_info): Fix baud rate report.
265 * dv-m68hc11tim.c (to_realtime): Likewise.
267 * interp.c (sim_open): When building device tree, only provide
268 devices that do not exist yet.
270 * emulos.c: Fix compilation pb under Windows.
272 * dv-m68hc11.c (attach_m68hc11_regs): Get the clock frequency
273 from the 'clock' property.
275 2000-01-02 Stephane Carrez <stcarrez@worldnet.fr>
277 * m68hc11_sim.h (*_REGNUM): Define.
278 (_sim_cpu): New member cpu_page0_reg table.
279 * interp.c (sim_create_inferior): Fill the cpu_page0_reg table with
280 addresses of soft registers in .page0.
281 (sim_fetch_register, sim_store_register): Use cpu_page0_reg table
282 to get/set soft registers.
284 1999-12-31 Stephane Carrez <stcarrez@worldnet.fr>
286 * dv-m68hc11.c (m68hc11cpu_io_write_buffer): Clear byte to avoid
287 returning random values.
289 1999-12-17 Stephane Carrez <stcarrez@worldnet.fr>
291 * gencode.c: Fix "subb N,x" that used a instead of b.
293 1999-09-09 Stephane Carrez <stcarrez@worldnet.fr>
295 * gencode.c: Fixed sbc8 and adc8 when there was a initial carry.
297 1999-09-01 Stephane Carrez <stcarrez@worldnet.fr>
299 * sim-main.h (SIM_HANDLES_LMA): Define to enable loading using lma.
301 1999-08-14 Stephane Carrez <stcarrez@worldnet.fr>
303 * dv-m68hc11.c (attach_m68hc11_regs): Save the size of the
304 register region in the m68hc11cpu struct.
305 (m68hc11cpu_io_write): When the IO mapping addres changes,
306 detach the register region and re-attach it at the new address.
307 (m68hc11cpu_io_read_buffer): Renamed base_address into
309 (m68hc11cpu_io_write_buffer): Likewise. Pass the hw pointer
310 to m68hc11cpu_io_write.
312 1999-08-13 Stephane Carrez <stcarrez@worldnet.fr>
314 * gencode.c: For sbc8, check the carry and increment the source
315 before trying to set the carry for the result.
317 1999-05-24 John S. Kallal <kallal@voicenet.com>
319 * interp.c (sim_get_info): Don't crash if the command line is 0.
320 Define prototype for sim_get_info() and init_system().
321 (sim_info): Correct call to sim_get_info().
323 1999-05-16 Stephane Carrez <stcarrez@worldnet.fr>
325 * configure.in: Recognize m6811-*-*.
326 * configure: Regenerate.
327 * m68hc11_sim.h (cpu_ccr_update_add8, cpu_ccr_update_add16,
328 cpu_ccr_update_sub8, cpu_ccr_update_sub16):
329 Correct the computation of carry of 8 and 16-bits add and subtract.
330 * gencode.c: Use cpu_ccr_update_sub8 for subtraction (carry and
331 overflow set in a different manner than add).
333 1999-05-14 Stephane Carrez <stcarrez@worldnet.fr>
335 * dv-m68hc11.c (dv_m6811_attach_address_callback): Removed a
337 * interp.c (sim_open, sim_create_inferior): Initialize the
338 cpu_elf_start from the ELF header.
339 * m68hc11_sim.c (cpu_initialize): Clear the new data members.
340 (cpu_restart): Use cpu_elf_start as the starting address when
342 (cpu_special): When cpu_use_elf_start is set, the WAI instruction
343 exits the simulator (exit status is in D).
344 * m68hc11_sim.h (_sim_cpu): Added members cpu_use_elf_start and
345 cpu_elf_star to start execution at address specified in ELF file.
347 1999-05-02 Stephane Carrez <stcarrez@worldnet.fr>
349 * Makefile.in, config.in, configure, configure.in: New files.
350 * gencode.c: New file, generation of 68HC11 interpreter.
351 * m68hc11_sim.h, m68hc11_sim.c: New files, specific operations
353 * interrupts.c, interrupts.h: New files, management of interrupts.
354 * interp.c, sim-main.h,
355 * dv-m68hc11.c, dv-m68hc11eepr.c, dv-m68hc11sio.c,
356 dv-m68hc11tim.c, dv-pram.c: New files representing devices for
357 68HC11 (dv-pram.c is generic and could probably migrate to common).
358 * emulos.c: New file, basic emulation of some os.