Source Code


Simulation Results

#pcoprdqd (hex)qd (dec)addr
100ori2000F15
201sw2000F150006
302lw3000F150006
403addi4001218
504addi5001622
605lw6000F150006
706sw6000F150007
807addi14001218
908halt

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
lw
0004
5 2 0x7
0003
0x12


0002
0xf
0002
0xf
80006
sw
0005
6 0 0x6
0004
0x16
0003



90006
sw

0005
0x6
0004

0003
0x12
0003
0x12
100007
addi
0006
0 0 0x7

0005
0xf
0004
0x16
0004
0x16

qd = 0xf = mem[0x6]

qb forwarded: 0xf (rb: 6)

qb forwarded: 0x12 (rb: 6)

qa transferred: 0xf (ra: 6)
110008
halt
0007
14 6 0x3
0006
0x7


0005
0xf
0005
0xf

qa forwarded: 0xf (ra: 6)
12
0008

0007
0x12
0006
0x12



mem[0x7] = 0x12
13

0008

0007

0006
0x12
0006
0xf
14


0008

0007
0x12
0007
0x12

errors: 1

Registers

formatr0r1r2r3r4r5r6r7
hex00000000000000010000000F0000000F00000012000000160000000F00000007
decimal0115151822157
formatr8r9r10r11r12r13r14r15
hex00000008000000090000000A0000000B0000000C0000000D000000120000000F
decimal89101112131815
formatr16r17r18r19r20r21r22r23
hex0000001000000011000000120000001300000014000000150000001600000017
decimal1617181920212223
formatr24r25r26r27r28r29r30r31
hex00000018000000190000001A0000001B0000001C0000001D0000001E0000001F
decimal2425262728293031

Memory

addr0123456789ABCDEF
000000000000000000000000000000000000000000000000000000000000000F00000012 0000000000000000000000000000000000000000000000000000000000000000
000000100000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000