Class: CacheSim

Inherits:
Object
  • Object
show all
Defined in:
cache_simulation.rb

Overview

This class creates a simulation of a cache. Currently it is built to take in an array of actions. It could easily be rewritten to take in user input instead.

Initialization:

cache = CacheSim::Cache.new(size)
cache.perform_actions(operations)

Definition of parameters:

size:       integer, reflects the number and size of slots.
            Ex. with this one, there are 16 slots and each
                slot has space for 16 pieces of data
operations: a list of operations
            Ex: ["R", "4C3", "D", "W", "14C", "99"]

Author:

  • Jennifer Konikowski <jmkoni@icloud.com>

Defined Under Namespace

Classes: Cache, MainMemory, Slot