Modeling CPU Performance
Notes
- I asked ChatGPT for help on this.
- I wanted up to date performance time for individual components of the CPU
- I don't think these are available, or at least I can't find them.
- I think what the AI gave me was the result of academic exercises.
- P&H have these in some exercises.
- But they will do for now.
-
Component Suggested delay Notes PC clock-to-output 30 ps Current PC becomes available Instruction memory 150 ps Read instruction Main control unit 50 ps Decode opcode and generate control signals ALU control 30 ps Determine ALU operation Register file read 100 ps Read either source register Register file write setup 50 ps Data and destination ready for clock edge ALU 120 ps Arithmetic, logic, address calculation, or comparison Adder (PC + 4) 70 ps Increment program counter Branch-target adder 100 ps Add PC-relative branch displacement Data memory read 200 ps Read load data Data memory write setup 50 ps Address and data ready for write 2-to-1 multiplexer 25 ps Select between two data inputs Sign/zero extender 20 ps Extend an immediate value Branch decision logic 20 ps Combine comparison and branch controls PC register setup 50 ps New PC ready for clock edge NOP 0 ps Do Nothing. - I changed the instruction memory time from 200 to 150.
- I would like to generate a somewhat academic performance calculation for this machine.
- Step 1 is to break the machine into five parts
- Instruction Fetch : IF
- Get the instruction into the MDR of the Instruction MMU
- This is probably just Instruction Memory time.
- Instruction Decode: ID
- Decode the instruction
- AND Get the values from the Register File or Fix the Immediate
- Execution: EX
- In previous versions of the text this was called ALU so I might do that.
- But perform the math portion of the instruction
- Memory Access: MEM
- Do whatever needs to be done in memory
- Also, compute the new value of the PC (Why put this off to this point)
- Write Back: WB
- Store new any value in the register file.
- Instruction Fetch : IF
- Let's establish time for each of these
- But I want different times for mem-write and mem-read
- After that, look at R-Type, I-Type, Load, Store, Branch (generic)
- Compute the time for 1,000,000 instructions
- Using the maximum path
- Using the exact time for each instruction type
- Using the time for the next class, but mem-read is two cycles
- Using a 5 stage pipeline, with worst case time.
- A starting point.
- Workbook from Friday.