コード例 #1
0
void cosimWriteBlock(Core *core, uint32_t pc, uint32_t address, uint32_t mask, 
	const uint32_t *values)
{
	uint64_t byteMask;
	int lane;
	
	byteMask = 0;
	for (lane = 0; lane < NUM_VECTOR_LANES; lane++)
	{
		if (mask & (1 << lane))
			byteMask |= 0xfull << (lane * 4);
	}

	cosimEventTriggered = true;
	if (cosimCheckEvent != EVENT_MEM_STORE
		|| cosimCheckPc != pc
		|| cosimCheckAddress != (address & ~(NUM_VECTOR_LANES * 4u - 1))
		|| cosimCheckMask != byteMask 
		|| !compareMasked(mask, cosimCheckValues, values))
	{
		cosimError = true;
		printRegisters(core, cosimCheckThread);
		printf("COSIM MISMATCH, thread %d\n", cosimCheckThread);
		printf("Reference: %08x memory[%x]{%016" PRIx64 "} <= ", pc, address, byteMask);
		for (lane = NUM_VECTOR_LANES - 1; lane >= 0; lane--)
			printf("%08x ", values[lane]);

		printf("\nHardware:  ");
		printCosimExpected();
		return;
	}
}
コード例 #2
0
ファイル: cosimulation.c プロジェクト: ChenZewei/NyuziHPS-old
void cosimWriteBlock(Core *core, uint32_t pc, uint32_t address, int mask, const uint32_t values[16])
{
	uint64_t byteMask;
	int lane;
	
	byteMask = 0;
	for (lane = 0; lane < 16; lane++)
	{
		if (mask & (1 << lane))
			byteMask |= 0xfLL << (lane * 4);
	}

	cosimEventTriggered = 1;
	if (cosimCheckEvent != kEventMemStore
		|| cosimCheckPc != pc
		|| cosimCheckAddress != (address & ~63)
		|| cosimCheckMask != byteMask 
		|| !compareMasked(mask, cosimCheckValues, values))
	{
		cosimError = 1;
		printRegisters(core, cosimCheckThread);
		printf("COSIM MISMATCH, thread %d\n", cosimCheckThread);
		printf("Reference: %08x memory[%x]{%016llx} <= ", pc, address, byteMask);
		for (lane = 15; lane >= 0; lane--)
			printf("%08x ", values[lane]);

		printf("\nHardware:  ");
		printCosimExpected();
		return;
	}
}
コード例 #3
0
void cosimSetVectorReg(Core *core, uint32_t pc, uint32_t reg, uint32_t mask, 
	const uint32_t *values)
{
	int lane;
	
	cosimEventTriggered = true;
	if (cosimCheckEvent != EVENT_VECTOR_WRITEBACK
		|| cosimCheckPc != pc
		|| cosimCheckRegister != reg
		|| !compareMasked(mask, cosimCheckValues, values)
		|| cosimCheckMask != (mask & 0xffff))
	{
		cosimError = true;
		printRegisters(core, cosimCheckThread);
		printf("COSIM MISMATCH, thread %d\n", cosimCheckThread);
		printf("Reference: %08x v%d{%04x} <= ", pc, reg, mask & 0xffff);
		for (lane = NUM_VECTOR_LANES - 1; lane >= 0; lane--)
			printf("%08x ", values[lane]);

		printf("\n");
		printf("Hardware:  ");
		printCosimExpected();
		return;
	}
}
コード例 #4
0
ファイル: cosimulation.c プロジェクト: ChenZewei/NyuziHPS-old
void cosimSetVectorReg(Core *core, uint32_t pc, int reg, int mask, const uint32_t values[16])
{
	int lane;
	
	cosimEventTriggered = 1;
	if (cosimCheckEvent != kEventVectorWriteback
		|| cosimCheckPc != pc
		|| cosimCheckRegister != reg
		|| !compareMasked(mask, cosimCheckValues, values)
		|| cosimCheckMask != (mask & 0xffff))
	{
		cosimError = 1;
		printRegisters(core, cosimCheckThread);
		printf("COSIM MISMATCH, thread %d\n", cosimCheckThread);
		printf("Reference: %08x v%d{%04x} <= ", pc, reg, mask & 0xffff);
		for (lane = 15; lane >= 0; lane--)
			printf("%08x ", values[lane]);

		printf("\n");
		printf("Hardware:  ");
		printCosimExpected();
		return;
	}
}