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 }
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); }
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); }