Processor Microarchitecture Flashcards

1
Q

What is microarchitecture?

A

the specific arrangement of registers, ALUs, FSMs, memories and other logic building blocks needed to implement an architecture

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the two interacting parts of the microarchitecture?

A

Datapath - made up of memories, registers, ALUs and multiplexers and operates in 32-bit words of data.
Control unit - produces signals to control the operation of the datapath. It receives the current instruction and tells the datapath how to execute it.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are two of the microarchitectures for ARM achitecture?

A

Single-cycle: each instruction executes in a single cycle

Pipelined: each instruction is broken up into a series of steps and multiple instructions execute at once

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is execution time?

A

Measure of performance for microarchitecture. Execution time = (#instructions)(cycles/instruction)(secs/cycle)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is CPI?

A

cycles/instruction

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

what is clock period?

A

seconds/cycle

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is IPC

A

instructions/cycle

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Name the ARM architectural state elements

A
  • PC
  • status register
  • instruction memory
  • register file
  • data memory
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Program counter:

A
  • part of the register file but it is read and written every cycle, independent of the register file
  • the output points to the address of the current instruction
  • the input points to the address of the next instruction
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Instruction memory:

A
  • receives a 32-bit instruction address at input A and reads the 32-bit instruction from that address into RD
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Register File:

A
  • two read ports, A1 and A2. The 4 bit addresses on these ports are used to select register operands. The 32-bit data from these registers are read to RD1 and RD2
  • 4-bit address on A3 specifies register which data at WD3 is written to, given WE3 is asserted
  • R15 gives PC+8
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Data memory:

A
  • single read/write port
  • if WE is asserted, data at WD is written to address A
  • if WE isn’t asserted, data at address A is read to port RD
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What are the main parts of the control unit?

A

Decoder: generates the control signal for a particular instruction
Conditional logic: maintains status flags. Only enables update to architectural state when instruction should be conditionally executed

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What are the sub sections of the decoder?

A
  • PC Logic: checks if instruction is a write to R15 or a branch
  • Main Decoder: determines type of instruction (e.g. STR, DP, B) and produces appropriate control signal to the datapath
  • ALU Decoder: chooses ALUcontrol based on type of instruction (ADD, SUB, AND)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What does conditional logic do in the control unit?

A
  • checks if instruction should execute (if not, force PCSrc, RegWrite and MemWrite to 0)
  • possible update status register (Flags 3:0)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Latency

A

time to execute one instruction

17
Q

Throughput

A

how many instructions can be completed per unit time

18
Q

What are the five stages of a pipelined ARM processor?

A
  • Fetch
  • Decode
  • Execute
  • Memory
  • Writeback
19
Q

Fetch stage:

A

processor reads instruction from memory

20
Q

Decode stage:

A

processor reads source operands from the register file and decodes the instruction to produce control signals

21
Q

Execute stage:

A

computation in current instruction is performed using ALU

22
Q

Memory stage:

A

processor reads or writes data to memory

23
Q

Writeback stage:

A

the processor writes the result to the register if applicable

24
Q

Explain the process a pipelined ARM processor carries out for each instruction

A

It is broken up into 5 stages: - - Fetch: processor reads instruction from memory.

  • Decode: processor reads source operands from the register file and decodes the instruction to produce control signals.
  • Execute: computation in current instruction is performed using ALU.
  • Memory: processor reads or writes data to memory.
  • Writeback: the processor writes the result to the register if applicable
25
Two types of pipelined hazards:
Data hazard: register value not yet written back to register file Control hazard: next instruction not decided yet (caused by branch)
26
Handling data hazards:
- insert NOPs in code at compile time - rearrange code at compile time - forward data at run time - stall the processor at run time
27
What is data forwarding, how does it work?
- It is a method of handling data hazards - Hazard unit checks if register read in execute stage matches register written in memory/writeback stage, if so forwards result
28
What is the problem with inserting NOPs to mitigate data hazards?
It wastes cycles and processor time
29
What is stalling? How does it work?
- It is a method of handling data hazards - Hazard unit checks if either source register in the decode stage matches the one being written in the execute stage - If so, hazard unit enables stall, flushing initial value in source operand and repeating decode instruction with correct register values
30
Why does branching cause control hazards?
- branch not determined until writeback stage of pipeline - instructions after branch fetched before branch occurs - these 4 instructions must be flushed if branch happens
31
Branch misprediction penalty:
- number of instructions flushed when branch is taken
32
How is branch misprediction penalty cut from 4 to 2 when branch instruction occur occur?
By adding a branch multiplexer before PC register to select BTA from ALU result in execute stage. The conditional unit controls this multiplexer, it is only asserted when branch is taken