Docsity

2 Solved Problems on Java Programs in Processor Design - Project 3 | CS 3220, Study Guides, Projects, Research of Computer Science

Toggle sidebar
bg1
GEORGIA INSTITUTE OF TECHNOLOGY
College of Computing
CS3220 | Processor Design
Spring 2001
CS3220 Issued: February 21, 2001
Project 3 Due: March 28, 2001
Purpose:
This project embodies the second ma jor point of the course: you
will build a translator to extend a hardware implementation to a
dierent instruction set.
Reading:
none
Problems:
1. Translator
2. Demo
HEADS UP:
Like Project 2, this pro ject requires a signicant amountofwork. Start early.
On-line copies of the linker and circuit may be found on the project web page:
http://www.cc.gatech.edu/classes/AY2001/cs3220 spring/project3/
CS3220 Spring 2001 {1{ February 21, 2001
pf3

Partial preview of the text

Download 2 Solved Problems on Java Programs in Processor Design - Project 3 | CS 3220 and more Study Guides, Projects, Research Computer Science in PDF only on Docsity!

GEORGIA INSTITUTE OF TECHNOLOGY

College of Computing

CS3220 | Pro cessor Design Spring 2001

CS3220 Issued: February 21, 2001 Pro ject 3 Due: March 28, 2001

Purp ose: This pro ject emb o dies the second ma jor p oint of the course: you will build a translator to extend a hardware implementation to a di erent instruction set.

Reading: none

Problems: 1. Translator

  1. Demo

HEADS UP:

Like Pro ject 2, this pro ject requires a signi cant amount of work. Start early.

On-line copies of the linker and circuit may b e found on the pro ject web page: http://www.cc.gatech.edu /classe s/AY200 1/cs32 20 spring/project3/

Problem 1: Translator

Mo dify the linker program to translate iJVM instructions to iMIPS instructions. The output should b e a .hex le which will execute on the msim simulator or on the iMIPS hardware.

We recommend the following approach (as discussed in class):

 De ne stack lo cations as registers (reserving a few registers for metho d invo cation). Use a technique similar to the compute stackdepth() algorithm you wrote for Home- work 3 to gure out the stack depth at each iJVM instruction in the source program. Assign each stack depth to a physical iMIPS register. Don't worry ab out running out of registers.  Convert iJVM instructions individually into equivalent iMIPS op erations on regis- ters. There should b e a more or less one-to-one corresp ondence b etween instructions. Exceptions are instructions with delay slots, for which you add a NOP, and the IN- VOKESTATIC case, which turns into a sequence of instructions. Extend the control- ow graph data structures (bb t and method info t) as required.  Here's a simple approach for pro cedure calls. First, save al l stack-state registers and the link register on the stack in memory. Second, move pro cedure arguments into registers R1, R2, etc. Third, use JAL to call the pro cedure. Fourth, after return, restore the link and stack-state registers. Finally, move R1, the return value, to the appropriate stack-state register.  OPTIONAL: Perform optimizations. E.g., eliminate unnecessary MOVE instructions, p erform p eephole reordering to remove pip eline-induced NOP instructions, p erform con- stant propagation, p erform live-register analysis to avoid spill/reload at pro cedure invo cation p oints, etc.  Finish co de generation by mo difying linker.c as necessary, e.g., to insert iMIPS GOTOs and iMIPS startup co de.

Make your changes primarily by adding new passes over the BB data structure in the manner of rewrite method() along with any required changes to the wrapp er co de in linker.c.

A: Turn in your mo di ed co de indicating the changes.