1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

use new plugin mechanism

This commit is contained in:
Steffen Vogel 2020-06-11 18:19:03 +02:00
parent 91f9000038
commit 77b55f65f7
21 changed files with 63 additions and 112 deletions

@ -1 +1 @@
Subproject commit 5071327844fd93de6d44ce9e47459a41b9bd17cb
Subproject commit 1ddb51d71d13295a76b06a10593102659227f972

View file

@ -124,9 +124,6 @@ using CardList = std::list<std::shared_ptr<PCIeCard>>;
class PCIeCardFactory : public plugin::Plugin {
public:
PCIeCardFactory() :
Plugin("pcie", "Xilinx PCIe FPGA cards") {}
static CardList
make(json_t *json, struct pci* pci, std::shared_ptr<VfioContainer> vc);
@ -136,6 +133,14 @@ public:
static Logger
getStaticLogger()
{ return villas::logging.get("PCIeCardFactory"); }
virtual std::string
getName() const
{ return "pcie"; }
virtual std::string
getDescription() const
{ return "Xilinx PCIe FPGA cards"; }
};
} /* namespace fpga */

View file

@ -257,8 +257,6 @@ private:
{ return true; }
virtual Vlnv getCompatibleVlnv() const = 0;
virtual std::string getName() const = 0;
virtual std::string getDescription() const = 0;
protected:
static Logger

View file

@ -64,20 +64,20 @@ private:
class AuroraFactory : public IpNodeFactory {
public:
AuroraFactory();
IpCore* create()
{ return new Aurora; }
std::string
virtual std::string
getName() const
{ return "Aurora"; }
std::string
virtual std::string
getDescription() const
{ return "Aurora 8B/10B and additional support modules, like an AXI4-Lite register interface."; }
Vlnv getCompatibleVlnv() const
virtual Vlnv
getCompatibleVlnv() const
{ return {"acs.eonerc.rwth-aachen.de:user:aurora_axis:"}; }
};

View file

@ -59,24 +59,21 @@ private:
class BramFactory : public IpCoreFactory {
public:
BramFactory() :
IpCoreFactory(getName(), getDescription())
{}
bool configureJson(IpCore& ip, json_t *json_ip);
IpCore* create()
{ return new Bram; }
std::string
virtual std::string
getName() const
{ return "Bram"; }
std::string
virtual std::string
getDescription() const
{ return "Block RAM"; }
Vlnv getCompatibleVlnv() const
virtual Vlnv
getCompatibleVlnv() const
{ return {"xilinx.com:ip:axi_bram_ctrl:"}; }
};

View file

@ -113,20 +113,20 @@ private:
class DmaFactory : public IpNodeFactory {
public:
DmaFactory();
IpCore* create()
{ return new Dma; }
std::string
virtual std::string
getName() const
{ return "Dma"; }
std::string
virtual std::string
getDescription() const
{ return "Xilinx's AXI4 Direct Memory Access Controller"; }
Vlnv getCompatibleVlnv() const
virtual Vlnv
getCompatibleVlnv() const
{ return {"xilinx.com:ip:axi_dma:"}; }
};

View file

