[Solved] CS311-COA Assignment 3

$25

File Name: CS311_COA_Assignment_3.zip
File Size: 207.24 KB

SKU: [Solved] CS311-COA Assignment 3 Category: Tag:
5/5 - (1 vote)

Rate this product

Develop a single cycle processor simulator for ToyRISC. Input to the Program

  1. full path to the configuration file. A sample file is given at src/configuration/config.xml. This describes the processor to be simulated. This is not of much use inthis assignment, but will be utilized in coming assignments.
  2. full path to the statistics file to be created. This file contains the statistics of the simulation run number of instructions executed, number of cycles taken, etc.
  3. full path to the object file whose execution is to be simulated.

Output of the Program

the program must create the statistics file at the specified location. Broad Outline of the Steps

  • The source is available at gitea. git clone https://gitea.iitdh.ac. in:443/rajshekar.k/CS311_assignment3.git
  • Loading of the program: Begin with implementing the loadProgram function in the file Simulator.java. Store the global data and instruc- tions in the approporiate locations in the mainMemory structure (see Sec- tion Address Space Layout in assignment 1). Set the PC register to the memory address of the first instruction (remember from assignment 2 that this is the first integer in the object file). Set x0= 0, x1= 216 1, and x2= 216 1.You can check the contents of the memory using processor.getMainMemory() .getContentsAsString(<starting-address>, <ending-address>).
  • Simulation of the program: The function simulate() in the file src/generic/Simulator.java describes the overall loop that captures the simulation. The five stages of the processor are called in-order.1
  • As discussed in class, between every two stages, there is a latch. Thecontents of the different latches are obviously different. Therefore, foreach latch type, a separate class has been created. For example, theIF-OF latch is described by the file src/processor/pipeline/IF OF LatchType.java. An object of this type is created, and references to the same objectare given to both the IF stage and the OF stage.You have to decide the contents of each latch. IF OF LatchType has been done for you. Similarly, implement the remaining latches.
  • Implement each of the stages. The IF stage has been implemented for you. Similarly, implement the remaining stages.
  • The simulation ends when an end instruction passes through the IFstage. Call setSimulationComplete() (defined in the file src/generic/Simulator.java) at this point.
  • Set the statistics number of instructions executed and the numberof cycles taken once the simulation is completed. You may do thisat the end of the simulate() function. To do the setting, call the appropriate functions in the file src/generic/Statistics.java.You are encouraged to add statistics of your own in the file Statistics.java. Tabulate cycles and instruction counts for all programs that you submitted as part of assignment 1, in your report. These programs will function as benchmarks for the our processor designs.TestingFive example ToyRISC programs, their object codes, and the corresponding ex- pected system state at the end of execution, are given in the supporting files archive. Also, the simulator prints a hash value a hash of the processor state at the end of the execution. The expected correct hash values are also given.Run python test zip.py <path to zip file> to check your submission.Follow the same naming convention: <roll-number-1> <roll-number-2> assignment3.zip.Note All subsequent assignments in this course will involve modifying this set of source files. You will be adding many more files to this project. Please use version controlling extensively, and back up your code frequently. You will have two weeks to submit this assignment.

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[Solved] CS311-COA Assignment 3[Solved] CS311-COA Assignment 3
$25