Getting Started with M68K Coral 66: Compilation System for the Motorola M68000 Family | ||
---|---|---|
Prev | Chapter 1. Basic Techniques | Next |
The simulator supports several options including the trace option (-t) and the statistics option (-s). Use the option --help for more information.
Example 1-8. Simulator Options
$ m68k-coff-run --help Usage: m68k-coff-run [options] [file...] Options: -a "ARGS", --args "ARGS" Pass ARGS to simulator -B, --branch-report Print branch coverage report -b, --branch-summary Print branch coverage summary -C, --coverage-report Print coverage report -c, --coverage-summary Print coverage summary -d T, --delay T Delay trace for T uSec -f MOD, --file FILE Report coverage for this source file only -h, --help Print this message -i I, --pending I Trigger trace on pending interrupt I -I I, --interrupt I Trigger trace on interrupt level I -l T, --limit T Time limit T uSec -m, --trace-memory Trace data memory cycles -M, --trace-memory-wide Trace data and instruction memory cycles -p, --perf Print performance summary -P PC, --pc PC Trigger trace on pc = PC (use 0x for hex) -r, --ram-tags-report Print RAM tags report with large blocks -R, --RAM-tags-report Print RAM tags report with small blocks -s, --stats Print execution statistics -t, --trace Trace instructions using 70 columns -T, --trace-wide Trace instructions using wide format -u U, --resolution U Set task trace resolution to U uSec -v, --verbose Print additional information -V, --version Print version number -w, --wide Widen a trace or report -y, --nosys Don't pass system calls to host -z, --tasking-report Print task switching report -Z, --tasking-report-wide Print task switching report wide format Simulator options are: -freq F Set the clock frequency to F MHz (default 25 MHz) -rbw Regard read before write as a fault -no-rbw Allow read before write (return 0) (default) -cpu=mc68000 Change to MC68000 CPU -cpu=mc68008 Change to MC68008 CPU -cpu=mc68010 Change to MC68010 CPU -cpu=mc68020 Change to MC68020 CPU -cpu=mc68040 Change to MC68040 CPU -cpu=cpu32 Change to CPU32 CPU -cpu=mc68881 Also simulate a MC68881/2 coprocessor (= -fpu) -fpu Run with floating-point coprocessor -no-fpu Run without floating-point coprocessor (default) -soe Stop on exception (default) -no-soe Don't stop on exceptions (let CPU handle them) -uarta DEV Connect UARTA to DEV (default stdin/stdout) -uartb DEV Connect UARTB to DEV -uben Swap roles of UARTs A and B Report problems to <support@xgc.com>
You can trace the execution of your program using the trace option. The output is a line of trace information for each instruction executed. The trace information gives the execution time so far (in microseconds), and program counter and the disassembled instruction. Source file names and lines numbers are printed where the source was compiled with the debug option. Linker labels are printed too.
Example 1-9. Simulator Trace
$ m68k-coff-run -t hello2 <__cold_start> ----------------------- -- Instruction trace -- ----------------------- ------------+-------+----+-+-----+--------+----------------------------- CPU time in pending ----psr----- disassembled microseconds 7654321 ttsm i xnzvc pc instruction ------------+-------+----+-+-----+--------+----------------------------- ... main(): examples/hello2.cor:26 <main> 47.120 s 0 z 00000668: linkw %fp,#0 47.240 s 0 z 0000066C: cmpal %sp,%a5 47.320 s 0 n c 0000066E: bmis 0x672 examples/hello2.cor:32 47.400 s 0 n c 00000672: pea 0x1030 47.520 s 0 n c 00000678: pea 0x1 47.640 s 0 n c 0000067C: jsr 0x6bc outstring__Fii(): examples/coralio.cor:51 <outstring(int, int)> 47.760 s 0 n c 000006BC: linkw %fp,#0 47.880 s 0 n c 000006C0: moveml %d2-%d3/%a2-%a4,-(%sp) 48.200 s 0 n c 000006C4: movel 8(%fp),%d3 48.320 s 0 000006C8: moveal 12(%fp),%a4 48.440 s 0 000006CC: cmpal %sp,%a5 48.520 s 0 n c 000006CE: bmis 0x6d2 ...