0% found this document useful (0 votes)
5 views

Lab2 Diagram

pipelined cpu diagram

Uploaded by

zackerysnu
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Lab2 Diagram

pipelined cpu diagram

Uploaded by

zackerysnu
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

ID clk rstn

2020 -40 IF mem jwmp lashg Simple CPU EX MEM WB


clk clk clk clk
-

memtalken
take

exmemreades memoead stal staln

plus plus
-

ex
pe mem pc 4
Adder
- -

rd
-
- -

ex
rd
-

ex
rg )
Hazard target
-

mem pc
taraget
. -

via rgl PE ( branch adder ☆


in_a
ex . -

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
-

Branch Control Unit


Control Unit ea branch or l anCn
branch ju p r
b
x- SelectonINEXT- P
-

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
-

mem_read id . memrcad exmemreaeal J


3 98

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

if -instraction readdata1 ioerEeddatal


O vbp plas
address instruction idimstractismizH z5) : 0

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
-

functx fspward done


funct7
ex
W☆ Nl rsJ
clk
-

- -

'

writedata readdata2 id readdatad


-

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

You should add wires to this diagram to complete the project!!!

You might also like