mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
Core/Card: enable IP init requiring other IPs
add initialized IP to card->ips already during initialization so that later IPs can use early initiliazed IPs to do their initilization. E.g. Dino needs I2c for initialization. Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
This commit is contained in:
parent
8b95182b08
commit
897d916886
2 changed files with 9 additions and 6 deletions
|
@ -33,6 +33,7 @@ static std::list<Vlnv> vlnvInitializationOrder = {
|
|||
Vlnv("xilinx.com:ip:axi_pcie:"),
|
||||
Vlnv("xilinx.com:module_ref:axi_pcie_intc:"),
|
||||
Vlnv("xilinx.com:ip:axis_switch:"),
|
||||
Vlnv("xilinx.com:ip:axi_iic:"),
|
||||
};
|
||||
|
||||
std::list<std::shared_ptr<Core>> CoreFactory::make(Card *card,
|
||||
|
@ -44,9 +45,11 @@ std::list<std::shared_ptr<Core>> CoreFactory::make(Card *card,
|
|||
std::list<IpIdentifier> orderedIps; // IPs ordered in initialization order
|
||||
|
||||
std::list<std::shared_ptr<Core>> configuredIps; // Successfully configured IPs
|
||||
std::list<std::shared_ptr<Core>>
|
||||
initializedIps; // Initialized, i.e. ready-to-use IPs
|
||||
|
||||
if (!card->ips.empty()) {
|
||||
loggerStatic->error("IP list of card {} already contains IPs.", card->name);
|
||||
throw RuntimeError("IP list of card {} already contains IPs.", card->name);
|
||||
}
|
||||
// Parse all IP instance names and their VLNV into list `allIps`
|
||||
const char *ipName;
|
||||
json_t *json_ip;
|
||||
|
@ -269,15 +272,15 @@ std::list<std::shared_ptr<Core>> CoreFactory::make(Card *card,
|
|||
}
|
||||
|
||||
// Will only be reached if the IP successfully was initialized
|
||||
initializedIps.push_back(std::move(ip));
|
||||
card->ips.push_back(std::move(ip));
|
||||
}
|
||||
|
||||
loggerStatic->debug("Initialized IPs:");
|
||||
for (auto &ip : initializedIps) {
|
||||
for (auto &ip : card->ips) {
|
||||
loggerStatic->debug(" {}", *ip);
|
||||
}
|
||||
|
||||
return initializedIps;
|
||||
return card->ips;
|
||||
}
|
||||
|
||||
void Core::dump() {
|
||||
|
|
|
@ -103,7 +103,7 @@ PCIeCardFactory::make(json_t *json_card, std::string card_name,
|
|||
throw ConfigError(json_ips, "node-config-fpga-ips",
|
||||
"FPGA IP core list must be an object!");
|
||||
|
||||
card->ips = ip::CoreFactory::make(card.get(), json_ips);
|
||||
ip::CoreFactory::make(card.get(), json_ips);
|
||||
if (card->ips.empty())
|
||||
throw ConfigError(json_ips, "node-config-fpga-ips",
|
||||
"Cannot initialize IPs of FPGA card {}", card_name);
|
||||
|
|
Loading…
Add table
Reference in a new issue