Create newstate a copy of the current state

Assignment Help C/C++ Programming
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

Reference no: EM131438791

Questions Cloud

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

Reviews

len1438791

3/24/2017 4:40:24 AM

This is a MIPS pipeline simulator in a single C file. The first attachment – the write up, says it all pretty much. I've uploaded the start file as well, all of the work needs to be done in this original file using the tools provided in it. I've included some test files as well.

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

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