ECE 4100 Lab 1: Analyzing Instruction Frequencies & Branch Prediction, Lab Reports of Computer Architecture and Organization

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

Pre 2010

Uploaded on 08/05/2009

koofers-user-o5e
koofers-user-o5e 🇺🇸

10 documents

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Score:______ Section:____________ Date:__________ Name:______________________________
ECE 4100 Laboratory Assignment 1
Due Date: Friday, June 11
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 (2
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.

Partial preview of the text

Download ECE 4100 Lab 1: Analyzing Instruction Frequencies & Branch Prediction and more Lab Reports Computer Architecture and Organization in PDF only on Docsity!

Score:______ Section:____________ Date:__________ Name:______________________________

ECE 4100 Laboratory Assignment 1

Due Date: Friday, June 11

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.