Lab2 Diagram
Lab2 Diagram
memtalken
take
plus plus
-
ex
pe mem pc 4
Adder
- -
rd
-
- -
ex
rd
-
ex
rg )
Hazard target
-
mem pc
taraget
. -
taraget
-
-
ex
rSJ pc
result
- -
Adder
Place MUXs
via ts
sextimm
-
IO SO
'
in_b
e-
adden)
'f -
pa -
plus -
t
pel plus 4
in_a
-
-
.
result yumpP
if you want to
mem -
ex
jump
* in_b
-
id
-pc -
plus - 4
iW PE
-
jump id 5 ump
- -
taken 5 ump )
E
.
takan Simple
taken
f mem
exX
mem
-
LPa -
s
simple -
cpa
branch id bramch-
check 1 S0
i5
1 -
PC 1p/ us4
-
ex - memprite ex - wrizedatca 4 11
S ,
mem_to_reg
jd -
memtoreg
exmam toreg
mem -
memtoreg
jinstzuctisntbioy
opcode alu_op id alusp
opcoole reg Wrste- data
-
wid - -
wb
aluresalty
mem_write ALU
-
jd meiwrite
-
a luinput SGc
-
Lb readdata
-
P
on …
MEET PE wif PC -
alu_src jd - aluspa
walu inl -
in_a alu eneck
wbk - memtoregs g
Nrite data mst PC
- - -
C
-
olusrc check
-
ex
almin
-
id regwrite s
reg_write in_b
-
alu result
result
ex
Data Memory
- -
i instructionel : n 3 n
alu_func
opam. memhwwite
miurd exfonwarding - rs
)
mem_write 1
ex -
regwrite D 8
forward dsne
-
-
rS 1
mam memread
mem_read
[ -
202
Register File ex readdatal
write -
daa- notEPC
O mem fanct- s hlio]
maskmode
3
readdate
-
-
mam a -a result
read_data
mem
7
-
s
linkeckpcwrite
Instruction Memory idinstraatiomala ' t 5m
rs1 [Z 3
sext
ALU Control Unit
"
ilrsl
rs2 -
meampepus alu resust
t .
-
address
mam
y
exalesp
- -
niadpsI
alu_op wb-jumpID + EO3
S
forwaurding rS mem woitedaetw
writereg alurfune
5
write_data
- -
alu_func
-
- -
'
funct 3 J
funct3
ex
Write lata M,X PC
-
reg writecdate
- - -
mem s
alhm t
-resul
3
jeg writedatn
-
wen ex - readdataJ ~s
@ - plu 3-
4
nB nenpa
regwrit
clk
-
iavinstructiostsl :
z5 n
vial func5@
-
ex - 8d
id instvactiom
- ☆ . 1 Z3 W
wid furct ☆
-
rd forwardlf
memrd
mem .
fomwardlA
Immediate Generator wly rd
wb rd
fopwardB
-
wb regaorite
-
foowardB
idinstructigm
-
id sextismm
instruction sextimm X-Nsl
-
exrs /
Forwarding mem -
regwrite
Ea rSI wb rd
rd
-
mem
forwarding
ex vs 2
(
-
)
-
mem .
regwrize
mam
reghwrite
IF/ID ID/EX EX/MEM MEM/WB
-
wb -
Wbregwrite regorite