A description of what we intended our programs to do and a description of our design process.
The first C program we wrote was designed to test the endianness of the processors we were testing. We did this by creating a variable of type long which we set to an 8-byte hexadecimal string. We then used a pointer to the variable to determine what value was in the 0 position in the variable and from that information, determine whether the processor used big-endian or little-endian representation of variables.
The next program was designed to test the cache structure of the processors. We tested a number of different cases involving a block of memory which was a multiple of the previously-determined cache size. We then accessed this memory block in different patterns and recorded the time each test took. In the first test, we created a memory block exactly the size of cache and then accessed every byte in the block multiple times. In the second test, we created a memory block exactly the size of cache and then accessed the first byte of every line in the block multiple times. In the third test, we created a memory block four times the size of cache and then accessed the first byte of every line in the block multiple times. In the final test, we created a memory block four times the size of cache and then repeatedly accessed two lines of the cache which we determined would map to the same location in cache.
The third program was designed to determine differences in the times the processors take to perform calculations on numbers represented as different types. The number types we tested were double-precision floating point numbers (double), single-precision floating point numbers (float), 32-bit integers (long), and 8-bit integers (char). We performed very large amounts of calculations on variables of these types and recorded the differences in calculation times.
The final program was designed to determing the superscalar architecture of the processors. We performed groups of four calculations in which certain calculations were dependent on the results of previous calculations. In our first test, none of the calculations were dependent on any others, in the second test the fourth calculation was dependent on the first, in the third test the third calculation was dependent on the first, and in the fourth test every calculation was dependent on the previous calculation.
Click here to go to the previous part of the lab write-up.