Reference no: EM131438791
Project: Pipeline Simulator
I. Purpose
The primary purpose of this project is to help you understand the pipelining process for a simple set of MIPS instructions. You will gain experience with basic pipelining principles, as well as the hazard control techniques of forwarding, stalling, and branch prediction. The secondary purpose of this project is to give you experience with writing C code.
II. Basic Description
Your job is to create a program, contained in a single C file called proj2.c, which takes as input a small simplified MIPS assembly program and prints to standard output the state of the pipelined datapath at the beginning of each clock cycle. At the end of execution, you should print out some information about the instruction sequence just executed. Your submitted C program will be compiled and run on linprog with the following commands, where test.asm is an assembly file as described below.
$ gcc proj2.c -lm
$ ./a.out < test.asm
The -lm flag links the math library, which is included by default in proj2_start.c. You do not have to use any functions from this library, but you may if you choose to do so. You should not rely on any other special compilation flags or other input methods. If your program does not compile and execute as expected with the above commands, points will be deducted from your project grade.
Take a look at the provided proj2_start.c file. At the heart of the proj2_start.c file is the run() function. The run() function creates a state, represented by the stateType struct. This state represents the state of the pipeline as a whole at the beginning of a specific clock cycle. Notice that it contains pipeline register structs to record the values of the pipeline registers in that specific cock cycle. Note that, in a real pipeline, all stages are executed at once. We cannot do this because our code will be executed sequentially. To mimic this "parallel" execution, we have state, which represents current state of the pipeline (in other words, the state of the pipeline at the end of the previous cycle), and newState, which should be used to represent the state of the pipeline after the current cycle has executed. The state is initialized and then we enter a while loop with the following steps:
1. Print the state.
2. Check to see if a halt instruction is entering its WB stage. If so, then we must be done. Print information about the execution and end the program.
3. Create newState, a copy of the current state. Any changes to the pipelined datapath are reflected in newState. In general, while simulating the execution, state should only be read from and newState should only be written to. However, there a few important exceptions.
4. Comments following indicate the general order in which steps should be implemented. Note that this order is not strict - for example, we assume that register writes (performed by instructions in their WB stage) must happen before register reads (performed by instructions in their ID stage).
You do not need to modify the instToInt, get_opcode, get_funct, get_immed, get_rs, get_rt, get_rd, get_shamt, or printState functions. These are provided for convenience. You will need to modify the run() instruction and possibly add support functions, depending on how you approach the problem. You may also modify the structs to include more information (control lines, for example) as well as the init_state function if you'd like.
Attachment:- Assignment Files.rar
Write a critique on the effectiveness of biofuels
: Review "Biofuel Contribution to Mitigate Fossil Fuel CO2 Emissions" by Luiz Rosa, Christiano Pires de Campos, and Maria Muylaert de Araujo from Reading Assignment. Write a critique on the effectiveness of biofuels in reducing CO2 emissions.
|
Discuss and explain three means of risk management
: Describe several reasons for differences in the prevalence of foodborne illness that may appear among the various regions of the world. Discuss and explain three means of risk management. What is indoor air pollution?
|
Write a paper about earth systems and weather
: Write a paper about Earth Systems and Weather- A detailed and technical look at : An examination of the worldwide polices than promote biodiversity.
|
Compute confidence interval for the mean interval
: A sample of 25 individuals at a shopping mall found that the mean number of visits to a restaurant per week was 2.88 with a standard deviation of 1.59.
|
Create newstate a copy of the current state
: CDA3101 Project: Pipeline Simulator. Your job is to create a program, contained in a single C file called proj2.c, which takes as input a small simplified MIPS assembly program and prints to standard output the state of the pipelined datapath at th..
|
Problem regarding the valuing bonds
: Even though most corporate bonds in the United States make coupon payments semiannually, bonds issued elsewhere often have annual coupon payments. Suppose a German company issues a bond with a par value of €1,000, 23 years to maturity, and a coupo..
|
Summarize articles major points and focusing on key aspects
: Summarize the article's major points, focusing on 3 key aspects. Describe at least 2 strengths and weaknesses in the review of studies.
|
What is the confidence interval workbook
: A bank sampled its customers to determine the proportion of customers who use their debit card at least once each month. A sample of 50 customers found that only 12 use their debit card monthly.
|
What is cross-cultural consumer analysis
: What is cross-cultural consumer analysis? How can a multinational company use cross-cultural research to design each factor in its marketing mix? Examples
|