cse141 Project 1: Design Your Own ISA


Changelog

Mar 29 Page created.
April 05 Updated due time, submission instructions for April 10
April 08 Clarification of writeup instructions for "Design Concept" submission deadline.
April 09 Minor clarification on macro instructions and speedup calculation. Mentioned SIMD memory instruction operation.
April 16 Minor clarification on turn-in requirements.
April 28 Updated submission details for May 1.

Due Dates: April 10, April 17, April 24, May 1

Due Time: 11:59 PM

A Letter from Jake

  
From:Jake Ivring;          CTO UnicationITY, Inc.
To: Cob Bolwell;       Principle FlexGermanica Technical, LLC.

Dear Cob,

Our revenues are getting hit by the knock-off clones from our low-cost rival, Boatorola Corp. The business strategist from Underson Consulting says our only hope for survival is to go afer a novel market and patent every aspect of our product. Our sales and market force has forwarded a market survey by Gaurdner group that says that the new SuperGarbage tablet platform is growing exponentially and soon to overtake Android and the Apple iOS. This is our opportunity!

We need a processor design that is highly unique (and patentable!), but also provides best-of-class performance on the SuperGarbage virtual machine. Although the design should be general-purpose (and for instance run the SuperGarbage app store's top selling app, Fibonacci), you should explore non-conventional designs so that we give our patent attorneys fodder for patent filings. Then when Boatorola copies us, we litigate for patent infringement!

We are hoping that you can pull together a team that can provide us with a new instruction set architecture that looks novel enough that we will have ample material to patent. We suggest as a start that you use a 17-bit fixed instruction size and 34-bit word size; that combination may help you explore a new design space. Furthermore, Boatorola has access to the MIPS and SPARC patent portfolio, so avoid similarities! Of course, our products still need to be competitive, so the ISA should be general purpose and reasonably efficient. Also, since the fuse is relatively short on this, you will need to keep it simple. Your compensation will be based on the correctness, novelty and efficiency of the end product.

Thanks in advance,

Jake

Overview

As you read in Jake's letter, you should save your company by designing a novel processor in less than one month. You will first focus on the design of your own ISA. You may work in groups of up to two people. Your ISA should be general enough to run all the provided benchmark programs, while being simple enough to allow you to implement a reasonably fast processor in the allotted time frame. Then, you will implement two essential components for architectural validation and verification -- assembler and simulator. An assembler translates your program written in your assembly language into binary code; a simulator performs a simulation upon a provided binary code. Collectively, they form essential infrastructure for your processor design. For the implementation of the assembler and the simulator, you are free to choose any high level language (including scripting languages).

Requirements

ISA

Assembler

It is difficult and error-prone to manually write machine code. To address this problem, people usually use an assembler, which automatically generates a machine code from an assembly file. Moreover, many C compilers first generate assembly files and then simply feed it to an assembler to get the executable machine code. For these reasons, you should write an assembler for your ISA. The assembler reads a program written in an assembly language, then translates it into binary code and generates two output files containing executable machine code. You will use the generated output files for both the simulator and the actual hardware you will implement.

Simulator

Now that you have an easy way to generate machine code, it is time to implement a simulator. With a simulator, you can 1) easily verify your ISA without actually implementing hardware, 2) debug your application without having actual hardware, and 3) improve your ISA by spotting performance bottlenecks in benchmark programs. Your simulator operates instruction by instruction; you must be able to execute instructions one by one and watch all the programmer visible states (eg. register, memory, ...) at a certain time when the execution of an instruction is completed.

In this project, we also provide you a simple simulator framework to save your time in developing the simulator running your new ISA. You may find the detailed description about the simulator here.
New for 2012: Check out the simulator via:
svn checkout svn://parallel.ucsd.edu/asm-sim-framework/trunk

Benchmarks

Two benchmarks are provided to help guide your ISA development. You need to write assembly programs based on your ISA for all the benchmarks. Assume that all the addresses (pointers) and data in the benchmark programs are 34 bits.

Deliverables

If you cannot complete you lab on time, you can turn it in late, but your grade will be penalized. The penalty is set after the due date, and typically runs as high as 10% per 24 hours.

Note that the entire package is due May 1. The milestone dates indicate the latest date at which you can submit this release without a late penalty. You should continue on to the next portion of the project even if you have completed a milestone early; we do not guarantee that these are spaced proportionally to the amount of work involved.

Milestone Release Description Due No Later Than
Design Concept Figure out your secret sauce   For this milestone, you should write out the code for Supergarbage (SG) in your favorite RISC ISA. Then, brainstorm a combination of new assembly instructions that could reduce the number of instructions that are needed for the SG app. Fewer instructions are better; but make them flexible or useful enough that they are not overly specialized, since you never know when SuperGarbage 2.0 might come out.

