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

platform irq draft

This commit is contained in:
Pascal Bauer 2024-09-20 17:12:35 +02:00
parent 1cda643599
commit cc325d3cb7
3 changed files with 23 additions and 3 deletions

View file

@ -82,6 +82,8 @@ public:
virtual ~Core() = default;
public:
void addIrq(std::string irqName, int port_num, InterruptController* intc);
// Generic management interface for IPs
// Runtime setup of IP, should access and initialize hardware

View file

@ -26,8 +26,8 @@ public:
virtual bool init() override;
virtual bool stop() override;
bool enableInterrupt(IrqMaskType mask, bool polling);
bool enableInterrupt(IrqPort irq, bool polling) {
virtual bool enableInterrupt(IrqMaskType mask, bool polling);
virtual bool enableInterrupt(IrqPort irq, bool polling) {
return enableInterrupt(1 << irq.num, polling);
}
@ -37,7 +37,7 @@ public:
ssize_t waitForInterrupt(int irq);
ssize_t waitForInterrupt(IrqPort irq) { return waitForInterrupt(irq.num); }
private:
protected:
static constexpr char registerMemory[] = "reg0";
std::list<MemoryBlockName> getMemoryBlocks() const {

View file

@ -22,6 +22,8 @@
#include <villas/kernel/kernel.hpp>
#include <villas/memory_manager.hpp>
#include <villas/fpga/ips/platform_intc.hpp>
using namespace villas;
using namespace villas::fpga;
using namespace villas::kernel;
@ -103,6 +105,22 @@ void PlatformCard::connectVFIOtoIps(
// Connect vfio vertex to Reg vertex
connect(vfio_device->getName(), ip);
// interrupts
if (vfio_device->getNumberIrqs() > 0) {
for (int i = 0; i < vfio_device->getNumberIrqs(); i++) {
auto intc = new PlatformInterruptController(vfio_device);
const char *irqName = "iic2intc_irpt";
int num = 0;
logger->error("Adding Platformintc {}", num);
//* dma
//* mm2s_introut
//* s2mm_introut
ip->addIrq(irqName, num, intc);
}
}
}
}