1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-30 00:00:11 +01:00
VILLASnode/fpga/include/villas/fpga/card.hpp
Pascal Bauer 5e23100df9 feat: add parsing for ip-ignorelist
Signed-off-by: Pascal Bauer <pascal.bauer@rwth-aachen.de>
2024-10-31 15:21:30 +01:00

60 lines
1.6 KiB
C++

/* FPGA card
*
* This class represents a FPGA device.
*
* Author: Steffen Vogel <post@steffenvogel.de>
* Author: Daniel Krebs <github@daniel-krebs.net>
* SPDX-FileCopyrightText: 2017 Institute for Automation of Complex Power Systems, RWTH Aachen University
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
#include <set>
#include <string>
#include <villas/fpga/core.hpp>
#include <villas/kernel/vfio_container.hpp>
namespace villas {
namespace fpga {
class Card {
public:
bool polling;
std::string name; // The name of the FPGA card
std::shared_ptr<kernel::vfio::Container> vfioContainer;
std::shared_ptr<kernel::vfio::Device> vfioDevice;
// Slave address space ID to access the PCIe address space from the
// FPGA
MemoryManager::AddressSpaceId addrSpaceIdDeviceToHost;
// Address space identifier of the master address space of this FPGA
// card. This will be used for address resolution of all IPs on this
// card.
MemoryManager::AddressSpaceId addrSpaceIdHostToDevice;
std::list<std::shared_ptr<ip::Core>> ips;
std::list<std::string> ignored_ip_names;
virtual ~Card();
virtual bool mapMemoryBlock(const std::shared_ptr<MemoryBlock> block);
virtual bool unmapMemoryBlock(const MemoryBlock &block);
std::shared_ptr<ip::Core> lookupIp(const std::string &name) const;
std::shared_ptr<ip::Core> lookupIp(const Vlnv &vlnv) const;
std::shared_ptr<ip::Core> lookupIp(const ip::IpIdentifier &id) const;
protected:
// Keep a map of already mapped memory blocks
std::map<MemoryManager::AddressSpaceId, std::shared_ptr<MemoryBlock>>
memoryBlocksMapped;
Logger logger;
};
} // namespace fpga
} // namespace villas