diff --git a/fpga/include/villas/fpga/card.hpp b/fpga/include/villas/fpga/card.hpp index 4d838559c..4b64a33ec 100644 --- a/fpga/include/villas/fpga/card.hpp +++ b/fpga/include/villas/fpga/card.hpp @@ -76,6 +76,7 @@ public: void dump() { } ip::IpCore* lookupIp(const std::string& name) const; + ip::IpCore* lookupIp(const Vlnv& vlnv) const; ip::IpCoreList ips; ///< IPs located on this FPGA card diff --git a/fpga/lib/card.cpp b/fpga/lib/card.cpp index b15328566..5b38d210c 100644 --- a/fpga/lib/card.cpp +++ b/fpga/lib/card.cpp @@ -142,6 +142,17 @@ PCIeCard::lookupIp(const std::string& name) const return nullptr; } +ip::IpCore* +PCIeCard::lookupIp(const Vlnv& vlnv) const +{ + for(auto& ip : ips) { + if(*ip == vlnv) { + return ip.get(); + } + } + return nullptr; +} + bool fpga::PCIeCard::init() {