03 Fetch Unit Operation
03 Fetch Unit Operation
03 Fetch Unit Operation
Lab 2A Status
Great progress by everyone
Almost halfway to a fully working
processor!
Amnesty policy:
By end of today (4/13): 0% penalty
By end of tomorrow (4/14): 5% penalty
Front-End vs Back-End
FIFO storage
Stores instruction address and SRAM
output into FIFO
restart_i
Control
load_data_valid_o
load_store_valid_i
sel_mux[3:0]
fifo_enque
ram_we
fifo_clear
store_en_i
0
instruction_valid_o
pc_r[9:0]
mux0
+1
+offset
restart_addr _i[9:0]
instruction_data_o[16:0]
FIFO
mux1
0
0
restart_addr_r [9:0]
ip_in.instr
mux2
deque_i
1
load_store_addr_i [9:0]
instruction_addr_o[9:0]
ip_in.addr
pc_next
load_store_addr_r [9:0]
SRAM
mux3
store_data_r [16:0]
fifo_empty fifo_full
store_data _i[16:0]
offset [9:0]
sign
extend
ram_data [4:0]
load_data_o[16:0]
Datapath
FIFO Store (FS)
AC
FS
AC
Prediction
known here
FS
AC
FS
AC
FS
AC
...
Restarting Fetch
Cycle #
0x2: bez $3, 0x10
0x12: add $7, $5, $9
0x13: mul $7, $7, $4
0x3: add $3, $6, $7
0x4: ...
AC
FS
AC
FS
AC
FS
X
AC
back-end
detects
mispredict!
restart @
0x3
FS
AC
...
AC
FS
AC
AC
FS
AC
FS
AC
FS
FIFO Full
asserted
FIFO Full
FS deasserted
AC
AC
FS
AC
FS
AC
FS
Lab 2B:
Fetch Unit Control
restart_i
Control
load_data_valid_o
load_store_valid_i
sel_mux[3:0]
store_en_i
0
instruction_valid_o
fifo_enque fifo_clear
ram_we
pc_r[9:0]
mux0
+1
+offset
restart_addr _i[9:0]
instruction_data_o[16:0]
FIFO
mux1
0
0
restart_addr_r [9:0]
ip_in.instr
mux2
deque_i
1
load_store_addr_i [9:0]
instruction_addr_o[9:0]
ip_in.addr
pc_next
load_store_addr_r [9:0]
SRAM
mux3
store_data_r [16:0]
fifo_empty fifo_full
store_data _i[16:0]
offset [9:0]
sign
extend
ram_data [4:0]
load_data_o[16:0]
Datapath
FIFO Store (FS)
Control logic
implementation
Fetch unit is pipelined
Not modeled as a finite state machine
Each pipeline stage depends on a subset
of the control signals
Simplified
Implementation Stategy
A Simple Example
sel_mux[3:0], ...