CacheSim - import java.io.*; import java.util.*; class...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
import java.io.*; import java.util.*; class MemAccess { //obtained from trace file by getAccess //atype is coded: Read = 0, Write = 1, Fetch = 2; int atype; int addr; } public class CacheSim { static BufferedReader in; final static int Read = 0, Write = 1, Fetch = 2; static int inst_fetches; static int csize,lsize; //total cache size and line size in bytes public static void main(String args[]){ try { in = new BufferedReader(new FileReader(args[0])); in.mark(1000000);//needed to repeatedly read data file csize =32; //small cache for initial tests lsize =8; System.out.println("Unified Cache - Secret"); Cache UnifiedCache = new DirectMappedCache(csize,lsize); doSimul(UnifiedCache,UnifiedCache,true); csize =8192; //larger cache for real experiments lsize =32; System.out.println("Unified Cache - Secret"); UnifiedCache = new SecretCache(csize,lsize); doSimul(UnifiedCache,UnifiedCache,true); } catch (FileNotFoundException e) { System.out.println("File "+args[0]+" Not Found"); } catch (IOException ioe) {
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 03/01/2010 for the course COMPUTER 20092 taught by Professor Jean during the Spring '10 term at Aarhus Universitet.

Page1 / 2

CacheSim - import java.io.*; import java.util.*; class...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online