From 434fb3708a2fef41a4107d4be68cd8e8a24c2f90 Mon Sep 17 00:00:00 2001 From: Megan Wachs Date: Wed, 28 Jun 2017 19:17:48 -0700 Subject: [PATCH] riscv: Correct DPC masking in compliance test. --- src/target/riscv/riscv-013.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/target/riscv/riscv-013.c b/src/target/riscv/riscv-013.c index f82f14fad..e5cddedec 100644 --- a/src/target/riscv/riscv-013.c +++ b/src/target/riscv/riscv-013.c @@ -2413,8 +2413,8 @@ int riscv013_test_compliance(struct target *target) { uint64_t testvar64 = 0xAAAAAAAAAAAAAAAAUL; uint64_t dpcmask = 0xFFFFFFFFFFFFFFFFUL; riscv_set_register(target, GDB_REGNO_DPC, dpcmask); - dpcmask = riscv_get_register(target, GDB_REGNO_PC); - COMPLIANCE_TEST(dpcmask >= 0xFFFFFFFF, "DPC must hold at least 32 bits (may hold more but hard to tell how many)"); + dpcmask = riscv_get_register(target, GDB_REGNO_DPC); + COMPLIANCE_TEST(dpcmask >= 0xFFFFFFFC, "DPC must hold the minimum for a virtual address (may tighten requirement later)."); riscv_set_register(target, GDB_REGNO_DPC, testvar64); COMPLIANCE_TEST((riscv_get_register(target, GDB_REGNO_DPC) & dpcmask) == (testvar64 & dpcmask), "DPC must be writable."); riscv_set_register(target, GDB_REGNO_DPC, ~testvar64);