GithubHelp home page GithubHelp logo

adhnguyen / cachesimulation Goto Github PK

View Code? Open in Web Editor NEW
9.0 1.0 1.0 44.11 MB

MIPS Cache Simulator in C. It will read an address trace (a chronological list of memory addresses referenced), simulate the cache, generate cache hit and miss data, and calculate the execution time for the executing program

C 100.00%

cachesimulation's Introduction

1. Build the cache simulator.
 % cc -o cachesim cache.c -lm

2. Test the cache simulator.
 % gunzip -c traces/art.trace.gz | ./cachesim
 % gunzip -c traces/[name of trace] | ./cachesim [cachesim args]

 Example 1 
 
> gunzip -c traces/art.trace.gz | ./cachesim -a 1 -s 16 -l 16 -mp 30 
        Cache parameters: 
        Cache Size (KB) 16 
        Cache Associativity 1 
        Cache Block Size (bytes) 16 
        Miss penalty (cyc) 30 
         
        Simulation results: 
                 execution time 21857966 cycles 
                 instructions 5136716 
                 memory accesses 1957764 
                 overall miss rate 0.28 
                 read miss rate 0.30 
                 memory CPI 3.26 
                 total CPI 4.26 
                 average memory access time 8.54 cycles 
                 
        dirty evictions 60540 
        load_misses 523277 
        store_misses 30062 
        load_hits 1208606 
        store_hits 195819 
 
Example 2 
 
> gunzip -c  traces/mcf.trace.gz | ./cachesim -a 8 -s 64 -l 32 -mp 42 
        Cache parameters: 
        Cache Size (KB) 64 
        Cache Associativity 8 
        Cache Block Size (bytes) 32 
        Miss penalty (cyc) 42 
         
        Simulation results: 
                 execution time 143963250 cycles 
                 instructions 19999998 
                 memory accesses 6943857 
                 overall miss rate 0.42 
                 read miss rate 0.36 
                 memory CPI 6.20 
                 total CPI 7.20 
                 average memory access time 17.85 cycles

        dirty evictions 995694 
        load_misses 2036666 
        store_misses 867426 
        load_hits 3552806 
        store_hits 486959 

cachesimulation's People

Contributors

adhnguyen avatar github-john-doe avatar

Stargazers

Jefferson Martines avatar bperris avatar soyeon Park avatar shirryliu avatar Andreas avatar Graham Haynie avatar Wenyu Zhang avatar Michael Hoffer avatar Kevin Phoenix avatar

Watchers

 avatar

Forkers

ryansingman

cachesimulation's Issues

Cannot compile on Ubuntu

$ cc -lm -o cachesim cache.c
/tmp/ccyFUIAD.o: In function `main':
cache.c:(.text+0xacb): undefined reference to `log'
cache.c:(.text+0xb1d): undefined reference to `log'
collect2: error: ld returned 1 exit status

running without arguments

Just wanted to let you know that running without arguments isn't handled, and causes the terminal to freeze. Might want to put a handle in for if argv is empty.

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.