Skip to content
This repository was archived by the owner on Feb 29, 2024. It is now read-only.

Commit 4419d5d

Browse files
authored
Merge pull request #80 from VILLASframework/refactorCard
Remove duplicate inherited members and functions in PcieCard class
2 parents fcab946 + 2b2abcd commit 4419d5d

File tree

3 files changed

+5
-56
lines changed

3 files changed

+5
-56
lines changed

include/villas/fpga/card.hpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ class Card
2121
{
2222
public:
2323
bool polling;
24+
25+
std::shared_ptr<kernel::vfio::Container> vfioContainer;
2426
std::shared_ptr<kernel::vfio::Device> vfioDevice;
2527

2628
// Slave address space ID to access the PCIe address space from the
@@ -32,13 +34,12 @@ class Card
3234
// card.
3335
MemoryManager::AddressSpaceId addrSpaceIdHostToDevice;
3436

35-
std::list<std::shared_ptr<ip::Core> > ips;
37+
std::list<std::shared_ptr<ip::Core>> ips;
3638

3739
virtual ~Card();
3840

39-
bool mapMemoryBlock(const std::shared_ptr<MemoryBlock> block);
40-
bool unmapMemoryBlock(const MemoryBlock &block);
41-
std::shared_ptr<kernel::vfio::Container> vfioContainer;
41+
virtual bool mapMemoryBlock(const std::shared_ptr<MemoryBlock> block);
42+
virtual bool unmapMemoryBlock(const MemoryBlock &block);
4243

4344
std::shared_ptr<ip::Core> lookupIp(const std::string &name) const;
4445
std::shared_ptr<ip::Core> lookupIp(const Vlnv &vlnv) const;

include/villas/fpga/pcie_card.hpp

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -59,18 +59,6 @@ class PCIeCard : public Card {
5959
void dump()
6060
{ }
6161

62-
std::shared_ptr<ip::Core>
63-
lookupIp(const std::string &name) const;
64-
65-
std::shared_ptr<ip::Core>
66-
lookupIp(const Vlnv &vlnv) const;
67-
68-
std::shared_ptr<ip::Core>
69-
lookupIp(const ip::IpIdentifier &id) const;
70-
71-
bool mapMemoryBlock(const MemoryBlock &block);
72-
bool unmapMemoryBlock(const MemoryBlock &block);
73-
7462
public: // TODO: make this private
7563
bool doReset; // Reset VILLASfpga during startup?
7664
int affinity; // Affinity for MSI interrupts
@@ -79,13 +67,6 @@ class PCIeCard : public Card {
7967

8068
std::shared_ptr<kernel::pci::Device> pdev; // PCI device handle
8169

82-
// Slave address space ID to access the PCIe address space from the FPGA
83-
MemoryManager::AddressSpaceId addrSpaceIdDeviceToHost;
84-
85-
// Address space identifier of the master address space of this FPGA card.
86-
// This will be used for address resolution of all IPs on this card.
87-
MemoryManager::AddressSpaceId addrSpaceIdHostToDevice;
88-
8970
protected:
9071
Logger
9172
getLogger() const

lib/pcie_card.cpp

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -155,39 +155,6 @@ PCIeCard::~PCIeCard()
155155

156156
}
157157

158-
std::shared_ptr<ip::Core> PCIeCard::lookupIp(const std::string &name) const
159-
{
160-
for (auto &ip : ips) {
161-
if (*ip == name) {
162-
return ip;
163-
}
164-
}
165-
166-
return nullptr;
167-
}
168-
169-
std::shared_ptr<ip::Core> PCIeCard::lookupIp(const Vlnv &vlnv) const
170-
{
171-
for (auto &ip : ips) {
172-
if (*ip == vlnv) {
173-
return ip;
174-
}
175-
}
176-
177-
return nullptr;
178-
}
179-
180-
std::shared_ptr<ip::Core> PCIeCard::lookupIp(const ip::IpIdentifier &id) const
181-
{
182-
for (auto &ip : ips) {
183-
if (*ip == id) {
184-
return ip;
185-
}
186-
}
187-
188-
return nullptr;
189-
}
190-
191158
bool PCIeCard::init()
192159
{
193160
logger = getLogger();

0 commit comments

Comments
 (0)