@@ -25,22 +25,22 @@ class DecoderSpec extends AnyFlatSpec with ChiselScalatestTester with should.Mat
2525 // ?????????????????000?????0010011
2626 c.io.DecoderPort .op.poke(makeBin(" andi x7, x24, -1" ))
2727 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 )
2929 }
3030 }
3131 it should " Decode an SB instruction (type S)" in {
3232 test(new Decoder ()) { c =>
3333 // Template: b?????????????????000?????0100011
3434 c.io.DecoderPort .op.poke(makeBin(" sb x10, -81(x21)" ))
3535 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 )
3737 }
3838 }
3939 it should " Decode an BEQ instruction (type B)" in {
4040 test(new Decoder ()) { c =>
4141 c.io.DecoderPort .op.poke(makeBin(" beq x21, x10, -1366" ))
4242 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 )
4444 }
4545 }
4646 it should " Decode an LUI instruction (type U)" in {
@@ -50,8 +50,8 @@ class DecoderSpec extends AnyFlatSpec with ChiselScalatestTester with should.Mat
5050 c.clock.step()
5151 c.io.DecoderPort .inst.expect(LUI )
5252 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 )
5555 c.io.DecoderPort .imm.peek().litValue should be(- 1431658496L )
5656 c.io.DecoderPort .toALU.expect(false .B )
5757 c.io.DecoderPort .branch.expect(false .B )
@@ -62,7 +62,7 @@ class DecoderSpec extends AnyFlatSpec with ChiselScalatestTester with should.Mat
6262 // Template: b?????????????????????????1101111
6363 c.io.DecoderPort .op.poke(makeBin(" jal x21, -699052" ))
6464 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 )
6666 }
6767 }
6868
0 commit comments