Giter Club home page Giter Club logo

cache-me-if-you-can's Introduction

cache-me-if-you-can

A program for simulating caches.

About

This program finds the cache number of cache hits and the number of the different types of cache misses for a cache specified by the user for a trace of address accesses specified by the user. Each Cache uses a Least Recently Used replacement policy.

Organization of a cache

Calculations

This is how each cache-miss 'type' is calculated. The definition of each of these 'type's of cache-miss is given as just the way in which they are calculated, as below.

Usage

java Cache <bytes per block> <lines in a set> <sets in the cache> <addresses accessed in trace>

This command must be followed by x lines of 32 bit addresses for the trace written in hexidecimal without the "0x" prefix. Where x is the number of addresses accessed in the trace.

Example

Here is an example using the cache from the visualisation above.

Input

java Cache 16 4 2 32
0000
0004
000c
2200
00d0
00e0
1130
0028
113c
2204
0010
0020
0004
0040
2208
0008
00a0
0004
1104
0028
000c
0084
000c
3390
00b0
1100
0028
0064
0070
00d0
0008
3394

Output

Total Hits: 15
Total Misses: 17
Compulsory: 15
Capacity: 1
Conflict: 1

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.