C.3. Examples of Simulator Use

The following example shows an instruction trace with line numbers. We have delayed the trace by 200 microseconds to skip to the lines of interest.


$ erc-coff-run -t -d 250 hello
memcpy():
/opt/erc32-ada-1.7.4b1/erc-coff/src/libc/string/memcpy.c:48
 <memcpy+18>
-----------------------
-- Instruction trace --
-----------------------

Trace timing starts at   250.000 microseconds

------------+----------------+--------+---+-+--------+---------------------------------------
CPU time in  -----intpdr----- -----psr------          disassembled
microseconds fedcba9876543210 nzvc pil spe c       pc instruction
------------+----------------+--------+---+-+--------+---------------------------------------
       0.000                         0   e 5 02003AE4 orcc  %o2, 0, %g2
       0.050                         0   e 5 02003AE8 bne  0x2003ad4
       0.100                         0   e 5 02003AEC add  %o2, -1, %o2
/opt/erc32-ada-1.7.4b1/erc-coff/src/libc/string/memcpy.c:47
 <memcpy+8>
       0.150                         0   e 5 02003AD4 ldub  [ %o1 ], %g2
       0.250                         0   e 5 02003AD8 stb  %g2, [ %g3 ]
       0.400                         0   e 5 02003ADC inc  %o1
       0.450                         0   e 5 02003AE0 inc  %g3
/opt/erc32-ada-1.7.4b1/erc-coff/src/libc/string/memcpy.c:48
       0.500                         0   e 5 02003AE4 orcc  %o2, 0, %g2
       0.550                         0   e 5 02003AE8 bne  0x2003ad4
       0.600                         0   e 5 02003AEC add  %o2, -1, %o2
/opt/erc32-ada-1.7.4b1/erc-coff/src/libc/string/memcpy.c:47
 <memcpy+8>
       0.650                         0   e 5 02003AD4 ldub  [ %o1 ], %g2
       0.750                         0   e 5 02003AD8 stb  %g2, [ %g3 ]
       0.900                         0   e 5 02003ADC inc  %o1
       0.950                         0   e 5 02003AE0 inc  %g3
/opt/erc32-ada-1.7.4b1/erc-coff/src/libc/string/memcpy.c:48
       1.000                         0   e 5 02003AE4 orcc  %o2, 0, %g2
       1.050                         0   e 5 02003AE8 bne  0x2003ad4
       1.100                         0   e 5 02003AEC add  %o2, -1, %o2
/opt/erc32-ada-1.7.4b1/erc-coff/src/libc/string/memcpy.c:47
...lots of output...

In this second example we run the demo program then interrupt with Ctrl-C. Using the -z option we get a short report on tasking showing task switches and the lock levels in the current task.


$ erc-coff-run demo -z
...
Ctrl-C
...


Tasks, y-axis is task number

  '>' Task running
  '.' Task in ready queue
  ' ' Task blocked

>   >  > >    > > >>   >>> > >  > > >  > > >>>>  >> > >    > > >>   >>|  1
                                                                      |  2
    >         >         >         >         >         >         >     |  3
    >         >         >         >         >         >         >     |  4
    >         >         >         >         >         >         >     |  5
    >         >         >         >         >         >         >     |  6
    >         >         >         >         >         >         >     |  7
    >    >    >    >    >    >    >    >    >    >    >    >    >    >|  8
    >    >    >    >    >    >    >    >    >    >    >    >    >    >|  9
    >    >    >    >    >    >    >    >    >    >    >    >    >    .| 10
    >    >    >    >    >    >    >    >    >    >    >    >    >    .| 11
    >    >    >    >    >    >    >    >    >    >    >    >    >    .| 12
>      > >      > >    > > >    >   >    > > >    > > >      > >    > | 13
>      > >      > >    > > >    >   >    > > >    > > >      > >    > | 14
>      > >      > >    > > >    >   >    > > >    > > >      > >    > | 15
>      > >      > >    > > >    >   >    > > >    > > >      > >    > | 16
>      > >      > >    > > >    >   >    > > >    > > >      > >    > | 17
                                                                      | 18
                                              >                       | 19
+---------+---------+---------+---------+---------+---------+---------0
-700000   -600000   -500000   -400000   -300000   -200000   -100000   
                                                  uSec before end time


Locks and active priority for current task (above), y-axis is priority
Note: blank rows omitted

  'b' No locks, therefore base priority
  '1' One lock, active priority inherited

                                              1                       | 132
1   1  1 1    1 1 11   111 1 1  1 1 1  1 1 111   11 1 1    1 1 11   11| 127
b      b b      b b    b b b    b   b    b b b    b b b      b b    b |  11
    b    b    b    b    b    b    b    b    b    b    b    b    b    b|  10
                                              b                       |   5
b   b  b b    b b bb   bbb b b  b b b  b b bbbb  bb b b    b b bb   bb|   0
+---------+---------+---------+---------+---------+---------+---------0
-700000   -600000   -500000   -400000   -300000   -200000   -100000   
                                                  uSec before end time