mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
move reordering of ips into function
Signed-off-by: Pascal Bauer <pascal.bauer@rwth-aachen.de>
This commit is contained in:
parent
823ba3281e
commit
cb53713953
2 changed files with 8 additions and 1 deletions
|
@ -208,6 +208,7 @@ public:
|
|||
using plugin::Plugin::Plugin;
|
||||
|
||||
static std::list<IpIdentifier> parseVLNV(json_t *json_ips);
|
||||
static std::list<IpIdentifier> reorderIps(std::list<IpIdentifier> allIps);
|
||||
|
||||
// Returns a running and checked FPGA IP
|
||||
static std::list<std::shared_ptr<Core>> make(Card *card, json_t *json_ips);
|
||||
|
|
|
@ -56,8 +56,11 @@ std::list<IpIdentifier> CoreFactory::parseVLNV(json_t *json_ips) {
|
|||
return allIps;
|
||||
}
|
||||
|
||||
std::list<IpIdentifier>
|
||||
CoreFactory::reorderIps(std::list<IpIdentifier> allIps) {
|
||||
// Pick out IPs to be initialized first.
|
||||
//
|
||||
std::list<IpIdentifier> orderedIps;
|
||||
|
||||
// Reverse walktrough, because we push to the
|
||||
// front of the output list, so that the first element will also be the
|
||||
// first to be initialized.
|
||||
|
@ -75,11 +78,14 @@ std::list<IpIdentifier> CoreFactory::parseVLNV(json_t *json_ips) {
|
|||
// Insert all other IPs at the end
|
||||
orderedIps.splice(orderedIps.end(), allIps);
|
||||
|
||||
auto loggerStatic = CoreFactory::getStaticLogger();
|
||||
loggerStatic->debug("IP initialization order:");
|
||||
for (auto &id : orderedIps) {
|
||||
loggerStatic->debug(" " CLR_BLD("{}"), id.getName());
|
||||
}
|
||||
|
||||
return orderedIps;
|
||||
}
|
||||
// Configure all IPs
|
||||
for (auto &id : orderedIps) {
|
||||
loggerStatic->info("Configuring {}", id);
|
||||
|
|
Loading…
Add table
Reference in a new issue