Update static initializer for MARSSx86 in DRAMSim.h
Deleted huge unzipped trace file
Moved power parameters from global scope into MemoryController

Fixes the #define issues with SST+gem5
Remove the 2GHz CPU clock assumption

If you were still using the 2GHz assumption, please the call to
setCPUClockSpeed() manually in your code.
example_app: pass missing bool argument to printStats

Otherwise it does not build.

Signed-off-by: Emilio G. Cota <cota@braap.org>
example_app: add dramsim_test to .gitignore

Signed-off-by: Emilio G. Cota <cota@braap.org>
gitignore: add *.deppo

Signed-off-by: Emilio G. Cota <cota@braap.org>
traces: add *.trc to gitignore

Signed-off-by: Emilio G. Cota <cota@braap.org>
TraceBasedSim: remove unused variable 'dramsim_logfile'

Signed-off-by: Emilio G. Cota <cota@braap.org>
PrintMacros: add missing include of <iostream>

The header file should be safely included even if there are
no other previously included header files. Fix it.

Signed-off-by: Emilio G. Cota <cota@braap.org>
PrintMacros: define SHOW_SIM_OUTPUT as weak symbol

When linking against libdramsim, library users have to define
SHOW_SIM_OUTPUT in order to avoid linking errors.

Fix it by emitting a weak version of the symbol. In case of the
DRAMSim tool, this weak symbol is overridden by the (strong) symbol
in the TraceBasedSim object.

Library users can optionally override the weak symbol, which means
that

a) New users of the library just won't have to worry about this,
   since they won't see an error at link time. They'll still be
   able to enable output by defining a strong symbol.

b) Existing users of the library will probably have already set
   a strong symbol, which will override the weak symbol we define
   here, and thus everything will work as before.

Signed-off-by: Emilio G. Cota <cota@braap.org>
Makefile: do not include TraceBasedSim object in library

This object should only be part of the DRAMSim executable.
Fix it.

Signed-off-by: Emilio G. Cota <cota@braap.org>
Makefile: build static library with libdramsim.a

Signed-off-by: Emilio G. Cota <cota@braap.org>
AddressMapping: precompute log2 values to increase performance

The log2 function is slow. But this is not the issue; calling it
in the hot path is the real (performance) issue.

The appended precomputes frequently-used values to avoid computing
them in the hot path. This results in a lot less instructions
executed, and a significant increase in performance.

This closes issue #46: simulation performance.

Before the patch:

 Performance counter stats for './DRAMSim -t traces/k6_aoe_02_short.trc -d ini/DDR3_micron_16M_8B_x8_sg15.ini -s system.ini.example -c 10000000' (3 runs):

      20507.071226 task-clock                #    1.000 CPUs utilized            ( +-  1.09% )
                61 context-switches          #    0.000 M/sec                    ( +-  0.95% )
                 0 CPU-migrations            #    0.000 M/sec
               468 page-faults               #    0.000 M/sec
    58,683,786,689 cycles                    #    2.862 GHz                      ( +-  0.69% ) [83.33%]
    13,434,240,170 stalled-cycles-frontend   #   22.89% frontend cycles idle     ( +-  2.80% ) [83.34%]
     5,915,970,070 stalled-cycles-backend    #   10.08% backend  cycles idle     ( +-  4.87% ) [66.67%]
   120,280,797,002 instructions              #    2.05  insns per cycle
                                             #    0.11  stalled cycles per insn  ( +-  0.00% ) [83.33%]
    23,425,385,282 branches                  # 1142.308 M/sec                    ( +-  0.01% ) [83.34%]
       226,637,631 branch-misses             #    0.97% of all branches          ( +-  1.03% ) [83.33%]

      20.514895432 seconds time elapsed                                          ( +-  1.09% )

After:

 Performance counter stats for './DRAMSim -t traces/k6_aoe_02_short.trc -d ini/DDR3_micron_16M_8B_x8_sg15.ini -s system.ini.example -c 10000000' (3 runs):

      15562.506598 task-clock                #    1.000 CPUs utilized            ( +-  0.72% )
                55 context-switches          #    0.000 M/sec
                 0 CPU-migrations            #    0.000 M/sec                    ( +-100.00% )
               469 page-faults               #    0.000 M/sec                    ( +-  0.07% )
    43,650,612,082 cycles                    #    2.805 GHz                      ( +-  0.58% ) [83.33%]
    11,878,548,969 stalled-cycles-frontend   #   27.21% frontend cycles idle     ( +-  1.46% ) [83.33%]
     6,125,126,936 stalled-cycles-backend    #   14.03% backend  cycles idle     ( +-  3.74% ) [66.67%]
    82,655,485,444 instructions              #    1.89  insns per cycle
                                             #    0.14  stalled cycles per insn  ( +-  0.01% ) [83.33%]
    14,515,927,254 branches                  #  932.750 M/sec                    ( +-  0.02% ) [83.34%]
       235,566,078 branch-misses             #    1.62% of all branches          ( +-  1.87% ) [83.34%]

      15.568698124 seconds time elapsed                                          ( +-  0.72% )

Signed-off-by: Emilio G. Cota <cota@braap.org>
DRAMSim: export Ini configuration getters

External simulators have no way of fetching configuration values
from the Ini file. This is a limitation that forces these simulators
to directly read the config file (e.g. gem5 with its dramsim_wrapper
class), which is a bad idea because a) the file is read twice
b) the DRAMSim overrides and sanity checks are ignored.

To avoid these limitations, the appended exports getters for
configuration values. These values are read directly from the
internal data structures, so that the configuration file is
only read once, as it should be.

Signed-off-by: Emilio G. Cota <cota@braap.org>
Merge pull request #51 from cota/for_dramninjas

For dramninjas
Merge pull request #52 from cota/perf_for_dramninjas

AddressMapping: precompute log2 values to increase performance
Merge pull request #53 from cota/ini_for_dramninjas

DRAMSim: export Ini configuration getters