From 23543cdde37a843456de6fccbc9776cdfbd6bbcd Mon Sep 17 00:00:00 2001 From: Pascal Bauer Date: Wed, 3 Jul 2024 12:42:00 +0000 Subject: [PATCH] connect core draft --- fpga/include/villas/fpga/core.hpp | 1 + fpga/lib/card/platform_card.cpp | 32 +++++++++++-------------------- 2 files changed, 12 insertions(+), 21 deletions(-) diff --git a/fpga/include/villas/fpga/core.hpp b/fpga/include/villas/fpga/core.hpp index 3968b5841..1a37f8249 100644 --- a/fpga/include/villas/fpga/core.hpp +++ b/fpga/include/villas/fpga/core.hpp @@ -82,6 +82,7 @@ class Core { virtual ~Core() = default; public: + size_t base_addr; // Generic management interface for IPs // Runtime setup of IP, should access and initialize hardware diff --git a/fpga/lib/card/platform_card.cpp b/fpga/lib/card/platform_card.cpp index c995a2b89..f1868f38f 100644 --- a/fpga/lib/card/platform_card.cpp +++ b/fpga/lib/card/platform_card.cpp @@ -12,6 +12,7 @@ #include "villas/memory_manager.hpp" #include +#include #include using namespace villas; @@ -62,9 +63,9 @@ PlatformCard::PlatformCard( void PlatformCard::connectVFIOtoIps( std::list> configuredIps) { - auto &mm = MemoryManager::get(); auto graph = mm.getGraph(); + for (auto device : devices) { std::string device_addr; std::string device_name; @@ -75,28 +76,17 @@ void PlatformCard::connectVFIOtoIps( logger->warn("#####DEVICE Name: {} Addr: {}", device_name, device_addr); - for (MemoryManager::AddressSpaceId id = 0; id < graph.getVertexCount(); - id++) { - auto vertex = graph.getVertex(id); - logger->warn("###Vertex Name: {}", vertex.get()->toString()); - } - - for (MemoryManager::AddressSpaceId edgeId = 0; - edgeId < graph.getEdgeCount(); edgeId++) { - auto edge = graph.getEdge(edgeId); - - std::stringstream ss; - ss << device_addr; + size_t addr; + std::stringstream ss; + ss << std::hex << device_addr; + ss >> addr; - size_t _address; - ss >> _address; + logger->warn("Testing: {0:x}", addr); - if (_address == edge->src) { - //graph.findVertex(UnaryPredicate p) - logger->warn("HEUREKA: {} | {}", edge->name, device_name); - logger->warn("From: {} To: {}", - graph.getVertex(edge->getVertexFrom())->name, - graph.getVertex(edge->getVertexTo())->name); + for (auto ip : configuredIps) { + logger->warn("with: {} | {}", ip->base_addr, ip->getInstanceName()); + if (ip->base_addr == addr) { + logger->warn("HEUREKA: {} | {}", device_name, ip->getInstanceName()); } } }