[Computer Architecture] data path

intro - where are we now?

image-20200331101915459

the cpu

Processor - datapath - control

cenario in RISC-V machine

image-20200331102713392

The datapath and control

image-20200331120145444
image-20200331120240686

Overview

  • problem: single monolithic bloc
  • solution: break up the process of excuting an instruction into stages
    • smaller stages are easier to design –
    • easy to optimize &modularity

five stages

image-20200331102935318

  • Instruction Fetch
    • pc+=4
    • take full use of mem hierarchy
  • Instruction Decode
  • read the opcode to determine instruction type and field lengths
  • second, (at the same time!) read in data from all necessary registers
    • for add, read two registers
    • for addi, read one register
  • third, generate the immediates
  • ALU
    • the real work of most instructions is done here: arithmetic (+, -, *, /), shifting, logic (&, |)
    • For instance, it's load and store
      • lw t0, 40(t1)
      • the address we are accessing in memory = the value in t1 PLUS the value 40
      • so we do this addition in this stage
  • Mem access
    • Actually only the load and store instruction do anything during this stage.
    • it's fast but unavoidable
  • Register write
    • write the result of some computation into a register.
    • for stores and brances idle

      misc

      image-20200331200948199

    image-20200331104008311

    memory alignment

    image-20200331201039177

data path elements state and sequencing

register

image-20200331112454437

instruction level

add

image-20200331105222087image-20200331105422860

image-20200331110018593

time diagram for add

image-20200331111255018

addi

image-20200331120334870

lw

image-20200331202936147

image-20200331203002110

sw - critical path

image-20200331203121826

image-20200331120529637

combined I+S Immediate generation

image-20200331203242961

branches

image-20200331120922178

image-20200331112154728

image-20200331114914251

pipelining

image-20200331120724483

summary

image-20200331180540752

quiz

image-20200331181726584

for D

image-20200331181714589image-20200331181804796image-20200331181819265

for E

image-20200331182129638