This part of the project requires you to implement a


Programming Project on Simulator for APEX

Both project parts require you to submit a hardcopy design documentation, a CD of your code and example results. Both parts also require you to demonstrate your simulator to one of the TAs. Instructions for scheduling the demos will be provided later.

PART 1. Demo to be scheduled with one of the TAs for the period 11/16 to 11/20.

This part of the project requires you to implement a cycle-by-cycle simulator for the simple 5-stage APEX pipeline. Assume that the code to be simulated is stored in a text file with one ascii string representing an instruction (in the symbolic form, such as ADD R1, R4, R6) in each line of the file. The instructions supported are:

• Register-to-register instructions: ADD, SUB, MOVC, MUL, AND, OR, EX-OR (all done on the ALU in a single cycle). You can assume that the result of multiplying two registers will fi into a single register.

• Memory instructions: LOAD, STORE

• Control flow instructions: BZ, BNZ, JUMP, BAL, HALT

Assume that there are 8 architectural registers, R0 through R7. Memory is viewed as a linear array of integer values (4 Bytes wide) numbered 0 through 9999.

The BAL register implements function calls, saves the return address in a special register X and transfers control to a specified target address:

BAL , literal: saves address of next instruction in X and then sets fetch PC to contents of plus the literal.

The HALT instruction stops execution. JUMP specifies a register and a literal and transfers control to the address obtained by adding the contents of the register to the literal.

To invoke the simulator, you specify the name of the executable and the name of the ascii file that contains the code to be simulated.

Your simulator should have a command interface that allows users to execute the following commands:

Initialize: Initializes the simulator state, sets the PC of the fetch stage to point to the first instruction in the ascii code file, which is assumed to be at address 20000. Each instruction takes 4 bytes of space, so the next instruction is at address 20001, as memory words are 4 Bytes long, just like the integer data items.

Simulate : simulates the number of cycles specified as and waits. Simulation can stop earlier if a HALT instruction is encountered and when the HALT instruction is in the WB stage.

Display: Displays the contents of each stage in the pipeline and the contents of the first 100 memory locations containing data, starting with address 0.

PART 2. Demo to be scheduled with one of the TAs during the finals week.

This part requires you to extend and modify your simulator of Part 1 as follows to simulate a datapath that looks like Variation 2. Three function units are present:

• INT (implements integer and logical instructions) - one stage, single cycle latency.

• MUL (implements the MUL operation, non-pipelined, latency 4 cycles,).

• Memory (implements LOAD and STORE instruction, 3 pipeline stages with a single cycle latency per stage.)

The issue queue has 8 entries, the LSQ has 4 entries and the ROB has 16 entries. The physical register file has 16 registers. You can assume that a tag based forwarding mechanism is used.

The command interface is similar to that in Part 1, but the Display command displays, in addition to what is displayed in Part 1, the contents of the architectural and physical registers, what is inside each FU, the rename table, the IQ and ROB, the free list of registers and all structures relevant to renaming, including the tag and result value broadcasted etc. An additional requirement for Part 2 is that you document in detail what each team member did.

• Variation 2: A separate physical register file (PRF) and an architectural register file is used. The ROB entry of an instruction that has a destination register points to the physical register is assigned to hold the result. In this case, the physical registers are called rename buffers. The IBM Power PC 604 implements this design.

378_IBM Power PC Design.png

Solution Preview :

Prepared by a verified Expert
Computer Engineering: This part of the project requires you to implement a
Reference No:- TGS01149221

Now Priced at $60 (50% Discount)

Recommended (99%)

Rated (4.3/5)

A

Anonymous user

5/25/2016 2:12:42 AM

The assignment here is a Programming Project on Simulator for APEX. This part of project needs you to apply a cycle-by-cycle simulator for the simple 5-phase APEX pipeline. Suppose that the code to be simulated is stored in the text file having one ASCII string presenting an instruction in each line of the file. The guidelines supported are: 1) Register-to-register instructions: ADD, MOVC, SUB, MUL, AND, OR, EX-OR. You can suppose that the outcome of multiplying two registers will fit to a single register. 2) Memory instructions: STORE, LOAD. 3) Control flow instructions: BZ, BNZ, BAL, JUMP, HALT. Suppose that there are 8 architectural registers, R0 via R7. Memory is observed as a linear array of integer values numbered 0 via 9999. The BAL register applies function calls, save the return address in the special register X and transfers control to a particular target address.