@ -65,7 +65,6 @@ private:
class FifoFactory : public IpNodeFactory {
public:
FifoFactory();
IpCore* create()
{ return new Fifo; }
@ -90,20 +89,20 @@ class FifoData : public IpNode {
class FifoDataFactory : public IpNodeFactory {
public:
FifoDataFactory();
IpCore* create()
{ return new FifoData; }
std::string
virtual std::string
getName() const
{ return "FifoData"; }
std::string
virtual std::string
getDescription() const
{ return "Xilinx's AXI4 data stream FIFO"; }
Vlnv getCompatibleVlnv() const
virtual Vlnv
getCompatibleVlnv() const
{ return {"xilinx.com:ip:axis_data_fifo:"}; }
};

View file

@ -54,10 +54,6 @@ private:
class GeneralPurposeIOFactory : public IpCoreFactory {
public:
GeneralPurposeIOFactory() :
IpCoreFactory(getName(), getDescription())
{}
static constexpr const char*
getCompatibleVlnvString()
{ return "xilinx.com:ip:axi_gpio:"; }
@ -65,15 +61,16 @@ public:
IpCore* create()
{ return new GeneralPurposeIO; }
std::string
virtual std::string
getName() const
{ return "GeneralPurposeIO"; }
std::string
virtual std::string
getDescription() const
{ return "Xilinx's AXI4 general purpose IO"; }
Vlnv getCompatibleVlnv() const
virtual Vlnv
getCompatibleVlnv() const
{ return Vlnv(getCompatibleVlnvString()); }
};

View file

@ -65,20 +65,20 @@ public:
class Gpu2RtdsFactory : public IpNodeFactory {
public:
Gpu2RtdsFactory();
IpCore* create()
{ return new Gpu2Rtds; }
std::string
virtual std::string
getName() const
{ return "Gpu2Rtds"; }
std::string
virtual std::string
getDescription() const
{ return "HLS Gpu2Rtds IP"; }
Vlnv getCompatibleVlnv() const
virtual Vlnv
getCompatibleVlnv() const
{ return {"acs.eonerc.rwth-aachen.de:hls:gpu2rtds:"}; }
};

View file

@ -84,10 +84,6 @@ private:
class InterruptControllerFactory : public IpCoreFactory {
public:
InterruptControllerFactory() :
IpCoreFactory(getName(), getDescription())
{}
static constexpr const char*
getCompatibleVlnvString()
{ return "acs.eonerc.rwth-aachen.de:user:axi_pcie_intc:"; }
@ -95,15 +91,16 @@ public:
IpCore* create()
{ return new InterruptController; }
std::string
virtual std::string
getName() const
{ return "InterruptController"; }
std::string
virtual std::string
getDescription() const
{ return "Xilinx's programmable interrupt controller"; }
Vlnv getCompatibleVlnv() const
virtual Vlnv
getCompatibleVlnv() const
{ return Vlnv(getCompatibleVlnvString()); }
};

View file

@ -65,8 +65,6 @@ private:
class AxiPciExpressBridgeFactory : public IpCoreFactory {
public:
AxiPciExpressBridgeFactory() :
IpCoreFactory(getName(), getDescription()) {}
static constexpr const char*
getCompatibleVlnvString()
@ -77,13 +75,16 @@ public:
IpCore* create()
{ return new AxiPciExpressBridge; }
std::string getName() const
virtual std::string
getName() const
{ return "AxiPciExpressBridge"; }
std::string getDescription() const
virtual std::string
getDescription() const
{ return "Xilinx's AXI-PCIe Bridge"; }
Vlnv getCompatibleVlnv() const
virtual Vlnv
getCompatibleVlnv() const
{ return Vlnv(getCompatibleVlnvString()); }
};

View file

@ -62,20 +62,19 @@ private:
class RtdsFactory : public IpNodeFactory {
public:
RtdsFactory();
IpCore* create()
{ return new Rtds; }
std::string
virtual std::string
getName() const
{ return "Rtds"; }
{ return "rtds"; }
std::string
virtual std::string
getDescription() const
{ return "RTDS's AXI4-Stream - GTFPGA interface"; }
Vlnv getCompatibleVlnv() const
virtual Vlnv
getCompatibleVlnv() const
{ return {"acs.eonerc.rwth-aachen.de:user:rtds_axis:"}; }
};

View file

@ -74,20 +74,20 @@ private:
class Rtds2GpuFactory : public IpNodeFactory {
public:
Rtds2GpuFactory();
IpCore* create()
{ return new Rtds2Gpu; }
std::string
virtual std::string
getName() const
{ return "Rtds2Gpu"; }
std::string
virtual std::string
getDescription() const
{ return "HLS RTDS2GPU IP"; }
Vlnv getCompatibleVlnv() const
virtual Vlnv
getCompatibleVlnv() const
{ return {"acs.eonerc.rwth-aachen.de:hls:rtds2gpu:"}; }
};

View file

@ -72,8 +72,6 @@ private:
class AxiStreamSwitchFactory : public IpNodeFactory {
public:
AxiStreamSwitchFactory() :
IpNodeFactory(getName(), getDescription()) {}
static constexpr const char*
getCompatibleVlnvString()
@ -84,13 +82,16 @@ public:
IpCore* create()
{ return new AxiStreamSwitch; }
std::string getName() const
virtual std::string
getName() const
{ return "AxiStreamSwitch"; }
std::string getDescription() const
virtual std::string
getDescription() const
{ return "Xilinx's AXI4-Stream switch"; }
Vlnv getCompatibleVlnv() const
virtual Vlnv
getCompatibleVlnv() const
{ return Vlnv(getCompatibleVlnvString()); }
};

View file

@ -76,22 +76,19 @@ private:
class TimerFactory : public IpCoreFactory {
public:
TimerFactory() :
IpCoreFactory(getName(), getDescription())
{}
IpCore* create()
{ return new Timer; }
std::string
virtual std::string
getName() const
{ return "Timer"; }
std::string
virtual std::string
getDescription() const
{ return "Xilinx's programmable timer / counter"; }
Vlnv getCompatibleVlnv() const
virtual Vlnv
getCompatibleVlnv() const
{ return {"xilinx.com:ip:axi_timer:"}; }
};

View file

@ -119,11 +119,6 @@ void Aurora::resetFrameCounters()
writeMemory<uint32_t>(registerMemory, AURORA_AXIS_CR_OFFSET, cr);
}
AuroraFactory::AuroraFactory() :
IpNodeFactory(getName(), getDescription())
{
}
} // namespace ip
} // namespace fpga
} // namespace villas

