Understand the pipelining process for a simple set of mips

Assignment Help Computer Engineering
Reference no: EM131422035

Project: Pipeline Simulator

1. 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 data path 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

Reference no: EM131422035

Questions Cloud

Comment on all students pay : Now the organization is trying to write its report and is considering the following interpretations. Comment on 95% of all students pay between $1102 and $1290 for food.
How should viewers interpret given news : Assuming he used a 95% confidence interval, how should viewers interpret this news? Comment on each of these statements:- During 95 of the last 100 winters, the region got between 21" and 25" of snow.
What interests you the most : What thoughts do you have about the topic right now (prior to researching it)? What do you expect to find when you research the topic? What do you hope to learn about? What are some of your assumptions right now?
Draw about the work from the observations : What conclusions can you draw about the work from the observations you have made - A television show has traditional elements of texts such as narrative and symbolic language of one sort or another, as well as visual elements that contribute to th..
Understand the pipelining process for a simple set of mips : CDA3101 Project: Pipeline Simulator. 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 contr..
Compare the public and private sector regulatory requirement : Compare the public and private sector regulatory requirements. Please list and write a brief description of each requirement.
Why is the us withdrawal from tpp seen as a win for china : In addition to a possible impact of trade on economic outcomes, TPP is viewed as an important geopolitical agreement. Why? Why is the US withdrawal from TPP seen as a win for China?
Analyze a visual text that conveys an argument : What would you like your readers to learn or think about in reading your analysis of the image and what specific and unique perspective can you share about this image? What will be your argument for this paper?
What is your impression of organization in your case study : Select one Baldrige Case Study (below). What is your impression of the organization in your case study? Do you think they achieved greater status from their achievement?

Reviews

Write a Review

 

Computer Engineering Questions & Answers

  Find how usable a web-site is

How could you structure a questionnaire to discover how usable a web-site is? What would your criteria be and why.

  Write a program that randomly selects letters

Write a program that randomly selects letters from the 26-letter alphabet [a,b,..., z} and forms four-letter words. Form 100 such words and see how many of these words make sense.

  Wan technologies for mobile user-to-office

WAN technologies for each of the Wilke’s three connectivity situations: mobile user-to-office, office to office, and home-to-office.

  Evaluates equivalence relation

For each of the subsequent relation, evaluates if it's an equivalence relation, if it's right-invariant, and give the index if it is an equivalence relation.

  We considered building a balanced or full bst from a sorted

we considered building a balanced or full bst from a sorted array. assume that the array has n 2k-1 elements in sorted

  How star configuration with a single router in the middle

A seven-story office building has 15 adjacent offices per floor. Each office contains the wall socket for a terminal in the front wall, so the sockets form a rectangular grid in the vertical plane, with a separation of 4 meters between sockets, bo..

  The written portion of paper on hippa and data security

the written portion of paper on hippa and data security will be no longer than 5 pages and no shorter than 4 pages and

  Detail the target market profiles key buying behaviors and

complete a market segmentation of no more than 1400 words for your buyers. be sure to include the followingq1. detail

  Analyze the changes in 4g technology since the printing of

there are a number of cellular phone companies each serving their own unique geographical areas. likewise they each may

  Point-to-point communication links

Suppose there is the wide-area network with N nodes, where N ≥ 2. Find out the smallest number of the point-to-point communication links such that each node within the network is able to talk to one another node?

  Write a program that reads in a line of text, counts

Output of the letter count is a loop running from 0-25, with an if statement that allows output if the array entry isn't zero.

  A function can also be called an inheritance

In computer programming would you say that a function could also be known an inheritance product due to the reuse of it in the program? A while loop that calls the function once the statement is true can be used over and over.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd