Skip to content

Commit

Permalink
connect core draft
Browse files Browse the repository at this point in the history
  • Loading branch information
IgnoreWarnings committed Jul 3, 2024
1 parent 5f3568c commit 23543cd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 21 deletions.
1 change: 1 addition & 0 deletions fpga/include/villas/fpga/core.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
32 changes: 11 additions & 21 deletions fpga/lib/card/platform_card.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

#include "villas/memory_manager.hpp"
#include <cstddef>
#include <string>
#include <villas/fpga/card/platform_card.hpp>

using namespace villas;
Expand Down Expand Up @@ -62,9 +63,9 @@ PlatformCard::PlatformCard(

void PlatformCard::connectVFIOtoIps(
std::list<std::shared_ptr<ip::Core>> configuredIps) {

auto &mm = MemoryManager::get();
auto graph = mm.getGraph();

for (auto device : devices) {
std::string device_addr;
std::string device_name;
Expand All @@ -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());
}
}
}
Expand Down

0 comments on commit 23543cd

Please sign in to comment.