protected void runTestRegisterBits(TracePlatform platform) throws Exception {
		Language language = platform.getLanguage();
		Register contextreg = language.getRegister("contextreg");
		Register fctx = language.getRegister("fctx");
		Register nfctx = language.getRegister("nfctx");
		Register phase = language.getRegister("phase");
		Register counter = language.getRegister("counter");

		TraceThread thread;
		try (Transaction tx = b.startTransaction()) {
			thread = getOrAddThread("Threads[1]", 0);
			waitForSwing();
			DBTraceMemorySpace regs = memory.getMemoryRegisterSpace(thread, true);

			regs.setValue(platform, 0, new RegisterValue(fctx, BigInteger.valueOf(0xa)));
			assertEquals(BigInteger.valueOf(0xa),
				regs.getValue(platform, 0, fctx).getUnsignedValue());

			regs.setValue(platform, 0, new RegisterValue(nfctx, BigInteger.valueOf(0xb)));
			assertEquals(BigInteger.valueOf(0xb),
				regs.getValue(platform, 0, nfctx).getUnsignedValue());
			assertEquals(BigInteger.valueOf(0xa),
				regs.getValue(platform, 0, fctx).getUnsignedValue());

			regs.setValue(platform, 0, new RegisterValue(phase, BigInteger.valueOf(0x3)));
			assertEquals(BigInteger.valueOf(0x3),
				regs.getValue(platform, 0, phase).getUnsignedValue());
			assertEquals(BigInteger.valueOf(0),
				regs.getValue(platform, 0, counter).getUnsignedValue());

			regs.setValue(platform, 0, new RegisterValue(counter, BigInteger.valueOf(0xf)));
			assertEquals(BigInteger.valueOf(0xf),
				regs.getValue(platform, 0, counter).getUnsignedValue());

			assertEquals("abfc000000000000",
				regs.getValue(platform, 0, contextreg).getUnsignedValue().toString(16));

			regs.setValue(platform, 0, new RegisterValue(fctx, BigInteger.valueOf(0x5)));
			assertEquals("5bfc000000000000",
				regs.getValue(platform, 0, contextreg).getUnsignedValue().toString(16));
		}
	}
This has to be called by the sub-class, having created a trace with the Toy:??:32:builder
language.
Ghidra/Debug/Framework-TraceModeling/src/test/java/ghidra/trace/database/memory/AbstractDBTraceMemoryManagerRegistersTest.java