Giter Club home page Giter Club logo

cache-simulator-2's Introduction

Cache Simulator

This project is a cache simulator. The simulator reads a text file as a command line argument and outputs the result to a text file specified by the second command line argument. The simulator simulates 6 different designs with variables within some of the designs. More information regarding the specifics of the designs can be found below in "Cache Designs." Please note that the cache line is 32 bytes throughout this entire project.

Note: This project is for reference only. Any code used must be adequately acknowledged.

Files

  • Makefile
  • src
    • driver.cpp : a driver file to create a simulator and run it
    • cache.h : the header file for the Cache class
    • cache.cpp : the implementation for the Cache class containing all functioning code
  • traces : a folder containing 3 example traces to test the simulator with
  • correct_outputs : a folder containing the expected results for each provided test

Running the program

To run the program with the included Makefile:

To compile:

make

To run with the first included test trace:

make run

To run after compiling:

./driver trace_file.txt output.txt

Cache Designs

  • Direct map cache
    • a simple cache design of one long cache in which each instruction has a specific index and is mapped solely to that index
    • runs 4x with the following sizes: 1KB, 4KB, 16KB, and 32KB
  • Set-associative cache
    • a simple cache design, similar to direct map but with each index containing multiple ways allowing for multiple memory blocks that map to the same index to be kept in the cache simultaneously.
    • runs 4x with the following n-way associativity: 2, 4, 8, and 16
  • Fully-associative cache with least recently used replacement
    • Similar to direct map in that it is one long cache with only 1 way, but there are no indices. Each entry maps to a free entry until they are full. When they are full, it implements a least recently used replacement policy and evicts the oldest entry in the cache.
    • runs 1x with a cache size of 16 KB
  • Fully-associative cache with hot / cold replacement
    • Same design as the previous fully-associative cache but when the cache is full it uses a temperature design to evict the least frequently used cache entry.
    • runs 1x with a cache size of 16 KB
  • Set-associative cache with no allocation on write miss
    • Similar to the set-associative cache design as stated before, but when a miss occurs on a write instruction, no cache entry is allocated.
    • runs 4x with the following n-way associativity: 2, 4, 8, and 16
  • Set-associative cache with next line prefetching
    • Similar to the set-associative cache design as stated before, but on each instruction, the next block of memory is prefetched into the cache.
    • runs 4x with the following n-way associativity: 2, 4, 8, and 16
  • Set-associative cache with prefetch on miss
    • Similar to the set-associative cache design as stated before, but when a miss occurs, the next block of memory is prefetched.
    • runs 4x with the following n-way associativity: 2, 4, 8, and 16

cache-simulator-2's People

Contributors

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