jhunterh / Cache-Hierarchy-Simulation-Tool

This tool is a highly configurable cache hierarchy simulator for use in computer architecture research and study.
0 stars 0 forks source link

Look into relative timestamp for instructions #63

Open CapdinCrando opened 3 months ago

CapdinCrando commented 3 months ago

As suggested by Dr. Milenkovic

jhunterh commented 3 months ago

After some investigation, this seems like it might be possible. The trick will be to determine the size of the differential timestamp. Currently, timestamps are 64-bits and have clock cycle precision. If we reduce the number of bits too much without reducing the precision, then we risk overflowing the timestamp counter. If we reduce the precision too much, we risk losing accuracy of the trace. After some experimentation, it looks like reducing the timestamp counter down to around 32 bits (maybe larger) is feasible if we reduce the precision by not considering the last 12 bits of the 64-bit timestamp. In other words, the 32-bit differential timestamp would be (currentTime - startTime)[45..13]. Not going to implement this until I am completely confident in the effects that this will have on the accuracy of the trace file and simulation.

jhunterh commented 3 months ago

Example output from using the current timestamp (64-bit hex): NOTE: This shows that the bottom 12 bits don't seem to make a difference as most memory accesses are far enough apart that these bottom bits aren't needed. startTime: 11cd23e8b3a8d48 timeStamp: 11cd23e8ca26566 difference: 167d81e hex: 167d81e

startTime: 11cd23e8b3a8d48 timeStamp: 11cd23e8ca42154 difference: 169940c hex: 169940c

startTime: 11cd23e8b3a8d48 timeStamp: 11cd23e8ca4ec34 difference: 16a5eec hex: 16a5eec

startTime: 11cd23e8b3a8d48 timeStamp: 11cd23e8ca5bca8 difference: 16b2f60 hex: 16b2f60

startTime: 11cd23e8b3a8d48 timeStamp: 11cd23e8ca68016 difference: 16bf2ce hex: 16bf2ce

startTime: 11cd23e8b3a8d48 timeStamp: 11cd23e8ca749a0 difference: 16cbc58 hex: 16cbc58

startTime: 11cd23e8b3a8d48 timeStamp: 11cd23e8ca81a32 difference: 16d8cea hex: 16d8cea

startTime: 11cd23e8b3a8d48 timeStamp: 11cd23e8ca90cb0 difference: 16e7f68 hex: 16e7f68

startTime: 11cd23e8b3a8d48 timeStamp: 11cd23e8ca9d85e difference: 16f4b16 hex: 16f4b16

startTime: 11cd23e8b3a8d48 timeStamp: 11cd23e8caaa2ca difference: 1701582 hex: 1701582