diff --git a/fpga b/fpga index ce8612379..1cac3fafd 160000 --- a/fpga +++ b/fpga @@ -1 +1 @@ -Subproject commit ce8612379de62f50a52e172fe8eaee924d5d8822 +Subproject commit 1cac3fafde6ef3098a145f9d5d936a2dc6b7d7c0 diff --git a/include/villas/nodes/fpga.hpp b/include/villas/nodes/fpga.hpp index e03f36e20..b76aa784e 100644 --- a/include/villas/nodes/fpga.hpp +++ b/include/villas/nodes/fpga.hpp @@ -14,6 +14,7 @@ #include #include +#include #include #include diff --git a/lib/nodes/fpga.cpp b/lib/nodes/fpga.cpp index 1462e7468..af884406e 100644 --- a/lib/nodes/fpga.cpp +++ b/lib/nodes/fpga.cpp @@ -149,14 +149,13 @@ int FpgaNode::prepare() auto &alloc = HostDmaRam::getAllocator(); - auto memRx = alloc.allocate(0x100 / sizeof(int32_t)); - auto memTx = alloc.allocate(0x100 / sizeof(int32_t)); + const std::shared_ptr blockRx = alloc.allocateBlock(0x100 * sizeof(float)); + const std::shared_ptr blockTx = alloc.allocateBlock(0x100 * sizeof(float)); + villas::MemoryAccessor memRx = *blockRx; + villas::MemoryAccessor memTx = *blockTx; - blockRx = std::unique_ptr(&memRx.getMemoryBlock()); - blockTx = std::unique_ptr(&memTx.getMemoryBlock()); - - dma->makeAccesibleFromVA(*blockRx); - dma->makeAccesibleFromVA(*blockTx); + dma->makeAccesibleFromVA(blockRx); + dma->makeAccesibleFromVA(blockTx); // Show some debugging infos auto &mm = MemoryManager::get(); @@ -176,7 +175,7 @@ int FpgaNode::_read(Sample *smps[], unsigned cnt) assert(cnt == 1); dma->read(*blockRx, blockRx->getSize()); // TODO: calc size - const size_t bytesRead = dma->readComplete(); + const size_t bytesRead = dma->readComplete().bytes; read = bytesRead / sizeof(int32_t); auto mem = MemoryAccessor(*blockRx);