Skip to the content.

← Back to Home

Cache Simulator

View Code on GitHub


Overview

This project is a Cache Simulator for the LC-2K instruction set architecture (ISA), implemented in C. The simulator integrates with an existing LC-2K processor simulator to model the behavior of a CPU cache.


Features


How It Works

Cache Structure:

The cache is organized into multiple sets, each containing a fixed number of blocks. Each block comprises:

Address Breakdown:

An LC-2K memory address is divided into:

Cache Initialization (cache_init):

Sets up the cache based on user-defined parameters:

Validates input parameters, initializes cache structures, and sets all blocks as invalid initially.

Cache Access (cache_access):

Handles memory read and write operations:

Replacement Policy:

Implements the LRU strategy:


Technologies


← Back to Home