Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In this project, you will develop a branch predictor simulator, using either Python (Python 3) or Java (Java 8). The simulator can simulate three kinds
In this project, you will develop a branch predictor simulator, using either Python (Python 3) or Java (Java 8). The simulator can simulate three kinds of branch predictors: simple bimodal BHT, correlating predictor, and tournament predictor. As we have discussed, the bimodal predictor is a special case of correlating predictor (with 0 bit global history). For simplicity, we will use correlating predictor to refer to both The simulator reads branch traces from the standard input and prints out the statistics to the standard output. A template is provided to help you complete the project The link to download the template and branch traces will be announced on Piazza It is highly recommended that you use a version control system (like git) for the project. However, your repository must be private and must not be accessible to other students. Format of branch trace files Branch trace files are text files. At the beginning of each line is the address of a branch instruction, which can be decimal or hexadecimal. Separated from the address by at least one space, a 0 or 1 indicates the outcome of the branch. 1 is for taken, and 0 for not taken. The simulator also recognize T and NT Two trace files are provided. Note that the traces are not from MIPS processors. The branches can be located anywhere. Do not divide the addresses by 4 The trace file can be large. When testing your code, you do not have to feed all the events to the simulator. You can use your favorite text editor to save part of big files to smaller files. You can also use text file tools like 'head' to select the first n lines. For example, the following command prints to the console the first 10 lines from branch-trace.txt head -n 10 branch-trace.txt You can save the 10 lines to a file by redirection Template The template provided can read branch traces from the standard input and feed the addresses and outcome to predictors. After all branches are processed, the program prints out the statistics. Of course, nothing is correct before you implement the predictors There are two files in the template. Do not modify the main file (bp main.py or BPMain.java) A correlating predictor (and a bimodal predictor) maintains a one-dimensional array of counters. It can be configured by a string like m,n,k where m, n, and k are three integers. m is the number of bits in global history. n is the number of bits in the counter (for prediction), and k is the number of bits from the branch address to form the In this project, you will develop a branch predictor simulator, using either Python (Python 3) or Java (Java 8). The simulator can simulate three kinds of branch predictors: simple bimodal BHT, correlating predictor, and tournament predictor. As we have discussed, the bimodal predictor is a special case of correlating predictor (with 0 bit global history). For simplicity, we will use correlating predictor to refer to both The simulator reads branch traces from the standard input and prints out the statistics to the standard output. A template is provided to help you complete the project The link to download the template and branch traces will be announced on Piazza It is highly recommended that you use a version control system (like git) for the project. However, your repository must be private and must not be accessible to other students. Format of branch trace files Branch trace files are text files. At the beginning of each line is the address of a branch instruction, which can be decimal or hexadecimal. Separated from the address by at least one space, a 0 or 1 indicates the outcome of the branch. 1 is for taken, and 0 for not taken. The simulator also recognize T and NT Two trace files are provided. Note that the traces are not from MIPS processors. The branches can be located anywhere. Do not divide the addresses by 4 The trace file can be large. When testing your code, you do not have to feed all the events to the simulator. You can use your favorite text editor to save part of big files to smaller files. You can also use text file tools like 'head' to select the first n lines. For example, the following command prints to the console the first 10 lines from branch-trace.txt head -n 10 branch-trace.txt You can save the 10 lines to a file by redirection Template The template provided can read branch traces from the standard input and feed the addresses and outcome to predictors. After all branches are processed, the program prints out the statistics. Of course, nothing is correct before you implement the predictors There are two files in the template. Do not modify the main file (bp main.py or BPMain.java) A correlating predictor (and a bimodal predictor) maintains a one-dimensional array of counters. It can be configured by a string like m,n,k where m, n, and k are three integers. m is the number of bits in global history. n is the number of bits in the counter (for prediction), and k is the number of bits from the branch address to form the
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started