Generally, you should follow RISC principles and avoid instructions that require multiple memory operations, or that read/write the register file too many times per instruction (3-4 is standard; probably you could go as high as 8, but your cycle time and area will start shooting up). One trick is to have special-purpose registers that hold values that are necessary, but tend to stay constant. These will not count against your quota. Another trick is if you do not have encoding space to specify many registers, is to pre-specify the registers that the instruction will write (either special purpose or general purpose registers.) For special-purpose registers, you will need special instructions that can read and write them, since you need the ability to read and write them in order to context switch.
Another final trick is that if you know that a set of loads or stores are going to be contiguous, you can have a "SIMD" load or store instruction that loads N consecutive words in one cycle. To implement this, you will divide your data memory into N banks so that it can read out N words at a time.

Evaluate the benefit of your design by counting the number of instructions required to execute an iteration of the loop in the common case, for both cases -- your RISC ISA, and your new brainstormed design. The ratio between the two is the "speedup" of your design. Make sure in both cases to expand out any macro instructions, as that could through off your calculations.

A few clarifications on the writeup of your "design concept".
    As part of your writeup, you should define the semantics of any novel instruction and show that you have sanity checked them; mainly to verify they are implementable and actually help performance:
    • How many reg writes, reg reads, ram loads and stores does it do?
    • What is the speedup attributable to that instruction?
    • Is there like to be a problem encoding it?
    • How brittle is the instruction? Will they still be useful if make small changes to the apps?
    • Could you generalize the instruction slightly to make it less brittle?

    You should shoot for (but may not attain) 1.5x - 10x speedup over MIPS. It is possible!
    Submit your writeup (before and after code sequences, your analysis of the overall speedup, analysis of your novel instructions) via e-mail to Vineet before the due date and time.

    Your email title should be "[CSE141] project1-design, name0, name1"
    Your only deliverable for this is a pdf with the relevant code sequences and your writeup!

    If you have time, you may also want to do this process for fibonacci. This will help you have the fastest performance across both benchmarks. Can you adapt your instructions so they can be useful for both benchmarks?
April 10
Alpha Release Make sure your architecture is general purpose  Beta Draft of your ISA specification (supported instructions, semantics, machine code format and encodings, etc), optimized Supergarbage (SG) asm code, and mildly-optimized Fib asm code. The fib code is to ensure your ISA is general purpose; no need to have super-specialized instructions. Note you will need to figure out how function calls work in your ISA for this exercise. You should include a detailed description of your function call ABI (caller/callee saved, return address, etc) in your submission. If your SG code has changed significantly because of your ISA mods, it is wise to include an updated version of your performance analysis from "Design Concept." To what extent was your "secret sauce" compromised by addressing generality or encoding issues?

The asm code should be encodable in the instruction set you specify. If you require any macro instructions, you should specify what instructions they turn into.
Submit a pdf via e-mail to Vineet.

Your email title should be "[CSE141] project1-alpha, name0, name1"
April 17
Beta Release Implement (and test) your assembler and write your manual   Latest revision of your ISA (in instruction manual form); optimized Fib asm code, Supergarbage asm code, and .coe files, generated by your assembler. Oh, and the assembler itself. =)

The instruction manual should include instruction names, instruction formats, and RTL descriptions of functionality. It should also include opcode maps, as explained in the class. For the manual style, follow the figure below, which is drawn from the MIPS R4400 manual. However, it does not need to be so ornately typeset.

Submit all the files (Manual, the assembler, assembly input files, .coe files) via e-mail to Vineet. Make sure you have a single pdf for the files!
Your email title should be "[CSE141] project1-beta, name0, name1 .."
April 24
Golden Release Implement your simulator (using framework described above), test everything together (this will take time!), and evaluate.  Final revision of your ISA (in instruction manual form), Test code, Fib code, Supergarbage code, Assembler, Simulator and "Final Package" (see below).

Before the submission of your report, you should evaluate your instruction set architecture and also revisit your design decisions if necessary.

The first test of your infrastructure to pass is a simple instruction test. Write a simple assembly program which uses all the instructions in your ISA, and checks their outcome. You should be able to automatically generate COE file via your assembler, and run the test on your simulator to confirm that each instruction works. Try to make your test program as concise as possible while it covers all the instructions.

Your ISA and infrastructure will be also tested using your SuperGarbage and Fibonacci benchmarks in the same way. You should verify that the answers are correct for both benchmarks.

Since "instruction count" is one of the three factors that affects execution time, you should run all the benchmark applications and get the dynamic instruction count for each benchmark. You may use the 'count' command of your ISA simulator to get this number.

May 1

    The Final Package, emailed to the TA, should contain:
    • Writeup (in .pdf form):
      • The name of your ISA and detailed explanation (at least two pages or so) of your design decisions. You must explicitly identify the elements that make your design novel compared to MIPS or Sparc.
      • Final Instruction manual.
      • A description of all architectural (i.e. programmer visible) state (registers, stacks, memories, queues, etc)
      • Stack management and function call / parameter passing conventions
      • The test program you wrote that tests all instructions, with heavy comments.
      • The two benchmark programs written in your ISA assembly language with heavy comments
      • Dynamic instruction counts for each benchmark
    • Zipped source files (including your assembler and simulator, sg asm, fib asm, test asm) and final writeup via e-mail to Vineet.

      Your email title should be "[CSE141] project1-golden, name0, name1, ...".