team antelope final presentation what doesn’t kill you, makes you stronger "the major...

56
Team Antelope Final Presentation What doesn’t kill you, makes you stronger "The major difference between a thing that might go wrong and a thing that cannot possibly go wrong is that when a thing that cannot possibly go wrong goes wrong it usually turns out to be impossible to get at or repair.“ James Zirkle John Lange Peter Johnson Chris

Upload: reynard-charles

Post on 28-Dec-2015

223 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Team Antelope Final Presentation What doesn’t kill you, makes you stronger "The major difference between a thing that might go wrong and a thing that cannot

Team AntelopeFinal Presentation

What doesn’t kill you, makes you stronger

"The major difference between a thing that might go wrong and a thing thatcannot possibly go wrong is that when a thing that cannot possibly go wrong

goes wrong it usually turns out to be impossible to get at or repair.“

James ZirkleJohn Lange

Peter JohnsonChris

Page 2: Team Antelope Final Presentation What doesn’t kill you, makes you stronger "The major difference between a thing that might go wrong and a thing that cannot

Processor Overview

Despite all my rage I'm still just a rat in a cage --Bullet With Butterfly Wings

• 5 stage pipeline• 10 nanosecond clock• 128 bit memory• Split Caches

– Write back policy

• CLZ and Multiply simplified to 1 clock cycle• MicroSequencer used to handle complex

operations

Page 3: Team Antelope Final Presentation What doesn’t kill you, makes you stronger "The major difference between a thing that might go wrong and a thing that cannot

Who did what

• James– Register File, Integration

• Jack– Cache, Memory, ALU

• Peter– Shifter, hazard detection unit

• Chris – Multiplier, CLZ, interrupts

Page 4: Team Antelope Final Presentation What doesn’t kill you, makes you stronger "The major difference between a thing that might go wrong and a thing that cannot

ALU

“Quidquid latine dictum sit, altum viditur”

• Handles all 16 data processing instructions

• Determines PSR flag values

• 4 bit carry look ahead units, combined into 16 blocks

Page 5: Team Antelope Final Presentation What doesn’t kill you, makes you stronger "The major difference between a thing that might go wrong and a thing that cannot

Shifter

• 32 bit Barrel Shifter

• Logical Shift Left/Right, Arithmetic Shift Right, Rotate Right, Rotate Right Extended

