Source Code


Simulation Results

#pcoprdqd (hex)qd (dec)addr
100ori2000F15
201sw2000F150006
302lw3000F150006
403addi4001218
504addi5001622
605halt

Pipeline Results

#IFIDEXMEMWBok
10000
ori






20001
sw
0000
2 0 0xf





30002
lw
0001
0 0 0x6
0000
0xf





qb forwarded: 0xf (rb: 2)
40003
addi
0002
3 0 0x6
0001
0x6
0000



50003
addi

0002
0x6
0001
0xf
0000
0xf
0000
0xf

mem[0x6] = 0xf
60004
addi
0003
4 3 0x3

0002
0xf
0001
0xf
0001
0xf

qd = 0xf = mem[0x6]

qa forwarded: 0xf (ra: 3)

qa forwarded: 0xf (ra: 3)
70005
halt
0004
5 2 0x7
0003
0x12


0002
0xf
0002
0xf
8
0005

0004
0x16
0003



9

0005

0004

0003
0x12
0003
0x12
10


0005

0004
0x16
0004
0x16

Registers

formatr0r1r2r3r4r5r6r7
hex00000000000000010000000F0000000F00000012000000160000000600000007
decimal011515182267
formatr8r9r10r11r12r13r14r15
hex00000008000000090000000A0000000B0000000C0000000D0000000E0000000F
decimal89101112131415
formatr16r17r18r19r20r21r22r23
hex0000001000000011000000120000001300000014000000150000001600000017
decimal1617181920212223
formatr24r25r26r27r28r29r30r31
hex00000018000000190000001A0000001B0000001C0000001D0000001E0000001F
decimal2425262728293031

Memory

addr0123456789ABCDEF
000000000000000000000000000000000000000000000000000000000000000F00000000 0000000000000000000000000000000000000000000000000000000000000000
000000100000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000