Skip to content

Commit 4f54e05

Browse files
committed
test: Add base address to powerpc load/store tests
1 parent 6fbce3e commit 4f54e05

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

vadl/test/vadl/iss/ppc64/CosimPpc64InstrTest.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,14 @@
3232
/* Tests ppc64.vadl instructions against the QEMU ppc64 simulator.
3333
* Some instructions are defined in the VADL specification but are not covered by the tests.
3434
* These are: mfmsr, mtmsr, mfspr, mtspr, mftb and all branch instructions
35-
* Load/Store instructions are tested with a reduced address space (0x0000'0000'0000'0200 - 0x0000'0000'0000'FFFF)
35+
* Load/Store instructions are tested with a reduced address space (0x0000'0000'0000'1000 - 0x0000'0000'0000'FFFF)
3636
*/
3737

3838
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
3939
public class CosimPpc64InstrTest extends CosimInstrTest {
4040

41+
private static final long BASE_ADDRESS_LOAD_STORE = 0x1000L;
42+
4143
public Ppc64TestBuilder getBuilder(String name, int id) {
4244
return new Ppc64TestBuilder(name, id);
4345
}
@@ -1066,7 +1068,7 @@ private Stream<DynamicTest> testDFormLoadInstruction(String instruction, String
10661068
var regSrc = update ? b.anyRegExceptZero().sample() : b.anyReg().sample();
10671069
var regDest = update ? b.anyReg().filter(r -> !Objects.equals(r, regSrc)).sample() :
10681070
b.anyReg().sample();
1069-
BigInteger val1 = b.anyImmU(15);
1071+
BigInteger val1 = b.anyImmUFrom(15, BigInteger.valueOf(BASE_ADDRESS_LOAD_STORE));
10701072
BigInteger val2 = b.anyImmU(15);
10711073
b.fillMem(val1.add(val2));
10721074
b.fillReg(regSrc, val1);
@@ -1084,7 +1086,7 @@ private Stream<DynamicTest> testXFormLoadInstruction(String instruction, String
10841086
var regSrc2 = b.anyReg().sample();
10851087
var regDest = update ? b.anyReg().filter(r -> !Objects.equals(r, regSrc1)).sample() :
10861088
b.anyReg().sample();
1087-
BigInteger val1 = b.anyImmU(15);
1089+
BigInteger val1 = b.anyImmUFrom(15, BigInteger.valueOf(BASE_ADDRESS_LOAD_STORE));
10881090
BigInteger val2 = b.anyImmU(15);
10891091
b.fillMem(val1.add(val2));
10901092
b.fillReg(regSrc1, val1);
@@ -1103,7 +1105,7 @@ private Stream<DynamicTest> testDFormStoreInstruction(String instruction, String
11031105
var regSrc2 = update ? b.anyRegExceptZero().sample() : b.anyReg().sample();
11041106
b.fillReg(regSrc1);
11051107
b.fillReg(regSrc2, b.anyImmU(15));
1106-
b.add("%s %s, %s(%s)", instruction, regSrc1, b.anyImmUFrom(15, BigInteger.valueOf(0x0200)), regSrc2);
1108+
b.add("%s %s, %s(%s)", instruction, regSrc1, b.anyImmUFrom(15, BigInteger.valueOf(BASE_ADDRESS_LOAD_STORE)), regSrc2);
11071109
return b.toTestCase();
11081110
});
11091111
}
@@ -1117,7 +1119,7 @@ private Stream<DynamicTest> testXFormStoreInstruction(String instruction, String
11171119
var regSrc2 = update ? b.anyRegExceptZero().sample() : b.anyReg().sample();
11181120
var regSrc3 = b.anyReg().sample();
11191121
b.fillReg(regSrc1);
1120-
b.fillReg(regSrc2, b.anyImmUFrom(15, BigInteger.valueOf(0x0200)));
1122+
b.fillReg(regSrc2, b.anyImmUFrom(15, BigInteger.valueOf(BASE_ADDRESS_LOAD_STORE)));
11211123
b.fillReg(regSrc3, b.anyImmU(15));
11221124
b.add("%s %s, %s, %s", instruction, regSrc1, regSrc2, regSrc3);
11231125
return b.toTestCase();

0 commit comments

Comments
 (0)