Skip to content

The following program here helps in simulating how blocks from main memory can get mapped to cache based on strategies: Direct-Mapping, Fully-Associative, Set-Associative

Notifications You must be signed in to change notification settings

niksram/Cache-Mapping-Simulator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Features

The above program simulates:-

        a)  1) Set-Associative Cache Mapping
            2) Direct Cache Mapping
            3) Associative Cache Mapping

        b)  Least-Recently-Used as well as FIFO based hierarchy

        c)  Cache main-frame to find Hits and Misses on a given input address

        d)  Dirty-Bit changes based on load and store operation

CLASS cache_mock

cache_size: size of cache frame
block_size: size of each block
mem_size: size of the main memory
set_size: size of the set, 1 in Direct-Map, cache_size in Fully-Associative
lru: 1 for Least-Recently-Used and 0 for First-In-First-Out hierarchy
no_sets: total number of sets in the cache

container: Vector matrix which simulates the functioning of cache

Functions

loader: used to simulate loading data to processor from cache
storer: used to simulate storing data to cache from processor
display: displays the container frame
container_init: initialises the container frame
refresh_dirty: sets all dirty-bits to 0

Client

self-explanatory

About

The following program here helps in simulating how blocks from main memory can get mapped to cache based on strategies: Direct-Mapping, Fully-Associative, Set-Associative

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published