From 8a6832edc3a26b3cfcbc4e57681df947a812417a Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Tue, 30 Aug 2022 10:39:52 -0400 Subject: [PATCH] card: allow loading IPs devicetree from extra file --- fpga/lib/card.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/fpga/lib/card.cpp b/fpga/lib/card.cpp index 6bd6187d7..2db4138ca 100644 --- a/fpga/lib/card.cpp +++ b/fpga/lib/card.cpp @@ -97,6 +97,14 @@ PCIeCardFactory::make(json_t *json, std::shared_ptr pci continue; } + /* Load IPs from a separate json file */ + if (json_is_string(json_ips)) { + auto json_ips_fn = json_string_value(json_ips); + json_ips = json_load_file(json_ips_fn, 0, nullptr); + if (json_ips == nullptr) + throw ConfigError(json_ips, "node-config-fpga-ips", "Failed to load FPGA IP cores from {}", json_ips_fn); + } + if (not json_is_object(json_ips)) throw ConfigError(json_ips, "node-config-fpga-ips", "FPGA IP core list must be an object!");