示例#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
        }
示例#2
0
        public void IntegerContstantGenerationTest()
        {
            // Test for positive numbers
            // C.LI Pos
            var pairLiPos = new RvcTestPair(architecture)
            {
                Coding            = te.ToBytes(0xFD, 0x40),
                ExpectedPayload   = te.LoadCI(1, 0x1F, 1, 2),
                ExpectedPayload32 = te.BuildIType(4, 1, 0, 0, 0x1F)
            };

            te.Test(pairLiPos);

            // C.LI Neg
            var pairLiNeg = new RvcTestPair(architecture)
            {
                Coding            = te.ToBytes(0xFD, 0x50),
                ExpectedPayload   = te.LoadCI(1, 0x3F, 1, 2),
                ExpectedPayload32 = te.BuildIType(4, 1, 0, 0, -1)
            };

            te.Test(pairLiNeg);


            // C.LUI
            // Inst32 Opcode 0x0D
            var pairLui1 = new RvcTestPair(architecture)
            {
                Coding            = te.ToBytes(0xFD, 0x70),
                ExpectedPayload   = te.LoadCI(1, 0x3F, 1, 3),
                ExpectedPayload32 = te.BuildUType(0x0D, 1, 0xFFFFF000)
            };

            te.Test(pairLui1);

            var pairLui2 = new RvcTestPair(architecture)
            {
                Coding            = te.ToBytes(0xFD, 0x60),
                ExpectedPayload   = te.LoadCI(1, 0x1F, 1, 3),
                ExpectedPayload32 = te.BuildUType(0x0D, 1, 0x1F000)
            };

            te.Test(pairLui2);
        }