@@ -25,22 +25,22 @@ class DecoderSpec extends AnyFlatSpec with ChiselScalatestTester with should.Mat
25
25
// ?????????????????000?????0010011
26
26
c.io.DecoderPort .op.poke(makeBin(" andi x7, x24, -1" ))
27
27
c.clock.step()
28
- validateResult(c, ANDI , 7 , 24 , 0 , - 1 , true .B , false .B )
28
+ validateResult(c, ANDI , 7 , 24 , 31 , - 1 , true .B , false .B )
29
29
}
30
30
}
31
31
it should " Decode an SB instruction (type S)" in {
32
32
test(new Decoder ()) { c =>
33
33
// Template: b?????????????????000?????0100011
34
34
c.io.DecoderPort .op.poke(makeBin(" sb x10, -81(x21)" ))
35
35
c.clock.step()
36
- validateResult(c, SB , 0 , 21 , 10 , - 81 , false .B , false .B )
36
+ validateResult(c, SB , 15 , 21 , 10 , - 81 , false .B , false .B )
37
37
}
38
38
}
39
39
it should " Decode an BEQ instruction (type B)" in {
40
40
test(new Decoder ()) { c =>
41
41
c.io.DecoderPort .op.poke(makeBin(" beq x21, x10, -1366" ))
42
42
c.clock.step()
43
- validateResult(c, BEQ , 0 , 21 , 10 , - 1366 , false .B , true .B )
43
+ validateResult(c, BEQ , 11 , 21 , 10 , - 1366 , false .B , true .B )
44
44
}
45
45
}
46
46
it should " Decode an LUI instruction (type U)" in {
@@ -50,8 +50,8 @@ class DecoderSpec extends AnyFlatSpec with ChiselScalatestTester with should.Mat
50
50
c.clock.step()
51
51
c.io.DecoderPort .inst.expect(LUI )
52
52
c.io.DecoderPort .rd.peek().litValue should be(23 )
53
- c.io.DecoderPort .rs1.peek().litValue should be(0 )
54
- c.io.DecoderPort .rs2.peek().litValue should be(0 )
53
+ c.io.DecoderPort .rs1.peek().litValue should be(21 )
54
+ c.io.DecoderPort .rs2.peek().litValue should be(10 )
55
55
c.io.DecoderPort .imm.peek().litValue should be(- 1431658496L )
56
56
c.io.DecoderPort .toALU.expect(false .B )
57
57
c.io.DecoderPort .branch.expect(false .B )
@@ -62,7 +62,7 @@ class DecoderSpec extends AnyFlatSpec with ChiselScalatestTester with should.Mat
62
62
// Template: b?????????????????????????1101111
63
63
c.io.DecoderPort .op.poke(makeBin(" jal x21, -699052" ))
64
64
c.clock.step()
65
- validateResult(c, JAL , 21 , 0 , 0 , - 699052 , false .B , false .B )
65
+ validateResult(c, JAL , 21 , 10 , 20 , - 699052 , false .B , false .B )
66
66
}
67
67
}
68
68
0 commit comments