Skip to content
This repository has been archived by the owner on Jan 14, 2021. It is now read-only.

9231058/TCache

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TCache

Introduction

TCache is a simple cache simulator can generate custom reports by means of function pointers callbacks on each cache event and it can simulate multi-layer caching.
My personal motivation to write this project was that I want to use Object Oriented Design in C which is COOL 😎.
This project is written originally as a solution to one of the homework problems of computer architecture course in the Amirkabir University Spring 2015.

Function Callbacks

Reporting Function

/*
 * On Replace function callback
*/
void set_on_replace_function(void (*new_replace)(uint64_t tag, uint64_t index));

void use_on_replace_function(uint64_t tag, uint64_t index);
/*
 * On Hit function callback
*/
void set_on_hit_function(void (*new_hit)(uint64_t tag, uint64_t index));

void use_on_hit_function(uint64_t tag, uint64_t index);
/*
 * On Miss function callback
*/
void set_on_miss_function(void (*new_miss)(uint64_t tag, uint64_t index));

void use_on_miss_function(uint64_t tag, uint64_t index);

Cache Behavioral Functions

/*
 * Replacing function callback
*/
void set_replace_function(void (*new_replace)(
	struct set *set, uint64_t tag, uint64_t index));

void use_replace_function(struct set *set, uint64_t tag, uint64_t index);
/*
 * Set block size function callback
*/
void set_block_size(uint64_t block_size);

void use_block_size(uint64_t * address);

Releases

No releases published

Packages

No packages published