LST

ERCO

CSI ]   [ ETH ]

Comments ]

LST Home ]   [ LST People ] [ LST Research ]   [ LST Teaching ] [ ERCO ]

Using ERCO - HOWTO

This page provides a quick introduction to the ERCO compiler usage.

Compiling HelloWorld

  • Compile the Java source
    javac HelloWorld.java
  • Compile the Intel binary
    ercc -main HelloWorld -out HelloWorld HelloWorld
    This will generate an intel binary executable named HelloWorld. The -main specifies which class contains the main method.

Computing the WCET of a program

  • Compile the Java source
    javac MyProgram.java
  • Compile the Intel binary enabling the WCET analysis
    ercc -wcet -main MyProgram -out MyProgram MyProgram
    This will generate, in addition to the executable, an annotated MyProgram.s file with additional information (number of loop iterations, false paths, ...)
  • Run the WCET estimator
    ercta MyProgram.s
    This will produce a file MyProgram.simulated with some information about the simulated processor behavior (program length in cycles, cycles per instruction, ...) for each method. Example:
    Method: TestShort01::main(JArray *)
    
    length:                 80242.19970003002
    cycles per instruction: 2.673536942931175
    branch speculation:     9.997000899730081E-5
    L1 cache misses:        0.0
    
            retired instructions:   30013.49950005
    			    
    In this example the main method length is 80'242 cycles, on the average 2.67 cycles were needed to execute an instruction, branches were always predicted correctly and there were no cache misses.
  • To check the result you can measure the real behavior of the program (the perfmod kernel module must be installed)
    measure MyProgram
    This produces a file MyProgram.measured with information about the real processor behavior measured with the Intel on-chip performance counters. Example:
    Overhead
            Overhead (number of samples):          12
            Overhead (mean):               21,799,903.69
            Overhead (standard deviation):  4,812,346.71
            Overhead (error):                      22.08%
            Overhead (best):               18,322,204.25
            Overhead (worst):              29,967,641.00
    
    CPU_CLK_UNHALTED
            CPU_CLK_UNHALTED (number of samples):           4
            CPU_CLK_UNHALTED (mean):               21,975,885.6875
            CPU_CLK_UNHALTED (standard deviation):  4,177,879.0007
            CPU_CLK_UNHALTED (error):                      19.01%
            CPU_CLK_UNHALTED (best):               18,556,318.7500
            CPU_CLK_UNHALTED (worst):              27,898,928.0000
    
    INST_RETIRED
            INST_RETIRED (number of samples):           4
            INST_RETIRED (mean):               14,266,994.6250
            INST_RETIRED (standard deviation):  3,102,665.8871
            INST_RETIRED (error):                      21.75%
            INST_RETIRED (best):               11,846,911.0000
            INST_RETIRED (worst):              18,635,607.5000
    
    Time
            Time (number of samples):          12
            Time (mean):               39,893,782.27
            Time (standard deviation):  6,174,433.24
            Time (error):                      15.48%
            Time (best):               30,538,630.75
            Time (worst):              49,841,554.00
    
    CPI: 1.5403304105120879
    
    BrPred: 0.8221425292242432
    
    WCET: 1.8093878583333336E7
    			    
    For each value that is measured (specified with the -e option) the file contains some statistics: the number of measurements (this can be different for each event), the mean over all the measurements, the standard deviation, the error and the biggest and smallest measurement. The first set of values (Overhead) refers to the length in cycles of a dummy measurement to estimate the tool's overhead. At the end of the file there is a summary with information similar to the one generated by the simulator (cycles per instructions, ...).