Coder Social home page Coder Social logo

hint-cache-sim's Introduction

Hint-Cache-Sim

This is a small cache simulator, written in pyhtin. It is able to simulate an Optimal trace based on the OPT or Belady algorithm. It will also simulate a HINT policy based on OPT and LRU.

How to use the tool

Currently only the trace can be given as an argument.

python cache-sim.py <traceFile.txt.gz> <#associativity> <#sets> <ProgBar>

An example to ru the simulator on a 2 associativity and 4 sets cache with a ProgressBar:

python cache-sim.py traces/short.txt.gz 2 4 1

How to generate usable Traces

Cache traces are generated by Dynamorio with:

/opt/dynamorio/bin64/drrun -t drcachesim -offline -- a.out 1000

After that run drcachesim on the file with:

bin64/drrun -t drcachesim -indir drmemtrace.app.pid.xxxx.dir/

And packed in a Human Readable format with:

zcat drmemtrace.tool.drcacheoff.burst_malloc.211917.2237.dir/trace/drmemtrace.tool.drcacheoff.burst_malloc.211917.8542.trace.gz | od -A x -t x2 -w12 | awk '{printf "0x%s 0x%s 0x%s 0x%s%s%s%s\n", $1, $2, $3, $7, $6, $5, $4}' >> trace.txt

It is recommended to pack the traces (They are very big):

gzip trace.txt

Current Status of the tool

Only used and tested with versions >= python3.7.

At the moment cache lines are ignored, or at least line size = adress size is assumed.

hint-cache-sim's People

Contributors

nilhoel1 avatar

Watchers

 avatar  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.