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

lib/card: start FPGA card prior to parsing

Initializing IPs may want to probe the actual hardware for feature
detection (e.g. DMA), so the card has to be started in order to access
any memory on the card.
This commit is contained in:
daniel-k 2017-11-28 11:26:41 +01:00
parent d67a120902
commit 737a5851df
2 changed files with 9 additions and 1 deletions

View file

@ -167,7 +167,7 @@ int fpga_card_start(struct fpga_card *c)
struct pci_device *pdev;
assert(c->state == STATE_CHECKED);
assert(c->state == STATE_INITIALIZED);
/* Search for FPGA card */
pdev = pci_lookup_device(c->pci, &c->filter);
@ -258,6 +258,8 @@ void fpga_card_dump(struct fpga_card *c)
int fpga_card_check(struct fpga_card *c)
{
assert(c->state == STATE_PARSED);
/* Check FPGA configuration */
c->reset = fpga_vlnv_lookup(&c->ips, &(struct fpga_vlnv) { "xilinx.com", "ip", "axi_gpio", NULL });
if (!c->reset)

View file

@ -76,9 +76,15 @@ static void init()
ret = fpga_card_init(card, &pci, &vc);
cr_assert_eq(ret, 0, "FPGA card initialization failed");
ret = fpga_card_start(card);
cr_assert_eq(ret, 0, "FPGA card cannot be started");
ret = fpga_card_parse(card, json_card, FPGA_CARD);
cr_assert_eq(ret, 0, "Failed to parse FPGA config");
ret = fpga_card_check(card);
cr_assert_eq(ret, 0, "FPGA card check failed");
json_decref(json);
if (criterion_options.logging_threshold < CRITERION_IMPORTANT)