From 02f60eb86e11a19a8b6ce370e815a5b554cd2301 Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Tue, 26 May 2020 15:24:15 +0200 Subject: [PATCH] add a writeMemory function to IpCore class --- fpga/include/villas/fpga/ip.hpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fpga/include/villas/fpga/ip.hpp b/fpga/include/villas/fpga/ip.hpp index 3ee89572b..efd979610 100644 --- a/fpga/include/villas/fpga/ip.hpp +++ b/fpga/include/villas/fpga/ip.hpp @@ -199,6 +199,10 @@ protected: template T readMemory(const std::string& block, uintptr_t address) const { return *(reinterpret_cast(getLocalAddr(block, address))); } + + template + void writeMemory(const std::string& block, uintptr_t address, T value) + { T* ptr = reinterpret_cast(getLocalAddr(block, address)); *ptr = value; } protected: struct IrqPort {