Exercise 3 - Counting cycles correctly

Objectives

Attention: This exercise, like all others, is individual. This means that you cannot, under any circumstances, look at the code of one of your colleagues. You can take questions away from the computer or ask the teacher for help.

Before you start

You should remember the concepts related to performance measures. Try to think of answers to the following questions (you do not need to include them in your report):

It is important that you know how to answer these questions before continuing the activity.

Activity

In this activity you must use the same programs as 1 Exercise. But I recommend that you first do an evaluation on "Hello World" for its size and ease of debugging. Subsequently run your code with the 3 largest programs.

Pre-activity

You already did the pre-activity in exercise 2.

Hazard control and deviation prediction

Similar to data hazards, control hazards will only occur in some of the instructions' executions. So they need to be counted correctly. You need to identify which instructions are subject to control hazards and what the impact is when these hazards happen. The next step is to capture this information directly in the simulator, calculating the impact on the execution time of the programs. Start by considering that diversion instructions can only be completed in the fourth stage of the pipeline (initial version of the book chapter, quite pessimistic).

After calculating the impact on the deviation instructions, you should assess how they can be improved using deviation prediction. For this, consider the following deviation forecasting techniques:

Delivery

Everyone must submit a 1 page report, in PDF format, through the Susy. Keep the source code until the end of the semester.

In your report, include a table with at least the following columns:

Also indicate, for each deviation forecasting technique, its average hit rate in the evaluated programs (the average of the percentages of the three programs for each of the techniques).