Lines Matching refs:sd
41 static void sim_get_info (SIM_DESC sd, char *cmd);
70 free_state (SIM_DESC sd) in free_state() argument
72 if (STATE_MODULES (sd) != NULL) in free_state()
73 sim_module_uninstall (sd); in free_state()
75 sim_state_free (sd); in free_state()
80 sim_get_info (SIM_DESC sd, char *cmd) in sim_get_info() argument
84 cpu = STATE_CPU (sd, 0); in sim_get_info()
92 arch = STATE_ARCHITECTURE (sd); in sim_get_info()
106 sim_io_eprintf (sd, "Device '%s' not found.\n", cmd); in sim_get_info()
107 sim_io_eprintf (sd, "Valid devices: cpu timer sio eeprom\n"); in sim_get_info()
110 hw_dev = sim_hw_parse (sd, "%s", dev_list[i].device); in sim_get_info()
113 sim_io_eprintf (sd, "Device '%s' not found\n", dev_list[i].device); in sim_get_info()
120 cpu_info (sd, cpu); in sim_get_info()
121 interrupts_info (sd, &M68HC11_SIM_CPU (cpu)->cpu_interrupts); in sim_get_info()
126 sim_board_reset (SIM_DESC sd) in sim_board_reset() argument
134 cpu = STATE_CPU (sd, 0); in sim_board_reset()
136 arch = STATE_ARCHITECTURE (sd); in sim_board_reset()
150 hw_cpu = sim_hw_parse (sd, "%s", cpu_type); in sim_board_reset()
153 sim_io_eprintf (sd, "%s cpu not found in device tree.", cpu_type); in sim_board_reset()
163 sim_hw_configure (SIM_DESC sd) in sim_hw_configure() argument
170 arch = STATE_ARCHITECTURE (sd); in sim_hw_configure()
174 cpu = STATE_CPU (sd, 0); in sim_hw_configure()
177 device_tree = sim_hw_parse (sd, "/"); in sim_hw_configure()
186 sim_do_commandf (sd, "memory region 0x%x@%d,0x%x", in sim_hw_configure()
189 sim_do_commandf (sd, "memory region 0x000@%d,0x8000", in sim_hw_configure()
191 sim_hw_parse (sd, "/m68hc11/reg 0x1000 0x03F"); in sim_hw_configure()
194 sim_do_commandf (sd, "memory region 0x%x@%d,0x100000", in sim_hw_configure()
196 sim_hw_parse (sd, "/m68hc11/use_bank 1"); in sim_hw_configure()
201 sim_hw_parse (sd, "/m68hc11/mode %s", m68hc11_cpu->cpu_start_mode); in sim_hw_configure()
205 sim_hw_parse (sd, "/m68hc11/m68hc11sio/reg 0x2b 0x5"); in sim_hw_configure()
206 sim_hw_parse (sd, "/m68hc11/m68hc11sio/backend stdio"); in sim_hw_configure()
207 sim_hw_parse (sd, "/m68hc11 > cpu-reset reset /m68hc11/m68hc11sio"); in sim_hw_configure()
212 sim_hw_parse (sd, "/m68hc11/m68hc11tim/reg 0x1b 0x5"); in sim_hw_configure()
213 sim_hw_parse (sd, "/m68hc11 > cpu-reset reset /m68hc11/m68hc11tim"); in sim_hw_configure()
214 sim_hw_parse (sd, "/m68hc11 > capture capture /m68hc11/m68hc11tim"); in sim_hw_configure()
220 sim_hw_parse (sd, "/m68hc11/m68hc11spi/reg 0x28 0x3"); in sim_hw_configure()
221 sim_hw_parse (sd, "/m68hc11 > cpu-reset reset /m68hc11/m68hc11spi"); in sim_hw_configure()
226 sim_hw_parse (sd, "/m68hc11/nvram/reg 0x0 256"); in sim_hw_configure()
227 sim_hw_parse (sd, "/m68hc11/nvram/file m68hc11.ram"); in sim_hw_configure()
228 sim_hw_parse (sd, "/m68hc11/nvram/mode save-modified"); in sim_hw_configure()
233 sim_hw_parse (sd, "/m68hc11/m68hc11eepr/reg 0xb000 512"); in sim_hw_configure()
234 sim_hw_parse (sd, "/m68hc11 > cpu-reset reset /m68hc11/m68hc11eepr"); in sim_hw_configure()
236 sim_hw_parse (sd, "/m68hc11 > port-a cpu-write-port /m68hc11"); in sim_hw_configure()
237 sim_hw_parse (sd, "/m68hc11 > port-b cpu-write-port /m68hc11"); in sim_hw_configure()
238 sim_hw_parse (sd, "/m68hc11 > port-c cpu-write-port /m68hc11"); in sim_hw_configure()
239 sim_hw_parse (sd, "/m68hc11 > port-d cpu-write-port /m68hc11"); in sim_hw_configure()
240 m68hc11_cpu->hw_cpu = sim_hw_parse (sd, "/m68hc11"); in sim_hw_configure()
248 sim_do_commandf (sd, "memory region 0x%x@%d,0x%x", in sim_hw_configure()
250 sim_do_commandf (sd, "memory region 0x000@%d,0x8000", in sim_hw_configure()
254 sim_do_commandf (sd, "memory region 0x%x@%d,0x100000", in sim_hw_configure()
256 sim_hw_parse (sd, "/m68hc12/use_bank 1"); in sim_hw_configure()
258 sim_hw_parse (sd, "/m68hc12/reg 0x0 0x3FF"); in sim_hw_configure()
263 sim_hw_parse (sd, "/m68hc12/m68hc12sio@1/reg 0xC0 0x8"); in sim_hw_configure()
264 sim_hw_parse (sd, "/m68hc12/m68hc12sio@1/backend stdio"); in sim_hw_configure()
265 sim_hw_parse (sd, "/m68hc12 > cpu-reset reset /m68hc12/m68hc12sio@1"); in sim_hw_configure()
270 sim_hw_parse (sd, "/m68hc12/m68hc12tim/reg 0x1b 0x5"); in sim_hw_configure()
271 sim_hw_parse (sd, "/m68hc12 > cpu-reset reset /m68hc12/m68hc12tim"); in sim_hw_configure()
272 sim_hw_parse (sd, "/m68hc12 > capture capture /m68hc12/m68hc12tim"); in sim_hw_configure()
278 sim_hw_parse (sd, "/m68hc12/m68hc12spi/reg 0x28 0x3"); in sim_hw_configure()
279 sim_hw_parse (sd, "/m68hc12 > cpu-reset reset /m68hc12/m68hc12spi"); in sim_hw_configure()
284 sim_hw_parse (sd, "/m68hc12/nvram/reg 0x2000 8192"); in sim_hw_configure()
285 sim_hw_parse (sd, "/m68hc12/nvram/file m68hc12.ram"); in sim_hw_configure()
286 sim_hw_parse (sd, "/m68hc12/nvram/mode save-modified"); in sim_hw_configure()
290 sim_hw_parse (sd, "/m68hc12/m68hc12eepr/reg 0x0800 2048"); in sim_hw_configure()
291 sim_hw_parse (sd, "/m68hc12 > cpu-reset reset /m68hc12/m68hc12eepr"); in sim_hw_configure()
294 sim_hw_parse (sd, "/m68hc12 > port-a cpu-write-port /m68hc12"); in sim_hw_configure()
295 sim_hw_parse (sd, "/m68hc12 > port-b cpu-write-port /m68hc12"); in sim_hw_configure()
296 sim_hw_parse (sd, "/m68hc12 > port-c cpu-write-port /m68hc12"); in sim_hw_configure()
297 sim_hw_parse (sd, "/m68hc12 > port-d cpu-write-port /m68hc12"); in sim_hw_configure()
298 m68hc11_cpu->hw_cpu = sim_hw_parse (sd, "/m68hc12"); in sim_hw_configure()
306 sim_get_bank_parameters (SIM_DESC sd) in sim_get_bank_parameters() argument
313 cpu = STATE_CPU (sd, 0); in sim_get_bank_parameters()
316 addr = trace_sym_value (sd, BFD_M68HC11_BANK_START_NAME); in sim_get_bank_parameters()
320 size = trace_sym_value (sd, BFD_M68HC11_BANK_SIZE_NAME); in sim_get_bank_parameters()
324 addr = trace_sym_value (sd, BFD_M68HC11_BANK_VIRTUAL_NAME); in sim_get_bank_parameters()
337 sim_prepare_for_program (SIM_DESC sd, bfd* abfd) in sim_prepare_for_program() argument
343 cpu = STATE_CPU (sd, 0); in sim_prepare_for_program()
367 if (STATE_LOAD_AT_LMA_P (sd)) in sim_prepare_for_program()
380 if (sim_get_bank_parameters (sd) != 0) in sim_prepare_for_program()
381 sim_io_eprintf (sd, "Memory bank parameters are not initialized\n"); in sim_prepare_for_program()
385 if (!sim_hw_configure (sd)) in sim_prepare_for_program()
389 sim_board_reset (sd); in sim_prepare_for_program()
414 SIM_DESC sd; in sim_open() local
417 sd = sim_state_alloc (kind, callback); in sim_open()
419 SIM_ASSERT (STATE_MAGIC (sd) == SIM_MAGIC_NUMBER); in sim_open()
425 if (sim_cpu_alloc_all_extra (sd, 0, sizeof (struct m68hc11_sim_cpu)) in sim_open()
428 free_state (sd); in sim_open()
432 cpu = STATE_CPU (sd, 0); in sim_open()
434 cpu_initialize (sd, cpu); in sim_open()
436 if (sim_pre_argv_init (sd, argv[0]) != SIM_RC_OK) in sim_open()
438 free_state (sd); in sim_open()
443 if (sim_parse_args (sd, argv) != SIM_RC_OK) in sim_open()
447 free_state (sd); in sim_open()
452 if (sim_analyze_program (sd, STATE_PROG_FILE (sd), abfd) != SIM_RC_OK) in sim_open()
454 free_state (sd); in sim_open()
459 if (sim_config (sd) != SIM_RC_OK) in sim_open()
461 free_state (sd); in sim_open()
465 if (sim_post_argv_init (sd) != SIM_RC_OK) in sim_open()
469 free_state (sd); in sim_open()
472 if (sim_prepare_for_program (sd, abfd) != SIM_RC_OK) in sim_open()
474 free_state (sd); in sim_open()
481 cpu = STATE_CPU (sd, i); in sim_open()
489 return sd; in sim_open()
496 sim_engine_run (SIM_DESC sd, in sim_engine_run() argument
503 SIM_ASSERT (STATE_MAGIC (sd) == SIM_MAGIC_NUMBER); in sim_engine_run()
504 cpu = STATE_CPU (sd, 0); in sim_engine_run()
510 if (sim_events_tickn (sd, M68HC11_SIM_CPU (cpu)->cpu_current_cycle)) in sim_engine_run()
512 sim_events_process (sd); in sim_engine_run()
518 sim_info (SIM_DESC sd, bool verbose) in sim_info() argument
524 if (verbose == 0 && STATE_VERBOSE_P (sd) == 0) in sim_info()
527 arch = STATE_ARCHITECTURE (sd); in sim_info()
533 sim_io_eprintf (sd, "Simulator info:\n"); in sim_info()
534 sim_io_eprintf (sd, " CPU Motorola %s\n", cpu_type); in sim_info()
535 sim_get_info (sd, 0); in sim_info()
536 sim_module_info (sd, verbose || STATE_VERBOSE_P (sd)); in sim_info()
540 sim_create_inferior (SIM_DESC sd, struct bfd *abfd, in sim_create_inferior() argument
543 return sim_prepare_for_program (sd, abfd); in sim_create_inferior()