View file

@ -42,13 +42,6 @@ namespace ip {
// instantiate factory to make available to plugin infrastructure
static DmaFactory factory;
DmaFactory::DmaFactory() :
IpNodeFactory(getName(), getDescription())
{
// nothing to do
}
bool
Dma::init()
{
@ -89,7 +82,7 @@ Dma::init()
/* Map buffer descriptors */
if (hasScatterGather()) {
logger->warn("Scatter Gather not yet implemented");
// return false;
return false;
// ret = dma_alloc(c, &dma->bd, FPGA_DMA_BD_SIZE, 0);
// if (ret)

View file

@ -41,19 +41,6 @@ static FifoFactory factory;
static FifoDataFactory factoryData;
FifoFactory::FifoFactory() :
IpNodeFactory(getName(), getDescription())
{
// nothing to do
}
FifoDataFactory::FifoDataFactory() :
IpNodeFactory(getName(), getDescription())
{
// nothing to do
}
bool Fifo::init()
{
XLlFifo_Config fifo_cfg;

View file

@ -92,11 +92,6 @@ double Rtds::getDt()
return (dt == 0xFFFF) ? 0.0 : (double) dt / RTDS_HZ;
}
RtdsFactory::RtdsFactory() :
IpNodeFactory(getName(), getDescription())
{
}
} // namespace ip
} // namespace fpga
} // namespace villas

View file

@ -131,11 +131,6 @@ Gpu2Rtds::getMaxFrameSize()
// logger->info(" Seq. number: {}", doorbell.seq_nr);
//}
Gpu2RtdsFactory::Gpu2RtdsFactory() :
IpNodeFactory(getName(), getDescription())
{
}
} // namespace ip
} // namespace fpga
} // namespace villas

View file

@ -116,11 +116,6 @@ Rtds2Gpu::dumpDoorbell(uint32_t doorbellRegister) const
logger->info(" Seq. number: {}", doorbell.seq_nr);
}
Rtds2GpuFactory::Rtds2GpuFactory() :
IpNodeFactory(getName(), getDescription())
{
}
} // namespace ip
} // namespace fpga
} // namespace villas