hi
i am trying to simulate accesses in a direct mapping cache.
my program currently reads in a file that is supposed to declare the size of the cache. so far i have the following code
int main (int argc, char* argv[]) {
ifstream inFile;
inFile.open("config.txt");
if (!inFile) {
cout << "Unable to open file";
exit(1); // terminate with error
}
inFile.close();
return 0;
but now that i read my file in what i would like to no is how do i store the value inside the file to be the size of the cache?
i also no that later on i will need to find a suitable data structure for each cache entry therefore i will need to keep in each entry the address/id, the item i want to store, and a boolean to say if the entry is valid. any help with this will be greatly appreciated
tahnks