11.3. Examples of Simulator Use

This section contains several example of using the target Microprocessor simulator.

$ erc-coff-run hello
Hello world
$ erc-coff-run -s hello
Clock Cycles
  regular     :      1735, 67.56 %
  annulled    :         2, 0.08 %
  stalls      :       831, 32.36 %
  Total       :      2568
Instructions
  call       :        12, 1.01 %
  woverflow  :         0, 0.00 % (0.00 % of calls)
  wunderflow :         0, 0.00 % (0.00 % of calls)
  integer    :       622, 52.23 %
  load       :       159, 13.35 %
  store      :       211, 17.72 %
  branch     :       199, 16.71 %
  float      :         0, 0.00 %
  Total      :      1191
Average Cycles per Instruction (CPI)
 Integer CPI  :      2.16
 Float CPI    :       nan
 Overall CPI  :      2.16
Performance
  ERC32 performance (10.0 MHz):  4.64 MOPS ( 4.64 MIPS,  0.00 MFLOPS)
  Simulated ERC32 time        :  0.26 ms
  Processor utilisation       : 100.00 %
  Real-time / simulator-time  : 1/0.00 
  Simulator performance       : 1 KIPS
  Used time (sys + user)      :   0 s

Hello World

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
/home/nettleto/xgc/work/erc32-ada/gcc/ada/rts/x-seriio.adb:168
 <write+38>
     250.000 02001AA8 ldub  [ %i1 + %o2 ], %o0
     250.200 02001AAC cmp  %o0, 0xa
     250.400 02001AB0 bne  0x2001ae0
     250.500 02001AB4 mov  %o4, %o1
/home/nettleto/xgc/work/erc32-ada/gcc/ada/rts/x-seriio.adb:169
     250.600 02001AB8 ld  [ %o4 + 0xe8 ], %o0
     250.800 02001ABC btst  4, %o0
     251.000 02001AC0 bne  0x2001ad8
     251.100 02001AC4 nop 
/home/nettleto/xgc/work/erc32-ada/gcc/ada/rts/x-seriio.adb:173
 <write+68>
     251.200 02001AD8 st  %g3, [ %o5 + 0xe0 ]
/home/nettleto/xgc/work/erc32-ada/gcc/ada/rts/x-seriio.adb:176
     251.500 02001ADC mov  %o4, %o1
     251.600 02001AE0 ld  [ %o1 + 0xe8 ], %o0
     251.800 02001AE4 btst  4, %o0
     252.000 02001AE8 be  0x2001ae0
     252.100 02001AEC nop 
/home/nettleto/xgc/work/erc32-ada/gcc/ada/rts/x-seriio.adb:180
     252.200 02001AF0 ldub  [ %i1 + %o2 ], %o0
     252.400 02001AF4 st  %o0, [ %o5 + 0xe0 ]
...lots of output...