|
CS316 Programming Assignment 4: FAQ Instructor: Kavita Bala Due: |
|
|||||||||||||||||||||
In particular, you should not be using math.h. Remember that you will be taking the logarithms of perfect powers of 2. Tuesday
November 6th, 4:45PM: To help you debug your
code here approximate ranges for the hit and miss counts of the
solution on the test programs supplied with the assignment. These
counts are for the default cache size and set associativity.
Tuesday November 6th, 4:45PM: We have made a minor change to the PA4 framework. The cache.c API asks you to calculate the hit rate but the API function is expecting, incorrectly, an integer return value instead of, correctly, a float value. We have issued a patch to the framework code that corrects the API. The total change amounts to 4 lines of code. You can either download new versions of the framework, now posted both on the CSUG lab machines and in CMS, or make the changes yourself. Following either set of instructions and then remaking your simulator with the make command will install the changes. Instructions to copy the new framework code: 1. On a CSUG machine, change to the directory containing your version of the PA4 source (the directory where you issue the make command typically <PA4 root directory>/cache) and issue the command:cp
/usr/local/cs316/pa4/cache/main.* .
2. In cache.c, change the return value of the function cache_read_hit_rate() from unsigned int to float. Instructions for making the change yourself: A total of four lines changed in the entire simulator source code. The changes are:1. In main.h, change line 50 from unsigned
int cache_read_hit_rate();
to float cache_read_hit_rate(); 2. In main.c, change line 26 fromunsigned int rate =
cache_read_hit_rate();
to float
rate = cache_read_hit_rate();
3. In main.c, chance line 34 from printf(“Hit Rate: %10i\n”,rate); toprintf(“Hit Rate: %10.3f\n”,rate); 4. In cache.c, change the return value of the function cache_read_hit_rate() from unsigned int to float. |
|||||||||||||||||||||||
Page maintained by Kavita Bala |