
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
A laboratory assignment for students in ece 4100 where they are required to write a program using java or c/c++ to evaluate and compare instruction frequencies and branch prediction schemes using a provided trace file from the gcc compiler on a mips processor. Students will extract the mips opcode and branch address fields from the trace file and compute various statistics related to loads, stores, conditional branches, and branch prediction rates.
Typology: Lab Reports
1 / 1
This page cannot be seen from the preview
Don't miss anything!

Score:______ Section:____________ Date:__________ Name:______________________________
In this lab, you will use Java or C/C++ to write a program that will evaluate and compare the instruction frequencies and several branch prediction schemes using a trace file collected from the gcc compiler running on a MIPS processor. The trace file is available in zip format from the Lab Web page: http://www.ece.gatech.edu/~hamblen/3055/gcc_trace_txt.zip There are around 1,000,000 memory references in this file stored one per line. The virtual address is the second field on the line. The first field gives the type of the memory reference ( for instruction fetch, 1 for store, and 0 for load). The third field gives the instruction value for a fetch and is always 0 for loads and stores. You will need to extract the MIPS opcode and branch address fields. To help you get started on the lab, a simple program that reads the trace file, extracts the virtual address, and performs some simple bit-wise operations similar to what is needed to extract bit fields is available on the 3055 Lab Web page in both C and Java formats. http://www.ece.gatech.edu/~hamblen/3055/read_trace.c and http://www.ece.gatech.edu/~hamblen/3055/read_trace.j http://users.ece.gatech.edu/~hamblen/2030/cod-appa.pdf contains a MIPS opcode table, if you can’t find your old 3055 textbook. Compute the following items based on the instructions found in the trace file: Loads = _________% of total instructions Stores = _________% of total instructions All conditional branches = ________% of total instructions (Beq,gez,gezal,gtz,lez,ltzal,ltz,ne) Others = __________% of total instructions Branches taken = ______________% of all conditional branch instructions Branches not taken = ____________% of all conditional branch instructions Forward branches not taken = _________% (branch that may jump to a larger virtual address) Reverse branches taken = _________% (branch that may jump to a smaller virtual address) Branch Prediction rates – based on material in 4100 Textbook Chapter 3 Section 4: (10%) 2-bit prediction with a 1024 prediction buffer = _____________% (10%) 2,2 branch prediction buffer with the same number of state bits as above = ______% Attach a hardcopy of your source code and highlight the branch prediction code section.