/// <summary>Pull table from the FPGA.</summary> public static void CopyFromSimpleMemoryToGrid(KpzNode[,] gridDst, SimpleMemory memorySrc) { for (int x = 0; x < KpzKernels.GridWidth; x++) { for (int y = 0; y < KpzKernels.GridHeight; y++) { gridDst[x, y] = KpzNode.DeserializeFromUInt32(memorySrc.ReadUInt32(KpzKernels.MemIndexGrid + y * KpzKernels.GridWidth + x)); } } }
/// <summary>Pull table from the FPGA.</summary> public static void CopyFromSimpleMemoryToGrid(KpzNode[,] gridDst, SimpleMemory memorySrc) { for (int x = 0; x < KpzKernelsParallelizedInterface.GridSize; x++) { for (int y = 0; y < KpzKernelsParallelizedInterface.GridSize; y++) { gridDst[x, y] = KpzNode.DeserializeFromUInt32( memorySrc.ReadUInt32(KpzKernelsParallelizedInterface.MemIndexGrid + y * KpzKernelsParallelizedInterface.GridSize + x)); } } }
/// <summary>Push table into FPGA.</summary> public static void CopyFromGridToSimpleMemory(KpzNode[,] gridSrc, SimpleMemory memoryDst) { for (int x = 0; x < KpzKernels.GridHeight; x++) { for (int y = 0; y < KpzKernels.GridWidth; y++) { KpzNode node = gridSrc[x, y]; memoryDst.WriteUInt32(KpzKernels.MemIndexGrid + y * KpzKernels.GridWidth + x, node.SerializeToUInt32()); } } }
/// <summary>Push table into FPGA.</summary> public static void CopyFromGridToSimpleMemory(KpzNode[,] gridSrc, SimpleMemory memoryDst) { for (int x = 0; x < KpzKernelsParallelizedInterface.GridSize; x++) { for (int y = 0; y < KpzKernelsParallelizedInterface.GridSize; y++) { KpzNode node = gridSrc[x, y]; memoryDst.WriteUInt32(KpzKernelsParallelizedInterface.MemIndexGrid + y * KpzKernelsParallelizedInterface.GridSize + x, node.SerializeToUInt32()); } } }