• Special Cases (LSR #0 encodes LSR #32, etc)

• Generates result by combining individual bit shifters

Page 6: Team Antelope Final Presentation What doesn’t kill you, makes you stronger "The major difference between a thing that might go wrong and a thing that cannot

Barrel Shifter

Result propagated through bit shifters

Added 32-bit Shifters

Page 7: Team Antelope Final Presentation What doesn’t kill you, makes you stronger "The major difference between a thing that might go wrong and a thing that cannot

16 Bit-Right Shifter

Page 8: Team Antelope Final Presentation What doesn’t kill you, makes you stronger "The major difference between a thing that might go wrong and a thing that cannot

32-Bit Barrel Shifter

Carry In / Carry Out

-Carry in only used in RRX (rotate right extended) operations

-Carry out always computed, even though not needed in rotate operations

Page 9: Team Antelope Final Presentation What doesn’t kill you, makes you stronger "The major difference between a thing that might go wrong and a thing that cannot

Carry Out Logic: Two Options• Separate logic computes Cout early using input

and shift amountPros:

-Cout signal ready much earlier, no need for propagation

-Simpler bit shifter designs

Cons:

-Many more gates needed

Page 10: Team Antelope Final Presentation What doesn’t kill you, makes you stronger "The major difference between a thing that might go wrong and a thing that cannot

Carry Out Logic: Two Options• Individual bit shifters compute and propagate

Cout signalPros:

-Simpler overall design

-Fewer logic gates

Cons:

-Takes longer for Cout to be ready (propagation delay)

-More complicated bit shifters

Page 11: Team Antelope Final Presentation What doesn’t kill you, makes you stronger "The major difference between a thing that might go wrong and a thing that cannot

Carry out: Conclusion• Went ahead and implemented Cout logic in the

bit shifters-Don’t really need the signal to be ready any earlier than the rest of the shifter output, especially not at the addition gate cost

-Each shifter computes Cout for its own shift amount and passes it on, or leaves Cout alone if it is disabled

Page 12: Team Antelope Final Presentation What doesn’t kill you, makes you stronger "The major difference between a thing that might go wrong and a thing that cannot

Complete Shifter

Page 13: Team Antelope Final Presentation What doesn’t kill you, makes you stronger "The major difference between a thing that might go wrong and a thing that cannot

Multiplier (MUL/MLA)• 32 additions in parallel

• Logarithmic time result

• 25 = 32, so time equals 5 adds

• Multiply w/accumulate inserted at the end with a multiplexor

Page 14: Team Antelope Final Presentation What doesn’t kill you, makes you stronger "The major difference between a thing that might go wrong and a thing that cannot
Page 15: Team Antelope Final Presentation What doesn’t kill you, makes you stronger "The major difference between a thing that might go wrong and a thing that cannot

Count leading zeros (CLZ)

• Output equals number of leading zeros on the input (Ex: 00010110 00000011)

• First step: 00010110 00011111

• Then, add one: 00011111 00100000

• Lastly, convert to binary. With a 32-bit input, output will have a 6-digit maximum.

• Timing: Only four gate delays.

Page 16: Team Antelope Final Presentation What doesn’t kill you, makes you stronger "The major difference between a thing that might go wrong and a thing that cannot
Page 17: Team Antelope Final Presentation What doesn’t kill you, makes you stronger "The major difference between a thing that might go wrong and a thing that cannot

Register File

• 37 Total Registers

• Different modes select between different registers.

• Registers r0-r7 and the PC (r15) are common to all modes

• PSR Mode bits select between different register banks

Page 18: Team Antelope Final Presentation What doesn’t kill you, makes you stronger "The major difference between a thing that might go wrong and a thing that cannot

Register File, Continued

• 3 normal (r0-r15) register outputs.

• 1 input that can access r0-r15

• An input and an output dedicated to the PC

• An input and an output dedicated to the SPSR

Page 19: Team Antelope Final Presentation What doesn’t kill you, makes you stronger "The major difference between a thing that might go wrong and a thing that cannot

Pipeline Design and Component Integration

“The manual for a ferrari 250 states that replacing the timing chain is a five-step process. Step one is the simple (?) instruction: ‘Invert motor on bench.’”

Page 20: Team Antelope Final Presentation What doesn’t kill you, makes you stronger "The major difference between a thing that might go wrong and a thing that cannot

Pipeline Selection

• Selected a 5 stage pipeline design– Fetch: Instruction is retrieved from memory

– Decode: Instruction is processed, control signals sent

– Execute: ALU, Shift, Multiply and CLZ operations

– Memory: Data cache/memory access

– Writeback: Results are written back to the register file

Fetch->Decode->Execute->Memory->Writeback

Page 21: Team Antelope Final Presentation What doesn’t kill you, makes you stronger "The major difference between a thing that might go wrong and a thing that cannot

Advantages

• Breaks datapath into logical operational blocks.

• Slower stages can be broken up to increase the clock speed.

• Results in higher throughput

Page 22: Team Antelope Final Presentation What doesn’t kill you, makes you stronger "The major difference between a thing that might go wrong and a thing that cannot

Disadvantages

• More time consuming to implement.

• Data hazards appear, so must implement forwarding and stalls in certain circumstances. This further complicates the design.

Page 23: Team Antelope Final Presentation What doesn’t kill you, makes you stronger "The major difference between a thing that might go wrong and a thing that cannot

Fetch

Decode

Execute

Memory

Writeback

Page 24: Team Antelope Final Presentation What doesn’t kill you, makes you stronger "The major difference between a thing that might go wrong and a thing that cannot

Pipelined Datapath Construction

“Purpose—to drive you to insanity”

• Implemented simple single stage datapath first.

• Used D flip-flops to break up the datapath into the 5 different stages.

• Added memory and cache.– Stall the pipeline by holding the clock.

Page 25: Team Antelope Final Presentation What doesn’t kill you, makes you stronger "The major difference between a thing that might go wrong and a thing that cannot

Fetch Stage

• Consists of Data Cache

• Runs almost every cycle.

• Stalled independently of the rest of the stages while the Sequencer is running.

Page 26: Team Antelope Final Presentation What doesn’t kill you, makes you stronger "The major difference between a thing that might go wrong and a thing that cannot

Execute Stage

• Contains:– Shifter– ALU– Multiplier– CLZ unit– Conditional Execution unit– PSR and PSR control

Page 27: Team Antelope Final Presentation What doesn’t kill you, makes you stronger "The major difference between a thing that might go wrong and a thing that cannot

Writeback

• Contains the interface to Data Cache

Memory

• Writes back to registers

Page 28: Team Antelope Final Presentation What doesn’t kill you, makes you stronger "The major difference between a thing that might go wrong and a thing that cannot

Decode Stage, Continued

• Stage contains:– Register File– Sequencer– Branching logic

• 32 bit shift extender

• 32 bit full adder

• PC is output from the register file straight into the Instruction Cache address

Page 29: Team Antelope Final Presentation What doesn’t kill you, makes you stronger "The major difference between a thing that might go wrong and a thing that cannot

Decode Stage

• Modular design, each instruction type has one module that is connected to a mux

• PLA takes instruction and outputs a 4 bit select signal that selects between all modules.

• Control is contained in a 32 bit bus that is piped through the entire processor.

Page 30: Team Antelope Final Presentation What doesn’t kill you, makes you stronger "The major difference between a thing that might go wrong and a thing that cannot

Current Processor Implementation

Page 31: Team Antelope Final Presentation What doesn’t kill you, makes you stronger "The major difference between a thing that might go wrong and a thing that cannot

Hazards

Read after Write:

FETCH DEC EXEC DATA WB

FETCH DEC EXEC DATA WB

1.

2. STALL

Page 32: Team Antelope Final Presentation What doesn’t kill you, makes you stronger "The major difference between a thing that might go wrong and a thing that cannot

Hazards

Branch:

FETCH DEC EXEC DATA WB

FETCH DEC EXEC DATA WB

1.

2.

3.

4.

FETCH DEC EXEC DATA WB

FETCH DEC EXEC DATA WB(Branch Target)

Page 33: Team Antelope Final Presentation What doesn’t kill you, makes you stronger "The major difference between a thing that might go wrong and a thing that cannot

Hazard Checking Logic

Checks to see if Rd (destination register) is read from in next 2

commands

Page 34: Team Antelope Final Presentation What doesn’t kill you, makes you stronger "The major difference between a thing that might go wrong and a thing that cannot

Data ForwardingFETCH

DECODE

EXEC

DATA BUFFER

WRITEBACK

Result

Data

Page 35: Team Antelope Final Presentation What doesn’t kill you, makes you stronger "The major difference between a thing that might go wrong and a thing that cannot

Overview

Page 36: Team Antelope Final Presentation What doesn’t kill you, makes you stronger "The major difference between a thing that might go wrong and a thing that cannot

CONDITION EVALUATE

CPSR

Flags

Page 37: Team Antelope Final Presentation What doesn’t kill you, makes you stronger "The major difference between a thing that might go wrong and a thing that cannot

Interrupt Handler

Component must handle the following seven cases:1. Reset (Highest Priority)

2. Data Abort

3. FIQ

4. IRQ

5. Prefetch Abort

6. Undefined Instruction

7. Software Interrupt (SWI) (Lowest Priority)

Page 38: Team Antelope Final Presentation What doesn’t kill you, makes you stronger "The major difference between a thing that might go wrong and a thing that cannot

Implementation

• One ROM file handles memory addresses.

• 3-bit input leads to 32-bit address for PC.

• Second ROM file handles CPSR alterations.

• 4-bit input leads to lower 8 bits of CPSR.

• Priorities of the interrupts are handled with CLZ functionality.

• Lastly, no interrupts leads to “Active = 0”.

Page 39: Team Antelope Final Presentation What doesn’t kill you, makes you stronger "The major difference between a thing that might go wrong and a thing that cannot
Page 40: Team Antelope Final Presentation What doesn’t kill you, makes you stronger "The major difference between a thing that might go wrong and a thing that cannot

Memory

"Memory is like an orgasm. It's a lot better if you don't have to fake it.“

-- Seymour Cray

• 128 bit wide Main Memory• 32 bit Split cache system

– Data and Instruction

• Data Cache operates with Write Back Policy• 2 State Machines in charge of Memory Control

Page 41: Team Antelope Final Presentation What doesn’t kill you, makes you stronger "The major difference between a thing that might go wrong and a thing that cannot

Main Memory Control

It wasn't very sporting, but what the hell.- Chuck Yeager on shooting down a landing Me-262

• Simulates memory latency with a delay component

• Implemented with a state machine– Enters a wait state while holding for memory to finish

• Operation order: – Data first, Instruction second

• Signals when data is valid, and when operation is finished

Page 42: Team Antelope Final Presentation What doesn’t kill you, makes you stronger "The major difference between a thing that might go wrong and a thing that cannot

Memory State Machine

Page 43: Team Antelope Final Presentation What doesn’t kill you, makes you stronger "The major difference between a thing that might go wrong and a thing that cannot

Caches

“I'm just here for moral support. Ignore the gun.”

• 128 bit lines separated into 32 bit blocks• Hits determined by using high address bits, as well

as a valid bit• Write strategy uses Dirty bit to signal when to

write to memory• On reset valid and dirty bits are cleared• Can operate in 128, 32, and 8 bit modes

– Necessary for memory and processor interface

Page 44: Team Antelope Final Presentation What doesn’t kill you, makes you stronger "The major difference between a thing that might go wrong and a thing that cannot

Cache Reset

"A day without killing... is like a day without sunshine“

-John Wayne

• Cache reset controlled by two signals– RESET and MEM_CLEAR

• When MEM_CLEAR is pulsed a sequencer is engaged– Adder attached to a flip-flop

– Cycles through addresses, setting values to 0

– Asserts pipeline hold signal while running

• RESET clears all the state machines back to initial state

Page 45: Team Antelope Final Presentation What doesn’t kill you, makes you stronger "The major difference between a thing that might go wrong and a thing that cannot

Memory System Control

"He spoke, I had no clue, it was a mutual relationship.“

• Implemented with a state machine• Interfaces I-Cache, D-Cache, Main Memory, and

Pipeline• During operation, pipeline hold signal is asserted• Autonomous operation, requires no special

datapath control• Took so much time, that it made my girlfriend

jealous

Page 46: Team Antelope Final Presentation What doesn’t kill you, makes you stronger "The major difference between a thing that might go wrong and a thing that cannot

Memory Control Overview

Page 47: Team Antelope Final Presentation What doesn’t kill you, makes you stronger "The major difference between a thing that might go wrong and a thing that cannot

Memory Control FSMs

Page 48: Team Antelope Final Presentation What doesn’t kill you, makes you stronger "The major difference between a thing that might go wrong and a thing that cannot

Memory Control FSMs

Page 49: Team Antelope Final Presentation What doesn’t kill you, makes you stronger "The major difference between a thing that might go wrong and a thing that cannot

Memory Control FSMs

Page 50: Team Antelope Final Presentation What doesn’t kill you, makes you stronger "The major difference between a thing that might go wrong and a thing that cannot

Interrupts

“The nice thing about standards is that there are so many of them to choose from.”

Page 51: Team Antelope Final Presentation What doesn’t kill you, makes you stronger "The major difference between a thing that might go wrong and a thing that cannot

Sequencer

• Built to handle complex operations– Interrupts, block load/store

• Is basically a clocked ROM file.– Has a start address and a start signal– Runs through a sequence of instructions in the

ROM file until sequence signals it is done.– One instruction per cycle is injected into

instruction stream, Fetch stage is stalled.

Page 52: Team Antelope Final Presentation What doesn’t kill you, makes you stronger "The major difference between a thing that might go wrong and a thing that cannot

Instructions: Data Processing, Multiply and CLZ

• These instructions move linearly through the pipeline, and don’t require stalls as they are all single cycle in our implementation.

• Present some data hazard problems, but hazard detection and forwarding logic maintains linear execution.

Page 53: Team Antelope Final Presentation What doesn’t kill you, makes you stronger "The major difference between a thing that might go wrong and a thing that cannot

Branch

• On decode, branch immediately adds the PC to the shifted offset and updates the PC.

• No stall necessary, since PC is updated before the next instruction is fetched.

• Branch w/link has r14 updated when branch finishes moving through the entire pipeline.

Page 54: Team Antelope Final Presentation What doesn’t kill you, makes you stronger "The major difference between a thing that might go wrong and a thing that cannot

LDR, STR

• Used asynchronous logic to make LDR and STR single cycle. During the first part of the clock cycle, the updated base register is written, the writeback register is changed, and the value is loaded from memory into that register.

• Simplifies load and store logic greatly.

Page 55: Team Antelope Final Presentation What doesn’t kill you, makes you stronger "The major difference between a thing that might go wrong and a thing that cannot

Multicycle Instructions

• Multiple Register Transfer• Swap

• Implemented with our sequencer:– Each of these instructions translates into a

sequence of single cycle instructions. These instructions are modified to correspond with the specific multicycle instruction.

Page 56: Team Antelope Final Presentation What doesn’t kill you, makes you stronger "The major difference between a thing that might go wrong and a thing that cannot

Where are we now?

"Time commitment--eternity.“--CTEC

• All 5 stages and Memory/Cache integrated.• Data Processing, Multiply, CLZ, Shifting, Load,

Store, Branch, MRS, MSR• Not yet fully functional:

– Load/Store Multiple– Swap– Conditional execution (in regards to branch)– Interrupts