2016-06-19 19:23:19 +02:00
|
|
|
/** Node type: VILLASfpga
|
|
|
|
*
|
|
|
|
* This file implements the fpga node-type.
|
|
|
|
*
|
|
|
|
* @file
|
|
|
|
* @author Steffen Vogel <stvogel@eonerc.rwth-aachen.de>
|
2017-03-03 20:20:13 -04:00
|
|
|
* @copyright 2017, Steffen Vogel
|
|
|
|
*********************************************************************************/
|
|
|
|
|
2016-06-19 19:23:19 +02:00
|
|
|
/**
|
2017-02-12 14:04:22 -03:00
|
|
|
* @addtogroup fpga VILLASfpga
|
2016-06-19 19:23:19 +02:00
|
|
|
* @ingroup node
|
|
|
|
* @{
|
2017-03-03 20:20:13 -04:00
|
|
|
*/
|
2016-06-19 19:23:19 +02:00
|
|
|
|
2017-02-16 09:04:12 -03:00
|
|
|
#pragma once
|
2016-06-19 19:23:19 +02:00
|
|
|
|
|
|
|
#include "kernel/vfio.h"
|
2016-10-08 20:10:36 -04:00
|
|
|
#include "kernel/pci.h"
|
2016-06-19 19:23:19 +02:00
|
|
|
|
2017-02-16 09:04:12 -03:00
|
|
|
#include "fpga/ips/dma.h"
|
2016-07-11 09:16:00 +02:00
|
|
|
|
2016-06-19 19:23:19 +02:00
|
|
|
#include "node.h"
|
|
|
|
#include "list.h"
|
|
|
|
|
2017-02-16 09:04:12 -03:00
|
|
|
/* Forward declarations */
|
|
|
|
struct fpga_ip;
|
2016-06-19 19:23:19 +02:00
|
|
|
|
2017-02-16 09:04:12 -03:00
|
|
|
/** The node type */
|
|
|
|
struct fpga {
|
|
|
|
struct fpga_ip *ip;
|
2017-05-05 19:24:16 +00:00
|
|
|
|
2017-03-29 04:25:30 +02:00
|
|
|
struct pci *pci;
|
|
|
|
struct vfio_container *vfio_container;
|
2016-06-19 19:23:19 +02:00
|
|
|
|
2016-06-26 15:22:25 +02:00
|
|
|
int use_irqs;
|
2016-07-08 13:32:18 +02:00
|
|
|
struct dma_mem dma;
|
2016-06-19 19:23:19 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
/** @see node_vtable::init */
|
2017-04-07 17:32:36 +02:00
|
|
|
int fpga_init(struct super_node *sn);
|
2016-06-19 19:23:19 +02:00
|
|
|
|
2017-04-18 17:58:23 +02:00
|
|
|
/** @see node_type::deinit */
|
2016-06-19 19:23:19 +02:00
|
|
|
int fpga_deinit();
|
|
|
|
|
2017-04-18 17:58:23 +02:00
|
|
|
/** @see node_type::parse */
|
2016-06-19 19:23:19 +02:00
|
|
|
int fpga_parse(struct node *n, config_setting_t *cfg);
|
|
|
|
|
2017-03-03 20:21:33 -04:00
|
|
|
struct fpga_card * fpga_lookup_card(const char *name);
|
|
|
|
|
2017-04-18 17:58:23 +02:00
|
|
|
/** @see node_type::print */
|
2016-06-19 19:23:19 +02:00
|
|
|
char * fpga_print(struct node *n);
|
|
|
|
|
2017-04-18 17:58:23 +02:00
|
|
|
/** @see node_type::open */
|
2017-03-11 23:30:24 -03:00
|
|
|
int fpga_start(struct node *n);
|
2016-06-19 19:23:19 +02:00
|
|
|
|
2017-04-18 17:58:23 +02:00
|
|
|
/** @see node_type::close */
|
2017-03-11 23:30:24 -03:00
|
|
|
int fpga_stop(struct node *n);
|
2016-06-19 19:23:19 +02:00
|
|
|
|
2017-04-18 17:58:23 +02:00
|
|
|
/** @see node_type::read */
|
2016-06-19 19:23:19 +02:00
|
|
|
int fpga_read(struct node *n, struct sample *smps[], unsigned cnt);
|
|
|
|
|
2017-04-18 17:58:23 +02:00
|
|
|
/** @see node_type::write */
|
2016-06-19 19:23:19 +02:00
|
|
|
int fpga_write(struct node *n, struct sample *smps[], unsigned cnt);
|
|
|
|
|
|
|
|
/** Get pointer to internal VILLASfpga datastructure */
|
|
|
|
struct fpga * fpga_get();
|
|
|
|
|
|
|
|
/** Reset VILLASfpga */
|
|
|
|
int fpga_reset(struct fpga *f);
|
|
|
|
|
|
|
|
/** Dump some details about the fpga card */
|
|
|
|
void fpga_dump(struct fpga *f);
|
|
|
|
|
2017-02-16 09:04:12 -03:00
|
|
|
/** @} */
|