diff --git a/fpga/include/villas/fpga/ip.hpp b/fpga/include/villas/fpga/ip.hpp index 172cbcb9e..d78edb850 100644 --- a/fpga/include/villas/fpga/ip.hpp +++ b/fpga/include/villas/fpga/ip.hpp @@ -114,7 +114,11 @@ public: protected: uintptr_t - getBaseaddr() const; + getBaseaddr() const + { return getAddrMapped(this->baseaddr); } + + uintptr_t + getAddrMapped(uintptr_t address) const; struct IrqPort { int num; diff --git a/fpga/lib/ip.cpp b/fpga/lib/ip.cpp index e84c7cb0e..8324c86fe 100644 --- a/fpga/lib/ip.cpp +++ b/fpga/lib/ip.cpp @@ -143,9 +143,10 @@ IpCoreFactory* IpCoreFactory::lookup(const Vlnv &vlnv) } uintptr_t -IpCore::getBaseaddr() const { +IpCore::getAddrMapped(uintptr_t address) const +{ assert(card != nullptr); - return reinterpret_cast(card->map) + this->baseaddr; + return reinterpret_cast(card->map) + address; }