Example #1
0
        public void LoadSpTest()
        {
            // C.LWSP
            var pairLwsp = new RvcTestPair(architecture)
            {
                ExpectedPayload   = te.LoadCI(2, 0x3F, 1, 2),
                Coding            = new byte[] { 0xFE, 0x50 },
                ExpectedPayload32 = te.BuildIType(0, 1, 2, 2, 0xFC)
            };

            te.Test(pairLwsp);

            // C.LDSP (RV64 / 128)
            var pairLdsp = new RvcTestPair(architecture)
            {
                ExpectedPayload   = te.LoadCI(2, 0x3F, 1, 3),
                Coding            = new byte[] { 0xFE, 0x70 },
                ExpectedPayload32 = te.BuildIType(0, 1, 3, 2, 0x1F8)
            };

            te.Test(pairLdsp);

            // C.LQSP



            // C.FLWSP



            // C.FLDSP
        }
Example #2
0
        public void LoadRegisterTest()
        {
            // C.LW
            var pairLw = new RvcTestPair(architecture)
            {
                ExpectedPayload   = te.LoadCL(00, 1, 0x1F, 2, 2),
                Coding            = te.ToBytes(0x64, 0x5D),
                ExpectedPayload32 = te.BuildIType(00, 9, 2, 10, 0x7C)
            };

            te.Test(pairLw);

            // C.LD
            var pairLd = new RvcTestPair(architecture, false)
            {
                //ExpectedPayload = te.LoadCL(00, 1, 0x1F, 2, 3),
                Coding = te.ToBytes(0x64, 0x7D)
            };

            te.Test(pairLd);
        }
Example #3
0
        public void ControlTransferInstructionTest()
        {
            // C.J
            var pairCj = new RvcTestPair(architecture)
            {
                ExpectedPayload = te.LoadCJ(1, 0x3FF, 5),
                Coding          = te.ToBytes(0xFD, 0xBF),
                // 0x1B
                ExpectedPayload32 = te.BuildJType(0x1B, 0, 0x7FE)
            };

            te.Test(pairCj);

            // C.JAL
            var pairCjal = new RvcTestPair(architecture)
            {
                ExpectedPayload   = te.LoadCJ(1, 0x3FF, 1),
                Coding            = te.ToBytes(0xFD, 0x3F),
                ExpectedPayload32 = te.BuildJType(0x1B, 1, 0x7FE)
            };

            te.Test(pairCjal);

            // C.BEQZ
            var pairBeqz = new RvcTestPair(architecture)
            {
                ExpectedPayload   = te.LoadCB(1, 1, 0xFF, 6),
                Coding            = te.ToBytes(0xFD, 0xDC),
                ExpectedPayload32 = te.BuildBType(0x18, 9, 0, 0, 0x1FE)
            };

            te.Test(pairBeqz);

            //// C.BNEZ
            var pairBnez = new RvcTestPair(architecture)
            {
                ExpectedPayload   = te.LoadCB(1, 1, 0xFF, 7),
                Coding            = te.ToBytes(0xFD, 0xFC),
                ExpectedPayload32 = te.BuildBType(0x18, 9, 0, 1, 0x1FE)
            };

            te.Test(pairBnez);
        }