Previous - Up - Next

8.3   Running and Stepping

The run-cycles command is used in the example above. It will run a particular number of cycles before returning to prompt. It is more appropriate to use this command than the run (continue) command when running MAI since the run command will run a certain number of instructions (steps) and this may not add up to an even number of cycles causing a cycle to be incomplete. The same holds for step-instruction and step breakpoints inserted by the step-break and step-break-absolute commands.

Steps are consumed just before an instruction is committed, or an exception or interrupt is handled. Breaking after a number of steps may force the MAI module to break inside a cycle. It is up to the module to decide what action to take if this happens. SIM_instruction_proceed, SIM_instruction_commit, SIM_instruction_handle_exception, and SIM_instruction_handle_interrupt will return special value if the simulation should be stopped at the next step count. The module can call SIM_break_cycle(cpu, 0) or SIM_break_simulation and then exit the cycle handler to return to prompt. The sample-micro-arch and ooo-micro-arch do this after printing a warning message.

To advance the simulation a single cycle use the step-cycle command. A neat combination of commands is:

simics> sc; piq -v

sc is short for step-cycle and piq is short for print-instruction-queue. With this it is easy to monitor changes in the instruction tree for each new cycle.

For multiprocessor systems there is a special command called step-cycle-single or scs for short that steps the first processor one cycle, then if reinvoked it steps the next processor one cycle etc. The current fronted processor is changed between each invocation making inspection commands like print-instruction-queue to work on the newly stepped processor:

simics> scs; piq -v

Previous - Up - Next