Pipeline freeze simulation

This is a discussion on Pipeline freeze simulation within the C Programming forums, part of the General Programming Boards category; me and my groupmate would like to ask HELP on this one we are required to implement a simulator for ...

  1. #1
    Registered User
    Join Date
    Jun 2006
    Posts
    4

    Question Pipeline freeze simulation

    me and my groupmate would like to ask HELP on this one we are required to implement a simulator for a simplified DLX processor, miniDLX. The miniDLX processor offers the following subset of DLX instructions:
    1. R-type instructions: ADD, SUB, AND, XOR, SGT
    2. I-type instructions: BNEZ, LW, SW, ADDI
    3. J-type instruction: J
    The miniDLX processor is based on the DLX architecture. Suggested programming language to be used is C.
    The objective this project is to “execute” the program using pipeline #2 with the following schemes to solve the hazards:
    • Structural Hazard: Separate Memory
    • Data Hazard: NO Forwarding (Set B/C/D/E), Forwarding (Set F)
    • Control Hazard: Pipeline Freeze

    In this case project, we will write the following modules:
    1. Utility program to input value for registers R1 to R31
    2. Write a simulator program using pipeline #2

    A.) Simulation Program
    Simulate the program based from the input files: FILENAME.COD; FILENAME.DAT & REGISTER.REG. FILENAME.COD is a file representing the “instruction” memory. It contains the op-code of the program. Each line is sequential in nature (i.e., 1st line is the 1st instruction, 2nd line is the 2nd instruction, etc.) and represents op-code in hex format. The program is always assumed to start at address 0 and succeeding address is incremented by 4. The opcode of the instructions are as follows:
    Instruction Opcode Function
    ADD 000000 00000000010
    SUB 000000 00000000110
    AND 000000 00000000000
    XOR 000000 00000000001
    SGT 000000 00000000111
    BNEZ 010000 Not applicable
    LW 010001 Not applicable
    SW 010010 Not applicable
    ADDI 010011 Not applicable
    J 100000 Not applicable

    FILENAME.DAT is a file representing the “data” memory. Each line is sequential in nature (i.e., 1st line is the 1st word data, 2nd line is the 2nd word data.) and in hex format. The data is always assumed to start at address 0 and the succeeding address is incremented by 4.
    Simulate the instructions by showing the contents of the registers/memory that will be affected in each clock cycle (i.e., like the examples shown above) Thus:
    Cycle 1: IF/ID.IR, IF/ID.NPC, PC;
    Cycle 2:ID/EX.A, ID/EX.B, ID/EX. IMM, ID/EX.IR;
    Cycle 3:EX/MEM.ALUOUTPUT, EX/MEM.ALUOUTPUT, EX/MEM.B (for LW & SW)
    Cycle 4:MEM/WB.IR, MEM/WB.ALUOUTPUT ( for ALU), MEM/WB.LMD (for LW), MEM[ALUOUTPUT] (for SW)
    Cycle 5: Register affected
    Note: Obviously, the simulation assumes separate memory for data and program. PC starts at zero.

    Note: There is no “COND” register in pipeline #2. Please refer to the appropriate algorithm for Pipeline #2

    Note: The affected registers/memory should contain the actual value.

    Note: FILENAM.DAT and FILENAME.COD is provided by the professor.

    Note: You have the option of having text-based or graphics-based output. The most important part is the correctness of value.


    we dont know were to start, please give us clear coding on this to starto to..thanks

  2. #2
    Gawking at stupidity
    Join Date
    Jul 2004
    Location
    Oregon, USA
    Posts
    3,175
    We're not here to do your homework for you. Here's clear coding on a place to start:
    Code:
    #include <stdio.h>
    Make an attempt, give us your ideas, etc. and then you might get some help.
    If you understand what you're doing, you're not learning anything.

  3. #3
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,821
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. fork, execv, spawn, or something else?
    By DavidP in forum C++ Programming
    Replies: 8
    Last Post: 01-26-2009, 04:25 PM
  2. Role of c++ in simulation software
    By CChakra in forum C++ Programming
    Replies: 9
    Last Post: 11-18-2008, 02:36 AM
  3. Help with time simulation assignment
    By rakan in forum C++ Programming
    Replies: 3
    Last Post: 10-31-2006, 11:39 AM
  4. MPI - linear pipeline solution for jacobi iteration
    By eclipt in forum C++ Programming
    Replies: 1
    Last Post: 05-03-2006, 06:25 AM
  5. pipeline troubles
    By Qui in forum Linux Programming
    Replies: 1
    Last Post: 02-18-2005, 01:39 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21