Code Monkey home page Code Monkey logo

gem5tomcpat's Introduction

From GEM5 Statistics to McPAT Input

This repository contains a script to convert GEM5 simulation statistics to McPAT compatible inputs.

My Notes

  • Create description file python2 GEM5ToMcPAT.py my_STATS/base/canneal_simsmall_64_0 templates/template-xeon_my_4_4.xml
  • Run (TODO) python2 run_extract.py base_canneal_simsmall_64_0_4_4 base_canneal_simsmall_64_0_4_8

Quick Start

Use the following command to invoke the script:
GEM5ToMcPAT.py [options] <gem5 stats file> <gem5 config file (json)> <mcpat template file>

For more options, please run:
GEM5ToMcPAT.py -h

Example

This repository contains a sample GEM5 generated stats file, a processor configuration file produced by GEM5 and a McPAT template file. To run GEM5ToMcPAT.py use:
GEM5ToMcPAT.py stats.txt config.json template-xeon.xml

The above command will produce mcpat-out.xml file. mcpat-out.xml can be used in the usual way with McPAT.
<mcpat-bin> -infile mcpat-out.xml

Internals

###Preparing Template File The above example uses a template file created by modifying ProcessorDescriptionFiles/Xeon.xml from McPAT. The parameters in Xeon.xml that should get their value from GEM5 configuration (config.json) should be replaced with config.<parameter_path>. Please take a look at the template-xeon.xml to get the hang of it. For example,
<param name="number_hardware_threads" value="2"/>
should be replaced by
<param name="number_hardware_threads" value="config.system.cpu.numThreads"/>
in the template file.

Any standard computation in python-supported format is allowed. For example, the following is acceptable:
<param name="target_core_clockrate" value="1e-6/config.system.cpu_clk_domain.clock"/><!--MHz -->

Similarly, statistics that should use values from GEM5 statistics (stats.txt) should be replaced with stats.<stat_path>. For example,
<stat name="total_cycles" value="100000"/>
should be replaced by
<stat name="total_cycles" value="stats.system.cpu.numCycles"/>
in the template file.

###Modifying Script The workhorse function of the script is dumpMcpatOut. It first replaces all the config parameters by using the values from config.json and subsequently works on stats parameters. This is the place to fix things if anything does not work for you.

Miscellaneous

These scripts are inspired by m5-mcpat.pl script but implemented in python instead of perl.

gem5tomcpat's People

Contributors

dskhudia avatar zhewen404 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.